Bug 30318

Summary: [glsl2] glean glsl1 test "texcoord varying" does not work
Product: Mesa Reporter: Brian Paul <brianp>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: git   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Brian Paul 2010-09-21 17:04:44 UTC
$ export GLSL_TEST="texcoord varying"
$ ./glean  -r /tmp/gleanresults --overwrite -t glsl1
glsl1: Running single test: texcoord varying
FAILURE:
  Shader test: texcoord varying
Vertex shader did not compile:
0:4(15): error: unsized array index must be constant
glsl1:  FAIL rgba8, db, z24, s8, accrgba16, win+pmap, id 33
	0 tests passed, 1 tests failed.


The shader used to compile with the old glsl compiler and it works with NVIDIA's compiler.  My hunch is the built-in declaration for the gl_TexCoord[] array is not dimensioned properly.
Comment 1 Ian Romanick 2010-09-22 09:47:57 UTC
We removed this test from the piglit list because we determined that the test was incorrect.  By default gl_TexCoord is declared as 'vec4 gl_TexCoord[]' (dimensionless).  The spec says that an array accessed with an index that is not a constant valued expression must be dimensioned.

Here's the piglit commit:

commit c6146f121e2f9319aa87631dcc024b208acf7829
Author: Eric Anholt <eric@anholt.net>
Date:   Thu Aug 5 16:20:15 2010 -0700

    glean: Flag the glsl1 test "texcoord varying" as being invalid GLSL.
    
    It accesses the builtin unsized array gl_TexCoord[] with a
    non-constant expression without sizing the array first.  See piglit
    glsl-texcoord-array for a working version of this tset.
Comment 2 Brian Paul 2010-09-22 10:01:02 UTC
OK, it looks like this changed at some point.  The original GLSL Orange book defined the array as varying vec4 gl_TexCoord[gl_MaxTextureCoords].

I'd rather see the glean test fixed than flagged as illegal though.
Comment 3 Brian Paul 2010-09-22 10:03:57 UTC
Fixed glean glsl1 "texcoord varying" with commit 390b0392f25dc85080a9a5c2a69926c290873e38

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.