diff options
author | Jason Fielder <jason_apple> | 2022-10-02 01:07:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-10-02 01:08:52 +0300 |
commit | 0fdb9cd6507a28b349abf47122d6dc394ca24dee (patch) | |
tree | dddb07304c74b8b843f6199a589ff798b1c4bdf2 /source | |
parent | ffd8390af7d9c6dc1f9a2998789f17932a3d23cf (diff) |
GPU: Fix issue with GPU render boundaries being opened while a GPUBackend does not exist.
Fixes regression introduced by rBe8bcca4bdc94 (D15900)
Ref T96261
Reviewed By: fclem
Maniphest Tasks: T96261
Differential Revision: https://developer.blender.org/D16085
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/engine.cc | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 99f75581a47..b6ca56d36fc 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -3113,6 +3113,8 @@ void DRW_render_context_enable(Render *render) WM_init_opengl(); } + GPU_render_begin(); + if (GPU_use_main_context_workaround()) { GPU_context_main_lock(); DRW_opengl_context_enable(); @@ -3136,6 +3138,8 @@ void DRW_render_context_enable(Render *render) void DRW_render_context_disable(Render *render) { + GPU_render_end(); + if (GPU_use_main_context_workaround()) { DRW_opengl_context_disable(); GPU_context_main_unlock(); diff --git a/source/blender/render/intern/engine.cc b/source/blender/render/intern/engine.cc index 9b5a5fff6b0..10a4788ef77 100644 --- a/source/blender/render/intern/engine.cc +++ b/source/blender/render/intern/engine.cc @@ -152,7 +152,6 @@ static void engine_depsgraph_free(RenderEngine *engine) /* Need GPU context since this might free GPU buffers. */ const bool use_gpu_context = (engine->type->flag & RE_USE_GPU_CONTEXT); if (use_gpu_context) { - GPU_render_begin(); DRW_render_context_enable(engine->re); } @@ -161,7 +160,6 @@ static void engine_depsgraph_free(RenderEngine *engine) if (use_gpu_context) { DRW_render_context_disable(engine->re); - GPU_render_end(); } } } @@ -758,7 +756,6 @@ static void engine_depsgraph_init(RenderEngine *engine, ViewLayer *view_layer) /* Need GPU context since this might free GPU buffers. */ const bool use_gpu_context = (engine->type->flag & RE_USE_GPU_CONTEXT) && reuse_depsgraph; if (use_gpu_context) { - GPU_render_begin(); DRW_render_context_enable(engine->re); } @@ -766,7 +763,6 @@ static void engine_depsgraph_init(RenderEngine *engine, ViewLayer *view_layer) if (use_gpu_context) { DRW_render_context_disable(engine->re); - GPU_render_end(); } } else { @@ -939,7 +935,6 @@ static void engine_render_view_layer(Render *re, if (use_engine) { const bool use_gpu_context = (engine->type->flag & RE_USE_GPU_CONTEXT); if (use_gpu_context) { - GPU_render_begin(); DRW_render_context_enable(engine->re); } @@ -955,7 +950,6 @@ static void engine_render_view_layer(Render *re, if (use_gpu_context) { DRW_render_context_disable(engine->re); - GPU_render_end(); } } |