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-09-22 19:03:29 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-09-22 19:05:59 +0300
commite8bcca4bdc947caaca6742cdefc60fb9a4f57e9a (patch)
treea03602a7dd7155ffbb572a7c772e8242062b6623 /source/blender/draw/engines/eevee
parent18b45aabf91ad0a407e8c7cd16c5503e7a99d6fa (diff)
GPU: Ensure rendering operations occur within GPU render boundaries.
This is required by the Metal backend to perform flushing of temporary objective-C resources. This is implemented as a global autoreleasepool, and is to ensure consistency such that all rendering operations, whether called via events, or via main loop will be within an autoreleasepool. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Differential Revision: https://developer.blender.org/D15900
Diffstat (limited to 'source/blender/draw/engines/eevee')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightcache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c
index 0fd87ef43f0..f9d3d74ffc7 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -591,6 +591,7 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake)
if (GPU_use_main_context_workaround() && !BLI_thread_is_main()) {
GPU_context_main_lock();
DRW_opengl_context_enable();
+ GPU_render_begin();
return;
}
@@ -604,10 +605,12 @@ static void eevee_lightbake_context_enable(EEVEE_LightBake *lbake)
else {
DRW_opengl_context_enable();
}
+ GPU_render_begin();
}
static void eevee_lightbake_context_disable(EEVEE_LightBake *lbake)
{
+ GPU_render_end();
if (GPU_use_main_context_workaround() && !BLI_thread_is_main()) {
DRW_opengl_context_disable();
GPU_context_main_unlock();