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/intern/gpu_codegen.c | |
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/intern/gpu_codegen.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 0a1d6f560b6..155179205c5 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1228,21 +1228,9 @@ bool GPU_pass_compile(GPUPass *pass, const char *shname) shader = NULL; } } - else if (!BLI_thread_is_main() && GPU_context_local_shaders_workaround()) { - pass->binary.content = GPU_shader_get_binary( - shader, &pass->binary.format, &pass->binary.len); - GPU_shader_free(shader); - shader = NULL; - } - pass->shader = shader; pass->compiled = true; } - else if (pass->binary.content && BLI_thread_is_main()) { - pass->shader = GPU_shader_load_from_binary( - pass->binary.content, pass->binary.format, pass->binary.len, shname); - MEM_SAFE_FREE(pass->binary.content); - } return success; } @@ -1263,9 +1251,6 @@ static void gpu_pass_free(GPUPass *pass) MEM_SAFE_FREE(pass->geometrycode); MEM_SAFE_FREE(pass->vertexcode); MEM_SAFE_FREE(pass->defines); - if (pass->binary.content) { - MEM_freeN(pass->binary.content); - } MEM_freeN(pass); } |