piglit: 0059532ce58bf33d611530d2adc38a92d04a1ace The piglit glsl-texcoord-array test fails GLSL compilation with compilers other the Mesa GLSL compiler. NVIDIA Failed to link: Vertex info ----------- 0(4) : warning C7011: implicit cast from "int" to "float" 0(5) : warning C7011: implicit cast from "int" to "float" 0(5) : error C5025: lvalue in assignment too complex Fragment info ------------- 0(4) : warning C7011: implicit cast from "float" to "int" 0(4) : error C6013: Only arrays of texcoords may be indexed in this profile, and only with a loop index variable fglrx Failed to compile FS: Fragment shader failed to compile with the following errors: ERROR: 0:4: error(#166) Integer expression required [] ERROR: error(#273) 1 compilation errors. No code generated Mac OS X Failed to compile VS: ERROR: 0:4: '<' : wrong operand types no operation '<' exists that takes a left-hand operand of type 'int' and a right operand of type 'uniform float' (or there is no acceptable conversion) ERROR: 0:5: '[' : array must be redeclared with a size before being indexed with a variable ERROR: 0:5: '*' : wrong operand types no operation '*' exists that takes a left-hand operand of type 'const 4-component vector of float' and a right operand of type 'int' (or there is no acceptable conversion)
piglit: c29c45f21eef7378e1c93cef8ac452e65c1ec6f8 glsl-texcoord-array compiles with fglrx now, but still fails with the NVIDIA and Apple compilers. NVIDIA Failed to link: Vertex info ----------- 0(6) : error C5025: lvalue in assignment too complex Fragment info ------------- 0(4) : error C6013: Only arrays of texcoords may be indexed in this profile, and only with a loop index variable Mac OS X 10.6.4 Failed to compile VS: ERROR: 0:6: '[' : array must be redeclared with a size before being indexed with a variable
The test is incorrect. The gl_TexCoord array should be explicitly sized before being variably accessed. We should do two things: 1. Add 'varying vec4 gl_TexCoord[5];' declarations to both the vertex and fragment shader in this test. 2. Add a parser test that tries to access gl_TexCoord with a variable index without an explicit size. This test should expect the compiler to generate an error. I'm going to assign this bug to Ken to fix.
This should be fixed in piglit master. I created a new failing parser test, unsized-array-non-const-index.vert, based on glsl-texcoord-array's vertex shader. The only change is an extra cast so it's 1.10 compatible...there isn't any real reason it has to be 1.20. I then added the array redeclarations as idr suggested. glsl-texcoord-array now compiles on ATI and nVidia.
piglit: 1d7d2a04e29f2986212225461d65ee24acd06a35 glsl-texcoord-array compiles now with the fglrx and Apple compilers, but still fails with the NVIDIA GLSL compiler. Both NVIDIA 197.45 and 256.35 result in the following error. Failed to link: Vertex info ----------- 0(7) : error C5025: lvalue in assignment too complex Fragment info ------------- 0(5) : error C6013: Only arrays of texcoords may be indexed in this profile, and only with a loop index variable
The NVIDIA compiler error is dependent on the hardware or possibly the OpenGL version. GeForce 9600 3.3.0 NVIDIA 256.35 - pass GeForce 7300 2.1.2 NVIDIA 256.35 - fail GeForce 6600 2.1.2 NVIDIA 197.45 - fail
The NVIDIA GLSL compilation error seems to be attributable to the shading language version of the NVIDIA Cg compiler. GeForce 6600 1.20 Cg - fail GeForce 7300 1.20 Cg - fail GeForce 8800 3.30 Cg - pass GeForce 9600 3.30 Cg - pass Marking is bug as resolved again.
(In reply to comment #6) > The NVIDIA GLSL compilation error seems to be attributable to the shading > language version of the NVIDIA Cg compiler. > > GeForce 6600 1.20 Cg - fail > GeForce 7300 1.20 Cg - fail > GeForce 8800 3.30 Cg - pass > GeForce 9600 3.30 Cg - pass > > > Marking is bug as resolved again. It's more likely that the Geforce6 and Geforce7 hardware can't do the required indexing of arrays. I'm pretty sure the Geforce6 can't do it (neither can R300), but I'm not so sure about Geforce7. Either way, it's not our problem (as you noted). :)
Closing this bug. For the record, glsl-texcoord-array also compiles with the Windows Intel GLSL compiler.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.