float b(int a); // ERROR: redefinition\r
\r
float f; // ERROR: redefinition\r
-float tan; // ERROR: redefines built-in function\r
-float sin(float x); // ERROR: can't overload built-in functions\r
-float cos(float x) // ERROR: can't overload built-in functions\r
+float tan; // okay, built-in is in an outer scope\r
+float sin(float x); // ERROR: can't redefine built-in functions\r
+float cos(float x) // ERROR: can't redefine built-in functions\r
{\r
return 1.0;\r
}\r
+bool radians(bool x) // okay, can overload built-in functions\r
+{\r
+ return true;\r
+}\r
\r
invariant gl_Position;\r
\r
\r
layout(stream = 6) out ooutb { vec4 a; } ouuaa6;\r
\r
-layout(stream = 6) out ooutb {\r
+layout(stream = 6) out ooutb2 {\r
layout(stream = 6) vec4 a;\r
} ouua6;\r
\r
-layout(stream = 7) out ooutb {\r
+layout(stream = 7) out ooutb3 {\r
layout(stream = 6) vec4 a; // ERROR\r
} ouua7;\r
\r
layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable\r
layout(triangle_strip) in vec4 bad2v4; // ERROR, not on a variable or input\r
layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block\r
-out outbn {\r
+out outbn2 {\r
layout(invocations = 3) int a; // ERROR, not on a block member\r
layout(max_vertices = 3) int b; // ERROR, not on a block member\r
layout(triangle_strip) int c; // ERROR, not on a block member\r
in inbn {\r
layout(stream = 2) int a; // ERROR, stream on input\r
} inbi;\r
+\r
+in sameName {\r
+ int a15;\r
+};\r
+\r
+out sameName {\r
+ float f15;\r
+};\r
+\r
+uniform sameName {\r
+ bool b15;\r
+};\r
invariant s2;
invariant out S s3;
flat out int;
+
+uniform ub2 {
+ float f;
+} a;
+
+uniform ub2 { // ERROR redeclaration of block name (same instance name)
+ float g;
+} a;
+
+uniform ub2 { // ERROR redeclaration of block name (different instance name)
+ float f;
+} c;
+
+uniform ub2 { // ERROR redeclaration of block name (no instance name)
+ float f123;
+};
+
+uniform ub3 {
+ bool b23;
+};
+
+uniform ub3 { // ERROR redeclaration of block name (no instance name in first or declared)
+ bool b234;
+};
float f; // ERROR: redefinition
float tan; // ERROR: redefines built-in function
-float sin(float x); // ERROR: can't overload built-in functions
-float cos(float x) // ERROR: can't overload built-in functions
+float sin(float x); // ERROR: can't redefine built-in functions
+float cos(float x) // ERROR: can't redefine built-in functions
{
return 1.0;
}
+bool radians(bool x) // ERROR: can't overload built-in functions
+{
+ return true;
+}
invariant gl_Position;
float f; // ERROR: redefinition
float tan; // okay, hides built-in function
-float sin(float x); // okay, can overload built-in functions
-float cos(float x) // okay, can overload built-in functions
+float sin(float x); // okay, can redefine built-in functions
+float cos(float x) // okay, can redefine built-in functions
{
return 1.0;
}
+bool radians(bool x) // okay, can overload built-in functions
+{
+ return true;
+}
invariant gl_Position;
ERROR: 0:5: 'a' : redefinition \r
-ERROR: 0:17: 'b' : illegal redeclaration \r
+ERROR: 0:17: 'b' : redeclaration of existing name \r
ERROR: 0:19: 'f' : redefinition \r
-ERROR: 0:20: 'tan' : redefinition \r
-ERROR: 0:31: 'local function declaration' : not supported with this profile: es\r
-ERROR: 0:50: 'z' : undeclared identifier \r
-ERROR: 0:50: 'z' : redefinition \r
-ERROR: 7 compilation errors. No code generated.\r
+ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es\r
+ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es\r
+ERROR: 0:35: 'local function declaration' : not supported with this profile: es\r
+ERROR: 0:54: 'z' : undeclared identifier \r
+ERROR: 0:54: 'z' : redefinition \r
+ERROR: 8 compilation errors. No code generated.\r
\r
ERROR: node is still EOpNull!\r
0:3 Function Definition: f(i1;i1;i1; (highp int)\r
0:24 Branch: Return with expression\r
0:24 Constant:\r
0:24 1.000000\r
-0:29 Function Definition: main( (void)\r
-0:29 Function Parameters: \r
+0:26 Function Definition: radians(b1; (bool)\r
+0:26 Function Parameters: \r
+0:26 'x' (in bool)\r
+0:28 Sequence\r
+0:28 Branch: Return with expression\r
+0:28 Constant:\r
+0:28 true (const bool)\r
+0:33 Function Definition: main( (void)\r
+0:33 Function Parameters: \r
0:? Sequence\r
-0:32 Function Call: g( (highp int)\r
-0:35 'sin' (highp float)\r
-0:37 Function Call: f(i1;i1;i1; (highp int)\r
-0:37 Constant:\r
-0:37 1 (const int)\r
-0:37 Constant:\r
-0:37 2 (const int)\r
-0:37 Constant:\r
-0:37 3 (const int)\r
-0:40 move second child to first child (highp float)\r
-0:40 'f' (highp float)\r
-0:40 Constant:\r
-0:40 3.000000\r
-0:42 move second child to first child (highp 4-component vector of float)\r
-0:42 'gl_Position' (invariant gl_Position highp 4-component vector of float)\r
-0:42 Construct vec4 (highp 4-component vector of float)\r
-0:42 'f' (highp float)\r
-0:44 Sequence\r
-0:44 Sequence\r
-0:44 move second child to first child (highp int)\r
-0:44 'f' (highp int)\r
-0:44 Constant:\r
-0:44 0 (const int)\r
-0:44 Loop with condition tested first\r
-0:44 Loop Condition\r
-0:44 Compare Less Than (bool)\r
-0:44 'f' (highp int)\r
-0:44 Constant:\r
-0:44 10 (const int)\r
-0:44 Loop Body\r
-0:45 Pre-Increment (highp int)\r
-0:45 'f' (highp int)\r
-0:44 Loop Terminal Expression\r
-0:44 Pre-Increment (highp int)\r
-0:44 'f' (highp int)\r
-0:47 Sequence\r
-0:47 move second child to first child (highp int)\r
-0:47 'x' (highp int)\r
-0:47 Constant:\r
-0:47 1 (const int)\r
-0:49 Sequence\r
-0:49 Sequence\r
-0:49 move second child to first child (highp float)\r
-0:49 'x' (highp float)\r
-0:49 Constant:\r
-0:49 2.000000\r
-0:49 move second child to first child (highp float)\r
-0:49 'y' (highp float)\r
-0:49 'x' (highp float)\r
+0:36 Function Call: g( (highp int)\r
+0:39 'sin' (highp float)\r
+0:41 Function Call: f(i1;i1;i1; (highp int)\r
+0:41 Constant:\r
+0:41 1 (const int)\r
+0:41 Constant:\r
+0:41 2 (const int)\r
+0:41 Constant:\r
+0:41 3 (const int)\r
+0:44 move second child to first child (highp float)\r
+0:44 'f' (highp float)\r
+0:44 Constant:\r
+0:44 3.000000\r
+0:46 move second child to first child (highp 4-component vector of float)\r
+0:46 'gl_Position' (invariant gl_Position highp 4-component vector of float)\r
+0:46 Construct vec4 (highp 4-component vector of float)\r
+0:46 'f' (highp float)\r
+0:48 Sequence\r
+0:48 Sequence\r
+0:48 move second child to first child (highp int)\r
+0:48 'f' (highp int)\r
+0:48 Constant:\r
+0:48 0 (const int)\r
+0:48 Loop with condition tested first\r
+0:48 Loop Condition\r
+0:48 Compare Less Than (bool)\r
+0:48 'f' (highp int)\r
+0:48 Constant:\r
+0:48 10 (const int)\r
+0:48 Loop Body\r
+0:49 Pre-Increment (highp int)\r
+0:49 'f' (highp int)\r
+0:48 Loop Terminal Expression\r
+0:48 Pre-Increment (highp int)\r
+0:48 'f' (highp int)\r
+0:51 Sequence\r
+0:51 move second child to first child (highp int)\r
+0:51 'x' (highp int)\r
+0:51 Constant:\r
+0:51 1 (const int)\r
0:53 Sequence\r
0:53 Sequence\r
-0:53 move second child to first child (highp int)\r
-0:53 'x' (highp int)\r
-0:53 'x' (highp int)\r
-0:61 Sequence\r
-0:61 Sequence\r
-0:61 move second child to first child (structure{x})\r
-0:61 'S' (structure{x})\r
-0:61 Constant:\r
-0:61 0 (const int)\r
-0:62 x: direct index for structure (highp int)\r
-0:62 'S' (structure{x})\r
-0:62 Constant:\r
-0:62 0 (const int)\r
+0:53 move second child to first child (highp float)\r
+0:53 'x' (highp float)\r
+0:53 Constant:\r
+0:53 2.000000\r
+0:53 move second child to first child (highp float)\r
+0:53 'y' (highp float)\r
+0:53 'x' (highp float)\r
+0:57 Sequence\r
+0:57 Sequence\r
+0:57 move second child to first child (highp int)\r
+0:57 'x' (highp int)\r
+0:57 'x' (highp int)\r
+0:65 Sequence\r
+0:65 Sequence\r
+0:65 move second child to first child (structure{x})\r
+0:65 'S' (structure{x})\r
+0:65 Constant:\r
+0:65 0 (const int)\r
+0:66 x: direct index for structure (highp int)\r
+0:66 'S' (structure{x})\r
+0:66 Constant:\r
+0:66 0 (const int)\r
0:? Linker Objects\r
0:? 'b' (bool)\r
+0:? 'tan' (highp float)\r
\r
0:? '__anon__1' (layout(stream=3 ) out block{a})\r
0:? 'outbi' (layout(stream=3 ) out block{a,b,c})\r
0:? 'inbi' (in block{a})\r
+0:? '__anon__2' (in block{a15})\r
+0:? '__anon__3' (layout(stream=3 ) out block{f15})\r
+0:? '__anon__4' (layout(column_major shared ) uniform block{b15})\r
\r
ERROR: 0:65: '' : array size required \r
ERROR: 0:64: '' : array size required \r
ERROR: 0:67: '' : array size required \r
-ERROR: 0:78: 'invariant' : can only apply to an output\r
- invIn\r
-ERROR: 21 compilation errors. No code generated.\r
+ERROR: 0:78: 'invariant' : can only apply to an output: invIn\r
+ERROR: 0:88: 'ub2' : Cannot reuse block name within the same interface: uniform\r
+ERROR: 0:92: 'ub2' : Cannot reuse block name within the same interface: uniform\r
+ERROR: 0:96: 'ub2' : Cannot reuse block name within the same interface: uniform\r
+ERROR: 0:104: 'ub3' : Cannot reuse block name within the same interface: uniform\r
+ERROR: 25 compilation errors. No code generated.\r
\r
ERROR: node is still EOpNull!\r
0:27 Function Definition: main( (void)\r
0:? 'invIn' (in highp 4-component vector of float)\r
0:? 's2' (smooth out structure{c,f})\r
0:? 's3' (invariant smooth out structure{c,f})\r
+0:? 'a' (layout(column_major shared ) uniform block{f})\r
+0:? '__anon__0' (layout(column_major shared ) uniform block{b23})\r
0:? 'gl_VertexID' (gl_VertexId highp int)\r
0:? 'gl_InstanceID' (gl_InstanceId highp int)\r
\r
ERROR: 0:5: 'a' : redefinition \r
-ERROR: 0:17: 'b' : illegal redeclaration \r
+ERROR: 0:17: 'b' : redeclaration of existing name \r
ERROR: 0:19: 'f' : redefinition \r
ERROR: 0:20: 'tan' : redefinition \r
-ERROR: 0:21: 'redeclaration of built-in function' : no longer supported in es profile; removed in version 300\r
-ERROR: 0:22: 'redeclaration of built-in function' : no longer supported in es profile; removed in version 300\r
-ERROR: 0:31: 'local function declaration' : not supported with this profile: es\r
-ERROR: 0:50: 'z' : undeclared identifier \r
-ERROR: 0:50: 'z' : redefinition \r
-ERROR: 9 compilation errors. No code generated.\r
+ERROR: 0:21: 'redefinition of built-in function' : not supported with this profile: es\r
+ERROR: 0:21: 'sin' : redeclaration of existing name \r
+ERROR: 0:22: 'redefinition of built-in function' : not supported with this profile: es\r
+ERROR: 0:22: 'cos' : redeclaration of existing name \r
+ERROR: 0:26: 'radians' : redeclaration of existing name \r
+ERROR: 0:26: 'radians' : can't find function \r
+ERROR: 0:28: 'return' : void function cannot return a value \r
+ERROR: 0:35: 'local function declaration' : not supported with this profile: es\r
+ERROR: 0:54: 'z' : undeclared identifier \r
+ERROR: 0:54: 'z' : redefinition \r
+ERROR: 14 compilation errors. No code generated.\r
\r
ERROR: node is still EOpNull!\r
0:3 Function Definition: f(i1;i1;i1; (highp int)\r
0:24 Branch: Return with expression\r
0:24 Constant:\r
0:24 1.000000\r
-0:29 Function Definition: main( (void)\r
-0:29 Function Parameters: \r
+0:26 Function Definition: radians(b1; (bool)\r
+0:26 Function Parameters: \r
+0:26 'x' (in bool)\r
+0:28 Sequence\r
+0:28 Branch: Return with expression\r
+0:28 Constant:\r
+0:28 true (const bool)\r
+0:33 Function Definition: main( (void)\r
+0:33 Function Parameters: \r
0:? Sequence\r
-0:32 Function Call: g( (highp int)\r
-0:35 'sin' (highp float)\r
-0:37 Function Call: f(i1;i1;i1; (highp int)\r
-0:37 Constant:\r
-0:37 1 (const int)\r
-0:37 Constant:\r
-0:37 2 (const int)\r
-0:37 Constant:\r
-0:37 3 (const int)\r
-0:40 move second child to first child (highp float)\r
-0:40 'f' (highp float)\r
-0:40 Constant:\r
-0:40 3.000000\r
-0:42 move second child to first child (highp 4-component vector of float)\r
-0:42 'gl_Position' (invariant gl_Position highp 4-component vector of float)\r
-0:42 Construct vec4 (highp 4-component vector of float)\r
-0:42 'f' (highp float)\r
-0:44 Sequence\r
-0:44 Sequence\r
-0:44 move second child to first child (highp int)\r
-0:44 'f' (highp int)\r
-0:44 Constant:\r
-0:44 0 (const int)\r
-0:44 Loop with condition tested first\r
-0:44 Loop Condition\r
-0:44 Compare Less Than (bool)\r
-0:44 'f' (highp int)\r
-0:44 Constant:\r
-0:44 10 (const int)\r
-0:44 Loop Body\r
-0:45 Pre-Increment (highp int)\r
-0:45 'f' (highp int)\r
-0:44 Loop Terminal Expression\r
-0:44 Pre-Increment (highp int)\r
-0:44 'f' (highp int)\r
-0:47 Sequence\r
-0:47 move second child to first child (highp int)\r
-0:47 'x' (highp int)\r
-0:47 Constant:\r
-0:47 1 (const int)\r
-0:49 Sequence\r
-0:49 Sequence\r
-0:49 move second child to first child (highp float)\r
-0:49 'x' (highp float)\r
-0:49 Constant:\r
-0:49 2.000000\r
-0:49 move second child to first child (highp float)\r
-0:49 'y' (highp float)\r
-0:49 'x' (highp float)\r
+0:36 Function Call: g( (highp int)\r
+0:39 'sin' (highp float)\r
+0:41 Function Call: f(i1;i1;i1; (highp int)\r
+0:41 Constant:\r
+0:41 1 (const int)\r
+0:41 Constant:\r
+0:41 2 (const int)\r
+0:41 Constant:\r
+0:41 3 (const int)\r
+0:44 move second child to first child (highp float)\r
+0:44 'f' (highp float)\r
+0:44 Constant:\r
+0:44 3.000000\r
+0:46 move second child to first child (highp 4-component vector of float)\r
+0:46 'gl_Position' (invariant gl_Position highp 4-component vector of float)\r
+0:46 Construct vec4 (highp 4-component vector of float)\r
+0:46 'f' (highp float)\r
+0:48 Sequence\r
+0:48 Sequence\r
+0:48 move second child to first child (highp int)\r
+0:48 'f' (highp int)\r
+0:48 Constant:\r
+0:48 0 (const int)\r
+0:48 Loop with condition tested first\r
+0:48 Loop Condition\r
+0:48 Compare Less Than (bool)\r
+0:48 'f' (highp int)\r
+0:48 Constant:\r
+0:48 10 (const int)\r
+0:48 Loop Body\r
+0:49 Pre-Increment (highp int)\r
+0:49 'f' (highp int)\r
+0:48 Loop Terminal Expression\r
+0:48 Pre-Increment (highp int)\r
+0:48 'f' (highp int)\r
+0:51 Sequence\r
+0:51 move second child to first child (highp int)\r
+0:51 'x' (highp int)\r
+0:51 Constant:\r
+0:51 1 (const int)\r
0:53 Sequence\r
0:53 Sequence\r
-0:53 move second child to first child (highp int)\r
-0:53 'x' (highp int)\r
-0:53 'x' (highp int)\r
-0:61 Sequence\r
-0:61 Sequence\r
-0:61 move second child to first child (structure{x})\r
-0:61 'S' (structure{x})\r
-0:61 Constant:\r
-0:61 0 (const int)\r
-0:62 x: direct index for structure (highp int)\r
-0:62 'S' (structure{x})\r
-0:62 Constant:\r
-0:62 0 (const int)\r
+0:53 move second child to first child (highp float)\r
+0:53 'x' (highp float)\r
+0:53 Constant:\r
+0:53 2.000000\r
+0:53 move second child to first child (highp float)\r
+0:53 'y' (highp float)\r
+0:53 'x' (highp float)\r
+0:57 Sequence\r
+0:57 Sequence\r
+0:57 move second child to first child (highp int)\r
+0:57 'x' (highp int)\r
+0:57 'x' (highp int)\r
+0:65 Sequence\r
+0:65 Sequence\r
+0:65 move second child to first child (structure{x})\r
+0:65 'S' (structure{x})\r
+0:65 Constant:\r
+0:65 0 (const int)\r
+0:66 x: direct index for structure (highp int)\r
+0:66 'S' (structure{x})\r
+0:66 Constant:\r
+0:66 0 (const int)\r
0:? Linker Objects\r
0:? 'b' (bool)\r
0:? 'gl_VertexID' (gl_VertexId highp int)\r
Warning, version 430 is not yet complete; some version-specific features are present, but many are missing.\r
ERROR: 0:5: 'a' : redefinition \r
-ERROR: 0:17: 'b' : illegal redeclaration \r
+ERROR: 0:17: 'b' : redeclaration of existing name \r
ERROR: 0:19: 'f' : redefinition \r
-ERROR: 0:50: 'z' : undeclared identifier \r
-ERROR: 0:50: 'z' : redefinition \r
+ERROR: 0:54: 'z' : undeclared identifier \r
+ERROR: 0:54: 'z' : redefinition \r
ERROR: 5 compilation errors. No code generated.\r
\r
ERROR: node is still EOpNull!\r
0:24 Branch: Return with expression\r
0:24 Constant:\r
0:24 1.000000\r
-0:29 Function Definition: main( (void)\r
-0:29 Function Parameters: \r
+0:26 Function Definition: radians(b1; (bool)\r
+0:26 Function Parameters: \r
+0:26 'x' (in bool)\r
+0:28 Sequence\r
+0:28 Branch: Return with expression\r
+0:28 Constant:\r
+0:28 true (const bool)\r
+0:33 Function Definition: main( (void)\r
+0:33 Function Parameters: \r
0:? Sequence\r
-0:32 Function Call: g( (int)\r
-0:35 'sin' (float)\r
-0:37 Function Call: f(i1;i1;i1; (int)\r
-0:37 Constant:\r
-0:37 1 (const int)\r
-0:37 Constant:\r
-0:37 2 (const int)\r
-0:37 Constant:\r
-0:37 3 (const int)\r
-0:40 move second child to first child (float)\r
-0:40 'f' (float)\r
-0:40 Constant:\r
-0:40 3.000000\r
-0:42 move second child to first child (4-component vector of float)\r
-0:42 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)\r
-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})\r
-0:42 Constant:\r
-0:42 0 (const uint)\r
-0:42 Construct vec4 (4-component vector of float)\r
-0:42 'f' (float)\r
-0:44 Sequence\r
-0:44 Sequence\r
-0:44 move second child to first child (int)\r
-0:44 'f' (int)\r
-0:44 Constant:\r
-0:44 0 (const int)\r
-0:44 Loop with condition tested first\r
-0:44 Loop Condition\r
-0:44 Compare Less Than (bool)\r
-0:44 'f' (int)\r
-0:44 Constant:\r
-0:44 10 (const int)\r
-0:44 Loop Body\r
-0:45 Pre-Increment (int)\r
-0:45 'f' (int)\r
-0:44 Loop Terminal Expression\r
-0:44 Pre-Increment (int)\r
-0:44 'f' (int)\r
-0:47 Sequence\r
-0:47 move second child to first child (int)\r
-0:47 'x' (int)\r
-0:47 Constant:\r
-0:47 1 (const int)\r
-0:49 Sequence\r
-0:49 Sequence\r
-0:49 move second child to first child (float)\r
-0:49 'x' (float)\r
-0:49 Constant:\r
-0:49 2.000000\r
-0:49 move second child to first child (float)\r
-0:49 'y' (float)\r
-0:49 'x' (float)\r
+0:36 Function Call: g( (int)\r
+0:39 'sin' (float)\r
+0:41 Function Call: f(i1;i1;i1; (int)\r
+0:41 Constant:\r
+0:41 1 (const int)\r
+0:41 Constant:\r
+0:41 2 (const int)\r
+0:41 Constant:\r
+0:41 3 (const int)\r
+0:44 move second child to first child (float)\r
+0:44 'f' (float)\r
+0:44 Constant:\r
+0:44 3.000000\r
+0:46 move second child to first child (4-component vector of float)\r
+0:46 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)\r
+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})\r
+0:46 Constant:\r
+0:46 0 (const uint)\r
+0:46 Construct vec4 (4-component vector of float)\r
+0:46 'f' (float)\r
+0:48 Sequence\r
+0:48 Sequence\r
+0:48 move second child to first child (int)\r
+0:48 'f' (int)\r
+0:48 Constant:\r
+0:48 0 (const int)\r
+0:48 Loop with condition tested first\r
+0:48 Loop Condition\r
+0:48 Compare Less Than (bool)\r
+0:48 'f' (int)\r
+0:48 Constant:\r
+0:48 10 (const int)\r
+0:48 Loop Body\r
+0:49 Pre-Increment (int)\r
+0:49 'f' (int)\r
+0:48 Loop Terminal Expression\r
+0:48 Pre-Increment (int)\r
+0:48 'f' (int)\r
+0:51 Sequence\r
+0:51 move second child to first child (int)\r
+0:51 'x' (int)\r
+0:51 Constant:\r
+0:51 1 (const int)\r
0:53 Sequence\r
0:53 Sequence\r
-0:53 move second child to first child (int)\r
-0:53 'x' (int)\r
-0:53 'x' (int)\r
-0:61 Sequence\r
-0:61 Sequence\r
-0:61 move second child to first child (structure{x})\r
-0:61 'S' (structure{x})\r
-0:61 Constant:\r
-0:61 0 (const int)\r
-0:62 x: direct index for structure (int)\r
-0:62 'S' (structure{x})\r
-0:62 Constant:\r
-0:62 0 (const int)\r
+0:53 move second child to first child (float)\r
+0:53 'x' (float)\r
+0:53 Constant:\r
+0:53 2.000000\r
+0:53 move second child to first child (float)\r
+0:53 'y' (float)\r
+0:53 'x' (float)\r
+0:57 Sequence\r
+0:57 Sequence\r
+0:57 move second child to first child (int)\r
+0:57 'x' (int)\r
+0:57 'x' (int)\r
+0:65 Sequence\r
+0:65 Sequence\r
+0:65 move second child to first child (structure{x})\r
+0:65 'S' (structure{x})\r
+0:65 Constant:\r
+0:65 0 (const int)\r
+0:66 x: direct index for structure (int)\r
+0:66 'S' (structure{x})\r
+0:66 Constant:\r
+0:66 0 (const int)\r
0:? Linker Objects\r
0:? 'b' (bool)\r
0:? 'tan' (float)\r
ERROR: 0:20: '' : numeric literal too big \r
ERROR: 0:21: '' : hexidecimal literal too big \r
ERROR: 0:37: 'view' : redefinition \r
-ERROR: 0:63: 'invariant' : can only apply to an output\r
- Color\r
+ERROR: 0:63: 'invariant' : can only apply to an output: Color\r
ERROR: 0:68: 'lightPosition' : redefinition \r
ERROR: 0:75: 'Atten' : member storage qualifier cannot contradict block storage qualifier \r
ERROR: 0:87: 'Color' : redefinition \r
//
// Redeclarations (full prototype match) are allowed. But, return types and parameter qualifiers must match.
//
- // ES does not allow redeclaring or hiding of built-in functions.
+ // ES 100 does not allow redefining, but does allow overloading of built-in functions.
+ // ES 300 does not allow redefining or overloading of built-in functions.
//
bool builtIn;
TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn);
if (symbol && symbol->getAsFunction() && builtIn)
- requireNotRemoved(loc, EEsProfile, 300, "redeclaration of built-in function");
+ requireProfile(loc, ~EEsProfile, "redefinition of built-in function");
const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
if (prevDec) {
if (prevDec->getType() != function.getType()) {
if (! symbolTable.insert(function))
- error(loc, "illegal redeclaration", function.getName().c_str(), "");
+ error(loc, "redeclaration of existing name", function.getName().c_str(), "");
//
// If this is a redeclaration, it could also be a definition,
TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
if (! prevDec)
- error(loc, "can't find function name", function.getName().c_str(), "");
+ error(loc, "can't find function", function.getName().c_str(), "");
//
// Note: 'prevDec' could be 'function' if this is the first time we've seen function
// whose type is EbtBlock, but without all the structure; that will come from the type
// the instances point to.
//
- TType blockNameType(EbtBlock);
+ TType blockNameType(EbtBlock, blockType.getQualifier().storage);
TVariable* blockNameVar = new TVariable(blockName, blockNameType);
if (! symbolTable.insert(*blockNameVar)) {
TSymbol* existingName = symbolTable.find(*blockName);
- if (existingName->getType().getBasicType() != EbtBlock) {
+ if (existingName->getType().getBasicType() == EbtBlock) {
+ if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) {
+ error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString());
+ return;
+ }
+ } else {
error(loc, "block name cannot redefine a non-block name", blockName->c_str(), "");
-
return;
}
}
bool pipeIn = type.getQualifier().isPipeInput();
if (version >= 300 || profile != EEsProfile && version >= 420) {
if (! pipeOut)
- error(loc, "can only apply to an output\n", "invariant", identifier.c_str());
+ error(loc, "can only apply to an output:", "invariant", identifier.c_str());
} else {
if ((language == EShLangVertex && pipeIn) || (! pipeOut && ! pipeIn))
error(loc, "can only apply to an output or an input in a non-vertex stage\n", "invariant", "");
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
InitializeSymbolTable(builtIns.getStageString(language), version, profile, language, infoSink, *symbolTables[language]);
IdentifyBuiltIns(version, profile, language, *symbolTables[language]);
- if (profile == EEsProfile)
+ if (profile == EEsProfile && version >= 300)
(*symbolTables[language]).setNoBuiltInRedeclarations();
}
return isOkay;
} else {
// Check for redefinition errors:
- // - STL itself will tell us if there is a direct name collision at this level
- // - additionally, check for function/variable name collisions
- // - for ES, for overriding or hiding built-in function
+ // - STL itself will tell us if there is a direct name collision, with name mangling, at this level
+ // - additionally, check for function-redefining-variable name collisions
const TString& insertName = symbol.getMangledName();
if (symbol.getAsFunction()) {
// make sure there isn't a variable of this name
{
symbol.setUniqueId(++uniqueId);
- if (! symbol.getAsFunction()) {
- // make sure there isn't a function of this name
- if (table[currentLevel()]->hasFunctionName(symbol.getName()))
- return false;
- if (atGlobalLevel() && currentLevel() > 0 && noBuiltInRedeclarations) {
+ // make sure there isn't a function of this variable name
+ if (! symbol.getAsFunction() && table[currentLevel()]->hasFunctionName(symbol.getName()))
+ return false;
+
+ // check for not overloading or redefining a built-in function
+ if (noBuiltInRedeclarations) {
+ if (atGlobalLevel() && currentLevel() > 0) {
if (table[0]->hasFunctionName(symbol.getName()))
return false;
if (currentLevel() > 1 && table[1]->hasFunctionName(symbol.getName()))