Developing Games on Intel Graphics
If you are gaming on graphics integrated in your Intel Processor, this is the place for you! Find answers to your questions or post your issues with PC games
489 Discussions

GLSL compilation issue (HD Graphics 4000, Driver version 10.18.10.3412)

Customer__Intel1
Beginner
659 Views

Hello,

Whilst testing some code on a broad range of hardware and drivers I came across a crash bug when running on a Mac Mini with Windows 7 installed on it. It's got an HD Graphics 4000 onboard, and I'm using OpenGL 3.2 Core Profile, only extension (bar ubiquitous ones for texture compression) is ARB_debug_output. I managed to wittle it down from a crash bug to just failing to compile a shader by removing the GLSLoptimiser step from our shader building pipeline. The code which causes the crash is as follows:

#version 140
struct SpeedTreeInstance {
  vec4 m_rotationQuat;
  vec3 m_translation;
  float m_uniformScale;
  vec3 m_scale;
  float m_materialID;
  float m_windMatOffset;
  float m_blendFactor;
  float m_alphaRef;
  float m_padding;
};
uniform vec4 g_nvStereoParams = vec4(0.0, 0.0, 0.0, 0.0);
uniform vec4 g_debugVisualizer = vec4(1.0, 1.0, 1.0, 1.0);
uniform vec4 g_HDRParams = vec4(0.0, 1.0, 1.0, 1.0);
uniform vec4 g_gammaCorrection = vec4(1.0, 1.0, 0.0, 0.0);
uniform mat4 g_viewMat;
uniform mat4 g_invViewMat;
uniform mat4 g_projMat;
uniform vec4 g_cameraPos;
uniform SpeedTreeInstance g_instance;
uniform bool g_useHighQuality = bool(1);
uniform bool g_useZPrePass = bool(0);
uniform bool alphaTestEnable = bool(1);
uniform mat4 g_windMatrices[6];
uniform vec4 g_leafAngles[64];
uniform vec4 g_leafAngleScalars;
uniform bool g_useAlpha = bool(0);
in vec4 aPosition;
in vec3 aNormal;
in vec4 aTexCoord0;
in vec4 aTexCoord1;
in vec3 aTexCoord2;
in vec3 aTangent;
in vec2 aBinormal;
out vec2 xlv_TEXCOORD0;
out vec4 xlv_TEXCOORD1;
out vec3 xlv_TEXCOORD2;
out vec3 xlv_TEXCOORD3;
out vec3 xlv_TEXCOORD4;
out vec3 xlv_TEXCOORD5;
void main ()
{
  vec2 tmpvar_1;
  vec4 tmpvar_2;
  tmpvar_2 = g_instance.m_rotationQuat;
  vec3 corner_3;
  vec3 centerPoint_4;
  centerPoint_4 = (aPosition.xyz * g_instance.m_scale);
  vec3 tmpvar_5;
  vec3 b_6;
  b_6 = (((tmpvar_2.yzx * centerPoint_4.zxy) - (tmpvar_2.zxy * centerPoint_4.yzx)) + (tmpvar_2.w * centerPoint_4));
  tmpvar_5 = (centerPoint_4 + (2.0 * (
    (tmpvar_2.yzx * b_6.zxy)
   - 
    (tmpvar_2.zxy * b_6.yzx)
  )));
 vec2 vWindInfo_7;
  vWindInfo_7 = (aTexCoord0.zw + vec2(g_instance.m_windMatOffset));
  vec2 tmpvar_8;
  tmpvar_8 = fract(vWindInfo_7);
  vec2 tmpvar_9;
  tmpvar_9 = (0.3 * (vWindInfo_7 - tmpvar_8));
  mat3 tmpvar_10;
  mat4 tmpvar_11;
  tmpvar_11 = g_windMatrices[int(tmpvar_9.x)];
  tmpvar_10[0] = tmpvar_11[0].xyz;
  tmpvar_10[1] = tmpvar_11[1].xyz;
  tmpvar_10[2] = tmpvar_11[2].xyz;
  vec3 tmpvar_12;
  tmpvar_12 = mix (tmpvar_5, (tmpvar_5 * tmpvar_10), tmpvar_8.xxx);
  mat3 tmpvar_13;
  mat4 tmpvar_14;
  tmpvar_14 = g_windMatrices[int(tmpvar_9.y)];
  tmpvar_13[0] = tmpvar_14[0].xyz;
  tmpvar_13[1] = tmpvar_14[1].xyz;
  tmpvar_13[2] = tmpvar_14[2].xyz;
  centerPoint_4 = mix (tmpvar_12, (tmpvar_12 * tmpvar_13), tmpvar_8.yyy);
  vec3 tmpvar_15;
  tmpvar_15 = vec4[5](vec4(0.5, 0.5, 0.0, 0.0), vec4(-0.5, 0.5, 0.0, 0.0), vec4(-0.5, -0.5, 0.0, 0.0), vec4(0.5, -0.5, 0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0))[int(aTexCoord2.y)].xyz;
  corner_3.z = tmpvar_15.z;
  corner_3.xy = (tmpvar_15.xy + aBinormal);
  corner_3 = (corner_3 * (g_instance.m_uniformScale * clamp (
    (g_cameraPos.w * 7.0)
  , 0.0, 1.0)));
  corner_3 = (corner_3 * aTexCoord1.zwz);
  vec2 tmpvar_16;
  tmpvar_16 = (g_leafAngleScalars.xy * g_leafAngles[int(aTexCoord2.x)].xy);
  vec2 sc_17;
  float x_18;
  x_18 = (aTexCoord1.y * 0.5);
  sc_17.x = sin(x_18);
  sc_17.y = cos(x_18);
  vec4 tmpvar_19;
  tmpvar_19.xyz = (vec3(1.0, 0.0, 0.0) * sc_17.x);
  tmpvar_19.w = sc_17.y;
  vec2 sc_20;
  float x_21;
  x_21 = ((aTexCoord1.x - tmpvar_16.y) * 0.5);
  sc_20.x = sin(x_21);
  sc_20.y = cos(x_21);
  vec4 tmpvar_22;
  tmpvar_22.xyz = (vec3(0.0, 1.0, 0.0) * sc_20.x);
  tmpvar_22.w = sc_20.y;
  vec4 tmpvar_23;
  tmpvar_23.xyz = (((
    (tmpvar_19.yzx * tmpvar_22.zxy)
   - 
    (tmpvar_19.zxy * tmpvar_22.yzx)
  ) + (tmpvar_19.xyz * sc_20.y)) + (tmpvar_22.xyz * sc_17.y));
  tmpvar_23.w = ((sc_17.y * sc_20.y) - dot (tmpvar_19.xyz, tmpvar_22.xyz));
  vec2 sc_24;
  float x_25;
  x_25 = (tmpvar_16.x * 0.5);
  sc_24.x = sin(x_25);
  sc_24.y = cos(x_25);
  vec4 tmpvar_26;
  tmpvar_26.xyz = (vec3(0.0, 0.0, 1.0) * sc_24.x);
  tmpvar_26.w = sc_24.y;
  vec4 tmpvar_27;
  tmpvar_27.xyz = (((
    (tmpvar_23.yzx * tmpvar_26.zxy)
   - 
    (tmpvar_23.zxy * tmpvar_26.yzx)
  ) + (tmpvar_23.xyz * sc_24.y)) + (tmpvar_26.xyz * tmpvar_23.w));
  tmpvar_27.w = ((tmpvar_23.w * sc_24.y) - dot (tmpvar_23.xyz, tmpvar_26.xyz));
  vec3 b_28;
  b_28 = (((tmpvar_27.yzx * corner_3.zxy) - (tmpvar_27.zxy * corner_3.yzx)) + (tmpvar_27.w * corner_3));
  corner_3 = (corner_3 + (2.0 * (
    (tmpvar_27.yzx * b_28.zxy)
   - 
    (tmpvar_27.zxy * b_28.yzx)
  )));
  vec4 tmpvar_29;
  tmpvar_29.w = 1.0;
  tmpvar_29.xyz = (centerPoint_4 + g_instance.m_translation);
  vec3 tmpvar_30;
  tmpvar_30 = ((tmpvar_29 * g_viewMat).xyz + corner_3);
  centerPoint_4 = tmpvar_30;
  vec4 tmpvar_31;
  tmpvar_31.w = 1.0;
  tmpvar_31.xyz = tmpvar_30;
  vec4 tmpvar_32;
  tmpvar_32 = (tmpvar_31 * g_projMat);
  vec4 tmpvar_33;
  tmpvar_33.xy = aTexCoord0.xy;
  tmpvar_33.z = aTexCoord2.z;
  tmpvar_33.w = g_instance.m_alphaRef;
  tmpvar_1.x = tmpvar_32.w;
  tmpvar_1.y = g_instance.m_materialID;
  vec3 tmpvar_34;
  vec4 q_35;
  q_35 = g_instance.m_rotationQuat;
  vec3 b_36;
  b_36 = (((q_35.yzx * aNormal.zxy) - (q_35.zxy * aNormal.yzx)) + (q_35.w * aNormal));
  tmpvar_34 = (aNormal + (2.0 * (
    (q_35.yzx * b_36.zxy)
   - 
    (q_35.zxy * b_36.yzx)
  )));
  vec3 tmpvar_37;
  vec4 q_38;
  q_38 = g_instance.m_rotationQuat;
  vec3 b_39;
  b_39 = (((q_38.yzx * aTangent.zxy) - (q_38.zxy * aTangent.yzx)) + (q_38.w * aTangent));
  tmpvar_37 = (aTangent + (2.0 * (
    (q_38.yzx * b_39.zxy)
   - 
    (q_38.zxy * b_39.yzx)
  )));
  gl_Position = tmpvar_32;
  xlv_TEXCOORD0 = tmpvar_1;
  xlv_TEXCOORD1 = tmpvar_33;
  xlv_TEXCOORD2 = tmpvar_37;
  xlv_TEXCOORD3 = normalize(((tmpvar_34.yzx * tmpvar_37.zxy) - (tmpvar_34.zxy * tmpvar_37.yzx)));
  xlv_TEXCOORD4 = tmpvar_34;
  xlv_TEXCOORD5 = (tmpvar_31 * g_invViewMat).xyz;
}


