Add all built-in variables for all versions/profiles/stages of GLSL. Also, made more readable; declarations are cut and paste from the specs, with quotes around them. This does not include built-in constants yet (other than MaxClipDistances), just the non-constants.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@23551 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-10-16 22:28:35 +00:00
parent 457145ded5
commit e7c59c187c
25 changed files with 1564 additions and 1024 deletions

View File

@ -126,7 +126,8 @@ const char* DefaultConfig =
"MaxVertexOutputVectors 16\n"
"MaxFragmentInputVectors 15\n"
"MinProgramTexelOffset -8\n"
"MaxProgramTexelOffset 7\n"
"MaxProgramTexelOffset 7\n"
"MaxClipDistances 8\n"
"nonInductiveForLoops 1\n"
"whileLoops 1\n"
"doWhileLoops 1\n"
@ -208,6 +209,8 @@ void ProcessConfigFile()
Resources.minProgramTexelOffset = value;
else if (strcmp(token, "MaxProgramTexelOffset") == 0)
Resources.maxProgramTexelOffset = value;
else if (strcmp(token, "MaxClipDistances") == 0)
Resources.maxClipDistances = value;
else if (strcmp(token, "nonInductiveForLoops") == 0)
Resources.limits.nonInductiveForLoops = (value != 0);
else if (strcmp(token, "whileLoops") == 0)

View File

@ -17,6 +17,9 @@ void main()
centTexCoord = attv2;
gl_Position = attv4;
gl_ClipVertex = attv4;
gl_ClipDistance[1] = 0.2; // ERROR
vec3[12] a;
vec4[a.length()] b;
gl_Position = b[b.length()-1];

View File

@ -15,4 +15,5 @@ noperspective in float fnop;
void main()
{
float clip = gl_ClipDistance[3];
}

View File

@ -5,8 +5,11 @@ varying vec4 v;
in vec4 i;
out vec4 o;
in float gl_ClipDistance[5];
void main()
{
float clip = gl_ClipDistance[2];
}
#ifdef GL_ES
#error GL_ES is set

View File

@ -1,9 +1,38 @@
#version 150 core
in fromVertex {
vec3 color;
} fromV;
out toFragment {
vec3 color;
} toF;
out fromVertex { // okay to reuse a block name for another block name
vec3 color;
};
out fooB {
vec2 color;
} fromVertex; // ERROR, cannot reuse block name as block instance
int fromVertex; // ERROR, cannot reuse a block name for something else
out fooC {
vec2 color;
} fooC; // ERROR, cannot have same name for block and instance name
void main()
{
EmitVertex();
EndPrimitive();
EmitStreamVertex(1); // ERROR
EndStreamPrimitive(0); // ERROR
color = fromV.color;
gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
gl_Position = gl_in[0].gl_Position;
gl_PointSize = gl_in[3].gl_PointSize;
gl_PrimitiveID = gl_PrimitiveIDIn;
gl_Layer = 2;
}

View File

@ -2,11 +2,12 @@
in vec2 c2D;
flat in int i;
out vec4 outp;
uniform sampler2D arrayedSampler[5];
void main()
{
vec4 v;
v = texture(arrayedSampler[i], c2D);
outp.x = gl_ClipDistance[1];
}

View File

@ -6,4 +6,6 @@ void main()
EndStreamPrimitive(0);
EmitVertex();
EndPrimitive();
int id = gl_InvocationID;
}

View File

