Commit 7c908d25 by John Kessenich

Additional semantic checking for tessellation shaders and related clean up:

- non-arrayed geometry inputs and tessellation-control outputs - include user blocks in i/o array resizing based on primitive type - things belonging only to 'in' or 'out' are verified only on 'in' or 'out' - invocation number changing - move shader-scoped qualifier checking into its class - remove an incidental union of two levels of the node hierarchy in the yacc stack - remove layout(location=) default tracking when setting on a variable git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24551 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 76ea74af
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
in fromVertex { in fromVertex {
vec3 color; vec3 color;
} fromV; } fromV[];
out toFragment { out toFragment {
vec3 color; vec3 color;
...@@ -29,7 +29,7 @@ void main() ...@@ -29,7 +29,7 @@ void main()
EmitStreamVertex(1); // ERROR EmitStreamVertex(1); // ERROR
EndStreamPrimitive(0); // ERROR EndStreamPrimitive(0); // ERROR
color = fromV.color; color = fromV[0].color;
gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2]; gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
gl_Position = gl_in[0].gl_Position; gl_Position = gl_in[0].gl_Position;
gl_PointSize = gl_in[3].gl_PointSize; gl_PointSize = gl_in[3].gl_PointSize;
...@@ -72,7 +72,7 @@ layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive ...@@ -72,7 +72,7 @@ layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive
layout(triangle_strip) in; // ERROR, not an input primitive layout(triangle_strip) in; // ERROR, not an input primitive
layout(triangle_strip) uniform; // ERROR layout(triangle_strip) uniform; // ERROR
layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
layout(triangle_strip) in vec4 bad2v4; // ERROR, not on a variable or input layout(triangle_strip) in vec4 bad2v4[]; // ERROR, not on a variable or input
layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block
out outbn2 { out outbn2 {
layout(invocations = 3) int a; // ERROR, not on a block member layout(invocations = 3) int a; // ERROR, not on a block member
...@@ -84,16 +84,16 @@ layout(lines) out; // ERROR, not on output ...@@ -84,16 +84,16 @@ layout(lines) out; // ERROR, not on output
layout(lines_adjancency) in; layout(lines_adjancency) in;
layout(triangles) in; // ERROR, can't change it layout(triangles) in; // ERROR, can't change it
layout(triangles_adjacency) in; // ERROR, can't change it layout(triangles_adjacency) in; // ERROR, can't change it
layout(invocations = 4) in;
layout(invocations = 4, max_vertices = 300) out; layout(max_vertices = 300) out;
in inbn { in inbn {
layout(stream = 2) int a; // ERROR, stream on input layout(stream = 2) int a; // ERROR, stream on input
} inbi; } inbi[];
in sameName { in sameName {
int a15; int a15;
}; } insn[];
out sameName { out sameName {
float f15; float f15;
......
...@@ -51,7 +51,7 @@ shared vec4 compute_only; // ERROR ...@@ -51,7 +51,7 @@ shared vec4 compute_only; // ERROR
layout(packed) uniform; layout(packed) uniform;
layout(packed) float aoeuntaoeu; layout(packed) float aoeuntaoeu; // ERROR, packed on variable
layout(location = 40) in float cd; layout(location = 40) in float cd;
layout(location = 37) in mat4x3 ce; // ERROR, overlap layout(location = 37) in mat4x3 ce; // ERROR, overlap
...@@ -6,12 +6,12 @@ void main() ...@@ -6,12 +6,12 @@ void main()
EndStreamPrimitive(0); EndStreamPrimitive(0);
EmitVertex(); EmitVertex();
EndPrimitive(); EndPrimitive();
int id = gl_InvocationID; int id = gl_InvocationID;
} }
layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block
layout(max_vertices = 127, invocations = 4) out; layout(max_vertices = 127) out;
layout(invocations = 4) in;
#extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_separate_shader_objects : enable
...@@ -55,5 +55,19 @@ layout(location = 4) in vec4 cva[3]; ...@@ -55,5 +55,19 @@ layout(location = 4) in vec4 cva[3];
layout(location = 5) in vec4 cvb[3]; layout(location = 5) in vec4 cvb[3];
layout(location = 2) in mat3 cmc[3]; // ERROR, collision layout(location = 2) in mat3 cmc[3]; // ERROR, collision
patch in vec4 patchIn; // ERROR patch in vec4 patchIn[]; // ERROR
patch out vec4 patchOut; // ERROR patch out vec4 patchOut; // ERROR
\ No newline at end of file
in float scalar; // ERROR, no array
layout(max_vertices = 127, invocations = 4) out; // ERROR
layout(invocations = 4, max_vertices = 127) in; // ERROR
layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs
in inblockscalar {
int a;
} inbls; // ERROR, not an array
in inblocka {
int a;
} inbla[17]; // ERROR, wrong array size
...@@ -5,8 +5,8 @@ layout(quads, cw) in; ...@@ -5,8 +5,8 @@ layout(quads, cw) in;
layout(triangles) in; // ERROR layout(triangles) in; // ERROR
layout(isolines) in; // ERROR layout(isolines) in; // ERROR
layout(cw) in;
layout(ccw) in; // ERROR layout(ccw) in; // ERROR
layout(cw) in;
layout(fractional_odd_spacing) in; layout(fractional_odd_spacing) in;
layout(equal_spacing) in; // ERROR layout(equal_spacing) in; // ERROR
...@@ -60,3 +60,13 @@ in gl_PerVertex ...@@ -60,3 +60,13 @@ in gl_PerVertex
{ {
float gl_ClipDistance[1]; float gl_ClipDistance[1];
} gl_in[gl_MaxPatchVertices]; } gl_in[gl_MaxPatchVertices];
layout(quads, cw) out; // ERROR
layout(triangles) out; // ERROR
layout(isolines) out; // ERROR
layout(cw) out; // ERROR
layout(fractional_odd_spacing) out; // ERROR
layout(equal_spacing) out; // ERROR
layout(fractional_even_spacing) out; // ERROR
layout(point_mode) out; // ERROR
...@@ -23,7 +23,7 @@ void foo3() ...@@ -23,7 +23,7 @@ void foo3()
} }
uniform sampler2D s2D; uniform sampler2D s2D;
in vec2 coord; in vec2 coord[];
uniform vec4 v4; uniform vec4 v4;
void foo4() void foo4()
...@@ -37,7 +37,7 @@ void foo4() ...@@ -37,7 +37,7 @@ void foo4()
ivec2(2,1) ivec2(2,1)
}; };
vec4 v = textureGatherOffset(s2D, coord, offsets[i].xy); vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy);
offsets[i].xy = ivec2(3); // ERROR offsets[i].xy = ivec2(3); // ERROR
v4.x = 3.2; // ERROR v4.x = 3.2; // ERROR
......
...@@ -25,3 +25,5 @@ void main() ...@@ -25,3 +25,5 @@ void main()
gl_out[1].gl_Position = p; gl_out[1].gl_Position = p;
gl_out[1].gl_PointSize = ps; // ERROR gl_out[1].gl_PointSize = ps; // ERROR
} }
out float outf; // ERROR, no array
...@@ -13,8 +13,8 @@ ERROR: 0:60: 'stream' : member cannot contradict block ...@@ -13,8 +13,8 @@ ERROR: 0:60: 'stream' : member cannot contradict block
ERROR: 0:65: 'max_vertices' : can only apply to a standalone qualifier ERROR: 0:65: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:70: 'points' : cannot change previously set output primitive ERROR: 0:70: 'points' : cannot change previously set output primitive
ERROR: 0:71: 'points' : cannot change previously set output primitive ERROR: 0:71: 'points' : cannot change previously set output primitive
ERROR: 0:72: 'triangle_strip' : does not apply to input ERROR: 0:72: 'triangle_strip' : cannot apply to input
ERROR: 0:73: 'triangle_strip' : cannot be used here ERROR: 0:73: 'triangle_strip' : cannot apply to: uniform
ERROR: 0:74: 'triangle_strip' : can only apply to a standalone qualifier ERROR: 0:74: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:75: 'triangle_strip' : can only apply to a standalone qualifier ERROR: 0:75: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:76: 'invocations' : not supported for this version or the enabled extensions ERROR: 0:76: 'invocations' : not supported for this version or the enabled extensions
...@@ -23,10 +23,10 @@ ERROR: 0:78: 'invocations' : not supported for this version or the enabled exten ...@@ -23,10 +23,10 @@ ERROR: 0:78: 'invocations' : not supported for this version or the enabled exten
ERROR: 0:78: 'invocations' : can only apply to a standalone qualifier ERROR: 0:78: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:79: 'max_vertices' : can only apply to a standalone qualifier ERROR: 0:79: 'max_vertices' : can only apply to a standalone qualifier
ERROR: 0:80: 'triangle_strip' : can only apply to a standalone qualifier ERROR: 0:80: 'triangle_strip' : can only apply to a standalone qualifier
ERROR: 0:83: 'lines' : does not apply to output ERROR: 0:83: 'lines' : cannot apply to 'out'
ERROR: 0:85: 'triangles' : cannot change previously set input primitive ERROR: 0:85: 'triangles' : cannot change previously set input primitive
ERROR: 0:86: 'triangles_adjacency' : cannot change previously set input primitive ERROR: 0:86: 'triangles_adjacency' : cannot change previously set input primitive
ERROR: 0:88: 'invocations' : not supported for this version or the enabled extensions ERROR: 0:87: 'invocations' : not supported for this version or the enabled extensions
ERROR: 0:88: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices ERROR: 0:88: 'max_vertices' : too large, must be less than gl_MaxGeometryOutputVertices
ERROR: 0:91: 'stream' : member cannot contradict block ERROR: 0:91: 'stream' : member cannot contradict block
ERROR: 29 compilation errors. No code generated. ERROR: 29 compilation errors. No code generated.
...@@ -52,7 +52,10 @@ ERROR: node is still EOpNull! ...@@ -52,7 +52,10 @@ ERROR: node is still EOpNull!
0:32 Constant: 0:32 Constant:
0:32 0 (const uint) 0:32 0 (const uint)
0:32 color: direct index for structure (3-component vector of float) 0:32 color: direct index for structure (3-component vector of float)
0:32 'fromV' (in block{color}) 0:32 direct index (block{color})
0:32 'fromV' (in 4-element array of block{color})
0:32 Constant:
0:32 0 (const int)
0:32 Constant: 0:32 Constant:
0:32 0 (const int) 0:32 0 (const int)
0:33 move second child to first child (float) 0:33 move second child to first child (float)
...@@ -119,7 +122,7 @@ ERROR: node is still EOpNull! ...@@ -119,7 +122,7 @@ ERROR: node is still EOpNull!
0:67 1.000000 0:67 1.000000
0:67 1.000000 0:67 1.000000
0:? Linker Objects 0:? Linker Objects
0:? 'fromV' (in block{color}) 0:? 'fromV' (in 4-element array of block{color})
0:? 'toF' (layout(stream=0 ) out block{color}) 0:? 'toF' (layout(stream=0 ) out block{color})
0:? '__anon__0' (layout(stream=0 ) out block{color}) 0:? '__anon__0' (layout(stream=0 ) out block{color})
0:? 'gl_in' (in 4-element array of block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:? 'gl_in' (in 4-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
...@@ -134,13 +137,13 @@ ERROR: node is still EOpNull! ...@@ -134,13 +137,13 @@ ERROR: node is still EOpNull!
0:? 'ouua7' (layout(stream=7 ) out block{a}) 0:? 'ouua7' (layout(stream=7 ) out block{a})
0:? 'ov2s3' (layout(stream=3 ) out 4-component vector of float) 0:? 'ov2s3' (layout(stream=3 ) out 4-component vector of float)
0:? 'badv4' (layout(stream=3 ) out 4-component vector of float) 0:? 'badv4' (layout(stream=3 ) out 4-component vector of float)
0:? 'bad2v4' (in 4-component vector of float) 0:? 'bad2v4' (in 4-element array of 4-component vector of float)
0:? '__anon__1' (layout(stream=3 ) out block{a}) 0:? '__anon__1' (layout(stream=3 ) out block{a})
0:? 'outbi' (layout(stream=3 ) out block{a,b,c}) 0:? 'outbi' (layout(stream=3 ) out block{a,b,c})
0:? 'inbi' (in block{a}) 0:? 'inbi' (in 4-element array of block{a})
0:? '__anon__2' (in block{a15}) 0:? 'insn' (in 4-element array of block{a15})
0:? '__anon__3' (layout(stream=3 ) out block{f15}) 0:? '__anon__2' (layout(stream=3 ) out block{f15})
0:? '__anon__4' (layout(column_major shared ) uniform block{b15}) 0:? '__anon__3' (layout(column_major shared ) uniform block{b15})
Linked geometry stage: Linked geometry stage:
......
400.geom 400.geom
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing. 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:12: 'invocations' : can only apply to a standalone qualifier
ERROR: 0:20: 'patch' : not supported in this stage: geometry ERROR: 0:20: 'patch' : not supported in this stage: geometry
ERROR: 0:20: 'gl_PointSize' : cannot add layout to redeclared block member 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:20: 'gl_PointSize' : cannot add patch to redeclared block member
ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier ERROR: 0:25: 'length' : array must first be sized by a redeclaration or layout qualifier
ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier ERROR: 0:36: 'length' : array must first be sized by a redeclaration or layout qualifier
ERROR: 0:40: 'triangles' : inconsistent input primitive for array size colorBad ERROR: 0:40: 'triangles' : inconsistent input primitive for array size of colorBad
ERROR: 0:44: 'triangles' : inconsistent input primitive for array size colorbad2 ERROR: 0:44: 'triangles' : inconsistent input primitive for array size of colorbad2
ERROR: 0:56: 'location' : repeated use of location 4 ERROR: 0:56: 'location' : repeated use of location 4
ERROR: 0:58: 'patch' : not supported in this stage: geometry ERROR: 0:58: 'patch' : not supported in this stage: geometry
ERROR: 0:59: 'patch' : not supported in this stage: geometry ERROR: 0:59: 'patch' : not supported in this stage: geometry
ERROR: 11 compilation errors. No code generated. ERROR: 0:61: 'in' : type must be an array: scalar
ERROR: 0:63: 'invocations' : can only apply to 'in'
ERROR: 0:64: 'max_vertices' : can only apply to 'out'
ERROR: 0:65: 'max_vertices' : can only apply to 'out'
ERROR: 0:65: 'invocations' : can only apply to 'in'
ERROR: 0:67: 'in' : type must be an array: inbls
ERROR: 0:71: 'triangles' : inconsistent input primitive for array size of inbla
ERROR: 18 compilation errors. No code generated.
invocations = 4 invocations = 4
...@@ -30,10 +37,10 @@ ERROR: node is still EOpNull! ...@@ -30,10 +37,10 @@ ERROR: node is still EOpNull!
0:6 0 (const int) 0:6 0 (const int)
0:7 EmitVertex (void) 0:7 EmitVertex (void)
0:8 EndPrimitive (void) 0:8 EndPrimitive (void)
0:10 Sequence 0:9 Sequence
0:10 move second child to first child (int) 0:9 move second child to first child (int)
0:10 'id' (int) 0:9 'id' (int)
0:10 'gl_InvocationID' (in int) 0:9 'gl_InvocationID' (in int)
0:23 Function Definition: foo( (void) 0:23 Function Definition: foo( (void)
0:23 Function Parameters: 0:23 Function Parameters:
0:25 Sequence 0:25 Sequence
...@@ -65,7 +72,7 @@ ERROR: node is still EOpNull! ...@@ -65,7 +72,7 @@ ERROR: node is still EOpNull!
0:51 Constant: 0:51 Constant:
0:51 3 (const int) 0:51 3 (const int)
0:? Linker Objects 0:? Linker Objects
0:? '__anon__0' (layout(stream=0 ) out block{a}) 0:? 'bn' (in 3-element array of block{a})
0:? 'gl_in' (in 3-element array of block{gl_Position,gl_PointSize}) 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:? 'color' (in 3-element array of 4-component vector of float)
0:? 'color2' (in 3-element array of 4-component vector of float) 0:? 'color2' (in 3-element array of 4-component vector of float)
...@@ -75,8 +82,11 @@ ERROR: node is still EOpNull! ...@@ -75,8 +82,11 @@ ERROR: node is still EOpNull!
0:? 'cva' (layout(location=4 ) in 3-element array of 4-component vector of float) 0:? 'cva' (layout(location=4 ) in 3-element array of 4-component vector of float)
0:? 'cvb' (layout(location=5 ) in 3-element array of 4-component vector of float) 0:? 'cvb' (layout(location=5 ) in 3-element array of 4-component vector of float)
0:? 'cmc' (layout(location=2 ) in 3-element array of 3X3 matrix of float) 0:? 'cmc' (layout(location=2 ) in 3-element array of 3X3 matrix of float)
0:? 'patchIn' (patch in 4-component vector of float) 0:? 'patchIn' (patch in 3-element array of 4-component vector of float)
0:? 'patchOut' (layout(stream=0 ) patch out 4-component vector of float) 0:? 'patchOut' (layout(stream=0 ) patch out 4-component vector of float)
0:? 'scalar' (in float)
0:? 'inbls' (in block{a})
0:? 'inbla' (in 17-element array of block{a})
Linked geometry stage: Linked geometry stage:
......
...@@ -3,7 +3,7 @@ Warning, version 400 is not yet complete; some version-specific features are pre ...@@ -3,7 +3,7 @@ Warning, version 400 is not yet complete; some version-specific features are pre
ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value ERROR: 0:3: 'vertices' : there is no such layout identifier for this stage taking an assigned value
ERROR: 0:5: 'triangles' : cannot change previously set input primitive ERROR: 0:5: 'triangles' : cannot change previously set input primitive
ERROR: 0:6: 'isolines' : cannot change previously set input primitive ERROR: 0:6: 'isolines' : cannot change previously set input primitive
ERROR: 0:9: 'ccw' : cannot change previously set vertex order ERROR: 0:8: 'ccw' : cannot change previously set vertex order
ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing ERROR: 0:12: 'equal_spacing' : cannot change previously set vertex spacing
ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing ERROR: 0:13: 'fractional_even_spacing' : cannot change previously set vertex spacing
ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader ERROR: 0:18: 'patch' : can only use on input in tessellation-evaluation shader
...@@ -14,7 +14,16 @@ ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch ...@@ -14,7 +14,16 @@ ERROR: 0:49: 'patch' : cannot use interpolation qualifiers with patch
ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample) ERROR: 0:50: '' : can only have one auxiliary qualifier (centroid, patch, and sample)
ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized ERROR: 0:54: 'gl_PerVertex' : block already declared with size, can't redeclare as unsized
ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use ERROR: 0:59: 'gl_PerVertex' : can only redeclare a built-in block once, and before any use
ERROR: 14 compilation errors. No code generated. ERROR: 0:64: 'quads' : cannot apply to 'out'
ERROR: 0:64: 'cw' : can only apply to 'in'
ERROR: 0:65: 'triangles' : cannot apply to 'out'
ERROR: 0:66: 'isolines' : cannot apply to 'out'
ERROR: 0:67: 'cw' : can only apply to 'in'
ERROR: 0:68: 'fractional_odd_spacing' : can only apply to 'in'
ERROR: 0:69: 'equal_spacing' : can only apply to 'in'
ERROR: 0:70: 'fractional_even_spacing' : can only apply to 'in'
ERROR: 0:71: 'point_mode' : can only apply to 'in'
ERROR: 23 compilation errors. No code generated.
input primitive = quads input primitive = quads
......
...@@ -53,7 +53,10 @@ ERROR: node is still EOpNull! ...@@ -53,7 +53,10 @@ ERROR: node is still EOpNull!
0:40 'v' (4-component vector of float) 0:40 'v' (4-component vector of float)
0:40 Function Call: textureGatherOffset(s21;vf2;vi2; (4-component vector of float) 0:40 Function Call: textureGatherOffset(s21;vf2;vi2; (4-component vector of float)
0:40 's2D' (uniform sampler2D) 0:40 's2D' (uniform sampler2D)
0:40 'coord' (in 2-component vector of float) 0:40 direct index (2-component vector of float)
0:40 'coord' (in 3-element array of 2-component vector of float)
0:40 Constant:
0:40 0 (const int)
0:40 vector swizzle (2-component vector of int) 0:40 vector swizzle (2-component vector of int)
0:40 indirect index (2-component vector of int) 0:40 indirect index (2-component vector of int)
0:40 Constant: 0:40 Constant:
...@@ -115,7 +118,7 @@ ERROR: node is still EOpNull! ...@@ -115,7 +118,7 @@ ERROR: node is still EOpNull!
0:? 'gl_in' (in 3-element array of block{gl_Position,gl_PointSize,gl_ClipDistance}) 0:? 'gl_in' (in 3-element array of block{gl_Position,gl_PointSize,gl_ClipDistance})
0:? 'color3' (in 3-element array of 4-component vector of float) 0:? 'color3' (in 3-element array of 4-component vector of float)
0:? 's2D' (uniform sampler2D) 0:? 's2D' (uniform sampler2D)
0:? 'coord' (in 2-component vector of float) 0:? 'coord' (in 3-element array of 2-component vector of float)
0:? 'v4' (uniform 4-component vector of float) 0:? 'v4' (uniform 4-component vector of float)
0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize,gl_ClipDistance}) 0:? '__anon__0' (layout(stream=0 ) out block{gl_PointSize,gl_ClipDistance})
......
420.tesc 420.tesc
Warning, version 400 is not yet complete; some version-specific features are present, but many are missing. Warning, version 400 is not yet complete; some version-specific features are present, but many are missing.
ERROR: 0:7: 'vertices' : inconsistent output number of vertices for array size gl_out ERROR: 0:7: 'vertices' : inconsistent output number of vertices for array size of gl_out
ERROR: 0:11: 'vertices' : inconsistent output number of vertices for array size a ERROR: 0:11: 'vertices' : inconsistent output number of vertices for array size of a
ERROR: 0:12: 'vertices' : inconsistent output number of vertices for array size outb ERROR: 0:12: 'vertices' : inconsistent output number of vertices for array size of outb
ERROR: 0:26: 'gl_PointSize' : no such field in structure ERROR: 0:26: 'gl_PointSize' : no such field in structure
ERROR: 0:26: 'assign' : cannot convert from 'float' to 'block{gl_Position}' ERROR: 0:26: 'assign' : cannot convert from 'float' to 'block{gl_Position}'
ERROR: 5 compilation errors. No code generated. ERROR: 0:29: 'out' : type must be an array: outf
ERROR: 6 compilation errors. No code generated.
vertices = 4 vertices = 4
...@@ -76,6 +77,7 @@ ERROR: node is still EOpNull! ...@@ -76,6 +77,7 @@ ERROR: node is still EOpNull!
0:? 'a' (out 3-element array of int) 0:? 'a' (out 3-element array of int)
0:? 'outb' (out 5-element array of int) 0:? 'outb' (out 5-element array of int)
0:? 'outc' (out 4-element array of int) 0:? 'outc' (out 4-element array of int)
0:? 'outf' (out float)
Linked tessellation control stage: Linked tessellation control stage:
......
...@@ -21,7 +21,7 @@ ERROR: 0:85: 'offset' : there is no such layout identifier for this stage taking ...@@ -21,7 +21,7 @@ ERROR: 0:85: 'offset' : there is no such layout identifier for this stage taking
ERROR: 0:85: 'binding' : requires block, or sampler/image, or atomic-counter type ERROR: 0:85: 'binding' : requires block, or sampler/image, or atomic-counter type
ERROR: 0:87: 'binding' : requires block, or sampler/image, or atomic-counter type ERROR: 0:87: 'binding' : requires block, or sampler/image, or atomic-counter type
ERROR: 0:89: 'offset' : there is no such layout identifier for this stage taking an assigned value ERROR: 0:89: 'offset' : there is no such layout identifier for this stage taking an assigned value
WARNING: 0:89: '' : cannot set qualifier defaults when using a type and no identifier WARNING: 0:89: 'layout' : useless application of layout qualifier
ERROR: 0:91: 'bar' : redefinition ERROR: 0:91: 'bar' : redefinition
ERROR: 0:92: 'offset' : there is no such layout identifier for this stage taking an assigned value ERROR: 0:92: 'offset' : there is no such layout identifier for this stage taking an assigned value
ERROR: 0:92: 'bar' : redefinition ERROR: 0:92: 'bar' : redefinition
......
...@@ -17,6 +17,7 @@ Link Validation ...@@ -17,6 +17,7 @@ Link Validation
- 1.3: only statically used built-ins have to be redeclared as flat - 1.3: only statically used built-ins have to be redeclared as flat
- 1.5: matching between gl_PerVertex blocks and gl_PerFragment blocks - 1.5: matching between gl_PerVertex blocks and gl_PerFragment blocks
- 1.3: deprecated mixing fixed vertex/fragment stage with programmable fragment/vertex stage. - 1.3: deprecated mixing fixed vertex/fragment stage with programmable fragment/vertex stage.
+ 4.0: tessellation primitive, vertices, spacing, order,
- 4.3: compute shader not combined with any other stages - 4.3: compute shader not combined with any other stages
- 4.3: remove cross-version linking restrictions. - 4.3: remove cross-version linking restrictions.
- 4.3: Allow mismatches in interpolation and auxiliary qualification across stages. - 4.3: Allow mismatches in interpolation and auxiliary qualification across stages.
...@@ -26,8 +27,8 @@ Link Validation ...@@ -26,8 +27,8 @@ Link Validation
- limits checking: - limits checking:
+ bindings + bindings
- number of input/output compononents - number of input/output compononents
- tessellation limits + tessellation limits
- tessellation primitive array sizing consistency + tessellation primitive array sizing consistency
+ Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords + Non ES: gl_TexCoord can only have a max array size of up to gl_MaxTextureCoords
+ Non ES: gl_ClipDistance ... + Non ES: gl_ClipDistance ...
- ... - ...
...@@ -106,10 +107,10 @@ Shader Functionality to Implement/Finish ...@@ -106,10 +107,10 @@ Shader Functionality to Implement/Finish
+ texel offset limit checking + texel offset limit checking
+ 1.50: geometry shaders: max_vertices must be checked against gl_MaxGeometryOutputVertices (maybe at compile time) + 1.50: geometry shaders: max_vertices must be checked against gl_MaxGeometryOutputVertices (maybe at compile time)
GLSL 4.0 GLSL 4.0
- tessellation control stage and tessellation evaluation stage. Includes barrier() built-in for synchronization. + tessellation control stage and tessellation evaluation stage. Includes barrier() built-in for synchronization.
- patch in, patch out + patch in, patch out
- input/output arrays + input/output arrays
- unsized array sizing to gl_MaxPatchVertices, including gl_in/gl_out + unsized array sizing to gl_MaxPatchVertices, including gl_in/gl_out
+ built-in variables, functions, and constants verification + built-in variables, functions, and constants verification
+ layout qualifiers for primitive types + layout qualifiers for primitive types
- Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine. - Polymorphic functions: Run-time selection of what function gets called, through the new keyword subroutine.
......
...@@ -471,6 +471,28 @@ struct TShaderQualifiers { ...@@ -471,6 +471,28 @@ struct TShaderQualifiers {
order = EvoNone; order = EvoNone;
pointMode = false; pointMode = false;
} }
// Merge in characteristics from the 'src' qualifier. They can override when
// set, but never erase when not set.
void merge(const TShaderQualifiers& src)
{
if (src.geometry != ElgNone)
geometry = src.geometry;
if (src.pixelCenterInteger)
pixelCenterInteger = src.pixelCenterInteger;
if (src.originUpperLeft)
originUpperLeft = src.originUpperLeft;
if (src.invocations != 0)
invocations = src.invocations;
if (src.vertices != 0)
vertices = src.vertices;
if (src.spacing != EvsNone)
spacing = src.spacing;
if (src.order != EvoNone)
order = src.order;
if (src.pointMode)
pointMode = true;
}
}; };
// //
......
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
// source have to figure out how to create revision.h just to get a build // source have to figure out how to create revision.h just to get a build
// going. However, if it is not updated, it can be a version behind. // going. However, if it is not updated, it can be a version behind.
#define GLSLANG_REVISION "24522" #define GLSLANG_REVISION "24530"
#define GLSLANG_DATE "2013/12/13 12:26:54" #define GLSLANG_DATE "2013/12/16 16:58:15"
...@@ -1285,8 +1285,6 @@ void TBuiltIns::initialize(int version, EProfile profile) ...@@ -1285,8 +1285,6 @@ void TBuiltIns::initialize(int version, EProfile profile)
"patch out float gl_TessLevelOuter[4];" "patch out float gl_TessLevelOuter[4];"
"patch out float gl_TessLevelInner[2];" "patch out float gl_TessLevelInner[2];"
"\n"); "\n");
// TODO 4.0 tessellation: do we also need to support the gl_VerticesOut mentioned in the extension specification?
} }
//============================================================================ //============================================================================
......
...@@ -85,7 +85,8 @@ public: ...@@ -85,7 +85,8 @@ public:
void checkIndex(TSourceLoc, const TType&, int& index); void checkIndex(TSourceLoc, const TType&, int& index);
void handleIndexLimits(TSourceLoc, TIntermTyped* base, TIntermTyped* index); void handleIndexLimits(TSourceLoc, TIntermTyped* base, TIntermTyped* index);
bool isIoResizeArray(const TType&); bool isIoResizeArray(const TType&) const;
void ioArrayCheck(TSourceLoc, const TType&, const TString& identifier);
void handleIoResizeArrayAccess(TSourceLoc, TIntermTyped* base); void handleIoResizeArrayAccess(TSourceLoc, TIntermTyped* base);
void checkIoArraysConsistency(TSourceLoc, bool tailOnly = false); void checkIoArraysConsistency(TSourceLoc, bool tailOnly = false);
int getIoArrayImplicitSize() const; int getIoArrayImplicitSize() const;
...@@ -94,7 +95,8 @@ public: ...@@ -94,7 +95,8 @@ public:
TIntermTyped* handleDotDereference(TSourceLoc, TIntermTyped* base, TString& field); TIntermTyped* handleDotDereference(TSourceLoc, TIntermTyped* base, TString& field);
TFunction* handleFunctionDeclarator(TSourceLoc loc, TFunction& function, bool prototype); TFunction* handleFunctionDeclarator(TSourceLoc loc, TFunction& function, bool prototype);
TIntermAggregate* handleFunctionDefinition(TSourceLoc, TFunction&); TIntermAggregate* handleFunctionDefinition(TSourceLoc, TFunction&);
TIntermTyped* handleFunctionCall(TSourceLoc, TFunction*, TIntermNode*, TIntermAggregate*); TIntermTyped* handleFunctionCall(TSourceLoc, TFunction*, TIntermNode*);
TIntermTyped* handleLengthMethod(TSourceLoc, TFunction*, TIntermNode*);
void nonOpBuiltInCheck(TSourceLoc, const TFunction&, TIntermAggregate&); void nonOpBuiltInCheck(TSourceLoc, const TFunction&, TIntermAggregate&);
TFunction* handleConstructorCall(TSourceLoc, TPublicType&); TFunction* handleConstructorCall(TSourceLoc, TPublicType&);
...@@ -146,7 +148,6 @@ public: ...@@ -146,7 +148,6 @@ public:
void setLayoutQualifier(TSourceLoc, TPublicType&, TString&); void setLayoutQualifier(TSourceLoc, TPublicType&, TString&);
void setLayoutQualifier(TSourceLoc, TPublicType&, TString&, int); void setLayoutQualifier(TSourceLoc, TPublicType&, TString&, int);
void mergeShaderLayoutQualifiers(TSourceLoc, TShaderQualifiers& dst, const TShaderQualifiers& src);
void mergeObjectLayoutQualifiers(TSourceLoc, TQualifier& dest, const TQualifier& src); void mergeObjectLayoutQualifiers(TSourceLoc, TQualifier& dest, const TQualifier& src);
void layoutTypeCheck(TSourceLoc, const TSymbol&); void layoutTypeCheck(TSourceLoc, const TSymbol&);
void layoutQualifierCheck(TSourceLoc, const TQualifier&); void layoutQualifierCheck(TSourceLoc, const TQualifier&);
...@@ -165,7 +166,6 @@ public: ...@@ -165,7 +166,6 @@ public:
void addQualifierToExisting(TSourceLoc, TQualifier, TIdentifierList&); void addQualifierToExisting(TSourceLoc, TQualifier, TIdentifierList&);
void invariantCheck(TSourceLoc, const TType&, const TString& identifier); void invariantCheck(TSourceLoc, const TType&, const TString& identifier);
void updateStandaloneQualifierDefaults(TSourceLoc, const TPublicType&); void updateStandaloneQualifierDefaults(TSourceLoc, const TPublicType&);
void updateTypedDefaults(TSourceLoc, const TQualifier&, const TString* id);
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
TIntermNode* addSwitch(TSourceLoc, TIntermTyped* expression, TIntermAggregate* body); TIntermNode* addSwitch(TSourceLoc, TIntermTyped* expression, TIntermAggregate* body);
......
...@@ -82,7 +82,6 @@ using namespace glslang; ...@@ -82,7 +82,6 @@ using namespace glslang;
TIntermNode* intermNode; TIntermNode* intermNode;
glslang::TIntermNodePair nodePair; glslang::TIntermNodePair nodePair;
glslang::TIntermTyped* intermTypedNode; glslang::TIntermTyped* intermTypedNode;
glslang::TIntermAggregate* intermAggregate;
}; };
union { union {
glslang::TPublicType type; glslang::TPublicType type;
...@@ -184,7 +183,7 @@ extern int yylex(YYSTYPE*, TParseContext&); ...@@ -184,7 +183,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%type <interm.intermNode> translation_unit function_definition %type <interm.intermNode> translation_unit function_definition
%type <interm.intermNode> statement simple_statement %type <interm.intermNode> statement simple_statement
%type <interm.intermAggregate> statement_list switch_statement_list compound_statement %type <interm.intermNode> statement_list switch_statement_list compound_statement
%type <interm.intermNode> declaration_statement selection_statement expression_statement %type <interm.intermNode> declaration_statement selection_statement expression_statement
%type <interm.intermNode> switch_statement case_label %type <interm.intermNode> switch_statement case_label
%type <interm.intermNode> declaration external_declaration %type <interm.intermNode> declaration external_declaration
...@@ -300,7 +299,7 @@ integer_expression ...@@ -300,7 +299,7 @@ integer_expression
function_call function_call
: function_call_or_method { : function_call_or_method {
$$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode, $1.intermAggregate); $$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode);
delete $1.function; delete $1.function;
} }
; ;
...@@ -753,9 +752,9 @@ declaration ...@@ -753,9 +752,9 @@ declaration
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
} }
| init_declarator_list SEMICOLON { | init_declarator_list SEMICOLON {
if ($1.intermAggregate) if ($1.intermNode && $1.intermNode->getAsAggregate())
$1.intermAggregate->setOperator(EOpSequence); $1.intermNode->getAsAggregate()->setOperator(EOpSequence);
$$ = $1.intermAggregate; $$ = $1.intermNode;
} }
| PRECISION precision_qualifier type_specifier SEMICOLON { | PRECISION precision_qualifier type_specifier SEMICOLON {
parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "precision statement"); parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "precision statement");
...@@ -980,42 +979,41 @@ init_declarator_list ...@@ -980,42 +979,41 @@ init_declarator_list
| init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer { | init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer {
$$.type = $1.type; $$.type = $1.type;
TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6); TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
$$.intermAggregate = parseContext.intermediate.growAggregate($1.intermAggregate, initNode, $5.loc); $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $5.loc);
} }
| init_declarator_list COMMA IDENTIFIER EQUAL initializer { | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
$$.type = $1.type; $$.type = $1.type;
TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5); TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
$$.intermAggregate = parseContext.intermediate.growAggregate($1.intermAggregate, initNode, $4.loc); $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $4.loc);
} }
; ;
single_declaration single_declaration
: fully_specified_type { : fully_specified_type {
$$.type = $1; $$.type = $1;
$$.intermAggregate = 0; $$.intermNode = 0;
parseContext.updateTypedDefaults($1.loc, $$.type.qualifier, 0); if ($$.type.qualifier.hasLayout())
parseContext.warn($1.loc, "useless application of layout qualifier", "layout", "");
} }
| fully_specified_type IDENTIFIER { | fully_specified_type IDENTIFIER {
$$.type = $1; $$.type = $1;
$$.intermAggregate = 0; $$.intermNode = 0;
parseContext.declareVariable($2.loc, *$2.string, $1); parseContext.declareVariable($2.loc, *$2.string, $1);
parseContext.updateTypedDefaults($2.loc, $$.type.qualifier, $2.string);
} }
| fully_specified_type IDENTIFIER array_specifier { | fully_specified_type IDENTIFIER array_specifier {
$$.type = $1; $$.type = $1;
$$.intermAggregate = 0; $$.intermNode = 0;
parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes); parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
parseContext.updateTypedDefaults($2.loc, $$.type.qualifier, $2.string);
} }
| fully_specified_type IDENTIFIER array_specifier EQUAL initializer { | fully_specified_type IDENTIFIER array_specifier EQUAL initializer {
$$.type = $1; $$.type = $1;
TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5); TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
$$.intermAggregate = parseContext.intermediate.growAggregate(0, initNode, $4.loc); $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $4.loc);
} }
| fully_specified_type IDENTIFIER EQUAL initializer { | fully_specified_type IDENTIFIER EQUAL initializer {
$$.type = $1; $$.type = $1;
TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4); TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
$$.intermAggregate = parseContext.intermediate.growAggregate(0, initNode, $3.loc); $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $3.loc);
} }
// Grammar Note: No 'enum', or 'typedef'. // Grammar Note: No 'enum', or 'typedef'.
...@@ -1045,7 +1043,7 @@ fully_specified_type ...@@ -1045,7 +1043,7 @@ fully_specified_type
$2.arraySizes = 0; $2.arraySizes = 0;
parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers); parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
parseContext.mergeShaderLayoutQualifiers($2.loc, $2.shaderQualifiers, $1.shaderQualifiers); $2.shaderQualifiers.merge($1.shaderQualifiers);
parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true); parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
parseContext.precisionQualifierCheck($2.loc, $2); parseContext.precisionQualifierCheck($2.loc, $2);
...@@ -1103,7 +1101,7 @@ layout_qualifier_id_list ...@@ -1103,7 +1101,7 @@ layout_qualifier_id_list
} }
| layout_qualifier_id_list COMMA layout_qualifier_id { | layout_qualifier_id_list COMMA layout_qualifier_id {
$$ = $1; $$ = $1;
parseContext.mergeShaderLayoutQualifiers($2.loc, $$.shaderQualifiers, $3.shaderQualifiers); $$.shaderQualifiers.merge($3.shaderQualifiers);
parseContext.mergeObjectLayoutQualifiers($2.loc, $$.qualifier, $3.qualifier); parseContext.mergeObjectLayoutQualifiers($2.loc, $$.qualifier, $3.qualifier);
} }
...@@ -1142,7 +1140,7 @@ type_qualifier ...@@ -1142,7 +1140,7 @@ type_qualifier
if ($$.basicType == EbtVoid) if ($$.basicType == EbtVoid)
$$.basicType = $2.basicType; $$.basicType = $2.basicType;
parseContext.mergeShaderLayoutQualifiers($$.loc, $$.shaderQualifiers, $2.shaderQualifiers); $$.shaderQualifiers.merge($2.shaderQualifiers);
parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false); parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false);
} }
; ;
...@@ -2159,8 +2157,8 @@ compound_statement ...@@ -2159,8 +2157,8 @@ compound_statement
--parseContext.controlFlowNestingLevel; --parseContext.controlFlowNestingLevel;
} }
RIGHT_BRACE { RIGHT_BRACE {
if ($3 != 0) if ($3 && $3->getAsAggregate())
$3->setOperator(EOpSequence); $3->getAsAggregate()->setOperator(EOpSequence);
$$ = $3; $$ = $3;
} }
; ;
...@@ -2188,8 +2186,8 @@ compound_statement_no_new_scope ...@@ -2188,8 +2186,8 @@ compound_statement_no_new_scope
$$ = 0; $$ = 0;
} }
| LEFT_BRACE statement_list RIGHT_BRACE { | LEFT_BRACE statement_list RIGHT_BRACE {
if ($2) if ($2 && $2->getAsAggregate())
$2->setOperator(EOpSequence); $2->getAsAggregate()->setOperator(EOpSequence);
$$ = $2; $$ = $2;
} }
; ;
...@@ -2206,7 +2204,7 @@ statement_list ...@@ -2206,7 +2204,7 @@ statement_list
| statement_list statement { | statement_list statement {
if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase || if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase ||
$2->getAsBranchNode()->getFlowOp() == EOpDefault)) { $2->getAsBranchNode()->getFlowOp() == EOpDefault)) {
parseContext.wrapupSwitchSubsequence($1, $2); parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2);
$$ = 0; // start a fresh subsequence for what's after this case $$ = 0; // start a fresh subsequence for what's after this case
} else } else
$$ = parseContext.intermediate.growAggregate($1, $2); $$ = parseContext.intermediate.growAggregate($1, $2);
...@@ -2261,7 +2259,7 @@ switch_statement ...@@ -2261,7 +2259,7 @@ switch_statement
parseContext.switchLevel.push_back(parseContext.controlFlowNestingLevel); parseContext.switchLevel.push_back(parseContext.controlFlowNestingLevel);
} }
LEFT_BRACE switch_statement_list RIGHT_BRACE { LEFT_BRACE switch_statement_list RIGHT_BRACE {
$$ = parseContext.addSwitch($1.loc, $3, $7); $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
delete parseContext.switchSequenceStack.back(); delete parseContext.switchSequenceStack.back();
parseContext.switchSequenceStack.pop_back(); parseContext.switchSequenceStack.pop_back();
parseContext.switchLevel.pop_back(); parseContext.switchLevel.pop_back();
...@@ -2422,14 +2420,14 @@ external_declaration ...@@ -2422,14 +2420,14 @@ external_declaration
function_definition function_definition
: function_prototype { : function_prototype {
$1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */); $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */);
$1.intermAggregate = parseContext.handleFunctionDefinition($1.loc, *$1.function); $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function);
} }
compound_statement_no_new_scope { compound_statement_no_new_scope {
// May be best done as post process phase on intermediate code // May be best done as post process phase on intermediate code
if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str()); parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str());
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
$$ = parseContext.intermediate.growAggregate($1.intermAggregate, $3); $$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc); parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
$$->getAsAggregate()->setName($1.function->getMangledName().c_str()); $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
......
...@@ -118,7 +118,7 @@ public: ...@@ -118,7 +118,7 @@ public:
bool setInvocations(int i) bool setInvocations(int i)
{ {
if (invocations > 0) if (invocations > 0)
return false; return invocations == i;
invocations = i; invocations = i;
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment