Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Fielder <jason_apple>2022-06-27 12:41:04 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-06-27 12:45:49 +0300
commit9130a60d3d833718c932d3f971b746ba253734bc (patch)
treedaa060bb87ee0bf52c96699aea103ea78e29caa7 /source/blender/windowmanager
parent7b6b740ace1e56a8217fb44ed9fd3cf0c0a324f4 (diff)
MTLCommandBufferState for coordinating GPU workload submission and render pass coordination.
MTLFrameBuffer has been implemented to support creation of RenderCommandEncoders, along with supporting functionality in the Metal Context. Optimisation stubs for GPU_framebuffer_bind_ext has been added, which enables specific assignment of attachment load-store ops at the bind level, rather than on a framebuffer object as a whole. Begin and end frame markers are used to encapsulate frame boundaries for explicit workload submission. This is required for explicit APIs where implicit flushing of work does not occur. Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15027
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c8
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c4
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index aaa28b1fd85..b6953b21b65 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -1098,6 +1098,8 @@ static void wm_draw_window_onscreen(bContext *C, wmWindow *win, int view)
static void wm_draw_window(bContext *C, wmWindow *win)
{
+ GPU_context_begin_frame(win->gpuctx);
+
bScreen *screen = WM_window_get_active_screen(win);
bool stereo = WM_stereo3d_enabled(win, false);
@@ -1167,6 +1169,8 @@ static void wm_draw_window(bContext *C, wmWindow *win)
}
screen->do_draw = false;
+
+ GPU_context_end_frame(win->gpuctx);
}
/**
@@ -1177,8 +1181,12 @@ static void wm_draw_surface(bContext *C, wmSurface *surface)
wm_window_clear_drawable(CTX_wm_manager(C));
wm_surface_make_drawable(surface);
+ GPU_context_begin_frame(surface->gpu_ctx);
+
surface->draw(C);
+ GPU_context_end_frame(surface->gpu_ctx);
+
/* Avoid interference with window drawable */
wm_surface_clear_drawable();
}
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index f77aad24719..252cfc6e143 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -310,6 +310,7 @@ void WM_init(bContext *C, int argc, const char **argv)
IMB_thumb_clear_translations();
if (!G.background) {
+ GPU_render_begin();
#ifdef WITH_INPUT_NDOF
/* Sets 3D mouse dead-zone. */
@@ -322,7 +323,10 @@ void WM_init(bContext *C, int argc, const char **argv)
exit(-1);
}
+ GPU_context_begin_frame(GPU_context_active_get());
UI_init();
+ GPU_context_end_frame(GPU_context_active_get());
+ GPU_render_end();
}
BKE_subdiv_init();