Flesh out 4.x block redeclaration semantics:

- hide non-redeclared anonymous members
 - array size limit checking
 - illegal member qualifiers
 - additional members


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24406 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-12-09 00:37:46 +00:00
parent e1b2e39a56
commit c719481d43
16 changed files with 229 additions and 127 deletions

View File

@@ -1,7 +1,14 @@
330.frag
Warning, version 330 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:27: 'block declaration' : cannot redeclare block: gl_block
ERROR: 0:31: 'gl_' : reserved built-in name: gl_name
ERROR: 0:32: 'gl_' : reserved built-in name: gl_i
ERROR: 0:35: 'gl_in' : no declaration found for redeclaration
ERROR: 0:39: 'gl_FragCoord' : cannot redeclare a non block as a block
ERROR: 5 compilation errors. No code generated.
0:? Sequence
ERROR: node is still EOpNull!
0:8 Function Definition: main( (void)
0:8 Function Parameters:
0:10 Sequence
@@ -26,9 +33,9 @@ Warning, version 330 is not yet complete; some version-specific features are pre
0:23 move second child to first child (4-component vector of float)
0:23 'c' (4-component vector of float)
0:23 gl_Color: direct index for structure (in 4-component vector of float)
0:23 '__anon__0' (in block{gl_Color})
0:23 '__anon__0' (in block{gl_Color,})
0:23 Constant:
0:23 0 (const uint)
0:23 2 (const uint)
0:24 move second child to first child (4-component vector of float)
0:24 'outVar' (out 4-component vector of float)
0:24 'inVar' (smooth in 4-component vector of float)
@@ -36,7 +43,8 @@ Warning, version 330 is not yet complete; some version-specific features are pre
0:? 'inVar' (smooth in 4-component vector of float)
0:? 'outVar' (out 4-component vector of float)
0:? 'varyingVar' (smooth in 4-component vector of float)
0:? '__anon__0' (in block{gl_Color})
0:? '__anon__0' (in block{gl_Color,})
0:? 'gl_name' (in block{gl_i})
Linked fragment stage:

View File

@@ -1,12 +1,14 @@
400.geom
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:13: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:24: 'length' : array must be declared with a size before using this method
ERROR: 0:35: 'length' : array must be declared with a size before using this method
ERROR: 0:39: 'triangles' : inconsistent input primitive for array size colorBad
ERROR: 0:43: 'triangles' : inconsistent input primitive for array size colorbad2
ERROR: 0:55: 'location' : repeated use of location 4
ERROR: 6 compilation errors. No code generated.
ERROR: 0:20: 'gl_PointSize' : cannot add layout to redeclared block member
ERROR: 0:20: 'gl_PointSize' : cannot add patch to redeclared block member
ERROR: 0:25: 'length' : array must be declared with a size before using this method
ERROR: 0:36: 'length' : array must be declared with a size before using this method
ERROR: 0:40: 'triangles' : inconsistent input primitive for array size colorBad
ERROR: 0:44: 'triangles' : inconsistent input primitive for array size colorbad2
ERROR: 0:56: 'location' : repeated use of location 4
ERROR: 8 compilation errors. No code generated.
invocations = 4
@@ -29,39 +31,39 @@ ERROR: node is still EOpNull!
0:10 move second child to first child (int)
0:10 'id' (int)
0:10 'gl_InvocationID' (in int)
0:22 Function Definition: foo( (void)
0:22 Function Parameters:
0:24 Sequence
0:24 Constant:
0:24 1 (const int)
0:25 gl_Position: direct index for structure (4-component vector of float)
0:25 direct index (block{gl_Position})
0:25 'gl_in' (in 3-element array of block{gl_Position})
0:25 Constant:
0:25 1 (const int)
0:25 Constant:
0:25 0 (const int)
0:33 Function Definition: foo2( (void)
0:33 Function Parameters:
0:35 Sequence
0:35 Constant:
0:35 1 (const int)
0:23 Function Definition: foo( (void)
0:23 Function Parameters:
0:25 Sequence
0:25 Constant:
0:25 1 (const int)
0:26 gl_Position: direct index for structure (4-component vector of float)
0:26 direct index (block{gl_Position,gl_PointSize})
0:26 'gl_in' (in 3-element array of block{gl_Position,gl_PointSize})
0:26 Constant:
0:26 1 (const int)
0:26 Constant:
0:26 0 (const int)
0:34 Function Definition: foo2( (void)
0:34 Function Parameters:
0:36 Sequence
0:36 Constant:
0:36 3 (const int)
0:45 Function Definition: foo3( (void)
0:45 Function Parameters:
0:47 Sequence
0:47 Constant:
0:47 3 (const int)
0:36 1 (const int)
0:37 Constant:
0:37 3 (const int)
0:46 Function Definition: foo3( (void)
0:46 Function Parameters:
0:48 Sequence
0:48 Constant:
0:48 3 (const int)
0:49 Constant:
0:49 3 (const int)
0:50 Constant:
0:50 3 (const int)
0:51 Constant:
0:51 3 (const int)
0:? Linker Objects
0:? '__anon__0' (layout(stream=0 ) out block{a})
0:? 'gl_in' (in 3-element array of block{gl_Position})
0:? 'gl_in' (in 3-element array of block{gl_Position,gl_PointSize})
0:? 'color' (in 3-element array of 4-component vector of float)
0:? 'color2' (in 3-element array of 4-component vector of float)
0:? 'colorS' (in 3-element array of 4-component vector of float)

View File

@@ -1,11 +1,13 @@
410.geom
Warning, version 410 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:8: 'myIn' : cannot redeclare a built-in block with a user name
ERROR: 0:8: 'gl_' : reserved built-in name
ERROR: 0:12: 'gl_' : reserved built-in name
ERROR: 0:12: 'gl_myIn' : no declaration found for redeclaration
ERROR: 0:20: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 0:20: 'gl_' : reserved built-in name
ERROR: 5 compilation errors. No code generated.
ERROR: 0:32: 'gl_Position' : no such field in structure
ERROR: 0:32: '=' : cannot convert from 'block{gl_PointSize}' to '4-component vector of float'
ERROR: 0:33: 'gl_Position' : member of nameless block was not redeclared
ERROR: 0:33: 'assign' : cannot convert from 'const 4-component vector of float' to 'layout(stream=0 ) gl_Position void'
ERROR: 7 compilation errors. No code generated.
invocations = 0
@@ -35,13 +37,17 @@ ERROR: node is still EOpNull!
0:30 0 (const int)
0:31 move second child to first child (float)
0:31 gl_PointSize: direct index for structure (layout(stream=0 ) gl_PointSize float)
0:31 '__anon__0' (layout(stream=0 ) out block{gl_PointSize})
0:31 '__anon__0' (layout(stream=0 ) out block{gl_PointSize,})
0:31 Constant:
0:31 0 (const uint)
0:31 1 (const uint)
0:31 'p' (float)
0:33 gl_Position: direct index for structure (layout(stream=0 ) gl_Position void)
0:33 '__anon__0' (layout(stream=0 ) out block{gl_PointSize,})
0:33 Constant:
0:33 0 (const uint)
0:? Linker Objects
0:? 'gl_in' (in unsized array of block{gl_PointSize})
0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize})
0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize,})
Linked geometry stage:

View File

@@ -4,7 +4,9 @@ ERROR: 0:9: 'length' : array must be declared with a size before using this met
ERROR: 0:11: '[' : array must be redeclared with a size before being indexed with a variable
ERROR: 0:42: 'assign' : l-value required (can't modify a const)
ERROR: 0:43: 'assign' : l-value required "v4" (can't modify a uniform)
ERROR: 4 compilation errors. No code generated.
ERROR: 0:48: 'gl_PointSize' : cannot change arrayness of redeclared block member
ERROR: 0:49: 'gl_ClipDistance' : cannot change arrayness of redeclared block member
ERROR: 6 compilation errors. No code generated.
invocations = 0
@@ -115,6 +117,7 @@ ERROR: node is still EOpNull!
0:? 's2D' (uniform sampler2D)
0:? 'coord' (in 2-component vector of float)
0:? 'v4' (uniform 4-component vector of float)
0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize,gl_ClipDistance})
Linked geometry stage:

View File

@@ -130,6 +130,7 @@ ERROR: node is still EOpNull!
0:? 'sampb3' (layout(binding=32 ) uniform sampler2D)
0:? 'sampb4' (layout(binding=31 ) uniform sampler2D)
0:? 'sampb5' (layout(binding=31 ) uniform 2-element array of sampler2D)
0:? '__anon__3' (out block{gl_ClipDistance,})
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)

View File

@@ -23,9 +23,9 @@ ERROR: node is still EOpNull!
0:16 move second child to first child (float)
0:16 direct index (float)
0:16 gl_ClipDistance: direct index for structure (17-element array of float)
0:16 '__anon__0' (out block{gl_ClipDistance})
0:16 '__anon__0' (out block{gl_ClipDistance,})
0:16 Constant:
0:16 0 (const uint)
0:16 2 (const uint)
0:16 Constant:
0:16 2 (const int)
0:16 Constant:
@@ -41,7 +41,7 @@ ERROR: node is still EOpNull!
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:? '__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)

View File

@@ -8,15 +8,15 @@ ERROR: 0:22: 'vn8' : illegal use of type 'void'
ERROR: 0:22: 'vp' : illegal use of type 'void'
ERROR: 0:25: 'cij' : variables with qualifier 'const' must be initialized
ERROR: 0:27: 'cip' : variables with qualifier 'const' must be initialized
ERROR: 0:34: 'gl_' : reserved built-in name
ERROR: 0:35: 'gl_' : reserved built-in name
ERROR: 0:35: 'gl_' : reserved built-in name
ERROR: 0:36: 'gl_' : reserved built-in name
ERROR: 0:36: 'gl_' : reserved built-in name
ERROR: 0:37: 'gl_' : reserved built-in name
ERROR: 0:37: 'gl_' : reserved built-in name
ERROR: 0:34: 'gl_' : reserved built-in name: gl_vi4
ERROR: 0:35: 'gl_' : reserved built-in name: gl_vj
ERROR: 0:35: 'gl_' : reserved built-in name: gl_vk5
ERROR: 0:36: 'gl_' : reserved built-in name: gl_vm2
ERROR: 0:36: 'gl_' : reserved built-in name: gl_vm3
ERROR: 0:37: 'gl_' : reserved built-in name: gl_vn8
ERROR: 0:37: 'gl_' : reserved built-in name: gl_vp
ERROR: 0:42: '' : boolean expression expected
ERROR: 0:43: 'gl_' : reserved built-in name
ERROR: 0:43: 'gl_' : reserved built-in name: gl_cond
ERROR: 18 compilation errors. No code generated.