diff options
-rw-r--r-- | source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl | 2 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 5 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 7 |
3 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl index 24dbb5436d9..b6b713e97a0 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_minmaxz_frag.glsl @@ -4,8 +4,6 @@ * Adapted from http://rastergrid.com/blog/2010/10/hierarchical-z-map-based-occlusion-culling/ **/ -#extension GL_ARB_texture_gather : enable - #ifdef LAYERED uniform sampler2DArray depthBuffer; uniform int depthLayer; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 26e1428cb8b..a8a1d735a90 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -377,14 +377,13 @@ static void OBJECT_engine_init(void *vedata) datatoc_common_fullscreen_vert_glsl, NULL, datatoc_object_outline_detect_frag_glsl, datatoc_common_globals_lib_glsl, - "#extension GL_ARB_texture_gather : enable\n"); + NULL); e_data.outline_detect_wire_sh = DRW_shader_create_with_lib( datatoc_common_fullscreen_vert_glsl, NULL, datatoc_object_outline_detect_frag_glsl, datatoc_common_globals_lib_glsl, - "#define WIRE\n" - "#extension GL_ARB_texture_gather : enable\n"); + "#define WIRE\n"); e_data.outline_fade_sh = DRW_shader_create_fullscreen(datatoc_object_outline_expand_frag_glsl, NULL); 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"); |