Add ES 3.0 fragment output link-time test for outputs having or not having location qualifiers.

Also split linker validation into its own file, removed dead "QualifierAlive" files, printed errors for parsing problems with built-in symbols,  updated the Windows binary, and added some tests.


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23490 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-15 21:46:20 +00:00
parent 27b72e42c3
commit fb57e7cc5e
23 changed files with 543 additions and 434 deletions

21
Test/150.vert Normal file
View file

@ -0,0 +1,21 @@
#version 150 core
in vec4 iv4;
uniform float ps;
invariant gl_Position;
void main()
{
gl_Position = iv4;
gl_PointSize = ps;
gl_ClipDistance[2] = iv4.x;
}
float gl_ClipDistance[4];
uniform foob {
int a[];
};
int a[5]; // ERROR, resizing user-block member

8
Test/300link.frag Normal file
View file

@ -0,0 +1,8 @@
#version 300 es
precision highp float;
out vec4 color1;
out vec4 color2;
void main() {}

11
Test/300link2.frag Normal file
View file

@ -0,0 +1,11 @@
#version 300 es
precision mediump float;
in vec4 pos;
layout(location = 1) out vec4 c;
layout(location = 5) out vec4 p;
layout(location = 9) out vec4 q[2];
void main()
{
}

7
Test/300link3.frag Normal file
View file

@ -0,0 +1,7 @@
#version 300 es
precision highp float;
out vec4 color1;
void main() {}

6
Test/410.geom Normal file
View file

@ -0,0 +1,6 @@
#version 410 core
void main()
{
gl_ViewportIndex = 7;
}

View file

@ -0,0 +1,33 @@
Warning, version 150 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:13: 'gl_ClipDistance' : undeclared identifier
ERROR: 0:13: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector
ERROR: 0:13: 'assign' : l-value required (can't modify a const)
ERROR: 0:16: 'gl_' : reserved built-in name
ERROR: 0:21: 'a' : cannot redeclare a user-block member array
ERROR: 5 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:9 Function Definition: main( (void)
0:9 Function Parameters:
0:11 Sequence
0:11 move second child to first child (4-component vector of float)
0:11 'gl_Position' (invariant gl_Position 4-component vector of float)
0:11 'iv4' (in 4-component vector of float)
0:12 move second child to first child (float)
0:12 'gl_PointSize' (gl_PointSize float)
0:12 'ps' (uniform float)
0:13 move second child to first child (float)
0:13 Constant:
0:13 0.000000
0:13 direct index (float)
0:13 'iv4' (in 4-component vector of float)
0:13 Constant:
0:13 0 (const int)
0:? Linker Objects
0:? 'iv4' (in 4-component vector of float)
0:? 'ps' (uniform float)
0:? 'gl_ClipDistance' (4-element array of float)
0:? '__anon__0' (layout(shared ) uniform block)
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)

View file

@ -0,0 +1,15 @@
300link.frag
0:? Sequence
0:8 Function Definition: main( (void)
0:8 Function Parameters:
0:? Linker Objects
0:? 'color1' (out highp 4-component vector of float)
0:? 'color2' (out highp 4-component vector of float)
Linked fragment stage:
ERROR: Linking fragment stage: when more than one fragment shader output, all must have location qualifiers

View file

@ -0,0 +1,16 @@
300link2.frag
0:? Sequence
0:9 Function Definition: main( (void)
0:9 Function Parameters:
0:? Linker Objects
0:? 'pos' (smooth in mediump 4-component vector of float)
0:? 'c' (layout(location=1 ) out mediump 4-component vector of float)
0:? 'p' (layout(location=5 ) out mediump 4-component vector of float)
0:? 'q' (layout(location=9 ) out 2-element array of mediump 4-component vector of float)
Linked fragment stage:

View file

@ -0,0 +1,13 @@
300link3.frag
0:? Sequence
0:7 Function Definition: main( (void)
0:7 Function Parameters:
0:? Linker Objects
0:? 'color1' (out highp 4-component vector of float)
Linked fragment stage:

View file

@ -0,0 +1,14 @@
Warning, version 410 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:5: 'gl_ViewportIndex' : undeclared identifier
ERROR: 1 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:3 Function Definition: main( (void)
0:3 Function Parameters:
0:5 Sequence
0:5 move second child to first child (float)
0:5 'gl_ViewportIndex' (float)
0:5 Constant:
0:5 7.000000
0:? Linker Objects

View file

@ -38,6 +38,9 @@ runLinkTest mains1.frag mains2.frag noMain1.geom noMain2.geom
runLinkTest noMain.vert mains.frag
runLinkTest link1.frag link2.frag link3.frag
runLinkTest recurse1.vert recurse1.frag recurse2.frag
runLinkTest 300link.frag
runLinkTest 300link2.frag
runLinkTest 300link3.frag
#
# multi-threaded test

View file

@ -12,6 +12,7 @@ versionsErrors.vert
120.frag
130.frag
140.frag
150.vert
150.geom
precision.frag
precision.vert
@ -52,6 +53,7 @@ numeral.frag
400.geom
400.tesc
400.tese
410.geom
420.tese
430.comp
dce.frag