// inputs: 7, stats: 104 alu 0 tex 0 flow

 

The 'unoptimised' code which simply fails to compile, but is functionally identical to the code as above is this:

#version 140
void xll_sincos_f_f_f( float x, out float s, out float c) {
  s = sin(x); 
  c = cos(x); 
}
void xll_sincos_vf2_vf2_vf2( vec2 x, out vec2 s, out vec2 c) {
  s = sin(x); 
  c = cos(x); 
}
void xll_sincos_vf3_vf3_vf3( vec3 x, out vec3 s, out vec3 c) {
  s = sin(x); 
  c = cos(x); 
}
void xll_sincos_vf4_vf4_vf4( vec4 x, out vec4 s, out vec4 c) {
  s = sin(x); 
  c = cos(x); 
}
void xll_sincos_mf2x2_mf2x2_mf2x2( mat2 x, out mat2 s, out mat2 c) {
  s = mat2( sin ( x[0] ), sin ( x[1] ) ); 
  c = mat2( cos ( x[0] ), cos ( x[1] ) ); 
}
void xll_sincos_mf3x3_mf3x3_mf3x3( mat3 x, out mat3 s, out mat3 c) {
  s = mat3( sin ( x[0] ), sin ( x[1] ), sin ( x[2] ) ); 
  c = mat3( cos ( x[0] ), cos ( x[1] ), cos ( x[2] ) ); 
}
void xll_sincos_mf4x4_mf4x4_mf4x4( mat4 x, out mat4 s, out mat4 c) {
  s = mat4( sin ( x[0] ), sin ( x[1] ), sin ( x[2] ), sin ( x[3] ) ); 
  c = mat4( cos ( x[0] ), cos ( x[1] ), cos ( x[2] ), cos ( x[3] ) ); 
}
float xll_saturate_f( float x) {
  return clamp( x, 0.0, 1.0);
}
vec2 xll_saturate_vf2( vec2 x) {
  return clamp( x, 0.0, 1.0);
}
vec3 xll_saturate_vf3( vec3 x) {
  return clamp( x, 0.0, 1.0);
}
vec4 xll_saturate_vf4( vec4 x) {
  return clamp( x, 0.0, 1.0);
}
mat2 xll_saturate_mf2x2(mat2 m) {
  return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
}
mat3 xll_saturate_mf3x3(mat3 m) {
  return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
}
mat4 xll_saturate_mf4x4(mat4 m) {
  return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
}
#line 60
struct SunLight {
    vec4 m_color;
    vec4 m_ambient;
    vec3 m_dir;
};
#line 68
struct FogParams {
    float m_enabled;
    float m_density;
    float m_start;
    float m_end;
    vec4 m_color;
    vec4 m_outerBB;
    vec4 m_innerBB;
};
#line 12
struct PointLight {
    vec4 position;
    vec4 colour;
    vec4 attenuation;
    vec4 padding;
};
#line 21
struct SpotLight {
    vec4 position;
    vec4 colour;
    vec4 attenuation;
    vec4 direction;
};
#line 8
struct G_BUFFER_LAYOUT {
    vec4 color0;
    vec4 color1;
    vec4 color2;
};
#line 17
struct SpeedTreeInstance {
    vec4 m_rotationQuat;
    vec3 m_translation;
    float m_uniformScale;
    vec3 m_scale;
    float m_materialID;
    float m_windMatOffset;
    float m_blendFactor;
    float m_alphaRef;
    float m_padding;
};
#line 34
struct SpeedTreeInstancingStream {
    vec4 m_row0;
    vec4 m_row1;
    vec4 m_row2;
    vec4 m_row3;
};
#line 154
struct VS_INPUT_BRANCHES {
    vec4 pos;
    vec3 normal;
    vec4 tcWindInfo;
    vec3 tangent;
};
#line 191
struct VS_INPUT_LEAF {
    vec4 pos;
    vec3 normal;
    vec4 tcWindInfo;
    vec4 rotGeomInfo;
    vec3 extraInfo;
    vec3 tangent;
    vec2 pivotInfo;
};
#line 4
struct ZPassOutput {
    vec4 pos;
    vec3 tcAlphaRef;
};
#line 251
struct VS_INPUT_BB {
    vec4 pos;
    vec3 lightNormal;
    vec3 alphaNormal;
    vec2 tc;
    vec3 binormal;
    vec3 tangent;
};
#line 105
struct VS_OUTPUT {
    vec4 pos;
    vec2 tc;
};
#line 98
struct VS_INPUT {
    vec4 pos;
    vec2 tc;
};
#line 206
struct LeafVS2PS {
    vec4 pos;
    vec2 linearZMatID;
    vec4 tcExtra;
    vec3 tangent;
    vec3 binormal;
    vec3 normal;
    vec3 wPos;
};
#line 283
struct BranchVS2PS {
    vec4 pos;
    vec2 linearZMatID;
    vec3 tcAlphaRef;
    vec3 normal;
    vec3 tangent;
    vec3 binormal;
    vec3 wPos;
};
#line 357
struct BillboardVS2PS {
    vec4 pos;
    vec2 linearZMatID;
    vec3 tcAlphaRef;
    vec3 tangent;
    vec3 binormal;
    vec3 normal;
    vec3 wPos;
};
uniform float g_time;
uniform vec4 g_nvStereoParams = vec4( 0.0, 0.0, 0.0, 0.0);
uniform vec4 g_debugVisualizer = vec4( 1.0, 1.0, 1.0, 1.0);
uniform vec4 g_windAnimation;
uniform SunLight g_sunLight;
uniform FogParams g_fogParams;
uniform float g_sunVisibility;
uniform mat4 g_SSAOParams;
uniform vec4 g_HDRParams = vec4( 0.0, 1.0, 1.0, 1.0);
uniform vec4 g_gammaCorrection = vec4( 1.0, 1.0, 0.0, 0.0);
uniform vec4 g_shadowBlendParams;
uniform vec4 g_specularParams;
uniform bool g_enableShadows;
uniform sampler2D g_GBufferChannel0Sml;
uniform sampler2D g_GBufferChannel1Sml;
uniform sampler2D g_GBufferChannel2Sml;
uniform vec4 g_screen;
uniform vec4 g_invScreen;
uniform mat4 g_viewMat;
uniform mat4 g_invViewMat;
uniform mat4 g_projMat;
uniform mat4 g_viewProjMat;
uniform mat4 g_invViewProjMat;
uniform mat4 g_lastViewProjMat;
uniform mat4 g_environmentMat;
uniform mat4 g_cameraDirs;
uniform vec4 g_cameraPos;
uniform vec4 g_lodCameraPos;
uniform vec3 g_cameraDir;
uniform vec4 g_farNearPlane;
uniform vec4 g_farPlane;
uniform vec4 g_clipPlane0;
uniform vec4 g_clipPlane1;
uniform vec4 g_clipPlane2;
uniform vec4 g_clipPlane3;
int G_RENDERING_PASS_COLOR = 0;
int G_RENDERING_PASS_REFLECTION = 1;
int G_RENDERING_PASS_SHADOWS = 2;
int G_RENDERING_PASS_DEPTH = 3;
bool g_isDual = false;
int G_STENCIL_SYSTEM_WRITE_MASK = 240;
int G_STENCIL_CUMSTOM_WRITE_MASK = 15;
int G_STENCIL_USAGE_TERRAIN = 16;
int G_STENCIL_USAGE_SPEEDTREE = 32;
int G_STENCIL_USAGE_FLORA = 64;
int G_STENCIL_USAGE_OTHER_OPAQUE = 128;
int G_STENCIL_USAGE_ALL_OPAQUE = 240;
int G_OBJECT_KIND_TERRAIN = 1;
int G_OBJECT_KIND_FLORA = 2;
int G_OBJECT_KIND_SPEEDTREE = 3;
int G_OBJECT_KIND_STATIC = 4;
int G_OBJECT_KIND_DYNAMIC = 5;
uniform sampler2D g_atan2LUTMapSml;
const int G_NUM_WIND_MATRICES = 6;
uniform SpeedTreeInstance g_instance;
uniform bool g_useHighQuality = true;
uniform bool g_useZPrePass = false;
uniform vec4 g_material[2];
uniform float g_leafLightAdj;
uniform bool alphaTestEnable = true;
uniform float g_leafRockFar;
uniform mat4 g_windMatrices[6];
uniform vec4 g_leafAngles[64];
uniform vec4 g_leafAngleScalars;
const vec4[5] g_leafUnitSquare = vec4[5]( vec4( 0.5, 0.5, 0.0, 0.0), vec4( -0.5, 0.5, 0.0, 0.0), vec4( -0.5, -0.5, 0.0, 0.0), vec4( 0.5, -0.5, 0.0, 0.0), vec4( 0.0, 0.0, 0.0, 0.0));
float g_specularFadeoutDist = 0.002;
uniform sampler2D speedTreeDiffuseSampler;
uniform sampler2D bbNormalSampler;
uniform sampler2D speedTreeNormalSampler;
uniform sampler2D g_nvStereoParamsMapSpl;
uniform bool g_useAlpha = false;
uniform sampler2D g_srcMapSampler;
#line 136
vec3 applyWind( in vec3 vPosition, in vec2 vWindInfo, in float windMatrixOffset ) {
        vWindInfo.xy += vec2( windMatrixOffset);
    vec2 vWeights = fract(vWindInfo.xy);
    vec2 vIndices = (((vWindInfo - vWeights) * 0.05) * 6.0);
        vec3 vWindEffect = mix( vPosition.xyz, (vPosition * mat3( g_windMatrices[int(vIndices.x)])), vec3( vWeights.x));
        return mix( vWindEffect, (vWindEffect * mat3( g_windMatrices[int(vIndices.y)])), vec3( vWeights.y));
}
#line 21
vec4 qmul( in vec4 a, in vec4 b ) {
    return vec4( ((cross( a.xyz, b.xyz) + (a.xyz * b.w)) + (b.xyz * a.w)), ((a.w * b.w) - dot( a.xyz, b.xyz)));
}
#line 6
vec3 qrot( in vec3 v, in vec4 q ) {
    return (v + (2.0 * cross( q.xyz, (cross( q.xyz, v) + (q.w * v)))));
}
#line 28
vec4 quat( in float angle, in vec3 axis ) {
    vec2 sc;
    xll_sincos_f_f_f( (angle * 0.5), sc.x, sc.y);
        return vec4( (axis * sc.x), sc.y);
}
#line 204
vec4 calcLeafVertex2( in VS_INPUT_LEAF i, in SpeedTreeInstance inst, in bool enableWind, in bool enableRockAndRustle ) {
    vec3 centerPoint = i.pos.xyz;
        centerPoint.xyz *= inst.m_scale.xyz;
    centerPoint = qrot( centerPoint, inst.m_rotationQuat);
        if (enableWind){
        centerPoint = applyWind( centerPoint, i.tcWindInfo.zw, inst.m_windMatOffset);
    }
        centerPoint += inst.m_translation;
    vec3 corner = g_leafUnitSquare[int(i.extraInfo.y)].xyz;
    corner.xy += i.pivotInfo.xy;
        corner.xyz *= (inst.m_uniformScale * xll_saturate_f((g_cameraPos.w * 7.0)));
    corner.xyz *= i.rotGeomInfo.zwz;
        if (enableRockAndRustle){
        float fRotAngleX = i.rotGeomInfo.x;
                float fRotAngleY = i.rotGeomInfo.y;
        vec2 leafRockAndRustle = (g_leafAngleScalars.xy * g_leafAngles[int(i.extraInfo.x)].xy);
                vec4 combQuat = quat( fRotAngleY, vec3( 1.0, 0.0, 0.0));
        combQuat = qmul( combQuat, quat( (fRotAngleX - leafRockAndRustle.y), vec3( 0.0, 1.0, 0.0)));
        combQuat = qmul( combQuat, quat( leafRockAndRustle.x, vec3( 0.0, 0.0, 1.0)));
        corner = qrot( corner, combQuat);
    }
        centerPoint = (vec4( centerPoint, 1.0) * g_viewMat).xyz;
    centerPoint += corner;
    return vec4( centerPoint, 1.0);
}
#line 218
LeafVS2PS vs_leaf_3_0( in VS_INPUT_LEAF i, bool highQuality ) {
    LeafVS2PS o = LeafVS2PS(vec4(0.0, 0.0, 0.0, 0.0), vec2(0.0, 0.0), vec4(0.0, 0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0));
        vec4 outPos = calcLeafVertex2( i, g_instance, true, highQuality);
   o.pos = (outPos * g_projMat);
    o.tcExtra = vec4( i.tcWindInfo.xy, i.extraInfo.z, g_instance.m_alphaRef);
        o.linearZMatID.x = o.pos.w;
    o.linearZMatID.y = g_instance.m_materialID;
    if (highQuality){
                o.normal = qrot( i.normal, g_instance.m_rotationQuat);
        o.tangent = qrot( i.tangent, g_instance.m_rotationQuat);
        o.binormal = normalize(cross( o.normal, o.tangent));
                o.wPos = vec3( (outPos * g_invViewMat));
    }
    else{
                o.normal = qrot( i.normal, g_instance.m_rotationQuat);
    }
    return o;
}
#line 986
LeafVS2PS xlat_main( in VS_INPUT_LEAF i ) {
    return vs_leaf_3_0( i, true);
}
in vec4 aPosition;
in vec3 aNormal;
in vec4 aTexCoord0;
in vec4 aTexCoord1;
in vec3 aTexCoord2;
in vec3 aTangent;
in vec2 aBinormal;
out vec2 xlv_TEXCOORD0;
out vec4 xlv_TEXCOORD1;
out vec3 xlv_TEXCOORD2;
out vec3 xlv_TEXCOORD3;
out vec3 xlv_TEXCOORD4;
out vec3 xlv_TEXCOORD5;
void main() {
    LeafVS2PS xl_retval;
    VS_INPUT_LEAF xlt_i;
    xlt_i.pos = vec4(aPosition);
    xlt_i.normal = vec3(aNormal);
    xlt_i.tcWindInfo = vec4(aTexCoord0);
    xlt_i.rotGeomInfo = vec4(aTexCoord1);
    xlt_i.extraInfo = vec3(aTexCoord2);
    xlt_i.tangent = vec3(aTangent);
    xlt_i.pivotInfo = vec2(aBinormal);
    xl_retval = xlat_main( xlt_i);
    gl_Position = vec4(xl_retval.pos);
    xlv_TEXCOORD0 = vec2(xl_retval.linearZMatID);
    xlv_TEXCOORD1 = vec4(xl_retval.tcExtra);
    xlv_TEXCOORD2 = vec3(xl_retval.tangent);
    xlv_TEXCOORD3 = vec3(xl_retval.binormal);
    xlv_TEXCOORD4 = vec3(xl_retval.normal);
    xlv_TEXCOORD5 = vec3(xl_retval.wPos);
}