@ -5,30 +5,33 @@ ERROR: 0:11: 'gl_Position' : cannot add storage, auxiliary, memory, interpolatio
ERROR: 0:12: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:12: '' : replicated qualifiers
ERROR: 0:12: 'foo' : identifier not previously declared
ERROR: 0:25: 'length' : array must be declared with a size before using this method
ERROR: 0:28: 'length' : incomplete method syntax
ERROR: 0:29: 'length' : method does not accept any arguments
ERROR: 0:30: 'flizbit' : only the length method is supported for array
ERROR: 0:30: '=' : cannot convert from '7-element array of float' to 'int'
ERROR: 0:31: 'flizbit' : only the length method is supported for array
ERROR: 0:31: 'f' : no matching overloaded function found
ERROR: 0:31: 'a4' : redefinition
ERROR: 0:32: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:33: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:34: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:21: 'gl_ClipDistance' : undeclared identifier
ERROR: 0:21: 'gl_ClipDistance' : left of '[' is not of type array, matrix, or vector
ERROR: 0:21: 'assign' : l-value required (can't modify a const)
ERROR: 0:28: 'length' : array must be declared with a size before using this method
ERROR: 0:31: 'length' : incomplete method syntax
ERROR: 0:32: 'length' : method does not accept any arguments
ERROR: 0:33: 'flizbit' : only the length method is supported for array
ERROR: 0:33: '=' : cannot convert from '7-element array of float' to 'int'
ERROR: 0:34: 'flizbit' : only the length method is supported for array
ERROR: 0:34: 'f' : no matching overloaded function found
ERROR: 0:34: 'a4' : redefinition
ERROR: 0:35: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:36: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:37: 'constructor' : array constructor needs one argument per array element
ERROR: 0:37: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:38: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:38: 'constructor' : array constructor needs one argument per array element
ERROR: 0:38: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:47: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:48: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:49: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:39: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:40: 'constructor' : array constructor needs one argument per array element
ERROR: 0:40: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:41: 'constructor' : array constructor needs one argument per array element
ERROR: 0:41: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:50: 'arrays of arrays' : not supported with this profile: none
ERROR: 29 compilation errors. No code generated.
ERROR: 0:51: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:52: 'arrays of arrays' : not supported with this profile: none
ERROR: 0:53: 'arrays of arrays' : not supported with this profile: none
ERROR: 32 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:15 Function Definition: main( (void)
@ -40,42 +43,50 @@ ERROR: node is still EOpNull!
0:18 move second child to first child (4-component vector of float)
0:18 'gl_Position' (invariant gl_Position 4-component vector of float)
0:18 'attv4' (in 4-component vector of float)
0:22 move second child to first child (4-component vector of float)
0:22 'gl_Position' (invariant gl_Position 4-component vector of float)
0:22 direct index (4-component vector of float)
0:22 'b' (12-element array of 4-component vector of float)
0:22 Constant:
0:22 11 (const int)
0:25 Sequence
0:25 move second child to first child (int)
0:25 'a1' (int)
0:20 move second child to first child (4-component vector of float)
0:20 'gl_ClipVertex' (gl_ClipVertex 4-component vector of float)
0:20 'attv4' (in 4-component vector of float)
0:21 move second child to first child (float)
0:21 Constant:
0:21 0.000000
0:21 Constant:
0:21 0.200000
0:25 move second child to first child (4-component vector of float)
0:25 'gl_Position' (invariant gl_Position 4-component vector of float)
0:25 direct index (4-component vector of float)
0:25 'b' (12-element array of 4-component vector of float)
0:25 Constant:
0:25 1 (const int)
0:27 Sequence
0:27 move second child to first child (int)
0:27 'aa' (int)
0:27 Constant:
0:27 7 (const int)
0:25 11 (const int)
0:28 Sequence
0:28 move second child to first child (int)
0:28 'a2' (int)
0:29 Sequence
0:29 move second child to first child (int)
0:29 'a3' (int)
0:29 Constant:
0:29 12 (const int)
0:37 Sequence
0:37 move second child to first child (2-element array of float)
0:37 'md9' (2-element array of float)
0:37 Construct float (const 2-element array of float)
0:38 Sequence
0:38 move second child to first child (2-element array of float)
0:38 'md11' (2-element array of float)
0:38 Construct float (const 2-element array of float)
0:40 move second child to first child (float)
0:40 'gl_PointSize' (invariant gl_PointSize float)
0:40 Constant:
0:40 3.800000
0:28 'a1' (int)
0:28 Constant:
0:28 1 (const int)
0:30 Sequence
0:30 move second child to first child (int)
0:30 'aa' (int)
0:30 Constant:
0:30 7 (const int)
0:31 Sequence
0:31 move second child to first child (int)
0:31 'a2' (int)
0:32 Sequence
0:32 move second child to first child (int)
0:32 'a3' (int)
0:32 Constant:
0:32 12 (const int)
0:40 Sequence
0:40 move second child to first child (2-element array of float)
0:40 'md9' (2-element array of float)
0:40 Construct float (const 2-element array of float)
0:41 Sequence
0:41 move second child to first child (2-element array of float)
0:41 'md11' (2-element array of float)
0:41 Construct float (const 2-element array of float)
0:43 move second child to first child (float)
0:43 'gl_PointSize' (invariant gl_PointSize float)
0:43 Constant:
0:43 3.800000
0:? Linker Objects
0:? 'i' (in 4-component vector of float)
0:? 'o' (smooth out 4-component vector of float)

View File

@ -2,6 +2,14 @@ Warning, version 130 is not yet complete; most features are present, but a few a
0:? Sequence
0:16 Function Definition: main( (void)
0:16 Function Parameters:
0:18 Sequence
0:18 Sequence
0:18 move second child to first child (float)
0:18 'clip' (float)
0:18 direct index (smooth in float)
0:18 'gl_ClipDistance' (smooth in unsized array of float)
0:18 Constant:
0:18 3 (const int)
0:? Linker Objects
0:? 'a' (3-component vector of float)
0:? 'b' (float)

View File

@ -1,13 +1,22 @@
Warning, version 140 is not yet complete; most features are present, but a few are missing.
WARNING: 0:3: varying deprecated in version 130; may be removed in future release
ERROR: 0:14: '#error' : GL_ES is not set
ERROR: 0:17: '#error' : GL_ES is not set
ERROR: 1 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:8 Function Definition: main( (void)
0:8 Function Parameters:
0:10 Function Definition: main( (void)
0:10 Function Parameters:
0:12 Sequence
0:12 Sequence
0:12 move second child to first child (float)
0:12 'clip' (float)
0:12 direct index (smooth in float)
0:12 'gl_ClipDistance' (smooth in 5-element array of float)
0:12 Constant:
0:12 2 (const int)
0:? Linker Objects
0:? 'v' (smooth in 4-component vector of float)
0:? 'i' (smooth in 4-component vector of float)
0:? 'o' (out 4-component vector of float)
0:? 'gl_ClipDistance' (smooth in 5-element array of float)

View File

@ -1,17 +1,81 @@
Warning, version 150 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:7: 'EmitStreamVertex' : no matching overloaded function found
ERROR: 0:8: 'EndStreamPrimitive' : no matching overloaded function found
ERROR: 2 compilation errors. No code generated.
ERROR: 0:15: 'fromVertex' : block instance name redefinition
ERROR: 0:19: 'fromVertex' : redefinition
ERROR: 0:21: 'fooC' : block instance name redefinition
ERROR: 0:29: 'EmitStreamVertex' : no matching overloaded function found
ERROR: 0:30: 'EndStreamPrimitive' : no matching overloaded function found
ERROR: 5 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 EmitVertex (void)
0:6 EndPrimitive (void)
0:7 Constant:
0:7 0.000000
0:8 Constant:
0:8 0.000000
0:25 Function Definition: main( (void)
0:25 Function Parameters:
0:27 Sequence
0:27 EmitVertex (void)
0:28 EndPrimitive (void)
0:29 Constant:
0:29 0.000000
0:30 Constant:
0:30 0.000000
0:32 move second child to first child (3-component vector of float)
0:32 color: direct index for structure (3-component vector of float)
0:32 '__anon__0' (out block)
0:32 Constant:
0:32 0 (const uint)
0:32 color: direct index for structure (3-component vector of float)
0:32 'fromV' (in block)
0:32 Constant:
0:32 0 (const int)
0:33 move second child to first child (float)
0:33 direct index (float)
0:33 gl_ClipDistance: direct index for structure (unsized array of float)
0:33 '__anon__1' (out block)
0:33 Constant:
0:33 2 (const uint)
0:33 Constant:
0:33 3 (const int)
0:33 direct index (float)
0:33 gl_ClipDistance: direct index for structure (unsized array of float)
0:33 direct index (in block)
0:33 'gl_in' (in unsized array of block)
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
0:33 2 (const int)
0:33 Constant:
0:33 2 (const int)
0:34 move second child to first child (4-component vector of float)
0:34 gl_Position: direct index for structure (4-component vector of float)
0:34 '__anon__1' (out block)
0:34 Constant:
0:34 0 (const uint)
0:34 gl_Position: direct index for structure (4-component vector of float)
0:34 direct index (in block)
0:34 'gl_in' (in unsized array of block)
0:34 Constant:
0:34 0 (const int)
0:34 Constant:
0:34 0 (const int)
0:35 move second child to first child (float)
0:35 gl_PointSize: direct index for structure (float)
0:35 '__anon__1' (out block)
0:35 Constant:
0:35 1 (const uint)
0:35 gl_PointSize: direct index for structure (float)
0:35 direct index (in block)
0:35 'gl_in' (in unsized array of block)
0:35 Constant:
0:35 3 (const int)
0:35 Constant:
0:35 1 (const int)
0:36 move second child to first child (int)
0:36 'gl_PrimitiveID' (out int)
0:36 'gl_PrimitiveIDIn' (in int)
0:37 move second child to first child (int)
0:37 'gl_Layer' (out int)
0:37 Constant:
0:37 2 (const int)
0:? Linker Objects
0:? 'fromV' (in block)
0:? 'toF' (out block)
0:? '__anon__0' (out block)

View File

@ -1,24 +1,31 @@
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: 1 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 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)
0:11 '__anon__0' (out block)
0:11 Constant:
0:11 0 (const uint)
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 gl_PointSize: direct index for structure (gl_PointSize float)
0:12 '__anon__0' (out block)
0:12 Constant:
0:12 1 (const uint)
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 gl_ClipDistance: direct index for structure (4-element array of float)
0:13 '__anon__0' (out block)
0:13 Constant:
0:13 2 (const uint)
0:13 Constant:
0:13 2 (const int)
0:13 direct index (float)
0:13 'iv4' (in 4-component vector of float)
0:13 Constant:
@ -26,8 +33,7 @@ ERROR: node is still EOpNull!
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:? '__anon__1' (layout(shared ) uniform block)
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)

View File

@ -13,8 +13,18 @@ ERROR: node is still EOpNull!
0:11 'arrayedSampler' (uniform 5-element array of sampler2D)
0:11 'i' (flat in int)
0:11 'c2D' (smooth in 2-component vector of float)
0:12 move second child to first child (float)
0:12 direct index (float)
0:12 'outp' (out 4-component vector of float)
0:12 Constant:
0:12 0 (const int)
0:12 direct index (smooth in float)
0:12 'gl_ClipDistance' (smooth in unsized array of float)
0:12 Constant:
0:12 1 (const int)
0:? Linker Objects
0:? 'c2D' (smooth in 2-component vector of float)
0:? 'i' (flat in int)
0:? 'outp' (out 4-component vector of float)
0:? 'arrayedSampler' (uniform 5-element array of sampler2D)

View File

@ -11,5 +11,9 @@ Warning, version 400 is not yet complete; some version-specific features are pre
0:6 0 (const int)
0:7 EmitVertex (void)
0:8 EndPrimitive (void)
0:10 Sequence
0:10 move second child to first child (int)
0:10 'id' (int)
0:10 'gl_InvocationID' (in int)
0:? Linker Objects

View File

@ -1,14 +1,11 @@
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:? Sequence
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 move second child to first child (int)
0:5 'gl_ViewportIndex' (out int)
0:5 Constant:
0:5 7.000000
0:5 7 (const int)
0:? Linker Objects

View File

@ -48,7 +48,10 @@ ERROR: node is still EOpNull!
0:40 Constant:
0:40 3.000000
0:42 move second child to first child (4-component vector of float)
0:42 'gl_Position' (invariant gl_Position 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)
0:42 Constant:
0:42 0 (const uint)
0:42 Construct vec4 (4-component vector of float)
0:42 'f' (float)
0:44 Sequence

View File

@ -21,7 +21,6 @@ ERROR: 0:112: 'depth_any' : unrecognized layout identifier
ERROR: 0:115: 'depth_greater' : unrecognized layout identifier
ERROR: 0:118: 'depth_less' : unrecognized layout identifier
ERROR: 0:121: 'depth_unchanged' : unrecognized layout identifier
ERROR: 0:123: 'gl_' : reserved built-in name
ERROR: 0:150: 'constructor' : constructing from a non-dereferenced array
ERROR: 0:152: '=' : cannot convert from 'const 2-element array of 4-component vector of float' to '3-element array of 4-component vector of float'
ERROR: 0:172: 'x' : undeclared identifier
@ -52,7 +51,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: 53 compilation errors. No code generated.
ERROR: 52 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:5 Sequence
@ -270,5 +269,5 @@ ERROR: node is still EOpNull!
0:? 'factor' (layout(location=3 ) out 4-component vector of float)
0:? 'colors' (layout(location=2 ) out 3-element array of 4-component vector of float)
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'gl_Color' (smooth in 4-component vector of float)
0:? '__anon__2' (in block)

View File

@ -32,7 +32,6 @@ ERROR: 0:95: 'binding' : not supported
ERROR: 0:96: 'binding' : not supported
ERROR: 0:97: 'binding' : not supported
ERROR: 0:106: '' : vertex input cannot be further qualified
ERROR: 0:106: 'gl_' : reserved built-in name
ERROR: 0:112: 'ColorIvn' : identifier not previously declared
ERROR: 0:119: 'a' : redefinition
ERROR: 0:132: 'shared' : not supported in this stage: vertex
@ -51,7 +50,7 @@ ERROR: 0:191: '=' : cannot convert from 'const 4-component vector of float' to
ERROR: 0:192: 'constructor' : constructing from a non-dereferenced array
ERROR: 0:193: 'constructor' : constructing from a non-dereferenced array
ERROR: 0:194: 'constructor' : constructing from a non-dereferenced array
ERROR: 52 compilation errors. No code generated.
ERROR: 51 compilation errors. No code generated.
ERROR: node is still EOpNull!
0:134 Function Definition: funcA(I21; (4-component vector of float)
@ -257,7 +256,7 @@ ERROR: node is still EOpNull!
0:? 'b2' (uniform int)
0:? 'c2' (uniform int)
0:? 'd2' (uniform int)
0:? 'gl_FrontColor' (flat in 4-component vector of float)
0:? '__anon__5' (out block)
0:? 'ColorInv' (smooth out 3-component vector of float)
0:? 'Color4' (invariant centroid smooth out 3-component vector of float)
0:? 'position' (smooth out 4-component vector of float)
@ -266,8 +265,8 @@ ERROR: node is still EOpNull!
0:? 'c' (in 4-component vector of float)
0:? 'd' (in 4-component vector of float)
0:? 'v' (smooth out 4-component vector of float)
0:? '__anon__5' (layout(shared ) uniform block)
0:? '__anon__6' (layout(shared ) uniform block)
0:? '__anon__7' (layout(shared ) uniform block)
0:? 'shv' (shared 4-component vector of float)
0:? 'img1' (uniform image2D)
0:? 'img2' (coherent uniform image2D)

View File

@ -17,6 +17,7 @@ MaxVertexOutputVectors 16
MaxFragmentInputVectors 15
MinProgramTexelOffset -8
MaxProgramTexelOffset 7
MaxClipDistances 8
nonInductiveForLoops 1
whileLoops 1
doWhileLoops 1

View File

@ -1,4 +1,4 @@
ERROR: 0:2: 'in' : must be qualified as 'flat' uint
ERROR: 0:2: 'uint' : must be qualified as flat in
ERROR: 0:6: 'in' : cannot be bool
ERROR: 0:20: 'const' : non-matching types for const initializer
ERROR: 0:24: 'const' : non-matching types for const initializer

View File

@ -4,7 +4,10 @@ Warning, version 420 is not yet complete; some version-specific features are pre
0:40 Function Parameters:
0:42 Sequence
0:42 move second child to first child (4-component vector of float)
0:42 'gl_Position' (gl_Position 4-component vector of float)
0:42 gl_Position: direct index for structure (gl_Position 4-component vector of float)
0:42 '__anon__1' (out block)
0:42 Constant:
0:42 0 (const uint)
0:42 Construct vec4 (4-component vector of float)
0:42 'color' (in 3-component vector of float)
0:42 Constant:

View File

@ -9,7 +9,10 @@ ERROR: node is still EOpNull!
0:42 Function Parameters:
0:44 Sequence
0:44 move second child to first child (4-component vector of float)
0:44 'gl_Position' (gl_Position 4-component vector of float)
0:44 gl_Position: direct index for structure (gl_Position 4-component vector of float)
0:44 '__anon__1' (out block)
0:44 Constant:
0:44 0 (const uint)
0:44 Construct vec4 (4-component vector of float)
0:44 'color' (in 3-component vector of float)
0:44 Constant:

View File

@ -69,6 +69,7 @@ struct TBuiltInResource {
int maxFragmentInputVectors;
int minProgramTexelOffset;
int maxProgramTexelOffset;
int maxClipDistances;
TLimits limits;
};

File diff suppressed because it is too large Load Diff

View File

@ -1484,20 +1484,17 @@ void TParseContext::globalQualifierCheck(TSourceLoc loc, const TQualifier& quali
if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble) {
profileRequires(loc, EEsProfile, 300, 0, "shader input/output");
if ((language != EShLangVertex && qualifier.storage == EvqVaryingIn && ! qualifier.flat) ||
(language != EShLangFragment && qualifier.storage == EvqVaryingOut && ! qualifier.flat)) {
error(loc, "must be qualified as 'flat'", GetStorageQualifierString(qualifier.storage), TType::getBasicString(publicType.basicType));
return;
if (! qualifier.flat) {
if (qualifier.storage == EvqVaryingIn && language == EShLangFragment)
error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage));
else if (qualifier.storage == EvqVaryingOut && language == EShLangVertex && version == 300)
error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage));
}
}
if (language == EShLangVertex && qualifier.storage == EvqVaryingIn &&
(qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant)) {
(qualifier.isAuxiliary() || qualifier.isInterpolation() || qualifier.isMemory() || qualifier.invariant))
error(loc, "vertex input cannot be further qualified", "", "");
return;
}
}
//
@ -1883,7 +1880,7 @@ TSymbol* TParseContext::redeclareBuiltin(TSourceLoc loc, const TString& identifi
if (builtIn) {
// Copy the symbol up to make a writable version
newDeclaration = true;
symbol = symbolTable.copyUp(symbol)->getAsVariable();
symbol = symbolTable.copyUp(symbol);
}
// Now, modify the type of the copy, as per the type of the current redeclaration.
@ -2573,16 +2570,33 @@ void TParseContext::addBlock(TSourceLoc loc, TTypeList& typeList, const TString*
if (arraySizes)
blockType.setArraySizes(arraySizes);
blockType.getQualifier().layoutPacking = defaultQualification.layoutPacking;
TVariable* userTypeDef = new TVariable(blockName, blockType, true);
if (! symbolTable.insert(*userTypeDef)) {
error(loc, "redefinition", blockName->c_str(), "block name");
return;
//
// Don't make a user-defined type out of block name; that will cause an error
// if the same block name gets reused in a different interface.
//
// "Block names have no other use within a shader
// beyond interface matching; it is a compile-time error to use a block name at global scope for anything
// other than as a block name (e.g., use of a block name for a global variable name or function name is
// currently reserved)."
//
// Use the symbol table to prevent normal reuse of the block's name, as a variable entry,
// whose type is EbtBlock, but without all the structure; that will come from the type
// the instances point to.
//
TType blockNameType(EbtBlock);
TVariable* blockNameVar = new TVariable(blockName, blockNameType);
if (! symbolTable.insert(*blockNameVar)) {
TSymbol* existingName = symbolTable.find(*blockName);
if (existingName->getType().getBasicType() != EbtBlock) {
error(loc, "block name cannot redefine a non-block name", blockName->c_str(), "");
return;
}
}
// Add the variable, as anonymous or named instanceName
// make an anonymous variable if no name was provided
// Add the variable, as anonymous or named instanceName.
// Make an anonymous variable if no name was provided.
if (! instanceName)
instanceName = NewPoolTString("");
@ -2596,7 +2610,7 @@ void TParseContext::addBlock(TSourceLoc loc, TTypeList& typeList, const TString*
return;
}
// save it in case there are no references in the AST, so the linker can error test against it
// Save it in the AST for linker use.
intermediate.addSymbolLinkageNode(linkage, *variable);
}