Implement location overlap error checking.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24376 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-12-05 20:07:56 +00:00
parent 2f15597a7e
commit 0b39137009
13 changed files with 146 additions and 12 deletions

View File

@@ -13,3 +13,7 @@ void main()
p = pos;
q[1] = pos;
}
layout(location = 40) out float ca[4];
layout(location = 41) out float cb[2]; // ERROR, overlap
layout(location = 39) out float cc[6]; // ERROR, overlap

View File

@@ -5,7 +5,7 @@ struct s { vec4 v; };
layout(location = 7) in vec3 c;
layout(LocatioN = 3) in vec4 p;
layout(LocatioN = 9) in vec4 q[4]; // ERROR, no array
layout(LocatioN = 10) in s r[4]; // ERROR, no struct
layout(LocatioN = 10) in s r[4]; // ERROR, no struct, ERROR, location overlap
out vec4 pos;
out vec3 color;
@@ -52,3 +52,6 @@ shared vec4 compute_only; // ERROR
layout(packed) uniform;
layout(packed) float aoeuntaoeu;
layout(location = 40) in float cd;
layout(location = 37) in mat4x3 ce; // ERROR, overlap

View File

@@ -33,7 +33,7 @@ layout(location = 4) in vec4 vl; // ERROR, not supported
#extension GL_ARB_separate_shader_objects : enable
#endif
layout(location = 4) in vec4 vl2;
layout(location = 6) in vec4 vl2;
layout(location = 3) uniform vec3 uv3;

View File

@@ -2,7 +2,7 @@
layout(location = 3) vec4 v4; // ERROR
layout(location = 3) uniform vec4 uv4;
layout(location = 4) uniform vec4 uv4;
layout(location = 2) in inb1 { vec4 v; } b1; // ERROR
layout(location = 2) out outb1 { vec4 v; } b2; // ERROR
@@ -30,4 +30,13 @@ void foo3(invariant vec4 v4, // ERROR
layout(location = 3) vec2 v2, // ERROR
centroid vec3 cv3) // ERROR
{
}
}
struct S {
mat3x2 m[7]; // needs 7*3 locations
float f; // needs 1 location
}; // needs 22 locations
layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53
layout(location = 54) out float cf;
layout(location = 53) out float cg; // ERROR, collision at 31

View File

@@ -1,6 +1,8 @@
300layout.frag
ERROR: 0:4: 'location qualifier on input' : not supported in this stage: fragment
ERROR: 1 compilation errors. No code generated.
ERROR: 0:18: 'location' : repeated use of location 41
ERROR: 0:19: 'location' : repeated use of location 40
ERROR: 3 compilation errors. No code generated.
ERROR: node is still EOpNull!
@@ -25,6 +27,9 @@ ERROR: node is still EOpNull!
0:? 'c' (layout(location=1 ) out mediump 4-component vector of float)
0:? 'p' (layout(location=3 ) out mediump 4-component vector of float)
0:? 'q' (layout(location=4 ) out 2-element array of mediump 4-component vector of float)
0:? 'ca' (layout(location=40 ) out 4-element array of mediump float)
0:? 'cb' (layout(location=41 ) out 2-element array of mediump float)
0:? 'cc' (layout(location=39 ) out 6-element array of mediump float)
Linked fragment stage:

View File

