diff options
author | Jason Fielder <jason_apple> | 2022-03-22 14:38:28 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-03-22 14:54:34 +0300 |
commit | 309ea314858a9b7892ea2c8a6fe55ab2a1028697 (patch) | |
tree | ad153ceb5e7e90c5cac65b59b99bb2d708577dba /source/blender/windowmanager/intern/wm_draw.c | |
parent | 913b6b9ec1b1f3cf83b21956b06e2f6d3341c78c (diff) |
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
Diffstat (limited to 'source/blender/windowmanager/intern/wm_draw.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 46f7b67c2ba..3c8474b1b6c 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -1037,6 +1037,10 @@ void wm_draw_update(bContext *C) wmWindowManager *wm = CTX_wm_manager(C); GPU_context_main_lock(); + + GPU_render_begin(); + GPU_render_step(); + BKE_image_free_unused_gpu_textures(); LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { @@ -1075,6 +1079,7 @@ void wm_draw_update(bContext *C) /* Draw non-windows (surfaces) */ wm_surfaces_iter(C, wm_draw_surface); + GPU_render_end(); GPU_context_main_unlock(); } |