More subtle checking for redeclarations:

- 300 doesn't allow built-in overload, while 100 does, while neither allows redefining
 - block name can't be reused for block name within the same interface 
   (though, the spec. isn't clear about that, it's easier than verifying member matches, will file bug on it)


git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23984 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich
2013-11-11 04:21:31 +00:00
parent 4d6570a1b3
commit a4351c55e8
15 changed files with 332 additions and 243 deletions

View File

@@ -1,11 +1,12 @@
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : illegal redeclaration
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:20: 'tan' : redefinition
ERROR: 0:31: 'local function declaration' : not supported with this profile: es
ERROR: 0:50: 'z' : undeclared identifier
ERROR: 0:50: 'z' : redefinition
ERROR: 7 compilation errors. No code generated.
ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:35: 'local function declaration' : not supported with this profile: es
ERROR: 0:54: 'z' : undeclared identifier
ERROR: 0:54: 'z' : redefinition
ERROR: 8 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:3 Function Definition: f(i1;i1;i1; (highp int)
@@ -32,73 +33,81 @@ ERROR: node is still EOpNull!
0:24 Branch: Return with expression
0:24 Constant:
0:24 1.000000
0:29 Function Definition: main( (void)
0:29 Function Parameters:
0:26 Function Definition: radians(b1; (bool)
0:26 Function Parameters:
0:26 'x' (in bool)
0:28 Sequence
0:28 Branch: Return with expression
0:28 Constant:
0:28 true (const bool)
0:33 Function Definition: main( (void)
0:33 Function Parameters:
0:? Sequence
0:32 Function Call: g( (highp int)
0:35 'sin' (highp float)
0:37 Function Call: f(i1;i1;i1; (highp int)
0:37 Constant:
0:37 1 (const int)
0:37 Constant:
0:37 2 (const int)
0:37 Constant:
0:37 3 (const int)
0:40 move second child to first child (highp float)
0:40 'f' (highp float)
0:40 Constant:
0:40 3.000000
0:42 move second child to first child (highp 4-component vector of float)
0:42 'gl_Position' (invariant gl_Position highp 4-component vector of float)
0:42 Construct vec4 (highp 4-component vector of float)
0:42 'f' (highp float)
0:44 Sequence
0:44 Sequence
0:44 move second child to first child (highp int)
0:44 'f' (highp int)
0:44 Constant:
0:44 0 (const int)
0:44 Loop with condition tested first
0:44 Loop Condition
0:44 Compare Less Than (bool)
0:44 'f' (highp int)
0:44 Constant:
0:44 10 (const int)
0:44 Loop Body
0:45 Pre-Increment (highp int)
0:45 'f' (highp int)
0:44 Loop Terminal Expression
0:44 Pre-Increment (highp int)
0:44 'f' (highp int)
0:47 Sequence
0:47 move second child to first child (highp int)
0:47 'x' (highp int)
0:47 Constant:
0:47 1 (const int)
0:49 Sequence
0:49 Sequence
0:49 move second child to first child (highp float)
0:49 'x' (highp float)
0:49 Constant:
0:49 2.000000
0:49 move second child to first child (highp float)
0:49 'y' (highp float)
0:49 'x' (highp float)
0:36 Function Call: g( (highp int)
0:39 'sin' (highp float)
0:41 Function Call: f(i1;i1;i1; (highp int)
0:41 Constant:
0:41 1 (const int)
0:41 Constant:
0:41 2 (const int)
0:41 Constant:
0:41 3 (const int)
0:44 move second child to first child (highp float)
0:44 'f' (highp float)
0:44 Constant:
0:44 3.000000
0:46 move second child to first child (highp 4-component vector of float)
0:46 'gl_Position' (invariant gl_Position highp 4-component vector of float)
0:46 Construct vec4 (highp 4-component vector of float)
0:46 'f' (highp float)
0:48 Sequence
0:48 Sequence
0:48 move second child to first child (highp int)
0:48 'f' (highp int)
0:48 Constant:
0:48 0 (const int)
0:48 Loop with condition tested first
0:48 Loop Condition
0:48 Compare Less Than (bool)
0:48 'f' (highp int)
0:48 Constant:
0:48 10 (const int)
0:48 Loop Body
0:49 Pre-Increment (highp int)
0:49 'f' (highp int)
0:48 Loop Terminal Expression
0:48 Pre-Increment (highp int)
0:48 'f' (highp int)
0:51 Sequence
0:51 move second child to first child (highp int)
0:51 'x' (highp int)
0:51 Constant:
0:51 1 (const int)
0:53 Sequence
0:53 Sequence
0:53 move second child to first child (highp int)
0:53 'x' (highp int)
0:53 'x' (highp int)
0:61 Sequence
0:61 Sequence
0:61 move second child to first child (structure{x})
0:61 'S' (structure{x})
0:61 Constant:
0:61 0 (const int)
0:62 x: direct index for structure (highp int)
0:62 'S' (structure{x})
0:62 Constant:
0:62 0 (const int)
0:53 move second child to first child (highp float)
0:53 'x' (highp float)
0:53 Constant:
0:53 2.000000
0:53 move second child to first child (highp float)
0:53 'y' (highp float)
0:53 'x' (highp float)
0:57 Sequence
0:57 Sequence
0:57 move second child to first child (highp int)
0:57 'x' (highp int)
0:57 'x' (highp int)
0:65 Sequence
0:65 Sequence
0:65 move second child to first child (structure{x})
0:65 'S' (structure{x})
0:65 Constant:
0:65 0 (const int)
0:66 x: direct index for structure (highp int)
0:66 'S' (structure{x})
0:66 Constant:
0:66 0 (const int)
0:? Linker Objects
0:? 'b' (bool)
0:? 'tan' (highp float)

View File

@@ -135,4 +135,7 @@ ERROR: node is still EOpNull!
0:? '__anon__1' (layout(stream=3 ) out block{a})
0:? 'outbi' (layout(stream=3 ) out block{a,b,c})
0:? 'inbi' (in block{a})
0:? '__anon__2' (in block{a15})
0:? '__anon__3' (layout(stream=3 ) out block{f15})
0:? '__anon__4' (layout(column_major shared ) uniform block{b15})

View File

@@ -18,9 +18,12 @@ ERROR: 0:63: '' : array size required
ERROR: 0:65: '' : array size required
ERROR: 0:64: '' : array size required
ERROR: 0:67: '' : array size required
ERROR: 0:78: 'invariant' : can only apply to an output
invIn
ERROR: 21 compilation errors. No code generated.
ERROR: 0:78: 'invariant' : can only apply to an output: invIn
ERROR: 0:88: 'ub2' : Cannot reuse block name within the same interface: uniform
ERROR: 0:92: 'ub2' : Cannot reuse block name within the same interface: uniform
ERROR: 0:96: 'ub2' : Cannot reuse block name within the same interface: uniform
ERROR: 0:104: 'ub3' : Cannot reuse block name within the same interface: uniform
ERROR: 25 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:27 Function Definition: main( (void)
@@ -167,6 +170,8 @@ ERROR: node is still EOpNull!
0:? 'invIn' (in highp 4-component vector of float)
0:? 's2' (smooth out structure{c,f})
0:? 's3' (invariant smooth out structure{c,f})
0:? 'a' (layout(column_major shared ) uniform block{f})
0:? '__anon__0' (layout(column_major shared ) uniform block{b23})
0:? 'gl_VertexID' (gl_VertexId highp int)
0:? 'gl_InstanceID' (gl_InstanceId highp int)

View File

@@ -1,13 +1,18 @@
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : illegal redeclaration
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:20: 'tan' : redefinition
ERROR: 0:21: 'redeclaration of built-in function' : no longer supported in es profile; removed in version 300
ERROR: 0:22: 'redeclaration of built-in function' : no longer supported in es profile; removed in version 300
ERROR: 0:31: 'local function declaration' : not supported with this profile: es
ERROR: 0:50: 'z' : undeclared identifier
ERROR: 0:50: 'z' : redefinition
ERROR: 9 compilation errors. No code generated.
ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:21: 'sin' : redeclaration of existing name
ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es
ERROR: 0:22: 'cos' : redeclaration of existing name
ERROR: 0:26: 'radians' : redeclaration of existing name
ERROR: 0:26: 'radians' : can't find function
ERROR: 0:28: 'return' : void function cannot return a value
ERROR: 0:35: 'local function declaration' : not supported with this profile: es
ERROR: 0:54: 'z' : undeclared identifier
ERROR: 0:54: 'z' : redefinition
ERROR: 14 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:3 Function Definition: f(i1;i1;i1; (highp int)
@@ -34,73 +39,80 @@ ERROR: node is still EOpNull!
0:24 Branch: Return with expression
0:24 Constant:
0:24 1.000000
0:29 Function Definition: main( (void)
0:29 Function Parameters:
0:26 Function Definition: radians(b1; (bool)
0:26 Function Parameters:
0:26 'x' (in bool)
0:28 Sequence
0:28 Branch: Return with expression
0:28 Constant:
0:28 true (const bool)
0:33 Function Definition: main( (void)
0:33 Function Parameters:
0:? Sequence
0:32 Function Call: g( (highp int)
0:35 'sin' (highp float)
0:37 Function Call: f(i1;i1;i1; (highp int)
0:37 Constant:
0:37 1 (const int)
0:37 Constant:
0:37 2 (const int)
0:37 Constant:
0:37 3 (const int)
0:40 move second child to first child (highp float)
0:40 'f' (highp float)
0:40 Constant:
0:40 3.000000
0:42 move second child to first child (highp 4-component vector of float)
0:42 'gl_Position' (invariant gl_Position highp 4-component vector of float)
0:42 Construct vec4 (highp 4-component vector of float)
0:42 'f' (highp float)
0:44 Sequence
0:44 Sequence
0:44 move second child to first child (highp int)
0:44 'f' (highp int)
0:44 Constant:
0:44 0 (const int)
0:44 Loop with condition tested first
0:44 Loop Condition
0:44 Compare Less Than (bool)
0:44 'f' (highp int)
0:44 Constant:
0:44 10 (const int)
0:44 Loop Body
0:45 Pre-Increment (highp int)
0:45 'f' (highp int)
0:44 Loop Terminal Expression
0:44 Pre-Increment (highp int)
0:44 'f' (highp int)
0:47 Sequence
0:47 move second child to first child (highp int)
0:47 'x' (highp int)
0:47 Constant:
0:47 1 (const int)
0:49 Sequence
0:49 Sequence
0:49 move second child to first child (highp float)
0:49 'x' (highp float)
0:49 Constant:
0:49 2.000000
0:49 move second child to first child (highp float)
0:49 'y' (highp float)
0:49 'x' (highp float)
0:36 Function Call: g( (highp int)
0:39 'sin' (highp float)
0:41 Function Call: f(i1;i1;i1; (highp int)
0:41 Constant:
0:41 1 (const int)
0:41 Constant:
0:41 2 (const int)
0:41 Constant:
0:41 3 (const int)
0:44 move second child to first child (highp float)
0:44 'f' (highp float)
0:44 Constant:
0:44 3.000000
0:46 move second child to first child (highp 4-component vector of float)
0:46 'gl_Position' (invariant gl_Position highp 4-component vector of float)
0:46 Construct vec4 (highp 4-component vector of float)
0:46 'f' (highp float)
0:48 Sequence
0:48 Sequence
0:48 move second child to first child (highp int)
0:48 'f' (highp int)
0:48 Constant:
0:48 0 (const int)
0:48 Loop with condition tested first
0:48 Loop Condition
0:48 Compare Less Than (bool)
0:48 'f' (highp int)
0:48 Constant:
0:48 10 (const int)
0:48 Loop Body
0:49 Pre-Increment (highp int)
0:49 'f' (highp int)
0:48 Loop Terminal Expression
0:48 Pre-Increment (highp int)
0:48 'f' (highp int)
0:51 Sequence
0:51 move second child to first child (highp int)
0:51 'x' (highp int)
0:51 Constant:
0:51 1 (const int)
0:53 Sequence
0:53 Sequence
0:53 move second child to first child (highp int)
0:53 'x' (highp int)
0:53 'x' (highp int)
0:61 Sequence
0:61 Sequence
0:61 move second child to first child (structure{x})
0:61 'S' (structure{x})
0:61 Constant:
0:61 0 (const int)
0:62 x: direct index for structure (highp int)
0:62 'S' (structure{x})
0:62 Constant:
0:62 0 (const int)
0:53 move second child to first child (highp float)
0:53 'x' (highp float)
0:53 Constant:
0:53 2.000000
0:53 move second child to first child (highp float)
0:53 'y' (highp float)
0:53 'x' (highp float)
0:57 Sequence
0:57 Sequence
0:57 move second child to first child (highp int)
0:57 'x' (highp int)
0:57 'x' (highp int)
0:65 Sequence
0:65 Sequence
0:65 move second child to first child (structure{x})
0:65 'S' (structure{x})
0:65 Constant:
0:65 0 (const int)
0:66 x: direct index for structure (highp int)
0:66 'S' (structure{x})
0:66 Constant:
0:66 0 (const int)
0:? Linker Objects
0:? 'b' (bool)
0:? 'gl_VertexID' (gl_VertexId highp int)

View File

@@ -1,9 +1,9 @@
Warning, version 430 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:5: 'a' : redefinition
ERROR: 0:17: 'b' : illegal redeclaration
ERROR: 0:17: 'b' : redeclaration of existing name
ERROR: 0:19: 'f' : redefinition
ERROR: 0:50: 'z' : undeclared identifier
ERROR: 0:50: 'z' : redefinition
ERROR: 0:54: 'z' : undeclared identifier
ERROR: 0:54: 'z' : redefinition
ERROR: 5 compilation errors. No code generated.
ERROR: node is still EOpNull!
@@ -31,76 +31,83 @@ ERROR: node is still EOpNull!
0:24 Branch: Return with expression
0:24 Constant:
0:24 1.000000
0:29 Function Definition: main( (void)
0:29 Function Parameters:
0:26 Function Definition: radians(b1; (bool)
0:26 Function Parameters:
0:26 'x' (in bool)
0:28 Sequence
0:28 Branch: Return with expression
0:28 Constant:
0:28 true (const bool)
0:33 Function Definition: main( (void)
0:33 Function Parameters:
0:? Sequence
0:32 Function Call: g( (int)
0:35 'sin' (float)
0:37 Function Call: f(i1;i1;i1; (int)
0:37 Constant:
0:37 1 (const int)
0:37 Constant:
0:37 2 (const int)
0:37 Constant:
0:37 3 (const int)
0:40 move second child to first child (float)
0:40 'f' (float)
0:40 Constant:
0:40 3.000000
0:42 move second child to first child (4-component vector of float)
0:42 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)
0:42 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord})
0:42 Constant:
0:42 0 (const uint)
0:42 Construct vec4 (4-component vector of float)
0:42 'f' (float)
0:44 Sequence
0:44 Sequence
0:44 move second child to first child (int)
0:44 'f' (int)
0:44 Constant:
0:44 0 (const int)
0:44 Loop with condition tested first
0:44 Loop Condition
0:44 Compare Less Than (bool)
0:44 'f' (int)
0:44 Constant:
0:44 10 (const int)
0:44 Loop Body
0:45 Pre-Increment (int)
0:45 'f' (int)
0:44 Loop Terminal Expression
0:44 Pre-Increment (int)
0:44 'f' (int)
0:47 Sequence
0:47 move second child to first child (int)
0:47 'x' (int)
0:47 Constant:
0:47 1 (const int)
0:49 Sequence
0:49 Sequence
0:49 move second child to first child (float)
0:49 'x' (float)
0:49 Constant:
0:49 2.000000
0:49 move second child to first child (float)
0:49 'y' (float)
0:49 'x' (float)
0:36 Function Call: g( (int)
0:39 'sin' (float)
0:41 Function Call: f(i1;i1;i1; (int)
0:41 Constant:
0:41 1 (const int)
0:41 Constant:
0:41 2 (const int)
0:41 Constant:
0:41 3 (const int)
0:44 move second child to first child (float)
0:44 'f' (float)
0:44 Constant:
0:44 3.000000
0:46 move second child to first child (4-component vector of float)
0:46 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)
0:46 '__anon__0' (out block{gl_Position,gl_PointSize,gl_ClipDistance,gl_ClipVertex,gl_FrontColor,gl_BackColor,gl_FrontSecondaryColor,gl_BackSecondaryColor,gl_TexCoord,gl_FogFragCoord})
0:46 Constant:
0:46 0 (const uint)
0:46 Construct vec4 (4-component vector of float)
0:46 'f' (float)
0:48 Sequence
0:48 Sequence
0:48 move second child to first child (int)
0:48 'f' (int)
0:48 Constant:
0:48 0 (const int)
0:48 Loop with condition tested first
0:48 Loop Condition
0:48 Compare Less Than (bool)
0:48 'f' (int)
0:48 Constant:
0:48 10 (const int)
0:48 Loop Body
0:49 Pre-Increment (int)
0:49 'f' (int)
0:48 Loop Terminal Expression
0:48 Pre-Increment (int)
0:48 'f' (int)
0:51 Sequence
0:51 move second child to first child (int)
0:51 'x' (int)
0:51 Constant:
0:51 1 (const int)
0:53 Sequence
0:53 Sequence
0:53 move second child to first child (int)
0:53 'x' (int)
0:53 'x' (int)
0:61 Sequence
0:61 Sequence
0:61 move second child to first child (structure{x})
0:61 'S' (structure{x})
0:61 Constant:
0:61 0 (const int)
0:62 x: direct index for structure (int)
0:62 'S' (structure{x})
0:62 Constant:
0:62 0 (const int)
0:53 move second child to first child (float)
0:53 'x' (float)
0:53 Constant:
0:53 2.000000
0:53 move second child to first child (float)
0:53 'y' (float)
0:53 'x' (float)
0:57 Sequence
0:57 Sequence
0:57 move second child to first child (int)
0:57 'x' (int)
0:57 'x' (int)
0:65 Sequence
0:65 Sequence
0:65 move second child to first child (structure{x})
0:65 'S' (structure{x})
0:65 Constant:
0:65 0 (const int)
0:66 x: direct index for structure (int)
0:66 'S' (structure{x})
0:66 Constant:
0:66 0 (const int)
0:? Linker Objects
0:? 'b' (bool)
0:? 'tan' (float)

View File

@@ -3,8 +3,7 @@ ERROR: 0:6: '=' : cannot convert from 'const uint' to 'int'
ERROR: 0:20: '' : numeric literal too big
ERROR: 0:21: '' : hexidecimal literal too big
ERROR: 0:37: 'view' : redefinition
ERROR: 0:63: 'invariant' : can only apply to an output
Color
ERROR: 0:63: 'invariant' : can only apply to an output: Color
ERROR: 0:68: 'lightPosition' : redefinition
ERROR: 0:75: 'Atten' : member storage qualifier cannot contradict block storage qualifier
ERROR: 0:87: 'Color' : redefinition