From 309ea314858a9b7892ea2c8a6fe55ab2a1028697 Mon Sep 17 00:00:00 2001 From: Jason Fielder Date: Tue, 22 Mar 2022 12:38:28 +0100 Subject: Metal: Initial Implementation of Metal Backend for GPU Module. Adding WITH_METAL option to CMAKE to guard compilation for macOS only. Implemented stub METALBackend to mirror GPUBackend interface and added capabilities initialisation, along with API initialisation paths. Global rendering coordination commands added to backend with GPU_render_begin and GPU_render_end() commands globally wrapping GPU work. This is required for Metal to ensure temporary resources are generated within an NSAutoReleasePool and freed accordingly. Authored by Apple: Michael Parkin-White, Vil Harvey, Marco Giordano, Michael Jones, Morteza Mostajabodaveh, Jason Fielder Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14293 --- source/blender/gpu/intern/gpu_backend.hh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/gpu/intern/gpu_backend.hh') diff --git a/source/blender/gpu/intern/gpu_backend.hh b/source/blender/gpu/intern/gpu_backend.hh index ad906c74980..6e07e6c3229 100644 --- a/source/blender/gpu/intern/gpu_backend.hh +++ b/source/blender/gpu/intern/gpu_backend.hh @@ -49,6 +49,12 @@ class GPUBackend { virtual UniformBuf *uniformbuf_alloc(int size, const char *name) = 0; virtual StorageBuf *storagebuf_alloc(int size, GPUUsageType usage, const char *name) = 0; virtual VertBuf *vertbuf_alloc() = 0; + + /* Render Frame Coordination -- + * Used for performing per-frame actions globally */ + virtual void render_begin() = 0; + virtual void render_end() = 0; + virtual void render_step() = 0; }; } // namespace gpu -- cgit v1.2.3