GLSL - Bug with 470gtx only - error: binding in multiple relative-addressedarrays

Started by
4 comments, last by Fiddler 13 years, 8 months ago
A shader which has been worked on for 3 months and used across an 8600GT, 9600GT, and a 240 GTS suddenly fails to compile on a brand new 470GTX with the latest nvidia drivers (258.96).

Here is the error message:
line 303, column 1: error: binding in multiple relative-addressedarrays

The fragment shader is the culprit. This small snippet of code from the large shader is the cause. It is producing the error if I ever access gl_LightSource.specular more than once. If I set the for loop to iterate only once it works. The shader accesses the rest of the light model variables just fine multiple times.
	for (int i = 0; i < 2; i++)	{					vec4 specular = gl_LightSource.specular;



Any advice? This card has done fine with everything thrown at it albeit it has all been DX stuff until now.


Here is the full error produced when running the program.
-- error message --line 303, column 1:  error: binding in multiple relative-addressedarrays-- internal text --!!NVfp5.0OPTION ARB_fragment_program_shadow;# cgc version 3.0.0001, build date Jul  9 2010# command line args:#vendor NVIDIA Corporation#version 3.0.0.1#profile gp5fp#program main#semantic gl_LightSource : state.light#semantic gl_FrontMaterial : state.material.front#semantic TextureMap#semantic ReflectionMap#semantic ShadowMap#var float4 gl_LightSource[0].ambient : state.light[0].ambient : c[0] : -1 : 0#var float4 gl_LightSource[0].diffuse : state.light[0].diffuse : c[1] : -1 : 0#var float4 gl_LightSource[0].specular : state.light[0].specular : c[2] : -1 : 1#var float4 gl_LightSource[0].position : state.light[0].position : c[3] : -1 : 1#var float4 gl_LightSource[0].halfVector : state.light[0].half : c[4] : -1 : 0#var float3 gl_LightSource[0].spotDirection : state.light[0].spot.direction : c[5] : -1 : 0#var float gl_LightSource[0].spotExponent : state.light[0].attenuation.w : c[6] : -1 : 0#var float gl_LightSource[0].spotCutoff : state.light[0].spot.cutoff.x : c[7] : -1 : 0#var float gl_LightSource[0].spotCosCutoff : state.light[0].spot.direction.w : c[8] : -1 : 0#var float gl_LightSource[0].constantAttenuation : state.light[0].attenuation.x : c[9] : -1 : 1#var float gl_LightSource[0].linearAttenuation : state.light[0].attenuation.y : c[10] : -1 : 1#var float gl_LightSource[0].quadraticAttenuation : state.light[0].attenuation.z : c[11] : -1 : 1#var float4 gl_LightSource[1].ambient : state.light[1].ambient : c[12] : -1 : 0#var float4 gl_LightSource[1].diffuse : state.light[1].diffuse : c[13] : -1 : 0#var float4 gl_LightSource[1].specular : state.light[1].specular : c[14] : -1 : 1#var float4 gl_LightSource[1].position : state.light[1].position : c[15] : -1 : 1#var float4 gl_LightSource[1].halfVector : state.light[1].half : c[16] : -1 : 0#var float3 gl_LightSource[1].spotDirection : state.light[1].spot.direction : c[17] : -1 : 0#var float gl_LightSource[1].spotExponent : state.light[1].attenuation.w : c[18] : -1 : 0#var float gl_LightSource[1].spotCutoff : state.light[1].spot.cutoff.x : c[19] : -1 : 0#var float gl_LightSource[1].spotCosCutoff : state.light[1].spot.direction.w : c[20] : -1 : 0#var float gl_LightSource[1].constantAttenuation : state.light[1].attenuation.x : c[21] : -1 : 1#var float gl_LightSource[1].linearAttenuation : state.light[1].attenuation.y : c[22] : -1 : 1#var float gl_LightSource[1].quadraticAttenuation : state.light[1].attenuation.z : c[23] : -1 : 1#var float4 gl_LightSource[2].ambient : state.light[2].ambient : c[24] : -1 : 0#var float4 gl_LightSource[2].diffuse : state.light[2].diffuse : c[25] : -1 : 0#var float4 gl_LightSource[2].specular : state.light[2].specular : c[26] : -1 : 1#var float4 gl_LightSource[2].position : state.light[2].position : c[27] : -1 : 1#var float4 gl_LightSource[2].halfVector : state.light[2].half : c[28] : -1 : 0#var float3 gl_LightSource[2].spotDirection : state.light[2].spot.direction : c[29] : -1 : 0#var float gl_LightSource[2].spotExponent : state.light[2].attenuation.w : c[30] : -1 : 0#var float gl_LightSource[2].spotCutoff : state.light[2].spot.cutoff.x : c[31] : -1 : 0#var float gl_LightSource[2].spotCosCutoff : state.light[2].spot.direction.w : c[32] : -1 : 0#var float gl_LightSource[2].constantAttenuation : state.light[2].attenuation.x : c[33] : -1 : 1#var float gl_LightSource[2].linearAttenuation : state.light[2].attenuation.y : c[34] : -1 : 1#var float gl_LightSource[2].quadraticAttenuation : state.light[2].attenuation.z : c[35] : -1 : 1#var float4 gl_LightSource[3].ambient : state.light[3].ambient : c[36] : -1 : 0#var float4 gl_LightSource[3].diffuse : state.light[3].diffuse : c[37] : -1 : 0#var float4 gl_LightSource[3].specular : state.light[3].specular : c[38] : -1 : 1#var float4 gl_LightSource[3].position : state.light[3].position : c[39] : -1 : 1#var float4 gl_LightSource[3].halfVector : state.light[3].half : c[40] : -1 : 0#var float3 gl_LightSource[3].spotDirection : state.light[3].spot.direction : c[41] : -1 : 0#var float gl_LightSource[3].spotExponent : state.light[3].attenuation.w : c[42] : -1 : 0#var float gl_LightSource[3].spotCutoff : state.light[3].spot.cutoff.x : c[43] : -1 : 0#var float gl_LightSource[3].spotCosCutoff : state.light[3].spot.direction.w : c[44] : -1 : 0#var float gl_LightSource[3].constantAttenuation : state.light[3].attenuation.x : c[45] : -1 : 1#var float gl_LightSource[3].linearAttenuation : state.light[3].attenuation.y : c[46] : -1 : 1#var float gl_LightSource[3].quadraticAttenuation : state.light[3].attenuation.z : c[47] : -1 : 1#var float4 gl_LightSource[4].ambient : state.light[4].ambient : c[48] : -1 : 0#var float4 gl_LightSource[4].diffuse : state.light[4].diffuse : c[49] : -1 : 0#var float4 gl_LightSource[4].specular : state.light[4].specular : c[50] : -1 : 1#var float4 gl_LightSource[4].position : state.light[4].position : c[51] : -1 : 1#var float4 gl_LightSource[4].halfVector : state.light[4].half : c[52] : -1 : 0#var float3 gl_LightSource[4].spotDirection : state.light[4].spot.direction : c[53] : -1 : 0#var float gl_LightSource[4].spotExponent : state.light[4].attenuation.w : c[54] : -1 : 0#var float gl_LightSource[4].spotCutoff : state.light[4].spot.cutoff.x : c[55] : -1 : 0#var float gl_LightSource[4].spotCosCutoff : state.light[4].spot.direction.w : c[56] : -1 : 0#var float gl_LightSource[4].constantAttenuation : state.light[4].attenuation.x : c[57] : -1 : 1#var float gl_LightSource[4].linearAttenuation : state.light[4].attenuation.y : c[58] : -1 : 1#var float gl_LightSource[4].quadraticAttenuation : state.light[4].attenuation.z : c[59] : -1 : 1#var float4 gl_LightSource[5].ambient : state.light[5].ambient : c[60] : -1 : 0#var float4 gl_LightSource[5].diffuse : state.light[5].diffuse : c[61] : -1 : 0#var float4 gl_LightSource[5].specular : state.light[5].specular : c[62] : -1 : 1#var float4 gl_LightSource[5].position : state.light[5].position : c[63] : -1 : 1#var float4 gl_LightSource[5].halfVector : state.light[5].half : c[64] : -1 : 0#var float3 gl_LightSource[5].spotDirection : state.light[5].spot.direction : c[65] : -1 : 0#var float gl_LightSource[5].spotExponent : state.light[5].attenuation.w : c[66] : -1 : 0#var float gl_LightSource[5].spotCutoff : state.light[5].spot.cutoff.x : c[67] : -1 : 0#var float gl_LightSource[5].spotCosCutoff : state.light[5].spot.direction.w : c[68] : -1 : 0#var float gl_LightSource[5].constantAttenuation : state.light[5].attenuation.x : c[69] : -1 : 1#var float gl_LightSource[5].linearAttenuation : state.light[5].attenuation.y : c[70] : -1 : 1#var float gl_LightSource[5].quadraticAttenuation : state.light[5].attenuation.z : c[71] : -1 : 1#var float4 gl_LightSource[6].ambient : state.light[6].ambient : c[72] : -1 : 0#var float4 gl_LightSource[6].diffuse : state.light[6].diffuse : c[73] : -1 : 0#var float4 gl_LightSource[6].specular : state.light[6].specular : c[74] : -1 : 1#var float4 gl_LightSource[6].position : state.light[6].position : c[75] : -1 : 1#var float4 gl_LightSource[6].halfVector : state.light[6].half : c[76] : -1 : 0#var float3 gl_LightSource[6].spotDirection : state.light[6].spot.direction : c[77] : -1 : 0#var float gl_LightSource[6].spotExponent : state.light[6].attenuation.w : c[78] : -1 : 0#var float gl_LightSource[6].spotCutoff : state.light[6].spot.cutoff.x : c[79] : -1 : 0#var float gl_LightSource[6].spotCosCutoff : state.light[6].spot.direction.w : c[80] : -1 : 0#var float gl_LightSource[6].constantAttenuation : state.light[6].attenuation.x : c[81] : -1 : 1#var float gl_LightSource[6].linearAttenuation : state.light[6].attenuation.y : c[82] : -1 : 1#var float gl_LightSource[6].quadraticAttenuation : state.light[6].attenuation.z : c[83] : -1 : 1#var float4 gl_LightSource[7].ambient : state.light[7].ambient : c[84] : -1 : 0#var float4 gl_LightSource[7].diffuse : state.light[7].diffuse : c[85] : -1 : 0#var float4 gl_LightSource[7].specular : state.light[7].specular : c[86] : -1 : 1#var float4 gl_LightSource[7].position : state.light[7].position : c[87] : -1 : 1#var float4 gl_LightSource[7].halfVector : state.light[7].half : c[88] : -1 : 0#var float3 gl_LightSource[7].spotDirection : state.light[7].spot.direction : c[89] : -1 : 0#var float gl_LightSource[7].spotExponent : state.light[7].attenuation.w : c[90] : -1 : 0#var float gl_LightSource[7].spotCutoff : state.light[7].spot.cutoff.x : c[91] : -1 : 0#var float gl_LightSource[7].spotCosCutoff : state.light[7].spot.direction.w : c[92] : -1 : 0#var float gl_LightSource[7].constantAttenuation : state.light[7].attenuation.x : c[93] : -1 : 1#var float gl_LightSource[7].linearAttenuation : state.light[7].attenuation.y : c[94] : -1 : 1#var float gl_LightSource[7].quadraticAttenuation : state.light[7].attenuation.z : c[95] : -1 : 1#var float4 gl_FrontMaterial.emission : state.material.front.emission :  : -1 : 0#var float4 gl_FrontMaterial.ambient : state.material.front.ambient :  : -1 : 0#var float4 gl_FrontMaterial.diffuse : state.material.front.diffuse :  : -1 : 0#var float4 gl_FrontMaterial.specular : state.material.front.specular : c[96] : -1 : 1#var float gl_FrontMaterial.shininess : state.material.front.shininess : c[97] : -1 : 1#var float4 gl_TexCoord[0] : $vin.TEX0 : TEX0 : -1 : 1#var float4 gl_TexCoord[1] :  :  : -1 : 0#var float4 gl_TexCoord[2] :  :  : -1 : 0#var float4 gl_TexCoord[3] :  :  : -1 : 0#var float4 gl_TexCoord[4] :  :  : -1 : 0#var float4 gl_TexCoord[5] :  :  : -1 : 0#var float4 gl_TexCoord[6] :  :  : -1 : 0#var float4 gl_TexCoord[7] :  :  : -1 : 0#var float4 gl_FragColor : $vout.COLOR : COL0[0] : -1 : 1#var sampler2D TextureMap :  : texunit 1 : -1 : 1#var sampler2D ReflectionMap :  :  : -1 : 0#var sampler2DSHADOW ShadowMap :  : texunit 0 : -1 : 1#var float4 ShadowCoord : $vin.ATTR0 : ATTR0 : -1 : 1#var float4 diffuse[0] : $vin.ATTR1 : ATTR1 : -1 : 1#var float4 diffuse[1] : $vin.ATTR2 : ATTR2 : -1 : 1#var float4 ambient[0] : $vin.ATTR3 : ATTR3 : -1 : 1#var float4 ambient[1] : $vin.ATTR4 : ATTR4 : -1 : 1#var float4 ambientGlobal : $vin.ATTR5 : ATTR5 : -1 : 1#var float3 normal : $vin.ATTR6 : ATTR6 : -1 : 1#var float3 lightDir[0] : $vin.ATTR7 : ATTR7 : -1 : 1#var float3 lightDir[1] : $vin.ATTR8 : ATTR8 : -1 : 1#var float3 halfVector[0] : $vin.ATTR9 : ATTR9 : -1 : 1#var float3 halfVector[1] : $vin.ATTR10 : ATTR10 : -1 : 1#var float dist[0] : $vin.ATTR11 : ATTR11 : -1 : 1#var float dist[1] : $vin.ATTR12 : ATTR12 : -1 : 1PARAM c[98] = { program.local[0..1],                state.light[0].specular,                state.light[0].position,                program.local[4..8],                state.light[0].attenuation,                state.light[0].attenuation,                state.light[0].attenuation,                program.local[12..13],                state.light[1].specular,                state.light[1].position,                program.local[16..20],                state.light[1].attenuation,                state.light[1].attenuation,                state.light[1].attenuation,                program.local[24..25],                state.light[2].specular,                state.light[2].position,                program.local[28..32],                state.light[2].attenuation,                state.light[2].attenuation,                state.light[2].attenuation,                program.local[36..37],                state.light[3].specular,                state.light[3].position,                program.local[40..44],                state.light[3].attenuation,                state.light[3].attenuation,                state.light[3].attenuation,                program.local[48..49],                state.light[4].specular,                state.light[4].position,                program.local[52..56],                state.light[4].attenuation,                state.light[4].attenuation,                state.light[4].attenuation,                program.local[60..61],                state.light[5].specular,                state.light[5].position,                program.local[64..68],                state.light[5].attenuation,                state.light[5].attenuation,                state.light[5].attenuation,                program.local[72..73],                state.light[6].specular,                state.light[6].position,                program.local[76..80],                state.light[6].attenuation,                state.light[6].attenuation,                state.light[6].attenuation,                program.local[84..85],                state.light[7].specular,                state.light[7].position,                program.local[88..92],                state.light[7].attenuation,                state.light[7].attenuation,                state.light[7].attenuation,                state.material.front.specular,                state.material.front.shininess };ATTRIB fragment_texcoord[] = { fragment.texcoord[0..0] };ATTRIB fragment_attrib[] = { fragment.attrib[0..12] };TEMP R0, R1, R2, R3, R4;TEMP RC, HC;OUTPUT result_color0 = result.color;TEXTURE texture0 = texture[0];TEXTURE texture1 = texture[1];SGT.F R0.x, fragment.attrib[0].w, {0, 0, 0, 0};TRUNC.U.CC HC.x, R0;MOV.F R0.w, {1, 0, 0, 0}.x;IF    NE.x;DIV.F R1, fragment.attrib[0], fragment.attrib[0].w;ADD.F R1.z, R1, {0.00050000002, 0, 0, 0}.x;MOV.F R0.w, {0.00050000002, 0, 0, 0}.x;MOV.F R0.z, R1;MOV.F R0.xy, R1;DIV.F R0.xyz, R0, R1.w;TXB.F R0.z, R0, texture0, SHADOW2D;SLT.F R0.x, R0.z, R1.z;MOV.F R0.w, {0.5, 0, 0, 0}.x;TRUNC.U.CC HC.x, R0;MOV.F R0.w(EQ.x), {1, 0, 0, 0}.x;ENDIF;DP3.F R0.x, fragment.attrib[6], fragment.attrib[6];RSQ.F R1.x, R0.x;MOV.F R0.xyz, {1, 0, 0, 0}.x;MUL.F R1.xyz, R1.x, fragment.attrib[6];MOV.S R1.w, {0, 0, 0, 0}.x;REP.S {2, 0, 0, 0};MUL.S R2.x, R1.w, {12, 0, 0, 0};MOV.U R3.x, R2;MOV.F R2.w, {0, 0, 0, 0}.x;SLE.F R2.w, c[R3.x + 3], R2;MOV.F R2.xyz, c[R3.x + 2];TRUNC.U.CC HC.x, R2.w;MOV.F R3.xyz, {0, 0, 0, 0}.x;IF    NE.x;MOV.U R3.x, R1.w;DP3.F R2.w, R1, fragment_attrib[R3.x + 7];MAX.F R2.w, R2, {0, 0, 0, 0}.x;SGE.F R3.w, R2, {0, 0, 0, 0}.x;TRUNC.U.CC HC.x, R3.w;MOV.F R3.xyz, fragment_attrib[R3.x + 3];IF    NE.x;MOV.U R4.w, R1;DP3.F R3.w, fragment_attrib[R4.w + 9], fragment_attrib[R4.w + 9];RSQ.F R3.w, R3.w;MUL.F R4.xyz, R3.w, fragment_attrib[R4.w + 9];DP3.F R3.w, R1, R4;MAX.F R3.w, R3, {0, 0, 0, 0}.x;POW.F R3.w, R3.w, c[97].x;MAD.F R3.xyz, fragment_attrib[R4.w + 1], R2.w, R3;MUL.F R2.xyz, R2, c[96];MAD.F R3.xyz, R2, R3.w, R3;ENDIF;ELSE;MUL.S R3.w, R1, {12, 0, 0, 0}.x;MOV.F R2.w, {1, 0, 0, 0}.x;MOV.U R3.w, R3;SGE.F R2.w, c[R3.w + 3], R2;TRUNC.U.CC HC.x, R2.w;IF    NE.x;MOV.U R2.w, R1;DP3.F R3.x, fragment_attrib[R2.w + 7], fragment_attrib[R2.w + 7];RSQ.F R3.x, R3.x;MUL.F R3.xyz, R3.x, fragment_attrib[R2.w + 7];DP3.F R2.w, R1, R3;MAX.F R2.w, R2, {0, 0, 0, 0}.x;SGT.F R3.w, R2, {0, 0, 0, 0}.x;TRUNC.U.CC HC.x, R3.w;MOV.F R3.xyz, fragment.attrib[5];IF    NE.x;MOV.U R4.w, R1;MUL.S R3.x, R1.w, {12, 0, 0, 0};DP3.F R4.x, fragment_attrib[R4.w + 9], fragment_attrib[R4.w + 9];RSQ.F R4.x, R4.x;MUL.F R4.xyz, R4.x, fragment_attrib[R4.w + 9];MOV.U R3.x, R3;MOV.F R3.y, fragment_attrib[R4.w + 11].x;MUL.F R3.z, R3.y, c[R3.x + 10].y;ADD.F R3.z, R3, c[R3.x + 9].x;MUL.F R3.x, c[R3.x + 11].z, R3.y;MAD.F R3.w, R3.x, fragment_attrib[R4.w + 11].x, R3.z;DIV.F R3.xyz, c[96], R3.w;MUL.F R2.xyz, R3, R2;MUL.F R3.xyz, fragment_attrib[R4.w + 1], R2.w;DP3.F R4.x, R1, R4;MAX.F R2.w, R4.x, {0, 0, 0, 0}.x;ADD.F R3.xyz, R3, fragment_attrib[R4.w + 3];RCP.F R3.w, R3.w;MAD.F R3.xyz, R3.w, R3, fragment.attrib[5];POW.F R2.w, R2.w, c[97].x;MAD.F R3.xyz, R2, R2.w, R3;ENDIF;ENDIF;ENDIF;MUL.F R0.xyz, R0, R3;ADD.S R1.w, R1, {1, 0, 0, 0}.x;ENDREP;TEX.F R1, fragment.texcoord[0], texture1, 2D;MUL.F R1.xyz, R1, R0.w;MUL.F result_color0.xyz, R1, R0;MOV.F result_color0.w, R1;END# 96 instructions, 5 R-regs
Advertisement
Where is a good place to file this to Nvidia?
NVIDIA developer forums
NVIDIA developer feedback
NVIDIA developer contact info
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Quote:Original post by Halsafar
Any advice?

Yep. Don't use old, deprecated features.

Eventhough this is most probably a driver bug, such bugs are much more likely to occur on legacy functionality rather than on modern OpenGL functionality.
And you would have me replace gl_LightSource.specular with?
Quote:Original post by Halsafar
And you would have me replace gl_LightSource.specular with?


With a custom uniform that you declare and bind yourself, e.g. Lightsource.specular. Built-in gl_Light* uniforms are considered deprecated.

If you wish to use deprecated uniforms, make sure you are requesting a context with the "compatibility profile".

[OpenTK: C# OpenGL 4.4, OpenGL ES 3.0 and OpenAL 1.1. Now with Linux/KMS support!]

This topic is closed to new replies.

Advertisement