diff options
author | Jeroen Bakker <jbakker> | 2020-08-05 16:26:49 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-08-05 16:45:42 +0300 |
commit | f7d38e2e6426a21f4b91bedc0fe635aba4692ff2 (patch) | |
tree | c3d240bcb10b992b41826d876dc1a3016dabe632 /source/blender/gpu/GPU_context.h | |
parent | 56d7e39b92997768b3db8ce2dbc262f869994145 (diff) |
Fix T77346: GPU Workaround Always Render Using Main Context
In Blender 2.90 EEVEE materials were refactored that introduced crashes on Intel
GPUs on Windows. The crash happened in the `local_context_workaround` that temporary
stored compiled materials in a binary form to reload it in the main GL context.
It has been tested that the workaround isn't needed anymore for HD6xx GPUs, but it
is still needed for HD4000.
After several unsuccesfull fixes we came to the conclusion that we could not support
the local context workaround and needed to come with a different workaround. The idea
of this patch is that in these cases there is only a single context that is used for
rendering. Threads that uses these contextes are guarded by a mutex and will block.
Impact on User Level:
* Due to main mutex lock the UI freezes when rendering or baking or feel less snappy
Reviewed By: Clément Foucault, Brecht van Lommel
Differential Revision: https://developer.blender.org/D8410
Diffstat (limited to 'source/blender/gpu/GPU_context.h')
-rw-r--r-- | source/blender/gpu/GPU_context.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_context.h b/source/blender/gpu/GPU_context.h index 9876aa6998c..6af150b4660 100644 --- a/source/blender/gpu/GPU_context.h +++ b/source/blender/gpu/GPU_context.h @@ -42,6 +42,14 @@ void GPU_context_discard(GPUContext *); void GPU_context_active_set(GPUContext *); GPUContext *GPU_context_active_get(void); +/* Legacy GPU (Intel HD4000 series) do not support sharing GPU objects between GPU + * contexts. EEVEE/Workbench can create different contexts for image/preview rendering, baking or + * compiling. When a legacy GPU is detected (`GPU_use_main_context_workaround()`) any worker + * threads should use the draw manager opengl context and make sure that they are the only one + * using it by locking the main context using these two functions. */ +void GPU_context_main_lock(void); +void GPU_context_main_unlock(void); + #ifdef __cplusplus } #endif |