diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-03-12 02:32:00 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-03-12 02:32:31 +0300 |
commit | 2ba35ea7c26413407caadff971f821d46e47e70e (patch) | |
tree | 9995ef58fda3e580757fe36901fb61f0aa0403a6 /source/blender/gpu/intern/gpu_codegen.c | |
parent | 6ad91be5d742be0a30b758b93d91561b8ff023cb (diff) |
GPU: Avoid access violation while reading the `pass->shader`.
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 8be4c178a75..63105fa96e2 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -1978,14 +1978,14 @@ void GPU_pass_compile(GPUPass *pass, const char *shname) } pass->shader = NULL; } - pass->compiled = true; - - if (!BLI_thread_is_main()) { + else if (!BLI_thread_is_main()) { /* For some drivers, you must use the program at least once in the * rendering context that it is created. */ glUseProgram(GPU_shader_get_program(pass->shader)); glUseProgram(0); } + + pass->compiled = true; } } |