GPU: Avoid access violation while reading the `pass->shader`.

This commit is contained in:
Germano Cavalcante 2019-03-11 20:32:00 -03:00
parent 6ad91be5d7
commit 2ba35ea7c2
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}