@@ -2,6 +2,7 @@
ERROR: 0:7: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'in' : cannot be a structure or array
ERROR: 0:8: 'vertex input arrays' : not supported with this profile: es
ERROR: 0:8: 'location' : repeated use of location 10
ERROR: 0:12: 'badm4' : cannot specify matrix layout on a variable declaration
ERROR: 0:12: 'badm4' : cannot specify packing on a variable declaration
ERROR: 0:19: 'badf' : member of uniform block cannot have an auxiliary or interpolation qualifier
@@ -15,7 +16,8 @@ ERROR: 0:42: 'location qualifier on output' : not supported in this stage: verte
ERROR: 0:50: 'shared' : not supported with this profile: es
ERROR: 0:50: 'shared' : not supported in this stage: vertex
ERROR: 0:54: 'aoeuntaoeu' : layout qualifiers for matrix layout and packing only apply to uniform or buffer blocks
ERROR: 16 compilation errors. No code generated.
ERROR: 0:57: 'location' : repeated use of location 40
ERROR: 18 compilation errors. No code generated.
ERROR: node is still EOpNull!
@@ -72,6 +74,8 @@ ERROR: node is still EOpNull!
0:? 'badoutA' (layout(location=10 ) smooth out highp 4-component vector of float)
0:? 'compute_only' (shared highp 4-component vector of float)
0:? 'aoeuntaoeu' (layout(packed ) highp float)
0:? 'cd' (layout(location=40 ) in highp float)
0:? 'ce' (layout(location=37 ) in highp 4X3 matrix of float)
0:? 'gl_VertexID' (gl_VertexId highp int)
0:? 'gl_InstanceID' (gl_InstanceId highp int)

View File

@@ -197,7 +197,7 @@ ERROR: node is still EOpNull!
0:? 'isamp2DA' (uniform isampler2DArray)
0:? 'gl_ClipDistance' (smooth in 4-element array of float)
0:? 'vl' (layout(location=4 ) smooth in 4-component vector of float)
0:? 'vl2' (layout(location=4 ) smooth in 4-component vector of float)
0:? 'vl2' (layout(location=6 ) smooth in 4-component vector of float)
0:? 'uv3' (layout(location=3 ) uniform 3-component vector of float)
0:? '__anon__0' (in block{gl_FogFragCoord,gl_TexCoord,gl_Color,gl_SecondaryColor})
0:? '__anon__0' (in block{gl_FogFragCoord,gl_TexCoord,gl_Color,gl_SecondaryColor})

View File

@@ -11,7 +11,8 @@ ERROR: 0:25: 'm3' : cannot use layout qualifiers on structure members
ERROR: 0:28: '' : cannot use invariant qualifier on a function parameter
ERROR: 0:30: '' : cannot use layout qualifiers on a function parameter
ERROR: 0:31: '' : cannot use auxiliary or interpolation qualifiers on a function parameter
ERROR: 11 compilation errors. No code generated.
ERROR: 0:42: 'location' : repeated use of location 53
ERROR: 12 compilation errors. No code generated.
ERROR: node is still EOpNull!
@@ -36,10 +37,13 @@ ERROR: node is still EOpNull!
0:31 'cv3' (in 3-component vector of float)
0:? Linker Objects
0:? 'v4' (layout(location=3 ) 4-component vector of float)
0:? 'uv4' (layout(location=3 ) uniform 4-component vector of float)
0:? 'uv4' (layout(location=4 ) uniform 4-component vector of float)
0:? 'b1' (layout(location=2 ) in block{v})
0:? 'b2' (layout(location=2 ) out block{v})
0:? '__anon__0' (out block{gl_ClipDistance})
0:? 'cs' (layout(location=10 ) smooth out 2-element array of structure{m,f})
0:? 'cf' (layout(location=54 ) smooth out float)
0:? 'cg' (layout(location=53 ) smooth out float)
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)

View File

@@ -16,6 +16,7 @@ ERROR: 0:99: 'local_size_y' : there is no such layout identifier for this stage
ERROR: 0:100: 'local_size_x' : there is no such layout identifier for this stage taking an assigned value
ERROR: 0:102: 'color' : redefinition
ERROR: 0:103: 'index' : there is no such layout identifier for this stage taking an assigned value
ERROR: 0:104: 'location' : repeated use of location 3
ERROR: 0:106: 'depth_greater' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
ERROR: 0:112: 'depth_any' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
ERROR: 0:115: 'depth_greater' : unrecognized layout identifier, or qualifier requires assignemnt (e.g., binding = 4)
@@ -48,7 +49,7 @@ ERROR: 0:226: 'in' : not allowed in nested scope
ERROR: 0:227: 'in' : not allowed in nested scope
ERROR: 0:228: 'in' : not allowed in nested scope
ERROR: 0:232: 'out' : not allowed in nested scope
ERROR: 48 compilation errors. No code generated.
ERROR: 49 compilation errors. No code generated.
gl_FragCoord pixel center is integer