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.
This commit is contained in:
Clément Foucault 2018-09-03 19:20:56 +02:00
parent cdd8a430d3
commit fbbadc8775
Notes: blender-bot 2023-02-14 10:09:24 +01:00
Referenced by issue #56544, Blender 2.80 crashes at startup
1 changed files with 11 additions and 1 deletions

View File

@ -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) {