diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-09-03 20:20:56 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-09-03 20:21:23 +0300 |
commit | fbbadc8775173c4a911838928b00b79701c90517 (patch) | |
tree | 559ad5c6f28c844671212f597b19a7c89399f406 /source/blender/gpu/intern/gpu_shader.c | |
parent | cdd8a430d3aab012cf896b7b1a21e5d53aea0c0d (diff) |
Fix T56544: Crash on startup with Radeon + Win 7
Testing GLEW_ARB_texture_gather is not sufficient in this case. We need to
test if GL_ARB_texture_gather is defined in the shader, which is always true
on some NVIDIA drivers who does not support it...
So trying to make everything work.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index 1bfa0788f00..486858b9c82 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -227,7 +227,17 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH]) * is reported to be supported but yield a compile error (see T55802). */ if (!GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_ANY) || GLEW_VERSION_4_0) { strcat(defines, "#extension GL_ARB_texture_gather: enable\n"); - strcat(defines, "#define GPU_ARB_texture_gather\n"); + + /* Some drivers don't agree on GLEW_ARB_texture_gather and the actual support in the + * shader so double check the preprocessor define (see T56544). */ + if (!GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_ANY) && !GLEW_VERSION_4_0) { + strcat(defines, "#ifdef GL_ARB_texture_gather\n"); + strcat(defines, "# define GPU_ARB_texture_gather\n"); + strcat(defines, "#endif\n"); + } + else { + strcat(defines, "#define GPU_ARB_texture_gather\n"); + } } } if (GLEW_ARB_texture_query_lod) { |