diff options
author | Thomas Dinges <dingto> | 2022-09-22 18:27:51 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-09-22 18:32:43 +0300 |
commit | 697b447c2069bbbbaa9929aab0ea1f66ef8bf4d0 (patch) | |
tree | f5c78b102b5c1478fb1dbd262b23508f5f072e33 /source/blender/windowmanager/intern | |
parent | bb63b98d1ff5acfd24dff9b5e72175f82f5bca26 (diff) |
Metal: MTLContext implementation and immediate mode rendering support.
MTLContext provides functionality for command encoding, binding management and graphics device management. MTLImmediate provides simple draw enablement with dynamically encoded data. These draws utilise temporary scratch buffer memory to provide minimal bandwidth overhead during workload submission.
This patch also contains empty placeholders for MTLBatch and MTLDrawList to enable testing of first pixels on-screen without failure.
The Metal API also requires access to the GHOST_Context to ensure the same pre-initialized Metal GPU device is used by the viewport. Given the explicit nature of Metal, explicit control is also needed over presentation, to ensure correct work scheduling and rendering pipeline state.
Authored by Apple: Michael Parkin-White
Ref T96261
(The diff is based on 043f59cb3b5835ba1a0bbf6f1cbad080b527f7f6)
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D15953
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 7c6650922a4..e768d18960b 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -1549,7 +1549,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) // GHOST_ActivateWindowDrawingContext(g_WS.ghost_window); /* initialize OpenGL immediate mode */ - g_WS.gpu_context = GPU_context_create(g_WS.ghost_window); + g_WS.gpu_context = GPU_context_create(g_WS.ghost_window, NULL); GPU_init(); /* initialize the font */ diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index b61ebdd11be..dea875becb1 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -579,7 +579,7 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, glSettings); if (ghostwin) { - win->gpuctx = GPU_context_create(ghostwin); + win->gpuctx = GPU_context_create(ghostwin, NULL); /* needed so we can detect the graphics card below */ GPU_init(); |