Commit f2d042a1 by John Kessenich

Non-functional, infrastructure: Be more explicit about "implicit array sizes",…

Non-functional, infrastructure: Be more explicit about "implicit array sizes", improving the infrastructure for handling them. Also fix some output that was too big for its buffer. There is more upcoming functionality for link-time sizing of implicitly-sized arrays that will use this. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@26176 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent b4ef9e0d
......@@ -332,7 +332,7 @@ ERROR: node is still EOpNull!
0:? 'v' (smooth in 3-element array of mediump 4-component vector of float)
0:? 'f' (mediump float)
0:? '__anon__0' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump int x})
0:? 'fa' (unsized array of mediump float)
0:? 'fa' (implicitly-sized array of mediump float)
0:? 'f13' (mediump float)
0:? 'fi' (invariant mediump float)
0:? 'av' (smooth in mediump 4-component vector of float)
......
......@@ -300,7 +300,7 @@ ERROR: node is still EOpNull!
0:120 move second child to first child (4-component vector of float)
0:120 'v' (4-component vector of float)
0:120 direct index (smooth 4-component vector of float)
0:120 'gl_TexCoord' (smooth in unsized array of 4-component vector of float)
0:120 'gl_TexCoord' (smooth in implicitly-sized array of 4-component vector of float)
0:120 Constant:
0:120 1 (const int)
0:121 add second child into first child (4-component vector of float)
......
......@@ -38,7 +38,7 @@ ERROR: node is still EOpNull!
0:18 move second child to first child (float)
0:18 'clip' (float)
0:18 direct index (smooth float)
0:18 'gl_ClipDistance' (smooth in unsized array of float)
0:18 'gl_ClipDistance' (smooth in implicitly-sized array of float)
0:18 Constant:
0:18 3 (const int)
0:23 Function Definition: foo( (void)
......@@ -334,7 +334,7 @@ ERROR: node is still EOpNull!
0:? 'fflat' (flat in float)
0:? 'fsmooth' (smooth in float)
0:? 'fnop' (noperspective in float)
0:? 'gl_ClipDistance' (smooth in unsized array of float)
0:? 'gl_ClipDistance' (smooth in implicitly-sized array of float)
0:? 'sampC' (uniform samplerCube)
0:? 'gl_Color' (smooth in 4-component vector of float)
0:? 'gl_Color' (flat in 4-component vector of float)
......
......@@ -63,16 +63,16 @@ ERROR: node is still EOpNull!
0:32 0 (const int)
0:33 move second child to first child (float)
0:33 direct index (layout(stream=0 ) float)
0:33 gl_ClipDistance: direct index for structure (layout(stream=0 ) out unsized array of float)
0:33 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out unsized array of float gl_ClipDistance})
0:33 gl_ClipDistance: direct index for structure (layout(stream=0 ) out implicitly-sized array of float)
0:33 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out implicitly-sized array of float gl_ClipDistance})
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 (in unsized array of float)
0:33 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:33 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:33 gl_ClipDistance: direct index for structure (in implicitly-sized array of float)
0:33 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:33 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:33 Constant:
0:33 1 (const int)
0:33 Constant:
......@@ -81,24 +81,24 @@ ERROR: node is still EOpNull!
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 (layout(stream=0 ) gl_Position 4-component vector of float)
0:34 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out unsized array of float gl_ClipDistance})
0:34 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out implicitly-sized array of float gl_ClipDistance})
0:34 Constant:
0:34 0 (const uint)
0:34 gl_Position: direct index for structure (in 4-component vector of float)
0:34 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:34 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:34 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:34 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
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 (layout(stream=0 ) gl_PointSize float)
0:35 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out unsized array of float gl_ClipDistance})
0:35 '__anon__1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float gl_Position, layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out implicitly-sized array of float gl_ClipDistance})
0:35 Constant:
0:35 1 (const uint)
0:35 gl_PointSize: direct index for structure (in float)
0:35 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:35 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:35 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:35 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:35 Constant:
0:35 3 (const int)
0:35 Constant:
......@@ -128,7 +128,7 @@ ERROR: node is still EOpNull!
0:? 'fromV' (in 4-element array of block{in 3-component vector of float color})
0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
0:? '__anon__0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color})
0:? 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:? 'gl_in' (in 4-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:? 'ov0' (layout(stream=0 ) out 4-component vector of float)
0:? 'ov4' (layout(stream=4 ) out 4-component vector of float)
0:? 'o1v0' (layout(stream=0 ) out 4-component vector of float)
......
......@@ -11,20 +11,20 @@ ERROR: node is still EOpNull!
0:11 Sequence
0:11 move second child to first child (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{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:11 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
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: direct index for structure (gl_PointSize float)
0:12 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:12 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:12 Constant:
0:12 1 (const uint)
0:12 'ps' (uniform float)
0:13 move second child to first child (float)
0:13 direct index (float)
0:13 gl_ClipDistance: direct index for structure (out 4-element array of float)
0:13 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:13 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:13 Constant:
0:13 2 (const uint)
0:13 Constant:
......@@ -35,14 +35,14 @@ ERROR: node is still EOpNull!
0:13 0 (const int)
0:14 move second child to first child (4-component vector of float)
0:14 gl_ClipVertex: direct index for structure (gl_ClipVertex 4-component vector of float)
0:14 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:14 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out 4-element array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:14 Constant:
0:14 3 (const uint)
0:14 'iv4' (in 4-component vector of float)
0:? Linker Objects
0:? 'iv4' (in 4-component vector of float)
0:? 'ps' (uniform float)
0:? '__anon__1' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform unsized array of int a})
0:? '__anon__1' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform implicitly-sized array of int a})
0:? 'gl_VertexID' (gl_VertexId int)
0:? 'gl_InstanceID' (gl_InstanceId int)
......
......@@ -274,9 +274,9 @@ ERROR: node is still EOpNull!
0:? 'rep2' (centroid smooth sample out highp 4-component vector of float)
0:? 'rep3' (in highp 4-component vector of float)
0:? 's' (smooth out structure{highp 3-component vector of float c, highp float f})
0:? 'badsize' (unsized array of highp float)
0:? 'badsize2' (unsized array of highp float)
0:? 'ubInst' (layout(column_major shared ) uniform unsized array of block{layout(column_major shared ) uniform unsized array of highp int a})
0:? 'badsize' (implicitly-sized array of highp float)
0:? 'badsize2' (implicitly-sized array of highp float)
0:? 'ubInst' (layout(column_major shared ) uniform implicitly-sized array of block{layout(column_major shared ) uniform implicitly-sized array of highp int a})
0:? 'okayA' (2-element array of highp float)
0:? 'newV' (smooth out highp 3-component vector of float)
0:? 'invIn' (in highp 4-component vector of float)
......
......@@ -39,7 +39,7 @@ ERROR: node is still EOpNull!
0:14 Constant:
0:14 0 (const int)
0:14 direct index (smooth float)
0:14 'gl_ClipDistance' (smooth in unsized array of float)
0:14 'gl_ClipDistance' (smooth in implicitly-sized array of float)
0:14 Constant:
0:14 1 (const int)
0:18 Sequence
......@@ -228,8 +228,8 @@ ERROR: node is still EOpNull!
0:? 'vl' (layout(location=4 ) smooth in 4-component vector of float)
0:? 'vl2' (layout(location=6 ) smooth in 4-component vector of float)
0:? 'uv3' (layout(location=3 ) uniform 3-component vector of float)
0:? '__anon__0' (in block{in float gl_FogFragCoord, in unsized array of 4-component vector of float gl_TexCoord, smooth in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__0' (in block{in float gl_FogFragCoord, in unsized array of 4-component vector of float gl_TexCoord, smooth in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__0' (in block{in float gl_FogFragCoord, in implicitly-sized array of 4-component vector of float gl_TexCoord, smooth in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__0' (in block{in float gl_FogFragCoord, in implicitly-sized array of 4-component vector of float gl_TexCoord, smooth in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? 'gl_FragCoord' (gl_FragCoord 4-component vector of float)
0:? 'gl_FragCoord' (gl_FragCoord 4-component vector of float)
0:? 'u2drs' (uniform sampler2DRectShadow)
......
......@@ -31,7 +31,7 @@ ERROR: node is still EOpNull!
0:30 'p' (float)
0:30 gl_PointSize: direct index for structure (in float)
0:30 direct index (block{in float gl_PointSize})
0:30 'gl_in' (in unsized array of block{in float gl_PointSize})
0:30 'gl_in' (in implicitly-sized array of block{in float gl_PointSize})
0:30 Constant:
0:30 1 (const int)
0:30 Constant:
......@@ -47,7 +47,7 @@ ERROR: node is still EOpNull!
0:33 Constant:
0:33 0 (const uint)
0:? Linker Objects
0:? 'gl_in' (in unsized array of block{in float gl_PointSize})
0:? 'gl_in' (in implicitly-sized array of block{in float gl_PointSize})
0:? '__anon__0' (layout(stream=0 ) out block{layout(stream=0 ) gl_PointSize float gl_PointSize, })
......
......@@ -21,15 +21,15 @@ ERROR: node is still EOpNull!
0:9 Constant:
0:9 1 (const int)
0:10 gl_Position: direct index for structure (in 4-component vector of float)
0:10 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:10 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:10 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:10 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 0 (const int)
0:11 gl_Position: direct index for structure (in 4-component vector of float)
0:11 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:11 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:11 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:11 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:11 'i' (int)
0:11 Constant:
0:11 0 (const int)
......@@ -39,8 +39,8 @@ ERROR: node is still EOpNull!
0:20 Constant:
0:20 3 (const int)
0:21 gl_Position: direct index for structure (in 4-component vector of float)
0:21 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:21 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:21 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:21 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:21 'i' (int)
0:21 Constant:
0:21 0 (const int)
......@@ -116,12 +116,12 @@ ERROR: node is still EOpNull!
0:44 1 (const int)
0:? Linker Objects
0:? 'i' (int)
0:? 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:? 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:? 'color3' (in 3-element array of 4-component vector of float)
0:? 's2D' (uniform sampler2D)
0:? 'coord' (in 3-element array of 2-component vector of float)
0:? 'v4' (uniform 4-component vector of float)
0:? '__anon__0' (layout(stream=0 ) out block{layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out unsized array of float gl_ClipDistance})
0:? '__anon__0' (layout(stream=0 ) out block{layout(stream=0 ) gl_PointSize float gl_PointSize, layout(stream=0 ) out implicitly-sized array of float gl_ClipDistance})
Linked geometry stage:
......
......@@ -134,7 +134,7 @@ ERROR: node is still EOpNull!
0:? 'sampb3' (layout(binding=80 ) uniform sampler2D)
0:? 'sampb4' (layout(binding=31 ) uniform sampler2D)
0:? 'sampb5' (layout(binding=79 ) uniform 2-element array of sampler2D)
0:? '__anon__3' (out block{out unsized array of float gl_ClipDistance, })
0:? '__anon__3' (out block{out implicitly-sized array of float gl_ClipDistance, })
0:? 'patchIn' (patch in 4-component vector of float)
0:? 'patchOut' (smooth patch out 4-component vector of float)
0:? 'gl_VertexID' (gl_VertexId int)
......
......@@ -16,8 +16,8 @@ ERROR: node is still EOpNull!
0:13 Constant:
0:13 3 (const int)
0:14 gl_Position: direct index for structure (in 4-component vector of float)
0:14 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:14 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:14 direct index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:14 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:14 Constant:
0:14 1 (const int)
0:14 Constant:
......@@ -25,8 +25,8 @@ ERROR: node is still EOpNull!
0:15 Constant:
0:15 3 (const int)
0:16 gl_Position: direct index for structure (in 4-component vector of float)
0:16 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:16 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:16 indirect index (block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:16 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
0:16 'i' (int)
0:16 Constant:
0:16 0 (const int)
......@@ -34,7 +34,7 @@ ERROR: node is still EOpNull!
0:? 'i' (int)
0:? 'colorun' (in 3-element array of 4-component vector of float)
0:? 'color3' (in 3-element array of 4-component vector of float)
0:? 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in unsized array of float gl_ClipDistance})
0:? 'gl_in' (in 3-element array of block{in 4-component vector of float gl_Position, in float gl_PointSize, in implicitly-sized array of float gl_ClipDistance})
Linked geometry stage:
......
......@@ -64,7 +64,7 @@ ERROR: node is still EOpNull!
0:47 3.000000
0:49 move second child to first child (4-component vector of float)
0:49 gl_Position: direct index for structure (invariant gl_Position 4-component vector of float)
0:49 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:49 '__anon__0' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:49 Constant:
0:49 0 (const uint)
0:49 Construct vec4 (4-component vector of float)
......
......@@ -3,7 +3,7 @@ Warning, version 130 is not yet complete; most features are present, but a few a
ERROR: 0:21: '[' : array index out of range '2'
ERROR: 0:27: '[' : array must be redeclared with a size before being indexed with a variable
ERROR: 0:30: 'assign' : cannot convert from '4-element array of float' to '5-element array of float'
ERROR: 0:31: 'assign' : cannot convert from '4-element array of float' to 'unsized array of float'
ERROR: 0:31: 'assign' : cannot convert from '4-element array of float' to 'implicitly-sized array of float'
ERROR: 0:33: 'foo' : no matching overloaded function found
ERROR: 0:42: '[' : array index out of range '5'
ERROR: 0:45: '[' : array index out of range '1000'
......@@ -60,21 +60,21 @@ ERROR: node is still EOpNull!
0:21 4.000000
0:24 move second child to first child (float)
0:24 direct index (float)
0:24 'gu' (unsized array of float)
0:24 'gu' (implicitly-sized array of float)
0:24 Constant:
0:24 2 (const int)
0:24 Constant:
0:24 4.000000
0:26 move second child to first child (float)
0:26 direct index (float)
0:26 'gu' (unsized array of float)
0:26 'gu' (implicitly-sized array of float)
0:26 Constant:
0:26 3 (const int)
0:26 Constant:
0:26 3.000000
0:27 move second child to first child (float)
0:27 indirect index (float)
0:27 'gu' (unsized array of float)
0:27 'gu' (implicitly-sized array of float)
0:27 'a' (uniform int)
0:27 Constant:
0:27 5.000000
......@@ -83,7 +83,7 @@ ERROR: node is still EOpNull!
0:29 Function Call: foo(f1[5]; (4-element array of float)
0:29 'g5' (5-element array of float)
0:30 'g5' (5-element array of float)
0:31 'gu' (unsized array of float)
0:31 'gu' (implicitly-sized array of float)
0:33 Constant:
0:33 0.000000
0:34 Function Call: bar(f1[5]; (void)
......@@ -100,7 +100,7 @@ ERROR: node is still EOpNull!
0:36 true case
0:37 move second child to first child (float)
0:37 direct index (float)
0:37 'gu' (unsized array of float)
0:37 'gu' (implicitly-sized array of float)
0:37 Constant:
0:37 0 (const int)
0:37 Constant:
......@@ -187,7 +187,7 @@ ERROR: node is still EOpNull!
0:58 Constant:
0:58 4 (const int)
0:? Linker Objects
0:? 'gu' (unsized array of float)
0:? 'gu' (implicitly-sized array of float)
0:? 'g4' (4-element array of float)
0:? 'g5' (5-element array of float)
0:? 'a' (uniform int)
......
......@@ -10,7 +10,7 @@ ERROR: 0:24: 'array assignment' : not supported for this version or the enabled
ERROR: 0:25: 'array assignment' : not supported for this version or the enabled extensions
ERROR: 0:25: 'assign' : cannot convert from '4-element array of mediump float' to '5-element array of mediump float'
ERROR: 0:26: 'array assignment' : not supported for this version or the enabled extensions
ERROR: 0:26: 'assign' : cannot convert from '4-element array of mediump float' to 'unsized array of mediump float'
ERROR: 0:26: 'assign' : cannot convert from '4-element array of mediump float' to 'implicitly-sized array of mediump float'
ERROR: 0:28: 'foo' : no matching overloaded function found
ERROR: 0:31: 'arrayed constructor' : not supported for this version or the enabled extensions
ERROR: 0:31: 'array comparison' : not supported for this version or the enabled extensions
......@@ -67,7 +67,7 @@ ERROR: node is still EOpNull!
0:24 Function Call: foo(f1[5]; (4-element array of mediump float)
0:24 'g5' (5-element array of mediump float)
0:25 'g5' (5-element array of mediump float)
0:26 'gu' (unsized array of mediump float)
0:26 'gu' (implicitly-sized array of mediump float)
0:28 Constant:
0:28 0.000000
0:29 Function Call: bar(f1[5]; (void)
......@@ -84,7 +84,7 @@ ERROR: node is still EOpNull!
0:31 true case
0:32 move second child to first child (mediump float)
0:32 direct index (mediump float)
0:32 'gu' (unsized array of mediump float)
0:32 'gu' (implicitly-sized array of mediump float)
0:32 Constant:
0:32 0 (const int)
0:32 Constant:
......@@ -152,7 +152,7 @@ ERROR: node is still EOpNull!
0:69 'initSb' (structure{mediump 4-component vector of float v4, structure{mediump 3-component vector of float v3, 4-element array of mediump 2-component vector of float v2} sa})
0:69 's1' (structure{mediump 4-component vector of float v4, structure{mediump 3-component vector of float v3, 4-element array of mediump 2-component vector of float v2} sa})
0:? Linker Objects
0:? 'gu' (unsized array of mediump float)
0:? 'gu' (implicitly-sized array of mediump float)
0:? 'g4' (4-element array of mediump float)
0:? 'g5' (5-element array of mediump float)
0:? 'a' (uniform mediump int)
......
......@@ -126,7 +126,7 @@ ERROR: node is still EOpNull!
0:65 0.050000
0:69 move second child to first child (4-component vector of float)
0:69 gl_Position: direct index for structure (gl_Position 4-component vector of float)
0:69 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:69 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:69 Constant:
0:69 0 (const uint)
0:69 Construct vec4 (4-component vector of float)
......@@ -166,7 +166,7 @@ ERROR: node is still EOpNull!
12:20034 Sequence
12:20034 move second child to first child (4-component vector of float)
12:20034 gl_Position: direct index for structure (gl_Position 4-component vector of float)
12:20034 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
12:20034 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
12:20034 Constant:
12:20034 0 (const uint)
12:20034 Constant:
......
......@@ -297,8 +297,8 @@ ERROR: node is still EOpNull!
0:? 'colors' (layout(location=2 ) out 3-element array of 4-component vector of float)
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? 'gl_FragDepth' (gl_FragDepth float)
0:? '__anon__2' (in block{in float gl_FogFragCoord, in unsized array of 4-component vector of float gl_TexCoord, flat in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__2' (in block{in float gl_FogFragCoord, in unsized array of 4-component vector of float gl_TexCoord, flat in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__2' (in block{in float gl_FogFragCoord, in implicitly-sized array of 4-component vector of float gl_TexCoord, flat in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
0:? '__anon__2' (in block{in float gl_FogFragCoord, in implicitly-sized array of 4-component vector of float gl_TexCoord, flat in 4-component vector of float gl_Color, in 4-component vector of float gl_SecondaryColor})
Linked fragment stage:
......
......@@ -283,7 +283,7 @@ ERROR: node is still EOpNull!
0:? Linker Objects
0:? 'Coords' (out block{out 4-component vector of float Position, out 2-component vector of float Texture})
0:? '__anon__0' (out block{out 4-component vector of float Color})
0:? 'transforms' (layout(column_major shared ) uniform 4-element array of block{layout(column_major shared ) uniform 4X4 matrix of float ModelViewMatrix, layout(column_major shared ) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout(column_major shared ) uniform unsized array of 4-component vector of float a, layout(column_major shared ) uniform float Deformation})
0:? 'transforms' (layout(column_major shared ) uniform 4-element array of block{layout(column_major shared ) uniform 4X4 matrix of float ModelViewMatrix, layout(column_major shared ) uniform 4X4 matrix of float ModelViewProjectionMatrix, layout(column_major shared ) uniform implicitly-sized array of 4-component vector of float a, layout(column_major shared ) uniform float Deformation})
0:? 'normal' (layout(location=3 ) in 4-component vector of float)
0:? 'colors' (layout(location=6 ) in 3-element array of 4-component vector of float)
0:? 's' (layout(location=3 ) structure{3-component vector of float a1, 2X2 matrix of float b, 2-element array of 4-component vector of float c})
......@@ -300,8 +300,8 @@ ERROR: node is still EOpNull!
0:? 'b2' (layout(binding=2 ) uniform int)
0:? 'c2' (layout(binding=3 ) uniform int)
0:? 'd2' (layout(binding=2 ) uniform int)
0:? '__anon__5' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, flat out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:? '__anon__5' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, flat out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:? '__anon__5' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, flat out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:? '__anon__5' (out block{invariant gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, flat out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
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)
......
......@@ -8,7 +8,7 @@ Shader version: 420
0:42 Sequence
0:42 move second child to first child (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{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:42 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:42 Constant:
0:42 0 (const uint)
0:42 Construct vec4 (4-component vector of float)
......
......@@ -14,7 +14,7 @@ ERROR: node is still EOpNull!
0:44 Sequence
0:44 move second child to first child (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{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out unsized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out unsized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:44 '__anon__1' (out block{gl_Position 4-component vector of float gl_Position, gl_PointSize float gl_PointSize, out implicitly-sized array of float gl_ClipDistance, gl_ClipVertex 4-component vector of float gl_ClipVertex, out 4-component vector of float gl_FrontColor, out 4-component vector of float gl_BackColor, out 4-component vector of float gl_FrontSecondaryColor, out 4-component vector of float gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float gl_TexCoord, out float gl_FogFragCoord})
0:44 Constant:
0:44 0 (const uint)
0:44 Construct vec4 (4-component vector of float)
......
......@@ -174,14 +174,14 @@ typedef TVector<TString*> TIdentifierList;
struct TArraySizes {
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
TArraySizes() : maxArraySize(0) { }
TArraySizes() : implicitArraySize(0) { }
int getSize() { return sizes.front(); } // TArraySizes only exists if there is at least one dimension
void setSize(int s) { sizes.push_back(s); }
bool isArrayOfArrays() { return sizes.size() > 1; }
protected:
TVector<int> sizes;
friend class TType;
int maxArraySize; // for tracking maximum referenced index, before an explicit size is given
int implicitArraySize; // for tracking maximum referenced index, before an explicit size is given
};
//
......@@ -889,7 +889,7 @@ public:
void shareArraySizes(const TType& type)
{
// For when we are sharing existing array descriptors.
// This allows all references to the same unsized array
// This allows all references to the same array
// to be updated at once, by having all of them share the
// array description.
*arraySizes = *type.arraySizes;
......@@ -903,8 +903,11 @@ public:
void setArraySizes(const TType& type) { setArraySizes(type.arraySizes); }
void changeArraySize(int s) { arraySizes->sizes.front() = s; }
void setMaxArraySize (int s) { arraySizes->maxArraySize = s; }
int getMaxArraySize () const { return arraySizes->maxArraySize; }
bool isImplicitlySizedArray() const { return isArray() && ! getArraySize(); }
bool isExplicitlySizedArray() const { return ! isImplicitlySizedArray(); }
void setImplicitArraySize (int s) { arraySizes->implicitArraySize = s; }
int getImplicitArraySize () const { return arraySizes->implicitArraySize; }
const char* getBasicString() const
{
return TType::getBasicString(basicType);
......@@ -998,7 +1001,7 @@ public:
p += snprintf(p, end - p, "%s ", getStorageQualifierString());
if (arraySizes) {
if (arraySizes->sizes.front() == 0)
p += snprintf(p, end - p, "unsized array of ");
p += snprintf(p, end - p, "implicitly-sized array of ");
else
p += snprintf(p, end - p, "%d-element array of ", arraySizes->sizes.front());
}
......@@ -1057,8 +1060,8 @@ public:
components = vectorSize;
if (isArray()) {
// this function can only be used in paths that don't allow unsized arrays
assert(getArraySize() > 0);
// this function can only be used in paths that have a known array size
assert(isExplicitlySizedArray());
components *= getArraySize();
}
......
......@@ -379,7 +379,9 @@ TIntermTyped* TParseContext::handleVariable(TSourceLoc loc, TSymbol* symbol, TSt
const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : 0;
if (anon) {
// it was a member of an anonymous container, have to insert its dereference
// it was a member of an anonymous container
// create a subtree for its dereference
const TVariable* variable = anon->getAnonContainer().getAsVariable();
TIntermTyped* container = intermediate.addSymbol(*variable, loc);
TConstUnionArray unionArray(1);
......@@ -414,6 +416,7 @@ TIntermTyped* TParseContext::handleVariable(TSourceLoc loc, TSymbol* symbol, TSt
type->deepCopy(variable->getType());
} else
type = &variable->getWritableType();
// addSymbol will do a shallow copy of the type to the node, thus sharing array and struct information
node = intermediate.addSymbol(variable->getUniqueId(), variable->getName(), *type, loc);
if (type->getQualifier().isIo())
noteAccess = true;
......@@ -454,11 +457,11 @@ TIntermTyped* TParseContext::handleBracketDereference(TSourceLoc loc, TIntermTyp
handleIoResizeArrayAccess(loc, base);
if (index->getQualifier().storage == EvqConst) {
if (base->isArray() && base->getType().getArraySize() == 0)
updateMaxArraySize(loc, base, indexValue);
if (base->getType().isImplicitlySizedArray())
updateImplicitArraySize(loc, base, indexValue);
result = intermediate.addIndex(EOpIndexDirect, base, index, loc);
} else {
if (base->isArray() && base->getType().getArraySize() == 0) {
if (base->getType().isImplicitlySizedArray()) {
if (base->getAsSymbolNode() && isIoResizeArray(base->getType()))
error(loc, "", "[", "array must be sized by a redeclaration or layout qualifier before being indexed with a variable");
else
......@@ -505,7 +508,7 @@ void TParseContext::checkIndex(TSourceLoc loc, const TType& type, int& index)
error(loc, "", "[", "index out of range '%d'", index);
index = 0;
} else if (type.isArray()) {
if (type.getArraySize() != 0 && index >= type.getArraySize()) {
if (type.isExplicitlySizedArray() && index >= type.getArraySize()) {
error(loc, "", "[", "array index out of range '%d'", index);
index = type.getArraySize() - 1;
}
......@@ -561,8 +564,8 @@ void TParseContext::fixIoArraySize(TSourceLoc loc, TType& type)
if (language == EShLangTessControl || language == EShLangTessEvaluation) {
if (type.getArraySize() != resources.maxPatchVertices) {
if (type.getArraySize() != 0)
error(loc, "tessellation input array size must be gl_MaxPatchVertices or unsized", "[]", "");
if (type.isExplicitlySizedArray())
error(loc, "tessellation input array size must be gl_MaxPatchVertices or implicitly sized", "[]", "");
type.changeArraySize(resources.maxPatchVertices);
}
}
......@@ -596,7 +599,7 @@ void TParseContext::handleIoResizeArrayAccess(TSourceLoc loc, TIntermTyped* base
arry = symbolTable.copyUp(arry);
// fix array size, if already implicitly size
if (arry->getType().getArraySize() == 0) {
if (arry->getType().isImplicitlySizedArray()) {
int newSize = getIoArrayImplicitSize();
if (newSize) {
arry->getWritableType().changeArraySize(newSize);
......@@ -656,7 +659,7 @@ int TParseContext::getIoArrayImplicitSize() const
void TParseContext::checkIoArrayConsistency(TSourceLoc loc, int requiredSize, const char* feature, TType& type, const TString& name)
{
if (type.getArraySize() == 0)
if (type.isImplicitlySizedArray())
type.changeArraySize(requiredSize);
else if (type.getArraySize() != requiredSize) {
if (language == EShLangGeometry)
......@@ -1034,8 +1037,7 @@ TIntermTyped* TParseContext::handleLengthMethod(TSourceLoc loc, TFunction* funct
error(loc, "method does not accept any arguments", function->getName().c_str(), "");
if (intermNode->getAsTyped() == 0 || ! intermNode->getAsTyped()->getType().isArray())
error(loc, "", function->getName().c_str(), "can only be applied to an array");
else if (intermNode->getAsTyped()->getType().getArraySize() == 0) {
bool implicitlySized = false;
else if (intermNode->getAsTyped()->getType().isImplicitlySizedArray()) {
if (intermNode->getAsSymbolNode() && isIoResizeArray(intermNode->getAsTyped()->getType())) {
// We could be between a layout declaration that gives a built-in io array implicit size and
// a user redeclaration of that array, meaning we have to substitute its implicit size here
......@@ -1741,7 +1743,7 @@ bool TParseContext::constructorError(TSourceLoc loc, TIntermNode* node, TFunctio
type.getQualifier().storage = EvqConst;
if (type.isArray()) {
if (type.getArraySize() == 0) {
if (type.isImplicitlySizedArray()) {
// auto adapt the constructor type to the number of arguments
type.changeArraySize(function.getParamCount());
} else if (type.getArraySize() != function.getParamCount()) {
......@@ -2253,7 +2255,7 @@ void TParseContext::declareArray(TSourceLoc loc, TString& identifier, const TTyp
error(loc, "redeclaring non-array as array", identifier.c_str(), "");
return;
}
if (newType.getArraySize() > 0) {
if (newType.isExplicitlySizedArray()) {
// be more leniant for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size
if (! (isIoResizeArray(type) && newType.getArraySize() == type.getArraySize()))
error(loc, "redeclaration of array with size", identifier.c_str(), "");
......@@ -2273,11 +2275,11 @@ void TParseContext::declareArray(TSourceLoc loc, TString& identifier, const TTyp
checkIoArraysConsistency(loc);
}
void TParseContext::updateMaxArraySize(TSourceLoc loc, TIntermNode *node, int index)
void TParseContext::updateImplicitArraySize(TSourceLoc loc, TIntermNode *node, int index)
{
// maybe there is nothing to do...
TIntermTyped* typedNode = node->getAsTyped();
if (typedNode->getType().getMaxArraySize() > index)
if (typedNode->getType().getImplicitArraySize() > index)
return;
// something to do...
......@@ -2293,7 +2295,7 @@ void TParseContext::updateMaxArraySize(TSourceLoc loc, TIntermNode *node, int in
return;
if (symbol->getAsFunction()) {
error(loc, "array variable name expected", symbolNode->getName().c_str(), "");
error(loc, "array variable name expected", symbol->getName().c_str(), "");
return;
}
......@@ -2309,7 +2311,7 @@ void TParseContext::updateMaxArraySize(TSourceLoc loc, TIntermNode *node, int in
intermediate.addSymbolLinkageNode(linkage, *symbol);
}
symbol->getWritableType().setMaxArraySize(index + 1);
symbol->getWritableType().setImplicitArraySize(index + 1);
}
//
......@@ -2514,7 +2516,7 @@ void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList
error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), "");
if (oldType.isArray() != newType.isArray())
error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), "");
else if (! oldType.sameArrayness(newType) && oldType.getArraySize() > 0)
else if (! oldType.sameArrayness(newType) && oldType.isExplicitlySizedArray())
error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), "");
else if (newType.isArray())
arrayLimitCheck(loc, member->type->getFieldName(), newType.getArraySize());
......@@ -2551,11 +2553,11 @@ void TParseContext::redeclareBuiltinBlock(TSourceLoc loc, TTypeList& newTypeList
if (type.isArray() != (arraySizes != 0))
error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), "");
else if (type.isArray()) {
if (type.getArraySize() > 0 && arraySizes->getSize() == 0)
error(loc, "block already declared with size, can't redeclare as unsized", blockName.c_str(), "");
else if (type.getArraySize() > 0 && type.getArraySize() != arraySizes->getSize())
if (type.isExplicitlySizedArray() && arraySizes->getSize() == 0)
error(loc, "block already declared with size, can't redeclare as implicitly-sized", blockName.c_str(), "");
else if (type.isExplicitlySizedArray() && type.getArraySize() != arraySizes->getSize())
error(loc, "cannot change array size of redeclared block", blockName.c_str(), "");
else if (type.getArraySize() == 0 && arraySizes->getSize() > 0)
else if (type.isImplicitlySizedArray() && arraySizes->getSize() > 0)
type.changeArraySize(arraySizes->getSize());
}
......@@ -3658,8 +3660,8 @@ TIntermNode* TParseContext::executeInitializer(TSourceLoc loc, TString& identifi
}
// Fix arrayness if variable is unsized, getting size from the initializer
if (initializer->getType().isArray() && initializer->getType().getArraySize() > 0 &&
variable->getType().isArray() && variable->getType().getArraySize() == 0)
if (initializer->getType().isArray() && initializer->getType().isExplicitlySizedArray() &&
variable->getType().isImplicitlySizedArray())
variable->getWritableType().changeArraySize(initializer->getType().getArraySize());
// Uniform and global consts require a constant initializer
......
......@@ -176,7 +176,7 @@ public:
void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
TIntermNode* addSwitch(TSourceLoc, TIntermTyped* expression, TIntermAggregate* body);
void updateMaxArraySize(TSourceLoc, TIntermNode*, int index);
void updateImplicitArraySize(TSourceLoc, TIntermNode*, int index);
void setScanContext(TScanContext* c) { scanContext = c; }
TScanContext* getScanContext() const { return scanContext; }
......
......@@ -473,12 +473,7 @@ void TOutputTraverser::visitSymbol(TIntermSymbol* node)
{
OutputTreeText(infoSink, node, depth);
const int maxSize = GlslangMaxTypeLength + GlslangMaxTokenLength;
char buf[maxSize];
snprintf(buf, maxSize, "'%s' (%s)\n",
node->getName().c_str(),
node->getCompleteString().c_str());
infoSink.debug << buf;
infoSink.debug << "'" << node->getName() << "' (" << node->getCompleteString() << ")\n";
if (! node->getConstArray().empty())
OutputConstantUnion(infoSink, node, node->getConstArray(), depth + 1);
......
......@@ -186,7 +186,7 @@ void TIntermediate::mergeBodies(TInfoSink& infoSink, TIntermSequence& globals, c
//
void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& linkerObjects, const TIntermSequence& unitLinkerObjects)
{
// Error check and merge the linker objects (duplicates should not be merged)
// Error check and merge the linker objects (duplicates should not be created)
std::size_t initialNumLinkerObjects = linkerObjects.size();
for (unsigned int unitLinkObj = 0; unitLinkObj < unitLinkerObjects.size(); ++unitLinkObj) {
bool merge = true;
......@@ -615,8 +615,8 @@ int TIntermediate::computeTypeLocationSize(const TType& type)
// consecutive locations..."
if (type.isArray()) {
TType elementType(type, 0);
if (type.getArraySize() == 0) {
// TODO: are there valid cases of having an unsized array with a location? If so, running this code too early.
if (type.isImplicitlySizedArray()) {
// TODO: are there valid cases of having an implicitly-sized array with a location? If so, running this code too early.
return computeTypeLocationSize(elementType);
} else
return type.getArraySize() * computeTypeLocationSize(elementType);
......@@ -703,7 +703,7 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
// level to get this sequence of components."
if (type.isArray()) {
assert(type.getArraySize() > 0);
assert(type.isExplicitlySizedArray());
TType elementType(type, 0);
return type.getArraySize() * computeTypeXfbSize(elementType, containsDouble);
}
......
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