GLSL linker crash with sampler2DShadow array

Hi,

System Setup Information:

-----------------------------------------

System Used: Microsoft Surface Pro 3
CPU SKU: i5
GPU SKU: HD4400
Processor Line: ?
System BIOS Version: ?
CMOS settings: ?
Graphics Driver Version: 10.18.14.4264
GOP/VBIOS Version: ?
Operating System: Windows
OS Version: 8.1
API: OpenGL
Occurs on non-Intel GPUs?: No

Steps to Reproduce:
-------------------------------
1. Compile & link the following vertex & fragment shaders (also can be found here ; Crash Intel GLSL linker (drivers 10.18.14.4264) - minimal repro ; the two files compile fine, but when calling glLinkProgram, crashes the application (works fine on other vendors, even on Intel HD 4000) · GitHub)

shader.frag
#version 150

// UNCOMMENT the following line to crash the linker
// Crash happens on driver 10.18.14.4264 on Windows 8.1 x64, on Intel HD 4400
#define CRASH_DRIVER_PLEASE

in vec4 var_shadowTexCoords;
uniform sampler2DShadow py_shadowMaps[ 1 ];

out vec4 fragColor;

#ifdef CRASH_DRIVER_PLEASE

float _eval_shadow( sampler2DShadow shadowMap, vec4 shadowTexCoord )
{
  return textureProj( shadowMap, shadowTexCoord );
}

#else

#define _eval_shadow(a, b) textureProj(a, b)

#endif

void main(void)
{
    float shadow_factor = _eval_shadow( py_shadowMaps[0], var_shadowTexCoords );
    fragColor = vec4(shadow_factor);
}

shader.vert
#version 150

out vec4 var_shadowTexCoords;

void init_shadows_es( vec4 someVertex )
{
  var_shadowTexCoords = someVertex;
}

in vec4 mg_vertex;

void main(void)
{
  init_shadows_es(mg_vertex);
  gl_Position = mg_vertex;
}

Expected Results:

-------------------------------

Shaders compile and link.

Actual Results:
-------------------------------

Shaders compile, and the call to glLinkProgram crashes the application.

Additional Information:
-------------------------------

The code posted above is a stripped down version of a bigger shader.

My understanding is that passing an element of a sampler2DShadow array as an argument to a function causes the crash. If the uniform is changed to become a simple sampler2DShadow value, the crash goes away, idem if the functions are replaced by macros.

FWIW the problem does not occur on the latest avail. driver for HD4000.

Hi,

Thanks for filling out the information. I have will get an internal ticket going and talk to the driver team about it.

-Michael

I came here to report something very similar. Working on a Blender bug report https://developer.blender.org/T49089. Original reporter is using HD 4600. Below is my system info, after reproducing the crash.

Problem seen when viewing a particular test file. Shaders involved are rather big… generated code from Blender’s nodal material system. I’ll look for any sampler2DShadow arrays & report back.

System Setup Information:
-----------------------------------------

System Used: Asus Z87-Plus
CPU SKU: i5-4670K
GPU SKU: HD 4600
System BIOS Version: 2170 PC 14.34 03/07/2013
Graphics Driver Version: 10.18.15.4279 WHQL / Win 10 64
Operating System: Windows
OS Version: 10
API: OpenGL
Occurs on non-Intel GPUs?: no

Expected Results:

-------------------------------

glLinkProgram should 1) succeed or 2) fail & report any problems if given bad input.

Actual Results:
-------------------------------

Crash inside glLinkProgram. The vertex & fragment shaders compiled successfully with nothing in their info logs.

Additional Information:

-------------------------------

Tested with a debug context, debug logging enabled. No errors were reported prior to crash.

Shaders are GLSL #version 150  compatibility. Context is GL 4.3 compatibility profile.

Test file exposes a totally different issue on AMD hardware, nothing to do with shader compilation or linking.