diff options
author | mano-wii <germano.costa@ig.com.br> | 2019-06-05 19:06:11 +0300 |
---|---|---|
committer | mano-wii <germano.costa@ig.com.br> | 2019-06-05 19:50:58 +0300 |
commit | ce66b22c427defa3db498d2d69ee615b3c913c5f (patch) | |
tree | 5b0b947f7c0cd22d100af33c23d3ad60eee2133c /source/blender/gpu/GPU_shader.h | |
parent | dd81efa4a343ecbb7a208e06ea854ce673e20504 (diff) |
Fix crash when editing shaders on Intel HD 4000.
In the Intel HD 4000 driver a shader has to be deleted in the same context in which it is created.
However, because you can't use a rendering context on different threads, to maintain the multithreaded compilation, the solution was to use the `GL_ARB_get_program_binary` and copy the binary generated for the shader and generate a shader on the main context using that binary.
This solution is limited only to Intel HD 4000 and windows.
Reviewers: fclem
Reviewed By: fclem
Differential Revision: https://developer.blender.org/D5019
Diffstat (limited to 'source/blender/gpu/GPU_shader.h')
-rw-r--r-- | source/blender/gpu/GPU_shader.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 0fe5427019a..dca66817666 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -58,6 +58,10 @@ GPUShader *GPU_shader_create_ex(const char *vertexcode, const char **tf_names, const int tf_count, const char *shader_name); +GPUShader *GPU_shader_load_from_binary(const char *binary, + const int binary_format, + const int binary_len, + const char *shname); struct GPU_ShaderCreateFromArray_Params { const char **vert, **geom, **frag, **defs; }; @@ -95,6 +99,8 @@ void GPU_shader_uniform_int(GPUShader *shader, int location, int value); int GPU_shader_get_attribute(GPUShader *shader, const char *name); +char *GPU_shader_get_binary(GPUShader *shader, int *r_binary_format, int *r_binary_len); + /* Builtin/Non-generated shaders */ typedef enum eGPUBuiltinShader { /* specialized drawing */ |