// uniforms:
// g_cameraPos:CameraPos type 12 arrsize 0
// g_instance:<none> type 31 arrsize 0
// g_invViewMat:InvView type 21 arrsize 0
// g_leafAngleScalars:<none> type 12 arrsize 0
// g_leafAngles:<none> type 12 arrsize 64
// g_projMat:Projection type 21 arrsize 0
// g_viewMat:View type 21 arrsize 0
// g_windMatrices:<none> type 21 arrsize 6
// highQuality:<none> type 1 arrsize 0

 

The error (simplified) is "ARB_debug_output: source=ShaderCompiler type=Error id=0 severity=High GLSL compile failed for shader 499, "": ERROR: 0:430: 'const 5-element array of 4-component vector of float' : cannot declare arrays of this qualifier".

The problematic line being:

const vec4[5] g_leafUnitSquare = vec4[5]( vec4( 0.5, 0.5, 0.0, 0.0), vec4( -0.5, 0.5, 0.0, 0.0), vec4( -0.5, -0.5, 0.0, 0.0), vec4( 0.5, -0.5, 0.0, 0.0), vec4( 0.0, 0.0, 0.0, 0.0));

This hasn't been a problem on any other OpenGL implementation we are working with (NVIDIA, AMD, Apple, and Mesa), so have put it down to missing functionality in the Intel GLSL compiler. Is this a known issue? Our workaround was simply to change from using a const float4[5] to a uniform and passing it through from C++.

Thanks,
Neil

0 Kudos
2 Replies
Michael_C_Intel2
Employee
659 Views

Hi Neil,

Thanks for bringing this up. I am unaware of any issues in our driver that could cause this. I have contacted our OpenGL driver development team and they will investigate.

0 Kudos
Michael_C_Intel2
Employee
659 Views

Hi Neil,

A new driver has been released that has a fix for your issue.

https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=24245&lang=eng&ProdId=3720

0 Kudos
Reply