diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-08-13 12:48:44 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-08-14 00:01:18 +0300 |
commit | 822de6e9e1b87e2ed3571e7166281fa622c28c02 (patch) | |
tree | 6a247033033301c8c999ad1dca070d59876df2d9 /source/blender/gpu/intern/gpu_shader.c | |
parent | 2aa26de378a6afd64257a79444af932d3e054558 (diff) |
Fix T55802 shader compile bug with texture gather on old Nvidia card
The extension GL_ARB_texture_gather is reported to be supported and does
not trigger an error when enabled but the textureGater functions are not
defined.
Workaround is to disable the use of this extension on such systems.
Diffstat (limited to 'source/blender/gpu/intern/gpu_shader.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index 67ae1414b66..6560b5e7f13 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -221,6 +221,13 @@ static void gpu_shader_standard_extensions(char defines[MAX_EXT_DEFINE_LENGTH]) * don't use an extension for something already available! */ + if (GLEW_ARB_texture_gather) { + /* There is a bug on older Nvidia GPU where GL_ARB_texture_gather + * 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"); + } + } if (GLEW_ARB_texture_query_lod) { /* a #version 400 feature, but we use #version 330 maximum so use extension */ strcat(defines, "#extension GL_ARB_texture_query_lod: enable\n"); |