From 2ba35ea7c26413407caadff971f821d46e47e70e Mon Sep 17 00:00:00 2001 From: mano-wii Date: Mon, 11 Mar 2019 20:32:00 -0300 Subject: GPU: Avoid access violation while reading the `pass->shader`. --- source/blender/gpu/intern/gpu_codegen.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/gpu') 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; } } -- cgit v1.2.3