[glslang] Refine implicit array size interfaces. (#3074)

* [glslang] Refine implicit array size interfaces.

Help to check builtin and other variables if across stages.
This commit is contained in:
Chow
2022-12-14 02:20:28 +08:00
committed by GitHub
parent c6b3f279a7
commit f9b760e6c7
14 changed files with 528 additions and 7 deletions

View File

@@ -0,0 +1,115 @@
implicitArraySize.vert
Shader version: 460
0:? Sequence
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:6 Sequence
0:6 move second child to first child ( temp float)
0:6 direct index ( smooth temp float)
0:6 'a' ( smooth out unsized 1-element array of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.100000
0:7 move second child to first child ( temp float)
0:7 direct index ( smooth temp float)
0:7 'c' ( smooth out unsized 6-element array of float)
0:7 Constant:
0:7 5 (const int)
0:7 Constant:
0:7 0.100000
0:? Linker Objects
0:? 'a' ( smooth out unsized 1-element array of float)
0:? 'c' ( smooth out unsized 6-element array of float)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
implicitArraySize.frag
Shader version: 460
0:? Sequence
0:6 Function Definition: main( ( global void)
0:6 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 'b' ( out 5-element array of float)
0:7 Constant:
0:7 0 (const int)
0:7 direct index ( smooth temp float)
0:7 'a' ( smooth in unsized 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:8 move second child to first child ( temp float)
0:8 direct index ( temp float)
0:8 'b' ( out 5-element array of float)
0:8 Constant:
0:8 1 (const int)
0:8 direct index ( smooth temp float)
0:8 'c' ( smooth in 3-element array of float)
0:8 Constant:
0:8 1 (const int)
0:? Linker Objects
0:? 'a' ( smooth in unsized 2-element array of float)
0:? 'c' ( smooth in 3-element array of float)
0:? 'b' ( out 5-element array of float)
Linked vertex stage:
Linked fragment stage:
ERROR: Linking vertex stage: Implicit size of unsized array doesn't match same symbol among multiple shaders.
Shader version: 460
0:? Sequence
0:5 Function Definition: main( ( global void)
0:5 Function Parameters:
0:6 Sequence
0:6 move second child to first child ( temp float)
0:6 direct index ( smooth temp float)
0:6 'a' ( smooth out 1-element array of float)
0:6 Constant:
0:6 0 (const int)
0:6 Constant:
0:6 0.100000
0:7 move second child to first child ( temp float)
0:7 direct index ( smooth temp float)
0:7 'c' ( smooth out 6-element array of float)
0:7 Constant:
0:7 5 (const int)
0:7 Constant:
0:7 0.100000
0:? Linker Objects
0:? 'a' ( smooth out 1-element array of float)
0:? 'c' ( smooth out 6-element array of float)
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
Shader version: 460
0:? Sequence
0:6 Function Definition: main( ( global void)
0:6 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 direct index ( temp float)
0:7 'b' ( out 5-element array of float)
0:7 Constant:
0:7 0 (const int)
0:7 direct index ( smooth temp float)
0:7 'a' ( smooth in 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:8 move second child to first child ( temp float)
0:8 direct index ( temp float)
0:8 'b' ( out 5-element array of float)
0:8 Constant:
0:8 1 (const int)
0:8 direct index ( smooth temp float)
0:8 'c' ( smooth in 3-element array of float)
0:8 Constant:
0:8 1 (const int)
0:? Linker Objects
0:? 'a' ( smooth in 2-element array of float)
0:? 'c' ( smooth in 3-element array of float)
0:? 'b' ( out 5-element array of float)

View File

@@ -0,0 +1,99 @@
implicitArraySize1.geom
Shader version: 460
invocations = -1
max_vertices = 204
input primitive = triangles
output primitive = line_strip
0:? Sequence
0:11 Function Definition: main( ( global void)
0:11 Function Parameters:
0:12 Sequence
0:12 Function Call: f( ( global void)
0:13 move second child to first child ( temp float)
0:13 direct index (layout( stream=0) temp float)
0:13 'o' (layout( stream=0) out 3-element array of float)
0:13 Constant:
0:13 1 (const int)
0:13 direct index ( temp float)
0:13 direct index ( temp 3-element array of float)
0:13 'g' ( in 3-element array of 3-element array of float)
0:13 Constant:
0:13 2 (const int)
0:13 Constant:
0:13 1 (const int)
0:? Linker Objects
0:? 'g' ( in 3-element array of 3-element array of float)
0:? 'o' (layout( stream=0) out 3-element array of float)
implicitArraySize2.geom
Shader version: 460
invocations = -1
max_vertices = -1
input primitive = none
output primitive = none
0:? Sequence
0:6 Function Definition: f( ( global void)
0:6 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 direct index (layout( stream=0) temp float)
0:7 'o' (layout( stream=0) out unsized 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 direct index ( temp float)
0:7 direct index ( temp 3-element array of float)
0:7 'g' ( in unsized 2-element array of 3-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 1 (const int)
0:? Linker Objects
0:? 'g' ( in unsized 2-element array of 3-element array of float)
0:? 'o' (layout( stream=0) out unsized 2-element array of float)
Linked geometry stage:
ERROR: Linking geometry stage: Not all array sizes match across all geometry shaders in the program
Shader version: 460
invocations = 1
max_vertices = 204
input primitive = triangles
output primitive = line_strip
0:? Sequence
0:11 Function Definition: main( ( global void)
0:11 Function Parameters:
0:12 Sequence
0:12 Function Call: f( ( global void)
0:13 move second child to first child ( temp float)
0:13 direct index (layout( stream=0) temp float)
0:13 'o' (layout( stream=0) out 3-element array of float)
0:13 Constant:
0:13 1 (const int)
0:13 direct index ( temp float)
0:13 direct index ( temp 3-element array of float)
0:13 'g' ( in 3-element array of 3-element array of float)
0:13 Constant:
0:13 2 (const int)
0:13 Constant:
0:13 1 (const int)
0:6 Function Definition: f( ( global void)
0:6 Function Parameters:
0:7 Sequence
0:7 move second child to first child ( temp float)
0:7 direct index (layout( stream=0) temp float)
0:7 'o' (layout( stream=0) out 2-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 direct index ( temp float)
0:7 direct index ( temp 3-element array of float)
0:7 'g' ( in 2-element array of 3-element array of float)
0:7 Constant:
0:7 1 (const int)
0:7 Constant:
0:7 1 (const int)
0:? Linker Objects
0:? 'g' ( in 3-element array of 3-element array of float)
0:? 'o' (layout( stream=0) out 3-element array of float)

View File

@@ -0,0 +1,176 @@
implicitArraySizeBuiltin.vert
Shader version: 460
0:? Sequence
0:3 Function Definition: f1(f1; ( global void)
0:3 Function Parameters:
0:3 'x' ( in float)
0:5 Sequence
0:5 move second child to first child ( temp float)
0:5 direct index ( temp float ClipDistance)
0:5 gl_ClipDistance: direct index for structure ( out unsized 7-element array of float ClipDistance)
0:5 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 7-element array of float ClipDistance gl_ClipDistance, out unsized 2-element array of float CullDistance gl_CullDistance})
0:5 Constant:
0:5 2 (const uint)
0:5 Constant:
0:5 6 (const int)
0:5 'x' ( in float)
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float CullDistance)
0:6 gl_CullDistance: direct index for structure ( out unsized 2-element array of float CullDistance)
0:6 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 7-element array of float ClipDistance gl_ClipDistance, out unsized 2-element array of float CullDistance gl_CullDistance})
0:6 Constant:
0:6 3 (const uint)
0:6 Constant:
0:6 1 (const int)
0:6 'x' ( in float)
0:9 Function Definition: main( ( global void)
0:9 Function Parameters:
0:10 Sequence
0:10 Function Call: f1(f1; ( global void)
0:10 Constant:
0:10 0.100000
0:? Linker Objects
0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 7-element array of float ClipDistance gl_ClipDistance, out unsized 2-element array of float CullDistance gl_CullDistance})
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
implicitArraySizeBuiltin.geom
Shader version: 460
invocations = -1
max_vertices = 204
input primitive = triangles
output primitive = line_strip
0:? Sequence
0:6 Function Definition: f2(f1; ( global void)
0:6 Function Parameters:
0:6 'x' ( in float)
0:8 Sequence
0:8 move second child to first child ( temp float)
0:8 direct index (layout( stream=0) temp float ClipDistance)
0:8 gl_ClipDistance: direct index for structure (layout( stream=0) out unsized 7-element array of float ClipDistance)
0:8 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 7-element array of float ClipDistance gl_ClipDistance, layout( stream=0) out unsized 2-element array of float CullDistance gl_CullDistance})
0:8 Constant:
0:8 2 (const uint)
0:8 Constant:
0:8 6 (const int)
0:8 direct index ( temp float ClipDistance)
0:8 gl_ClipDistance: direct index for structure ( in unsized 7-element array of float ClipDistance)
0:8 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 7-element array of float ClipDistance gl_ClipDistance, in unsized 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in unsized 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:8 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 7-element array of float ClipDistance gl_ClipDistance, in unsized 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in unsized 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:8 Constant:
0:8 0 (const int)
0:8 Constant:
0:8 2 (const int)
0:8 Constant:
0:8 6 (const int)
0:10 Function Definition: f3(f1; ( global void)
0:10 Function Parameters:
0:10 'x' ( in float)
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 direct index (layout( stream=0) temp float CullDistance)
0:12 gl_CullDistance: direct index for structure (layout( stream=0) out unsized 2-element array of float CullDistance)
0:12 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 7-element array of float ClipDistance gl_ClipDistance, layout( stream=0) out unsized 2-element array of float CullDistance gl_CullDistance})
0:12 Constant:
0:12 3 (const uint)
0:12 Constant:
0:12 1 (const int)
0:12 direct index ( temp float CullDistance)
0:12 gl_CullDistance: direct index for structure ( in unsized 2-element array of float CullDistance)
0:12 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 7-element array of float ClipDistance gl_ClipDistance, in unsized 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in unsized 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:12 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 7-element array of float ClipDistance gl_ClipDistance, in unsized 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in unsized 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 3 (const int)
0:12 Constant:
0:12 1 (const int)
0:15 Function Definition: main( ( global void)
0:15 Function Parameters:
0:19 Sequence
0:19 Function Call: f3(f1; ( global void)
0:19 Constant:
0:19 0.100000
0:? Linker Objects
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out unsized 7-element array of float ClipDistance gl_ClipDistance, layout( stream=0) out unsized 2-element array of float CullDistance gl_CullDistance})
0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 7-element array of float ClipDistance gl_ClipDistance, in unsized 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in unsized 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
Linked vertex stage:
Linked geometry stage:
Shader version: 460
0:? Sequence
0:3 Function Definition: f1(f1; ( global void)
0:3 Function Parameters:
0:3 'x' ( in float)
0:5 Sequence
0:5 move second child to first child ( temp float)
0:5 direct index ( temp float ClipDistance)
0:5 gl_ClipDistance: direct index for structure ( out 7-element array of float ClipDistance)
0:5 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 7-element array of float ClipDistance gl_ClipDistance, out 2-element array of float CullDistance gl_CullDistance})
0:5 Constant:
0:5 2 (const uint)
0:5 Constant:
0:5 6 (const int)
0:5 'x' ( in float)
0:6 move second child to first child ( temp float)
0:6 direct index ( temp float CullDistance)
0:6 gl_CullDistance: direct index for structure ( out 2-element array of float CullDistance)
0:6 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 7-element array of float ClipDistance gl_ClipDistance, out 2-element array of float CullDistance gl_CullDistance})
0:6 Constant:
0:6 3 (const uint)
0:6 Constant:
0:6 1 (const int)
0:6 'x' ( in float)
0:9 Function Definition: main( ( global void)
0:9 Function Parameters:
0:10 Sequence
0:10 Function Call: f1(f1; ( global void)
0:10 Constant:
0:10 0.100000
0:? Linker Objects
0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 7-element array of float ClipDistance gl_ClipDistance, out 2-element array of float CullDistance gl_CullDistance})
0:? 'gl_VertexID' ( gl_VertexId int VertexId)
0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId)
Shader version: 460
invocations = 1
max_vertices = 204
input primitive = triangles
output primitive = line_strip
0:? Sequence
0:10 Function Definition: f3(f1; ( global void)
0:10 Function Parameters:
0:10 'x' ( in float)
0:12 Sequence
0:12 move second child to first child ( temp float)
0:12 direct index (layout( stream=0) temp float CullDistance)
0:12 gl_CullDistance: direct index for structure (layout( stream=0) out 2-element array of float CullDistance)
0:12 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 7-element array of float ClipDistance gl_ClipDistance, layout( stream=0) out 2-element array of float CullDistance gl_CullDistance})
0:12 Constant:
0:12 3 (const uint)
0:12 Constant:
0:12 1 (const int)
0:12 direct index ( temp float CullDistance)
0:12 gl_CullDistance: direct index for structure ( in 2-element array of float CullDistance)
0:12 direct index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 7-element array of float ClipDistance gl_ClipDistance, in 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:12 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 7-element array of float ClipDistance gl_ClipDistance, in 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})
0:12 Constant:
0:12 0 (const int)
0:12 Constant:
0:12 3 (const int)
0:12 Constant:
0:12 1 (const int)
0:15 Function Definition: main( ( global void)
0:15 Function Parameters:
0:19 Sequence
0:19 Function Call: f3(f1; ( global void)
0:19 Constant:
0:19 0.100000
0:? Linker Objects
0:? 'anon@0' (layout( stream=0) out block{layout( stream=0) gl_Position 4-component vector of float Position gl_Position, layout( stream=0) gl_PointSize float PointSize gl_PointSize, layout( stream=0) out 7-element array of float ClipDistance gl_ClipDistance, layout( stream=0) out 2-element array of float CullDistance gl_CullDistance})
0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 7-element array of float ClipDistance gl_ClipDistance, in 2-element array of float CullDistance gl_CullDistance, in 4-component vector of float SecondaryPositionNV gl_SecondaryPositionNV, in 1-element array of 4-component vector of float PositionPerViewNV gl_PositionPerViewNV})