[Bf-blender-cvs] [fbbadc87751] blender2.8: Fix T56544: Crash on startup with Radeon + Win 7

Clément Foucault noreply at git.blender.org
Mon Sep 3 19:21:30 CEST 2018


Commit: fbbadc8775173c4a911838928b00b79701c90517
Author: Clément Foucault
Date:   Mon Sep 3 19:20:56 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBfbbadc8775173c4a911838928b00b79701c90517

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.

===================================================================

M	source/blender/gpu/intern/gpu_shader.c

===================================================================

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



More information about the Bf-blender-cvs mailing list