From 5597c8d7cfc616f9a0c4dedba2ea9b57db94658c Mon Sep 17 00:00:00 2001 From: Kevin McCullough Date: Tue, 6 Jul 2021 11:50:48 -0700 Subject: [PATCH 01/64] Fix isIoResizeArray() tessellation stage handling --- Test/baseResults/link.tesselation.tese.out | 254 ++++++++++++++++++++ Test/baseResults/link.tesselation.vert.out | 94 ++++++++ Test/link.tesselation.frag | 15 ++ Test/link.tesselation.tesc | 21 ++ Test/link.tesselation.tese | 26 ++ Test/link.tesselation.vert | 16 ++ glslang/MachineIndependent/linkValidate.cpp | 3 +- gtests/Link.FromFile.cpp | 2 + 8 files changed, 430 insertions(+), 1 deletion(-) create mode 100644 Test/baseResults/link.tesselation.tese.out create mode 100644 Test/baseResults/link.tesselation.vert.out create mode 100644 Test/link.tesselation.frag create mode 100644 Test/link.tesselation.tesc create mode 100644 Test/link.tesselation.tese create mode 100644 Test/link.tesselation.vert diff --git a/Test/baseResults/link.tesselation.tese.out b/Test/baseResults/link.tesselation.tese.out new file mode 100644 index 00000000..056459f5 --- /dev/null +++ b/Test/baseResults/link.tesselation.tese.out @@ -0,0 +1,254 @@ +link.tesselation.tese +Shader version: 440 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'u' ( temp float) +0:17 direct index ( temp float) +0:17 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'v' ( temp float) +0:18 direct index ( temp float) +0:18 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'w' ( temp float) +0:19 direct index ( temp float) +0:19 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'newUv' ( temp 2-component vector of float) +0:21 Construct vec2 ( temp 2-component vector of float) +0:21 add ( temp 2-component vector of float) +0:21 add ( temp 2-component vector of float) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'u' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'v' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'w' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 0 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 texCoord: direct index for structure ( out 2-component vector of float) +0:22 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:22 Constant: +0:22 0 (const int) +0:22 'newUv' ( temp 2-component vector of float) +0:23 move second child to first child ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:23 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 0 (const uint) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_PatchVerticesIn' ( in int PatchVertices) +0:23 Constant: +0:23 0 (const int) +0:? Linker Objects +0:? 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:? 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) + +link.tesselation.tesc +Shader version: 440 +vertices = 3 +0:? Sequence +0:14 Function Definition: main( ( global void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of float) +0:16 texCoord: direct index for structure ( out 2-component vector of float) +0:16 indirect index (layout( location=0) temp block{ out 2-component vector of float texCoord}) +0:16 'OUT' (layout( location=0) out 3-element array of block{ out 2-component vector of float texCoord}) +0:16 'gl_InvocationID' ( in int InvocationID) +0:16 Constant: +0:16 0 (const int) +0:16 texCoord: direct index for structure ( in 2-component vector of float) +0:16 indirect index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:16 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:16 'gl_InvocationID' ( in int InvocationID) +0:16 Constant: +0:16 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'tessLevel' ( temp float) +0:18 Constant: +0:18 10.000000 +0:19 move second child to first child ( temp float) +0:19 indirect index ( patch temp float TessLevelOuter) +0:19 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:19 'gl_InvocationID' ( in int InvocationID) +0:19 'tessLevel' ( temp float) +0:20 move second child to first child ( temp float) +0:20 direct index ( patch temp float TessLevelInner) +0:20 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:20 Constant: +0:20 0 (const int) +0:20 'tessLevel' ( temp float) +0:? Linker Objects +0:? 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:? 'OUT' (layout( location=0) out 3-element array of block{ out 2-component vector of float texCoord}) + + +Linked tessellation control stage: + + +Linked tessellation evaluation stage: + + +Shader version: 440 +vertices = 3 +0:? Sequence +0:14 Function Definition: main( ( global void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp 2-component vector of float) +0:16 texCoord: direct index for structure ( out 2-component vector of float) +0:16 indirect index (layout( location=0) temp block{ out 2-component vector of float texCoord}) +0:16 'OUT' (layout( location=0) out 3-element array of block{ out 2-component vector of float texCoord}) +0:16 'gl_InvocationID' ( in int InvocationID) +0:16 Constant: +0:16 0 (const int) +0:16 texCoord: direct index for structure ( in 2-component vector of float) +0:16 indirect index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:16 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:16 'gl_InvocationID' ( in int InvocationID) +0:16 Constant: +0:16 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'tessLevel' ( temp float) +0:18 Constant: +0:18 10.000000 +0:19 move second child to first child ( temp float) +0:19 indirect index ( patch temp float TessLevelOuter) +0:19 'gl_TessLevelOuter' ( patch out 4-element array of float TessLevelOuter) +0:19 'gl_InvocationID' ( in int InvocationID) +0:19 'tessLevel' ( temp float) +0:20 move second child to first child ( temp float) +0:20 direct index ( patch temp float TessLevelInner) +0:20 'gl_TessLevelInner' ( patch out 2-element array of float TessLevelInner) +0:20 Constant: +0:20 0 (const int) +0:20 'tessLevel' ( temp float) +0:? Linker Objects +0:? 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:? 'OUT' (layout( location=0) out 3-element array of block{ out 2-component vector of float texCoord}) +Shader version: 440 +input primitive = triangles +vertex spacing = fractional_odd_spacing +triangle order = cw +0:? Sequence +0:15 Function Definition: main( ( global void) +0:15 Function Parameters: +0:17 Sequence +0:17 Sequence +0:17 move second child to first child ( temp float) +0:17 'u' ( temp float) +0:17 direct index ( temp float) +0:17 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:17 Constant: +0:17 0 (const int) +0:18 Sequence +0:18 move second child to first child ( temp float) +0:18 'v' ( temp float) +0:18 direct index ( temp float) +0:18 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:18 Constant: +0:18 1 (const int) +0:19 Sequence +0:19 move second child to first child ( temp float) +0:19 'w' ( temp float) +0:19 direct index ( temp float) +0:19 'gl_TessCoord' ( in 3-component vector of float TessCoord) +0:19 Constant: +0:19 2 (const int) +0:21 Sequence +0:21 move second child to first child ( temp 2-component vector of float) +0:21 'newUv' ( temp 2-component vector of float) +0:21 Construct vec2 ( temp 2-component vector of float) +0:21 add ( temp 2-component vector of float) +0:21 add ( temp 2-component vector of float) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'u' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 0 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'v' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 1 (const int) +0:21 Constant: +0:21 0 (const int) +0:21 vector-scale ( temp 2-component vector of float) +0:21 'w' ( temp float) +0:21 texCoord: direct index for structure ( in 2-component vector of float) +0:21 direct index (layout( location=0) temp block{ in 2-component vector of float texCoord}) +0:21 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:21 Constant: +0:21 2 (const int) +0:21 Constant: +0:21 0 (const int) +0:22 move second child to first child ( temp 2-component vector of float) +0:22 texCoord: direct index for structure ( out 2-component vector of float) +0:22 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:22 Constant: +0:22 0 (const int) +0:22 'newUv' ( temp 2-component vector of float) +0:23 move second child to first child ( temp 4-component vector of float) +0:23 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:23 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:23 Constant: +0:23 0 (const uint) +0:23 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:23 indirect index ( temp block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' ( in 32-element array of block{ in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_PatchVerticesIn' ( in int PatchVertices) +0:23 Constant: +0:23 0 (const int) +0:? Linker Objects +0:? 'IN' (layout( location=0) in 32-element array of block{ in 2-component vector of float texCoord}) +0:? 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) + diff --git a/Test/baseResults/link.tesselation.vert.out b/Test/baseResults/link.tesselation.vert.out new file mode 100644 index 00000000..d56c3402 --- /dev/null +++ b/Test/baseResults/link.tesselation.vert.out @@ -0,0 +1,94 @@ +link.tesselation.vert +Shader version: 440 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 'i_Pos' (layout( location=0) in 4-component vector of float) +0:14 move second child to first child ( temp 2-component vector of float) +0:14 texCoord: direct index for structure ( out 2-component vector of float) +0:14 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:14 Constant: +0:14 0 (const int) +0:14 'i_Tex' (layout( location=1) in 2-component vector of float) +0:? Linker Objects +0:? 'i_Pos' (layout( location=0) in 4-component vector of float) +0:? 'i_Tex' (layout( location=1) in 2-component vector of float) +0:? 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.tesselation.frag +Shader version: 440 +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'oColor' (layout( location=0) out 4-component vector of float) +0:14 texture ( global 4-component vector of float) +0:14 'mytex' (layout( binding=0) uniform sampler2D) +0:14 texCoord: direct index for structure ( in 2-component vector of float) +0:14 'IN' (layout( location=0) in block{ in 2-component vector of float texCoord}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'IN' (layout( location=0) in block{ in 2-component vector of float texCoord}) +0:? 'oColor' (layout( location=0) out 4-component vector of float) +0:? 'mytex' (layout( binding=0) uniform sampler2D) + + +Linked vertex stage: + + +Linked fragment stage: + + +Shader version: 440 +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 'i_Pos' (layout( location=0) in 4-component vector of float) +0:14 move second child to first child ( temp 2-component vector of float) +0:14 texCoord: direct index for structure ( out 2-component vector of float) +0:14 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:14 Constant: +0:14 0 (const int) +0:14 'i_Tex' (layout( location=1) in 2-component vector of float) +0:? Linker Objects +0:? 'i_Pos' (layout( location=0) in 4-component vector of float) +0:? 'i_Tex' (layout( location=1) in 2-component vector of float) +0:? 'OUT' (layout( location=0) out block{ out 2-component vector of float texCoord}) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 440 +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'oColor' (layout( location=0) out 4-component vector of float) +0:14 texture ( global 4-component vector of float) +0:14 'mytex' (layout( binding=0) uniform sampler2D) +0:14 texCoord: direct index for structure ( in 2-component vector of float) +0:14 'IN' (layout( location=0) in block{ in 2-component vector of float texCoord}) +0:14 Constant: +0:14 0 (const int) +0:? Linker Objects +0:? 'IN' (layout( location=0) in block{ in 2-component vector of float texCoord}) +0:? 'oColor' (layout( location=0) out 4-component vector of float) +0:? 'mytex' (layout( binding=0) uniform sampler2D) + diff --git a/Test/link.tesselation.frag b/Test/link.tesselation.frag new file mode 100644 index 00000000..420384db --- /dev/null +++ b/Test/link.tesselation.frag @@ -0,0 +1,15 @@ +#version 440 + +layout(location = 0) in Primitive +{ + vec2 texCoord; +} IN; + +layout(location = 0) out vec4 oColor; + +layout(binding = 0) uniform sampler2D mytex; + +void main() +{ + oColor = texture(mytex, IN.texCoord); +} diff --git a/Test/link.tesselation.tesc b/Test/link.tesselation.tesc new file mode 100644 index 00000000..c47d2ad6 --- /dev/null +++ b/Test/link.tesselation.tesc @@ -0,0 +1,21 @@ +#version 440 + +layout(location = 0) in Primitive +{ + vec2 texCoord; +} IN[]; + +layout(location = 0) out Primitive +{ + vec2 texCoord; +} OUT[]; + +layout(vertices = 3) out; +void main() +{ + OUT[gl_InvocationID].texCoord = IN[gl_InvocationID].texCoord; + + float tessLevel = 10.0; + gl_TessLevelOuter[gl_InvocationID] = tessLevel; + gl_TessLevelInner[0] = tessLevel; +} diff --git a/Test/link.tesselation.tese b/Test/link.tesselation.tese new file mode 100644 index 00000000..e1112920 --- /dev/null +++ b/Test/link.tesselation.tese @@ -0,0 +1,26 @@ +#version 440 + +layout(location = 0) in Primitive +{ + vec2 texCoord; +} IN[]; + +layout(location = 0) out Primitive +{ + vec2 texCoord; +} OUT; + +layout(triangles, fractional_odd_spacing) in; +layout(cw) in; +void main() +{ + float u = gl_TessCoord.x; + float v = gl_TessCoord.y; + float w = gl_TessCoord.z; + + vec2 newUv = vec2( u * IN[0].texCoord + v * IN[1].texCoord + w * IN[2].texCoord); + OUT.texCoord = newUv; + gl_Position = gl_in[gl_PatchVerticesIn].gl_Position; +} + + diff --git a/Test/link.tesselation.vert b/Test/link.tesselation.vert new file mode 100644 index 00000000..daf35372 --- /dev/null +++ b/Test/link.tesselation.vert @@ -0,0 +1,16 @@ +#version 440 + +layout(location = 0) in vec4 i_Pos; +layout(location = 1) in vec2 i_Tex; + +layout(location = 0) out Primitive +{ + vec2 texCoord; +} OUT; + +void main() +{ + gl_Position = i_Pos; + OUT.texCoord = i_Tex; +} + diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 42b416db..cec94fc8 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -2158,8 +2158,9 @@ int TIntermediate::computeBufferReferenceTypeSize(const TType& type) bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) { return type.isArray() && ((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) || - (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && + (language == EShLangTessControl && (type.getQualifier().storage == EvqVaryingIn || type.getQualifier().storage == EvqVaryingOut) && ! type.getQualifier().patch) || + (language == EShLangTessEvaluation && type.getQualifier().storage == EvqVaryingIn) || (language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn && type.getQualifier().pervertexNV) || (language == EShLangMeshNV && type.getQualifier().storage == EvqVaryingOut && diff --git a/gtests/Link.FromFile.cpp b/gtests/Link.FromFile.cpp index 29590c02..a83d49d9 100644 --- a/gtests/Link.FromFile.cpp +++ b/gtests/Link.FromFile.cpp @@ -106,6 +106,8 @@ INSTANTIATE_TEST_SUITE_P( {"link.multiAnonBlocksValid.0.0.vert", "link.multiAnonBlocksValid.0.1.vert"}, {"link.multiBlocksInvalid.0.0.vert", "link.multiBlocksInvalid.0.1.vert"}, {"link.multiBlocksValid.1.0.vert", "link.multiBlocksValid.1.1.vert"}, + {"link.tesselation.vert", "link.tesselation.frag"}, + {"link.tesselation.tese", "link.tesselation.tesc"}, })) ); // clang-format on From 22d19b963c89b109f2d4d5b67bf762b328f7a3af Mon Sep 17 00:00:00 2001 From: "andrei.malashkin" Date: Mon, 12 Jul 2021 20:08:15 +0400 Subject: [PATCH 02/64] add possibility to not override runtime of MSVC --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0600516e..6b8ebe06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,8 @@ endif(ENABLE_GLSLANG_WEBMIN) if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") - if(MSVC) + option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) + if(MSVC and OVERRIDE_MSVCCRT) include(ChooseMSVCCRT.cmake) endif(MSVC) add_definitions(-DGLSLANG_OSINCLUDE_WIN32) From fda1c58350273dd9c1d27430c10538dd0c97de87 Mon Sep 17 00:00:00 2001 From: "andrei.malashkin" Date: Wed, 14 Jul 2021 09:33:02 +0400 Subject: [PATCH 03/64] make AND to upper case --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b8ebe06..5fb6c958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,7 +139,7 @@ endif(ENABLE_GLSLANG_WEBMIN) if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) - if(MSVC and OVERRIDE_MSVCCRT) + if(MSVC AND OVERRIDE_MSVCCRT) include(ChooseMSVCCRT.cmake) endif(MSVC) add_definitions(-DGLSLANG_OSINCLUDE_WIN32) From 0784c41300d1c66196788dbc0f216115304c68b5 Mon Sep 17 00:00:00 2001 From: "andrei.malashkin" Date: Fri, 30 Jul 2021 09:12:45 +0200 Subject: [PATCH 04/64] correct ident --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fb6c958..2d290622 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,7 @@ endif(ENABLE_GLSLANG_WEBMIN) if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") - option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) + option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) if(MSVC AND OVERRIDE_MSVCCRT) include(ChooseMSVCCRT.cmake) endif(MSVC) From 27384e04f60add37a6da961d05caf4b6b7ec6b2a Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Fri, 30 Jul 2021 11:11:16 -0600 Subject: [PATCH 05/64] Allow layout(std430) uniform with GL_EXT_scalar_block_layout --- Test/spv.scalarlayout.frag | 2 ++ glslang/MachineIndependent/ParseHelper.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Test/spv.scalarlayout.frag b/Test/spv.scalarlayout.frag index c7ecf502..e0e1b18d 100644 --- a/Test/spv.scalarlayout.frag +++ b/Test/spv.scalarlayout.frag @@ -27,6 +27,8 @@ layout(column_major, scalar) uniform B1 S i[2]; // offset = 160 (aligned to multiple of 8) stride = 48 }; +layout (std430) uniform; + void main() { } diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index d2ad355f..d84bc8da 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -3675,7 +3675,7 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q if (blockName == nullptr && qualifier.layoutPacking == ElpStd430) { - error(loc, "it is invalid to declare std430 qualifier on uniform", "", ""); + requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "default std430 layout for uniform"); } break; default: From 715f5c6cf11d88859699481de265784da0778e45 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 29 Jul 2021 14:58:10 -0600 Subject: [PATCH 06/64] Add support for pragma STDGL invariant(all) Fixes #2689 --- Test/baseResults/spv.invariantAll.vert.out | 55 +++++++++++++++++++ Test/spv.invariantAll.vert | 10 ++++ glslang/MachineIndependent/ParseHelper.cpp | 39 ++++++++++++- glslang/MachineIndependent/ParseHelper.h | 2 + glslang/MachineIndependent/linkValidate.cpp | 1 + .../MachineIndependent/localintermediate.h | 4 ++ gtests/Spv.FromFile.cpp | 1 + 7 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 Test/baseResults/spv.invariantAll.vert.out create mode 100644 Test/spv.invariantAll.vert diff --git a/Test/baseResults/spv.invariantAll.vert.out b/Test/baseResults/spv.invariantAll.vert.out new file mode 100644 index 00000000..ec5ad30a --- /dev/null +++ b/Test/baseResults/spv.invariantAll.vert.out @@ -0,0 +1,55 @@ +spv.invariantAll.vert +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 13 17 + Source GLSL 450 + Name 4 "main" + Name 11 "gl_PerVertex" + MemberName 11(gl_PerVertex) 0 "gl_Position" + MemberName 11(gl_PerVertex) 1 "gl_PointSize" + MemberName 11(gl_PerVertex) 2 "gl_ClipDistance" + MemberName 11(gl_PerVertex) 3 "gl_CullDistance" + Name 13 "" + Name 17 "v" + MemberDecorate 11(gl_PerVertex) 0 Invariant + MemberDecorate 11(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 11(gl_PerVertex) 1 Invariant + MemberDecorate 11(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 11(gl_PerVertex) 2 Invariant + MemberDecorate 11(gl_PerVertex) 2 BuiltIn ClipDistance + MemberDecorate 11(gl_PerVertex) 3 Invariant + MemberDecorate 11(gl_PerVertex) 3 BuiltIn CullDistance + Decorate 11(gl_PerVertex) Block + Decorate 17(v) Location 0 + Decorate 17(v) Invariant + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeInt 32 0 + 9: 8(int) Constant 1 + 10: TypeArray 6(float) 9 +11(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 10 10 + 12: TypePointer Output 11(gl_PerVertex) + 13: 12(ptr) Variable Output + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Output 6(float) + 17(v): 16(ptr) Variable Output + 20: 6(float) Constant 0 + 21: 6(float) Constant 1065353216 + 23: TypePointer Output 7(fvec4) + 4(main): 2 Function None 3 + 5: Label + 18: 6(float) Load 17(v) + 19: 6(float) Load 17(v) + 22: 7(fvec4) CompositeConstruct 18 19 20 21 + 24: 23(ptr) AccessChain 13 15 + Store 24 22 + Return + FunctionEnd diff --git a/Test/spv.invariantAll.vert b/Test/spv.invariantAll.vert new file mode 100644 index 00000000..e094aa07 --- /dev/null +++ b/Test/spv.invariantAll.vert @@ -0,0 +1,10 @@ +#version 450 core +#pragma STDGL invariant(all) + +layout(location=0) out highp float v; + +void main() +{ + gl_Position = vec4(v, v, 0, 1); +} + diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index c2b9edcf..f1c7d848 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -327,6 +327,16 @@ void TParseContext::setAtomicCounterBlockDefaults(TType& block) const block.getQualifier().layoutMatrix = ElmRowMajor; } +void TParseContext::setInvariant(const TSourceLoc& loc, const char* builtin) { + TSymbol* symbol = symbolTable.find(builtin); + if (symbol && symbol->getType().getQualifier().isPipeOutput()) { + if (intermediate.inIoAccessed(builtin)) + warn(loc, "changing qualification after use", "invariant", builtin); + TSymbol* csymbol = symbolTable.copyUp(symbol); + csymbol->getWritableType().getQualifier().invariant = true; + } +} + void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& tokens) { #ifndef GLSLANG_WEB @@ -404,8 +414,33 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& intermediate.setUseVariablePointers(); } else if (tokens[0].compare("once") == 0) { warn(loc, "not implemented", "#pragma once", ""); - } else if (tokens[0].compare("glslang_binary_double_output") == 0) + } else if (tokens[0].compare("glslang_binary_double_output") == 0) { intermediate.setBinaryDoubleOutput(); + } else if (spvVersion.spv > 0 && tokens[0].compare("STDGL") == 0 && + tokens[1].compare("invariant") == 0 && tokens[3].compare("all") == 0) { + intermediate.setInvariantAll(); + // Set all builtin out variables invariant if declared + setInvariant(loc, "gl_Position"); + setInvariant(loc, "gl_PointSize"); + setInvariant(loc, "gl_ClipDistance"); + setInvariant(loc, "gl_CullDistance"); + setInvariant(loc, "gl_TessLevelOuter"); + setInvariant(loc, "gl_TessLevelInner"); + setInvariant(loc, "gl_PrimitiveID"); + setInvariant(loc, "gl_Layer"); + setInvariant(loc, "gl_ViewportIndex"); + setInvariant(loc, "gl_FragDepth"); + setInvariant(loc, "gl_SampleMask"); + setInvariant(loc, "gl_ClipVertex"); + setInvariant(loc, "gl_FrontColor"); + setInvariant(loc, "gl_BackColor"); + setInvariant(loc, "gl_FrontSecondaryColor"); + setInvariant(loc, "gl_BackSecondaryColor"); + setInvariant(loc, "gl_TexCoord"); + setInvariant(loc, "gl_FogFragCoord"); + setInvariant(loc, "gl_FragColor"); + setInvariant(loc, "gl_FragData"); + } #endif } @@ -3651,6 +3686,8 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs"); profileRequires(loc, EEsProfile, 300, nullptr, "out for stage outputs"); qualifier.storage = EvqVaryingOut; + if (intermediate.isInvariantAll()) + qualifier.invariant = true; break; case EvqInOut: qualifier.storage = EvqVaryingIn; diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index c9e63342..de448846 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -241,6 +241,7 @@ protected: // override this to set the language-specific name virtual const char* getAtomicCounterBlockName() const { return ""; } virtual void setAtomicCounterBlockDefaults(TType&) const {} + virtual void setInvariant(const TSourceLoc& loc, const char* builtin) {} virtual void finalizeAtomicCounterBlockLayout(TVariable&) {} bool isAtomicCounterBlock(const TSymbol& symbol) { const TVariable* var = symbol.getAsVariable(); @@ -511,6 +512,7 @@ protected: virtual const char* getAtomicCounterBlockName() const override; virtual void finalizeAtomicCounterBlockLayout(TVariable&) override; virtual void setAtomicCounterBlockDefaults(TType& block) const override; + virtual void setInvariant(const TSourceLoc& loc, const char* builtin) override; public: // diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 42b416db..9656e2e7 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -316,6 +316,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(useUnknownFormat); MERGE_TRUE(hlslOffsets); MERGE_TRUE(useStorageBuffer); + MERGE_TRUE(invariantAll); MERGE_TRUE(hlslIoMapping); // TODO: sourceFile diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 5cc9930a..9e8af389 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -291,6 +291,7 @@ public: numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invertY(false), useStorageBuffer(false), + invariantAll(false), nanMinMaxClamp(false), depthReplacing(false), uniqueId(0), @@ -560,6 +561,8 @@ public: void setUseStorageBuffer() { useStorageBuffer = true; } bool usingStorageBuffer() const { return useStorageBuffer; } + void setInvariantAll() { invariantAll = true; } + bool isInvariantAll() const { return invariantAll; } void setDepthReplacing() { depthReplacing = true; } bool isDepthReplacing() const { return depthReplacing; } bool setLocalSize(int dim, int size) @@ -1063,6 +1066,7 @@ protected: bool recursive; bool invertY; bool useStorageBuffer; + bool invariantAll; bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN bool depthReplacing; int localSize[3]; diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index 20683a68..3746557f 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -363,6 +363,7 @@ INSTANTIATE_TEST_SUITE_P( "spv.intrinsicsSpirvLiteral.vert", "spv.intrinsicsSpirvStorageClass.rchit", "spv.intrinsicsSpirvType.rgen", + "spv.invariantAll.vert", "spv.layer.tese", "spv.layoutNested.vert", "spv.length.frag", From bf567735170ff148cd292d3a58527110437a5063 Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Thu, 8 Jul 2021 11:12:05 +0800 Subject: [PATCH 07/64] Support Extension GL_ARB_shader_atomic_counter_ops and relative intrisic functions. refs: https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_shader_atomic_counter_ops.txt Signed-off-by: ZhiqianXia --- Test/atomicCounterARBOps.vert | 28 +++ Test/baseResults/atomicCounterARBOps.vert.out | 201 ++++++++++++++++++ glslang/MachineIndependent/Initialize.cpp | 41 ++++ glslang/MachineIndependent/Versions.cpp | 1 + glslang/MachineIndependent/Versions.h | 1 + gtests/AST.FromFile.cpp | 1 + 6 files changed, 273 insertions(+) create mode 100644 Test/atomicCounterARBOps.vert create mode 100644 Test/baseResults/atomicCounterARBOps.vert.out diff --git a/Test/atomicCounterARBOps.vert b/Test/atomicCounterARBOps.vert new file mode 100644 index 00000000..5eb66371 --- /dev/null +++ b/Test/atomicCounterARBOps.vert @@ -0,0 +1,28 @@ +#version 450 core +#extension GL_ARB_shader_atomic_counters: enable +#extension GL_ARB_shader_atomic_counter_ops:enable + +layout(binding = 0) uniform atomic_uint counter; + +out highp vec4 vsColor; + +void main(){ + vec4 outColor = vec4(1.0); + uint ret; + + ret = atomicCounterAddARB(counter, 4u); + ret = atomicCounterSubtractARB(counter, 4u); + ret = atomicCounterMinARB(counter, 4u); + ret = atomicCounterMaxARB(counter, 4u); + ret = atomicCounterAndARB(counter, 4u); + ret = atomicCounterOrARB(counter, 4u); + ret = atomicCounterXorARB(counter, 4u); + ret = atomicCounterExchangeARB(counter, 4u); + ret = atomicCounterCompSwapARB(counter, 4u, 4u); + + uint after = atomicCounter(counter); + if (after == ret) + outColor = vec4(0.0); + + vsColor = outColor; +} \ No newline at end of file diff --git a/Test/baseResults/atomicCounterARBOps.vert.out b/Test/baseResults/atomicCounterARBOps.vert.out new file mode 100644 index 00000000..ebb4411f --- /dev/null +++ b/Test/baseResults/atomicCounterARBOps.vert.out @@ -0,0 +1,201 @@ +atomicCounterARBOps.vert +Shader version: 450 +Requested GL_ARB_shader_atomic_counter_ops +Requested GL_ARB_shader_atomic_counters +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'outColor' ( temp 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:13 move second child to first child ( temp uint) +0:13 'ret' ( temp uint) +0:13 AtomicCounterAdd ( global uint) +0:13 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:13 Constant: +0:13 4 (const uint) +0:14 move second child to first child ( temp uint) +0:14 'ret' ( temp uint) +0:14 AtomicCounterSubtract ( global uint) +0:14 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:14 Constant: +0:14 4 (const uint) +0:15 move second child to first child ( temp uint) +0:15 'ret' ( temp uint) +0:15 AtomicCounterMin ( global uint) +0:15 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:15 Constant: +0:15 4 (const uint) +0:16 move second child to first child ( temp uint) +0:16 'ret' ( temp uint) +0:16 AtomicCounterMax ( global uint) +0:16 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:16 Constant: +0:16 4 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'ret' ( temp uint) +0:17 AtomicCounterAnd ( global uint) +0:17 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:17 Constant: +0:17 4 (const uint) +0:18 move second child to first child ( temp uint) +0:18 'ret' ( temp uint) +0:18 AtomicCounterOr ( global uint) +0:18 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:18 Constant: +0:18 4 (const uint) +0:19 move second child to first child ( temp uint) +0:19 'ret' ( temp uint) +0:19 AtomicCounterXor ( global uint) +0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:19 Constant: +0:19 4 (const uint) +0:20 move second child to first child ( temp uint) +0:20 'ret' ( temp uint) +0:20 AtomicCounterExchange ( global uint) +0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:20 Constant: +0:20 4 (const uint) +0:21 move second child to first child ( temp uint) +0:21 'ret' ( temp uint) +0:21 AtomicCounterCompSwap ( global uint) +0:21 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:21 Constant: +0:21 4 (const uint) +0:21 Constant: +0:21 4 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp uint) +0:23 'after' ( temp uint) +0:23 AtomicCounter ( global uint) +0:23 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:24 Test condition and select ( temp void) +0:24 Condition +0:24 Compare Equal ( temp bool) +0:24 'after' ( temp uint) +0:24 'ret' ( temp uint) +0:24 true case +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'outColor' ( temp 4-component vector of float) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'vsColor' ( smooth out 4-component vector of float) +0:27 'outColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'vsColor' ( smooth out 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +Requested GL_ARB_shader_atomic_counter_ops +Requested GL_ARB_shader_atomic_counters +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:10 Sequence +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'outColor' ( temp 4-component vector of float) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:13 move second child to first child ( temp uint) +0:13 'ret' ( temp uint) +0:13 AtomicCounterAdd ( global uint) +0:13 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:13 Constant: +0:13 4 (const uint) +0:14 move second child to first child ( temp uint) +0:14 'ret' ( temp uint) +0:14 AtomicCounterSubtract ( global uint) +0:14 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:14 Constant: +0:14 4 (const uint) +0:15 move second child to first child ( temp uint) +0:15 'ret' ( temp uint) +0:15 AtomicCounterMin ( global uint) +0:15 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:15 Constant: +0:15 4 (const uint) +0:16 move second child to first child ( temp uint) +0:16 'ret' ( temp uint) +0:16 AtomicCounterMax ( global uint) +0:16 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:16 Constant: +0:16 4 (const uint) +0:17 move second child to first child ( temp uint) +0:17 'ret' ( temp uint) +0:17 AtomicCounterAnd ( global uint) +0:17 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:17 Constant: +0:17 4 (const uint) +0:18 move second child to first child ( temp uint) +0:18 'ret' ( temp uint) +0:18 AtomicCounterOr ( global uint) +0:18 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:18 Constant: +0:18 4 (const uint) +0:19 move second child to first child ( temp uint) +0:19 'ret' ( temp uint) +0:19 AtomicCounterXor ( global uint) +0:19 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:19 Constant: +0:19 4 (const uint) +0:20 move second child to first child ( temp uint) +0:20 'ret' ( temp uint) +0:20 AtomicCounterExchange ( global uint) +0:20 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:20 Constant: +0:20 4 (const uint) +0:21 move second child to first child ( temp uint) +0:21 'ret' ( temp uint) +0:21 AtomicCounterCompSwap ( global uint) +0:21 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:21 Constant: +0:21 4 (const uint) +0:21 Constant: +0:21 4 (const uint) +0:23 Sequence +0:23 move second child to first child ( temp uint) +0:23 'after' ( temp uint) +0:23 AtomicCounter ( global uint) +0:23 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:24 Test condition and select ( temp void) +0:24 Condition +0:24 Compare Equal ( temp bool) +0:24 'after' ( temp uint) +0:24 'ret' ( temp uint) +0:24 true case +0:25 move second child to first child ( temp 4-component vector of float) +0:25 'outColor' ( temp 4-component vector of float) +0:25 Constant: +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:25 0.000000 +0:27 move second child to first child ( temp 4-component vector of float) +0:27 'vsColor' ( smooth out 4-component vector of float) +0:27 'outColor' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'counter' (layout( binding=0 offset=0) uniform atomic_uint) +0:? 'vsColor' ( smooth out 4-component vector of float) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index a79925d3..d461ad33 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1864,6 +1864,22 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if (profile != EEsProfile && version == 450) { + commonBuiltins.append( + "uint atomicCounterAddARB(atomic_uint, uint);" + "uint atomicCounterSubtractARB(atomic_uint, uint);" + "uint atomicCounterMinARB(atomic_uint, uint);" + "uint atomicCounterMaxARB(atomic_uint, uint);" + "uint atomicCounterAndARB(atomic_uint, uint);" + "uint atomicCounterOrARB(atomic_uint, uint);" + "uint atomicCounterXorARB(atomic_uint, uint);" + "uint atomicCounterExchangeARB(atomic_uint, uint);" + "uint atomicCounterCompSwapARB(atomic_uint, uint, uint);" + + "\n"); + } + + if (profile != EEsProfile && version >= 460) { commonBuiltins.append( "uint atomicCounterAdd(atomic_uint, uint);" @@ -8261,6 +8277,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("atomicCounter" , 1, &E_GL_ARB_shader_atomic_counters); } + // E_GL_ARB_shader_atomic_counter_ops + if (profile != EEsProfile && version == 450) { + symbolTable.setFunctionExtensions("atomicCounterAddARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterSubtractARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterMinARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterMaxARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterAndARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterOrARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterXorARB" , 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterExchangeARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + symbolTable.setFunctionExtensions("atomicCounterCompSwapARB", 1, &E_GL_ARB_shader_atomic_counter_ops); + } + // E_GL_ARB_derivative_control if (profile != EEsProfile && version < 450) { symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_ARB_derivative_control); @@ -9261,6 +9290,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("clockRealtimeEXT", EOpReadClockDeviceKHR); symbolTable.relateToOperator("clockRealtime2x32EXT", EOpReadClockDeviceKHR); + if (profile != EEsProfile && version == 450) { + symbolTable.relateToOperator("atomicCounterAddARB", EOpAtomicCounterAdd); + symbolTable.relateToOperator("atomicCounterSubtractARB", EOpAtomicCounterSubtract); + symbolTable.relateToOperator("atomicCounterMinARB", EOpAtomicCounterMin); + symbolTable.relateToOperator("atomicCounterMaxARB", EOpAtomicCounterMax); + symbolTable.relateToOperator("atomicCounterAndARB", EOpAtomicCounterAnd); + symbolTable.relateToOperator("atomicCounterOrARB", EOpAtomicCounterOr); + symbolTable.relateToOperator("atomicCounterXorARB", EOpAtomicCounterXor); + symbolTable.relateToOperator("atomicCounterExchangeARB", EOpAtomicCounterExchange); + symbolTable.relateToOperator("atomicCounterCompSwapARB", EOpAtomicCounterCompSwap); + } + if (profile != EEsProfile && version >= 460) { symbolTable.relateToOperator("atomicCounterAdd", EOpAtomicCounterAdd); symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicCounterSubtract); diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 2698dd91..b33e9808 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -198,6 +198,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_explicit_uniform_location] = EBhDisable; extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable; extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_atomic_counter_ops] = EBhDisable; extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable; extensionBehavior[E_GL_ARB_shader_group_vote] = EBhDisable; extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 2e8cc298..326a1323 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -136,6 +136,7 @@ const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attri const char* const E_GL_ARB_explicit_uniform_location = "GL_ARB_explicit_uniform_location"; const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; +const char* const E_GL_ARB_shader_atomic_counter_ops = "GL_ARB_shader_atomic_counter_ops"; const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters"; const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote"; const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index b63825b6..6e7a659e 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -284,6 +284,7 @@ INSTANTIATE_TEST_SUITE_P( "textureoffset_sampler2darrayshadow.vert", "atomicAdd.comp", "GL_ARB_gpu_shader5.u2i.vert", + "atomicCounterARBOps.vert" })), FileNameAsCustomTestSuffix ); From 48937f931a85578fd7511c394d9715fa62f95399 Mon Sep 17 00:00:00 2001 From: Alastair Cota Date: Sun, 8 Aug 2021 17:00:26 +0100 Subject: [PATCH 08/64] Update CMakeLists.txt Checked REGEX REPLACE for consistency failure --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d290622..c318eef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -198,7 +198,7 @@ elseif(MSVC) if(ENABLE_EXCEPTIONS) add_compile_options(/EHsc) # Enable Exceptions else() - string(REGEX REPLACE /EHsc "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Try to remove default /EHsc cxx_flag + string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Try to remove default /EHsc cxx_flag add_compile_options(/D_HAS_EXCEPTIONS=0) endif() endif() From 9f18258e41f119b3b7df80f5313c1e1fa248546f Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Mon, 9 Aug 2021 17:52:40 -0600 Subject: [PATCH 09/64] Fix seperate stores to swizzled lvalue. Seen with += and ++ ops on swizzled lvalues. Was using stale access chain. Fixes 2725. --- SPIRV/SpvBuilder.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 6751dec2..e83306eb 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -2812,6 +2812,7 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce accessChain.component == NoResult) { for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) { accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle[i])); + accessChain.instr = NoResult; Id base = collapseAccessChain(); addDecoration(base, nonUniform); From fc60f77aa255d03e0bd760066599ad067cda2175 Mon Sep 17 00:00:00 2001 From: alelenv Date: Tue, 10 Aug 2021 10:40:28 -0700 Subject: [PATCH 10/64] Add support for GL_NV_ray_tracing_motion_blur. --- SPIRV/GLSL.ext.NV.h | 3 + SPIRV/GlslangToSpv.cpp | 16 +++- SPIRV/doc.cpp | 17 ++++ SPIRV/spirv.hpp | 6 ++ .../spv.AnyHitShaderMotion.rahit.out | 33 ++++++++ .../spv.ClosestHitShaderMotion.rchit.out | 59 ++++++++++++++ .../spv.IntersectShaderMotion.rint.out | 33 ++++++++ .../spv.MissShaderMotion.rmiss.out | 59 ++++++++++++++ .../spv.RayGenShaderMotion.rgen.out | 81 +++++++++++++++++++ Test/spv.AnyHitShaderMotion.rahit | 6 ++ Test/spv.ClosestHitShaderMotion.rchit | 10 +++ Test/spv.IntersectShaderMotion.rint | 6 ++ Test/spv.MissShaderMotion.rmiss | 10 +++ Test/spv.RayGenShaderMotion.rgen | 13 +++ glslang/Include/BaseTypes.h | 2 + glslang/Include/intermediate.h | 1 + glslang/MachineIndependent/Initialize.cpp | 12 ++- glslang/MachineIndependent/ParseHelper.cpp | 4 + glslang/MachineIndependent/Versions.cpp | 6 +- glslang/MachineIndependent/Versions.h | 1 + glslang/MachineIndependent/intermOut.cpp | 1 + gtests/Spv.FromFile.cpp | 19 +++++ 22 files changed, 394 insertions(+), 4 deletions(-) create mode 100644 Test/baseResults/spv.AnyHitShaderMotion.rahit.out create mode 100644 Test/baseResults/spv.ClosestHitShaderMotion.rchit.out create mode 100644 Test/baseResults/spv.IntersectShaderMotion.rint.out create mode 100644 Test/baseResults/spv.MissShaderMotion.rmiss.out create mode 100644 Test/baseResults/spv.RayGenShaderMotion.rgen.out create mode 100644 Test/spv.AnyHitShaderMotion.rahit create mode 100644 Test/spv.ClosestHitShaderMotion.rchit create mode 100644 Test/spv.IntersectShaderMotion.rint create mode 100644 Test/spv.MissShaderMotion.rmiss create mode 100644 Test/spv.RayGenShaderMotion.rgen diff --git a/SPIRV/GLSL.ext.NV.h b/SPIRV/GLSL.ext.NV.h index 50146da1..93c98bf6 100644 --- a/SPIRV/GLSL.ext.NV.h +++ b/SPIRV/GLSL.ext.NV.h @@ -69,6 +69,9 @@ const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader"; //SPV_NV_raytracing const char* const E_SPV_NV_ray_tracing = "SPV_NV_ray_tracing"; +//SPV_NV_ray_tracing_motion_blur +const char* const E_SPV_NV_ray_tracing_motion_blur = "SPV_NV_ray_tracing_motion_blur"; + //SPV_NV_shading_rate const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate"; diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index c8a73a6b..c323bcdb 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1033,6 +1033,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI return spv::BuiltInIncomingRayFlagsKHR; case glslang::EbvGeometryIndex: return spv::BuiltInRayGeometryIndexKHR; + case glslang::EbvCurrentRayTimeNV: + builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); + builder.addCapability(spv::CapabilityRayTracingMotionBlurNV); + return spv::BuiltInCurrentRayTimeNV; // barycentrics case glslang::EbvBaryCoordNV: @@ -3018,6 +3022,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpIgnoreIntersectionNV: case glslang::EOpTerminateRayNV: case glslang::EOpTraceNV: + case glslang::EOpTraceRayMotionNV: case glslang::EOpTraceKHR: case glslang::EOpExecuteCallableNV: case glslang::EOpExecuteCallableKHR: @@ -3317,9 +3322,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst(); operands.push_back(builder.makeIntConstant(cond ? 1 : 0)); } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) || + (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) || (arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR)) { - const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : 1; - const int set = glslangOp == glslang::EOpTraceKHR ? 0 : 1; + const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : (glslangOp == glslang::EOpTraceRayMotionNV ? 11 : 1); + const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0; + const int location = glslangOperands[opdNum]->getAsConstantUnion()->getConstArray()[0].getUConst(); auto itNode = locationToSymbol[set].find(location); visitSymbol(itNode->second); @@ -8322,6 +8329,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpTraceNV: builder.createNoResultOp(spv::OpTraceNV, operands); return 0; + case glslang::EOpTraceRayMotionNV: + builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur); + builder.addCapability(spv::CapabilityRayTracingMotionBlurNV); + builder.createNoResultOp(spv::OpTraceRayMotionNV, operands); + return 0; case glslang::EOpTraceKHR: builder.createNoResultOp(spv::OpTraceRayKHR, operands); return 0; diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index 31b20a1f..dbdf7077 100644 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -426,6 +426,7 @@ const char* BuiltInString(int builtIn) case BuiltInSMCountNV: return "SMCountNV"; case BuiltInWarpIDNV: return "WarpIDNV"; case BuiltInSMIDNV: return "SMIDNV"; + case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV"; default: return "Bad"; } @@ -916,6 +917,7 @@ const char* CapabilityString(int info) case CapabilityPerViewAttributesNV: return "PerViewAttributesNV"; case CapabilityGroupNonUniformPartitionedNV: return "GroupNonUniformPartitionedNV"; case CapabilityRayTracingNV: return "RayTracingNV"; + case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV"; case CapabilityRayTracingKHR: return "RayTracingKHR"; case CapabilityRayQueryKHR: return "RayQueryKHR"; case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR"; @@ -1382,6 +1384,7 @@ const char* OpcodeString(int op) case OpTerminateRayNV: return "OpTerminateRayNV"; case OpTerminateRayKHR: return "OpTerminateRayKHR"; case OpTraceNV: return "OpTraceNV"; + case OpTraceRayMotionNV: return "OpTraceRayMotionNV"; case OpTraceRayKHR: return "OpTraceRayKHR"; case OpTypeAccelerationStructureKHR: return "OpTypeAccelerationStructureKHR"; case OpExecuteCallableNV: return "OpExecuteCallableNV"; @@ -2812,6 +2815,20 @@ void Parameterize() InstructionDesc[OpTraceNV].operands.push(OperandId, "'Payload'"); InstructionDesc[OpTraceNV].setResultAndType(false, false); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Flags'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Cull Mask'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Origin'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMin'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Direction'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMax'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Time'"); + InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Payload'"); + InstructionDesc[OpTraceRayMotionNV].setResultAndType(false, false); + InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Acceleration Structure'"); InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Flags'"); InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Cull Mask'"); diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index 317db81f..e0fe2498 100644 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -652,6 +652,7 @@ enum BuiltIn { BuiltInHitTNV = 5332, BuiltInHitKindKHR = 5333, BuiltInHitKindNV = 5333, + BuiltInCurrentRayTimeNV = 5334, BuiltInIncomingRayFlagsKHR = 5351, BuiltInIncomingRayFlagsNV = 5351, BuiltInRayGeometryIndexKHR = 5352, @@ -988,6 +989,7 @@ enum Capability { CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312, CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312, CapabilityRayTracingNV = 5340, + CapabilityRayTracingMotionBlurNV = 5341, CapabilityVulkanMemoryModel = 5345, CapabilityVulkanMemoryModelKHR = 5345, CapabilityVulkanMemoryModelDeviceScope = 5346, @@ -1503,6 +1505,8 @@ enum Op { OpIgnoreIntersectionNV = 5335, OpTerminateRayNV = 5336, OpTraceNV = 5337, + OpTraceMotionNV = 5338, + OpTraceRayMotionNV = 5339, OpTypeAccelerationStructureKHR = 5341, OpTypeAccelerationStructureNV = 5341, OpExecuteCallableNV = 5344, @@ -2090,6 +2094,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; case OpTraceNV: *hasResult = false; *hasResultType = false; break; + case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break; + case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break; case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break; case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; diff --git a/Test/baseResults/spv.AnyHitShaderMotion.rahit.out b/Test/baseResults/spv.AnyHitShaderMotion.rahit.out new file mode 100644 index 00000000..f9e1e1b9 --- /dev/null +++ b/Test/baseResults/spv.AnyHitShaderMotion.rahit.out @@ -0,0 +1,33 @@ +spv.AnyHitShaderMotion.rahit +// Module Version 10400 +// Generated by (magic number): 8000a +// Id's are bound by 14 + + Capability RayTracingKHR + Capability RayTracingMotionBlurNV + Extension "SPV_KHR_ray_tracing" + Extension "SPV_NV_ray_tracing_motion_blur" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint AnyHitKHR 4 "main" 10 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing_motion_blur" + Name 4 "main" + Name 8 "time" + Name 10 "gl_CurrentRayTimeNV" + Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: TypePointer Input 6(float) +10(gl_CurrentRayTimeNV): 9(ptr) Variable Input + 12: 6(float) Constant 1056964608 + 4(main): 2 Function None 3 + 5: Label + 8(time): 7(ptr) Variable Function + 11: 6(float) Load 10(gl_CurrentRayTimeNV) + 13: 6(float) FAdd 11 12 + Store 8(time) 13 + Return + FunctionEnd diff --git a/Test/baseResults/spv.ClosestHitShaderMotion.rchit.out b/Test/baseResults/spv.ClosestHitShaderMotion.rchit.out new file mode 100644 index 00000000..e89abb45 --- /dev/null +++ b/Test/baseResults/spv.ClosestHitShaderMotion.rchit.out @@ -0,0 +1,59 @@ +spv.ClosestHitShaderMotion.rchit +// Module Version 10400 +// Generated by (magic number): 8000a +// Id's are bound by 33 + + Capability RayTracingKHR + Capability RayTracingMotionBlurNV + Extension "SPV_KHR_ray_tracing" + Extension "SPV_NV_ray_tracing_motion_blur" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint ClosestHitKHR 4 "main" 10 16 32 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + SourceExtension "GL_NV_ray_tracing_motion_blur" + Name 4 "main" + Name 8 "time" + Name 10 "gl_CurrentRayTimeNV" + Name 16 "accEXT" + Name 32 "incomingPayloadEXT" + Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV + Decorate 16(accEXT) DescriptorSet 0 + Decorate 16(accEXT) Binding 0 + Decorate 32(incomingPayloadEXT) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: TypePointer Input 6(float) +10(gl_CurrentRayTimeNV): 9(ptr) Variable Input + 12: 6(float) Constant 1056964608 + 14: TypeAccelerationStructureKHR + 15: TypePointer UniformConstant 14 + 16(accEXT): 15(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: 18(int) Constant 1 + 21: 18(int) Constant 2 + 22: 18(int) Constant 3 + 23: TypeVector 6(float) 3 + 24: 23(fvec3) ConstantComposite 12 12 12 + 25: 6(float) Constant 1065353216 + 26: 23(fvec3) ConstantComposite 25 25 25 + 27: 6(float) Constant 1061158912 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypeVector 6(float) 4 + 31: TypePointer IncomingRayPayloadKHR 30(fvec4) +32(incomingPayloadEXT): 31(ptr) Variable IncomingRayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(time): 7(ptr) Variable Function + 11: 6(float) Load 10(gl_CurrentRayTimeNV) + 13: 6(float) FAdd 11 12 + Store 8(time) 13 + 17: 14 Load 16(accEXT) + TraceRayMotionNV 17 19 20 21 22 19 24 12 26 27 25 32(incomingPayloadEXT) + Return + FunctionEnd diff --git a/Test/baseResults/spv.IntersectShaderMotion.rint.out b/Test/baseResults/spv.IntersectShaderMotion.rint.out new file mode 100644 index 00000000..f77c9a81 --- /dev/null +++ b/Test/baseResults/spv.IntersectShaderMotion.rint.out @@ -0,0 +1,33 @@ +spv.IntersectShaderMotion.rint +// Module Version 10400 +// Generated by (magic number): 8000a +// Id's are bound by 14 + + Capability RayTracingKHR + Capability RayTracingMotionBlurNV + Extension "SPV_KHR_ray_tracing" + Extension "SPV_NV_ray_tracing_motion_blur" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint IntersectionKHR 4 "main" 10 + Source GLSL 460 + SourceExtension "GL_NV_ray_tracing_motion_blur" + Name 4 "main" + Name 8 "time" + Name 10 "gl_CurrentRayTimeNV" + Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: TypePointer Input 6(float) +10(gl_CurrentRayTimeNV): 9(ptr) Variable Input + 12: 6(float) Constant 1056964608 + 4(main): 2 Function None 3 + 5: Label + 8(time): 7(ptr) Variable Function + 11: 6(float) Load 10(gl_CurrentRayTimeNV) + 13: 6(float) FAdd 11 12 + Store 8(time) 13 + Return + FunctionEnd diff --git a/Test/baseResults/spv.MissShaderMotion.rmiss.out b/Test/baseResults/spv.MissShaderMotion.rmiss.out new file mode 100644 index 00000000..2f183381 --- /dev/null +++ b/Test/baseResults/spv.MissShaderMotion.rmiss.out @@ -0,0 +1,59 @@ +spv.MissShaderMotion.rmiss +// Module Version 10400 +// Generated by (magic number): 8000a +// Id's are bound by 33 + + Capability RayTracingKHR + Capability RayTracingMotionBlurNV + Extension "SPV_KHR_ray_tracing" + Extension "SPV_NV_ray_tracing_motion_blur" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint MissKHR 4 "main" 10 16 32 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + SourceExtension "GL_NV_ray_tracing_motion_blur" + Name 4 "main" + Name 8 "time" + Name 10 "gl_CurrentRayTimeNV" + Name 16 "accEXT" + Name 32 "localPayloadEXT" + Decorate 10(gl_CurrentRayTimeNV) BuiltIn CurrentRayTimeNV + Decorate 16(accEXT) DescriptorSet 0 + Decorate 16(accEXT) Binding 0 + Decorate 32(localPayloadEXT) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 9: TypePointer Input 6(float) +10(gl_CurrentRayTimeNV): 9(ptr) Variable Input + 12: 6(float) Constant 1056964608 + 14: TypeAccelerationStructureKHR + 15: TypePointer UniformConstant 14 + 16(accEXT): 15(ptr) Variable UniformConstant + 18: TypeInt 32 0 + 19: 18(int) Constant 0 + 20: 18(int) Constant 1 + 21: 18(int) Constant 2 + 22: 18(int) Constant 3 + 23: TypeVector 6(float) 3 + 24: 23(fvec3) ConstantComposite 12 12 12 + 25: 6(float) Constant 1065353216 + 26: 23(fvec3) ConstantComposite 25 25 25 + 27: 6(float) Constant 1061158912 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: TypeVector 6(float) 4 + 31: TypePointer RayPayloadKHR 30(fvec4) +32(localPayloadEXT): 31(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(time): 7(ptr) Variable Function + 11: 6(float) Load 10(gl_CurrentRayTimeNV) + 13: 6(float) FAdd 11 12 + Store 8(time) 13 + 17: 14 Load 16(accEXT) + TraceRayMotionNV 17 19 20 21 22 19 24 12 26 27 25 32(localPayloadEXT) + Return + FunctionEnd diff --git a/Test/baseResults/spv.RayGenShaderMotion.rgen.out b/Test/baseResults/spv.RayGenShaderMotion.rgen.out new file mode 100644 index 00000000..f9b9fa5f --- /dev/null +++ b/Test/baseResults/spv.RayGenShaderMotion.rgen.out @@ -0,0 +1,81 @@ +spv.RayGenShaderMotion.rgen +// Module Version 10400 +// Generated by (magic number): 8000a +// Id's are bound by 47 + + Capability RayTracingKHR + Capability RayTracingMotionBlurNV + Extension "SPV_KHR_ray_tracing" + Extension "SPV_NV_ray_tracing_motion_blur" + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint RayGenerationKHR 4 "main" 11 21 29 46 + Source GLSL 460 + SourceExtension "GL_EXT_ray_tracing" + SourceExtension "GL_NV_ray_tracing_motion_blur" + Name 4 "main" + Name 8 "lx" + Name 11 "gl_LaunchIDEXT" + Name 16 "ly" + Name 20 "sx" + Name 21 "gl_LaunchSizeEXT" + Name 24 "sy" + Name 29 "accEXT" + Name 46 "payloadEXT" + Decorate 11(gl_LaunchIDEXT) BuiltIn LaunchIdKHR + Decorate 21(gl_LaunchSizeEXT) BuiltIn LaunchSizeKHR + Decorate 29(accEXT) DescriptorSet 0 + Decorate 29(accEXT) Binding 0 + Decorate 46(payloadEXT) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypeVector 6(int) 3 + 10: TypePointer Input 9(ivec3) +11(gl_LaunchIDEXT): 10(ptr) Variable Input + 12: 6(int) Constant 0 + 13: TypePointer Input 6(int) + 17: 6(int) Constant 1 +21(gl_LaunchSizeEXT): 10(ptr) Variable Input + 27: TypeAccelerationStructureKHR + 28: TypePointer UniformConstant 27 + 29(accEXT): 28(ptr) Variable UniformConstant + 35: TypeFloat 32 + 36: TypeVector 35(float) 3 + 37: 35(float) Constant 1056964608 + 38: 36(fvec3) ConstantComposite 37 37 37 + 39: 35(float) Constant 1065353216 + 40: 36(fvec3) ConstantComposite 39 39 39 + 41: 35(float) Constant 1061158912 + 42: TypeInt 32 1 + 43: 42(int) Constant 0 + 44: TypeVector 35(float) 4 + 45: TypePointer RayPayloadKHR 44(fvec4) + 46(payloadEXT): 45(ptr) Variable RayPayloadKHR + 4(main): 2 Function None 3 + 5: Label + 8(lx): 7(ptr) Variable Function + 16(ly): 7(ptr) Variable Function + 20(sx): 7(ptr) Variable Function + 24(sy): 7(ptr) Variable Function + 14: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 12 + 15: 6(int) Load 14 + Store 8(lx) 15 + 18: 13(ptr) AccessChain 11(gl_LaunchIDEXT) 17 + 19: 6(int) Load 18 + Store 16(ly) 19 + 22: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 12 + 23: 6(int) Load 22 + Store 20(sx) 23 + 25: 13(ptr) AccessChain 21(gl_LaunchSizeEXT) 17 + 26: 6(int) Load 25 + Store 24(sy) 26 + 30: 27 Load 29(accEXT) + 31: 6(int) Load 8(lx) + 32: 6(int) Load 16(ly) + 33: 6(int) Load 20(sx) + 34: 6(int) Load 24(sy) + TraceRayMotionNV 30 31 32 33 34 12 38 37 40 41 37 46(payloadEXT) + Return + FunctionEnd diff --git a/Test/spv.AnyHitShaderMotion.rahit b/Test/spv.AnyHitShaderMotion.rahit new file mode 100644 index 00000000..6972577a --- /dev/null +++ b/Test/spv.AnyHitShaderMotion.rahit @@ -0,0 +1,6 @@ +#version 460 +#extension GL_NV_ray_tracing_motion_blur : enable +void main() +{ + float time = gl_CurrentRayTimeNV + 0.5f; +} diff --git a/Test/spv.ClosestHitShaderMotion.rchit b/Test/spv.ClosestHitShaderMotion.rchit new file mode 100644 index 00000000..42a18382 --- /dev/null +++ b/Test/spv.ClosestHitShaderMotion.rchit @@ -0,0 +1,10 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +#extension GL_NV_ray_tracing_motion_blur : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadInEXT vec4 incomingPayloadEXT; +void main() +{ + float time = gl_CurrentRayTimeNV + 0.5f; + traceRayMotionNV(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1.0, 0); +} diff --git a/Test/spv.IntersectShaderMotion.rint b/Test/spv.IntersectShaderMotion.rint new file mode 100644 index 00000000..6972577a --- /dev/null +++ b/Test/spv.IntersectShaderMotion.rint @@ -0,0 +1,6 @@ +#version 460 +#extension GL_NV_ray_tracing_motion_blur : enable +void main() +{ + float time = gl_CurrentRayTimeNV + 0.5f; +} diff --git a/Test/spv.MissShaderMotion.rmiss b/Test/spv.MissShaderMotion.rmiss new file mode 100644 index 00000000..3a3dcb16 --- /dev/null +++ b/Test/spv.MissShaderMotion.rmiss @@ -0,0 +1,10 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +#extension GL_NV_ray_tracing_motion_blur : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 localPayloadEXT; +void main() +{ + float time = gl_CurrentRayTimeNV + 0.5f; + traceRayMotionNV(accEXT, 0u, 1u, 2u, 3u, 0u, vec3(0.5f), 0.5f, vec3(1.0f), 0.75f, 1.0f, 0); +} diff --git a/Test/spv.RayGenShaderMotion.rgen b/Test/spv.RayGenShaderMotion.rgen new file mode 100644 index 00000000..c38fffe5 --- /dev/null +++ b/Test/spv.RayGenShaderMotion.rgen @@ -0,0 +1,13 @@ +#version 460 +#extension GL_EXT_ray_tracing : enable +#extension GL_NV_ray_tracing_motion_blur : enable +layout(binding = 0, set = 0) uniform accelerationStructureEXT accEXT; +layout(location = 0) rayPayloadEXT vec4 payloadEXT; +void main() +{ + uint lx = gl_LaunchIDEXT.x; + uint ly = gl_LaunchIDEXT.y; + uint sx = gl_LaunchSizeEXT.x; + uint sy = gl_LaunchSizeEXT.y; + traceRayMotionNV(accEXT, lx, ly, sx, sy, 0u, vec3(0.5), 0.5f, vec3(1.0), 0.75f, 0.5, 0); +} diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index 1d9da12d..c8203c22 100644 --- a/glslang/Include/BaseTypes.h +++ b/glslang/Include/BaseTypes.h @@ -270,6 +270,7 @@ enum TBuiltInVariable { EbvWorldToObject, EbvWorldToObject3x4, EbvIncomingRayFlags, + EbvCurrentRayTimeNV, // barycentrics EbvBaryCoordNV, EbvBaryCoordNoPerspNV, @@ -475,6 +476,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvIncomingRayFlags: return "IncomingRayFlagsNV"; case EbvObjectToWorld: return "ObjectToWorldNV"; case EbvWorldToObject: return "WorldToObjectNV"; + case EbvCurrentRayTimeNV: return "CurrentRayTimeNV"; case EbvBaryCoordNV: return "BaryCoordNV"; case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV"; diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 172c09cf..1e6ab4aa 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -926,6 +926,7 @@ enum TOperator { EOpMul32x16, EOpTraceNV, + EOpTraceRayMotionNV, EOpTraceKHR, EOpReportIntersection, EOpIgnoreIntersectionNV, diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index a79925d3..08d0dc7c 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -4661,7 +4661,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // Builtins for GL_NV_ray_tracing/GL_EXT_ray_tracing/GL_EXT_ray_query + // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query if (profile != EEsProfile && version >= 460) { commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);" "void rayQueryTerminateEXT(rayQueryEXT);" @@ -4690,6 +4690,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV stageBuiltins[EShLangRayGen].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" @@ -4704,12 +4705,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); stageBuiltins[EShLangClosestHit].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" "\n"); stageBuiltins[EShLangMiss].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" "void executeCallableNV(uint, int);" "void executeCallableEXT(uint, int);" @@ -5918,6 +5921,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in mat3x4 gl_WorldToObject3x4EXT;" "in uint gl_IncomingRayFlagsNV;" "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" "\n"; const char *hitDecls = "in uvec3 gl_LaunchIDNV;" @@ -5953,6 +5957,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in mat3x4 gl_WorldToObject3x4EXT;" "in uint gl_IncomingRayFlagsNV;" "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" "\n"; const char *missDecls = "in uvec3 gl_LaunchIDNV;" @@ -5971,6 +5976,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in float gl_RayTmaxEXT;" "in uint gl_IncomingRayFlagsNV;" "in uint gl_IncomingRayFlagsEXT;" + "in float gl_CurrentRayTimeNV;" "\n"; const char *callableDecls = @@ -8789,11 +8795,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing); symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing); + symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur); symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group); symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing); + symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur); symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing); symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing); symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing); @@ -8837,6 +8845,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion BuiltInVariable("gl_IncomingRayFlagsNV", EbvIncomingRayFlags, symbolTable); BuiltInVariable("gl_IncomingRayFlagsEXT", EbvIncomingRayFlags, symbolTable); BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable); + BuiltInVariable("gl_CurrentRayTimeNV", EbvCurrentRayTimeNV, symbolTable); // GL_ARB_shader_ballot symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); @@ -9668,6 +9677,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion case EShLangMiss: if (profile != EEsProfile && version >= 460) { symbolTable.relateToOperator("traceNV", EOpTraceNV); + symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV); symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR); symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV); symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR); diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 35a53e42..b957bb87 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -2308,6 +2308,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (!(*argp)[10]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "payload number", "a"); break; + case EOpTraceRayMotionNV: + if (!(*argp)[11]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "payload number", "a"); + break; case EOpTraceKHR: if (!(*argp)[10]->getAsConstantUnion()) error(loc, "argument must be compile-time constant", "payload number", "a"); diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 2698dd91..832fb7a5 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -165,7 +165,9 @@ void TParseVersions::initializeExtensionBehavior() EShTargetLanguageVersion minSpvVersion; } extensionData; - const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4} }; + const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4}, + {E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4} + }; for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) { // Add only extensions which require > spv1.0 to save space in map @@ -281,6 +283,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_shader_subgroup_partitioned] = EBhDisable; extensionBehavior[E_GL_NV_shading_rate_image] = EBhDisable; extensionBehavior[E_GL_NV_ray_tracing] = EBhDisable; + extensionBehavior[E_GL_NV_ray_tracing_motion_blur] = EBhDisable; extensionBehavior[E_GL_NV_fragment_shader_barycentric] = EBhDisable; extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; @@ -518,6 +521,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_shader_subgroup_partitioned 1\n" "#define GL_NV_shading_rate_image 1\n" "#define GL_NV_ray_tracing 1\n" + "#define GL_NV_ray_tracing_motion_blur 1\n" "#define GL_NV_fragment_shader_barycentric 1\n" "#define GL_NV_compute_shader_derivatives 1\n" "#define GL_NV_shader_texture_footprint 1\n" diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 2e8cc298..878c6f8f 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -247,6 +247,7 @@ const char* const E_GL_NV_shader_noperspective_interpolation = "GL_NV_shader_ const char* const E_GL_NV_shader_subgroup_partitioned = "GL_NV_shader_subgroup_partitioned"; const char* const E_GL_NV_shading_rate_image = "GL_NV_shading_rate_image"; const char* const E_GL_NV_ray_tracing = "GL_NV_ray_tracing"; +const char* const E_GL_NV_ray_tracing_motion_blur = "GL_NV_ray_tracing_motion_blur"; const char* const E_GL_NV_fragment_shader_barycentric = "GL_NV_fragment_shader_barycentric"; const char* const E_GL_NV_compute_shader_derivatives = "GL_NV_compute_shader_derivatives"; const char* const E_GL_NV_shader_texture_footprint = "GL_NV_shader_texture_footprint"; diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index 105adc48..a0fade16 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -1089,6 +1089,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break; case EOpTraceNV: out.debug << "traceNV"; break; + case EOpTraceRayMotionNV: out.debug << "traceRayMotionNV"; break; case EOpTraceKHR: out.debug << "traceRayKHR"; break; case EOpReportIntersection: out.debug << "reportIntersectionNV"; break; case EOpIgnoreIntersectionNV: out.debug << "ignoreIntersectionNV"; break; diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index a7e1a3ef..29740f31 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -77,6 +77,7 @@ using HlslIoMap = GlslangTest<::testing::TestWithParam>; using GlslIoMap = GlslangTest<::testing::TestWithParam>; using CompileVulkanToSpirvTestAMD = GlslangTest<::testing::TestWithParam>; using CompileVulkanToSpirvTestNV = GlslangTest<::testing::TestWithParam>; +using CompileVulkanToSpirv14TestNV = GlslangTest<::testing::TestWithParam>; using CompileUpgradeTextureToSampledTextureAndDropSamplersTest = GlslangTest<::testing::TestWithParam>; // Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully @@ -204,6 +205,13 @@ TEST_P(CompileVulkanToSpirvTestNV, FromFile) Target::Spv); } +TEST_P(CompileVulkanToSpirv14TestNV, FromFile) +{ + loadFileCompileAndCheck(GlobalTestSettings.testRoot, GetParam(), + Source::GLSL, Semantics::Vulkan, glslang::EShTargetVulkan_1_1, glslang::EShTargetSpv_1_4, + Target::Spv); +} + TEST_P(CompileUpgradeTextureToSampledTextureAndDropSamplersTest, FromFile) { loadCompileUpgradeTextureToSampledTextureAndDropSamplersAndCheck(GlobalTestSettings.testRoot, @@ -765,6 +773,17 @@ INSTANTIATE_TEST_SUITE_P( FileNameAsCustomTestSuffix ); +INSTANTIATE_TEST_SUITE_P( + Glsl, CompileVulkanToSpirv14TestNV, + ::testing::ValuesIn(std::vector({ + "spv.RayGenShaderMotion.rgen", + "spv.IntersectShaderMotion.rint", + "spv.AnyHitShaderMotion.rahit", + "spv.ClosestHitShaderMotion.rchit", + "spv.MissShaderMotion.rmiss", +})), +FileNameAsCustomTestSuffix +); INSTANTIATE_TEST_SUITE_P( Glsl, CompileUpgradeTextureToSampledTextureAndDropSamplersTest, ::testing::ValuesIn(std::vector({ From 35af9ea58e5dee716a3ec1a6b8cbaa6bb324ceec Mon Sep 17 00:00:00 2001 From: alelenv Date: Thu, 12 Aug 2021 09:57:22 -0700 Subject: [PATCH 11/64] Update known_good for SPV_NV_ray_tracing_motion_blur. --- known_good.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/known_good.json b/known_good.json index c6fd4ff4..d40b91c5 100644 --- a/known_good.json +++ b/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "5dd2f76918bb2d0d67628e338f60f724f3e02e13" + "commit" : "54524ffa6a1b5ab173ebff89fb31e4a21d365477" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "07f259e68af3a540038fa32df522554e74f53ed5" + "commit" : "4cce109bcdb7fbb028d21230f07ea292a684bea1" } ] } From e49ae91c9d56d11631eb7048272bd660071e392e Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 25 Aug 2021 13:32:27 -0600 Subject: [PATCH 12/64] Update known goods and CHANGES for 11.6.0 --- CHANGES.md | 11 +++++++++++ known_good.json | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 27b002e8..ad4fa400 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## 11.6.0 2021-08-25 + +### Other changes +* Atomic memory function only for shader storage block member or shared variable +* Add support for gl_MaxVaryingVectors for ogl +* Fix loading bool arrays from interface blocks +* Generate separate stores for partially swizzled memory stores +* Allow layout(std430) uniform with GL_EXT_scalar_block_layout +* Support for pragma STDGL invariant(all) +* Support for GL_NV_ray_tracing_motion_blur + ## 11.5.0 2021-06-23 ### Other changes diff --git a/known_good.json b/known_good.json index d40b91c5..e1c2ce81 100644 --- a/known_good.json +++ b/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "54524ffa6a1b5ab173ebff89fb31e4a21d365477" + "commit" : "1fbed83c8aab8517d821fcb4164c08567951938f" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "4cce109bcdb7fbb028d21230f07ea292a684bea1" + "commit" : "449bc986ba6f4c5e10e32828783f9daef2a77644" } ] } From 012436d6800882309463f4804dd54e35805bd2c4 Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Mon, 9 Aug 2021 14:41:50 -0600 Subject: [PATCH 13/64] Fix GCC warnings Fix -Wsign-compare warnings. Fix -Wunused-parameter warnings. --- SPIRV/GlslangToSpv.cpp | 2 +- glslang/MachineIndependent/Constant.cpp | 2 +- glslang/MachineIndependent/ParseHelper.h | 4 ++-- glslang/MachineIndependent/attribute.cpp | 2 +- glslang/MachineIndependent/glslang.m4 | 8 ++++---- glslang/MachineIndependent/glslang.y | 8 ++++---- glslang/MachineIndependent/glslang_tab.cpp | 8 ++++---- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index c323bcdb..71b00d72 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -3384,7 +3384,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt const auto& spirvInst = node->getSpirvInstruction(); if (spirvInst.set == "") { std::vector idImmOps; - for (int i = 0; i < glslangOperands.size(); ++i) { + for (unsigned int i = 0; i < glslangOperands.size(); ++i) { if (glslangOperands[i]->getAsTyped()->getQualifier().isSpirvLiteral()) { // Translate the constant to a literal value std::vector literals; diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index 4629cc2d..7f5d4c4f 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -531,7 +531,7 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; // Note: avoid UBSAN error regarding negating 0x80000000 case EbtInt: newConstArray[i].setIConst( - unionArray[i].getIConst() == 0x80000000 + static_cast(unionArray[i].getIConst()) == 0x80000000 ? -0x7FFFFFFF - 1 : -unionArray[i].getIConst()); break; diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index de448846..442741d6 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -241,7 +241,7 @@ protected: // override this to set the language-specific name virtual const char* getAtomicCounterBlockName() const { return ""; } virtual void setAtomicCounterBlockDefaults(TType&) const {} - virtual void setInvariant(const TSourceLoc& loc, const char* builtin) {} + virtual void setInvariant(const TSourceLoc&, const char*) {} virtual void finalizeAtomicCounterBlockLayout(TVariable&) {} bool isAtomicCounterBlock(const TSymbol& symbol) { const TVariable* var = symbol.getAsVariable(); @@ -472,7 +472,7 @@ public: // Determine loop control from attributes void handleLoopAttributes(const TAttributes& attributes, TIntermNode*); // Function attributes - void handleFunctionAttributes(const TSourceLoc&, const TAttributes&, TFunction*); + void handleFunctionAttributes(const TSourceLoc&, const TAttributes&); // GL_EXT_spirv_intrinsics TSpirvRequirement* makeSpirvRequirement(const TSourceLoc& loc, const TString& name, diff --git a/glslang/MachineIndependent/attribute.cpp b/glslang/MachineIndependent/attribute.cpp index 8a92f6ae..df7fdc2a 100644 --- a/glslang/MachineIndependent/attribute.cpp +++ b/glslang/MachineIndependent/attribute.cpp @@ -347,7 +347,7 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN // // Function attributes // -void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttributes& attributes, TFunction* function) +void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttributes& attributes) { for (auto it = attributes.begin(); it != attributes.end(); ++it) { if (it->size() > 0) { diff --git a/glslang/MachineIndependent/glslang.m4 b/glslang/MachineIndependent/glslang.m4 index 93041ce3..b30c734e 100644 --- a/glslang/MachineIndependent/glslang.m4 +++ b/glslang/MachineIndependent/glslang.m4 @@ -983,20 +983,20 @@ function_prototype $$.function = $1; $$.loc = $2.loc; parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($2.loc, *$3, $$.function); + parseContext.handleFunctionAttributes($2.loc, *$3); } | attribute function_declarator RIGHT_PAREN { $$.function = $2; $$.loc = $3.loc; parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($3.loc, *$1, $$.function); + parseContext.handleFunctionAttributes($3.loc, *$1); } | attribute function_declarator RIGHT_PAREN attribute { $$.function = $2; $$.loc = $3.loc; parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($3.loc, *$1, $$.function); - parseContext.handleFunctionAttributes($3.loc, *$4, $$.function); + parseContext.handleFunctionAttributes($3.loc, *$1); + parseContext.handleFunctionAttributes($3.loc, *$4); } ; diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index b77f4617..c535ecc2 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -983,20 +983,20 @@ function_prototype $$.function = $1; $$.loc = $2.loc; parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($2.loc, *$3, $$.function); + parseContext.handleFunctionAttributes($2.loc, *$3); } | attribute function_declarator RIGHT_PAREN { $$.function = $2; $$.loc = $3.loc; parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($3.loc, *$1, $$.function); + parseContext.handleFunctionAttributes($3.loc, *$1); } | attribute function_declarator RIGHT_PAREN attribute { $$.function = $2; $$.loc = $3.loc; parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes($3.loc, *$1, $$.function); - parseContext.handleFunctionAttributes($3.loc, *$4, $$.function); + parseContext.handleFunctionAttributes($3.loc, *$1); + parseContext.handleFunctionAttributes($3.loc, *$4); } ; diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp index dba06aef..648bc370 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -6204,7 +6204,7 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes), (yyval.interm).function); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } #line 6210 "MachineIndependent/glslang_tab.cpp" break; @@ -6215,7 +6215,7 @@ yyreduce: (yyval.interm).function = (yyvsp[-1].interm.function); (yyval.interm).loc = (yyvsp[0].lex).loc; parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes), (yyval.interm).function); + parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } #line 6221 "MachineIndependent/glslang_tab.cpp" break; @@ -6226,8 +6226,8 @@ yyreduce: (yyval.interm).function = (yyvsp[-2].interm.function); (yyval.interm).loc = (yyvsp[-1].lex).loc; parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute"); - parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes), (yyval.interm).function); - parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes), (yyval.interm).function); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); + parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } #line 6233 "MachineIndependent/glslang_tab.cpp" break; From 8ef6a4cb4d348aa2b2f3895f0beaf9208a2f8d34 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 2 Sep 2021 10:49:46 -0600 Subject: [PATCH 14/64] Perform update_precision on constructors and converts Fixes #2740 --- Test/baseResults/300block.frag.out | 20 +++---- Test/baseResults/310.comp.out | 6 +-- Test/baseResults/310.frag.out | 6 +-- Test/baseResults/310.vert.out | 8 +-- Test/baseResults/320.frag.out | 4 +- Test/baseResults/320.vert.out | 4 +- Test/baseResults/glsl.es320.subgroup.geom.out | 4 +- Test/baseResults/glsl.es320.subgroup.tesc.out | 4 +- Test/baseResults/glsl.es320.subgroup.tese.out | 4 +- Test/baseResults/glsl.es320.subgroup.vert.out | 4 +- .../spv.ext.AnyHitShader.rahit.out | 1 + ...pv.ext.ClosestHitShader_Subgroup.rchit.out | 11 ++++ Test/baseResults/spv.precise.tese.out | 4 -- Test/baseResults/spv.subgroup.frag.out | 1 + Test/baseResults/spv.subgroup.geom.out | 1 + Test/baseResults/spv.subgroup.tesc.out | 1 + Test/baseResults/spv.subgroup.tese.out | 1 + Test/baseResults/spv.subgroup.vert.out | 1 + Test/baseResults/spv.uint.frag.out | 1 + Test/baseResults/uint.frag.out | 4 +- Test/baseResults/vulkan.ast.vert.out | 40 +++++++------- glslang/Include/intermediate.h | 1 + glslang/MachineIndependent/Intermediate.cpp | 54 ++++++++++++++----- glslang/MachineIndependent/ParseHelper.cpp | 8 ++- 24 files changed, 120 insertions(+), 73 deletions(-) diff --git a/Test/baseResults/300block.frag.out b/Test/baseResults/300block.frag.out index e5b07dd9..1a5bd9b6 100644 --- a/Test/baseResults/300block.frag.out +++ b/Test/baseResults/300block.frag.out @@ -24,18 +24,18 @@ ERROR: node is still EOpNull! 0:42 Function Definition: main( ( global void) 0:42 Function Parameters: 0:44 Sequence -0:44 texture ( global lowp 4-component vector of int) +0:44 texture ( global lowp 4-component vector of int, operation at mediump) 0:44 sampler: direct index for structure ( global lowp isampler3D) 0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) 0:44 Constant: 0:44 2 (const int) -0:44 Construct vec3 ( temp lowp 3-component vector of float) -0:44 Convert int to float ( temp lowp float) +0:44 Construct vec3 ( temp mediump 3-component vector of float) +0:44 Convert int to float ( temp mediump float) 0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int) 0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float ( temp lowp float) +0:44 Convert uint to float ( temp mediump float) 0:44 direct index ( temp mediump uint) 0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) 0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, layout( column_major) global structure{ global mediump int a} t} fbs}) @@ -43,7 +43,7 @@ ERROR: node is still EOpNull! 0:44 0 (const uint) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float ( temp lowp float) +0:44 Convert uint to float ( temp mediump float) 0:44 direct index ( temp mediump uint) 0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) 0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) @@ -92,18 +92,18 @@ ERROR: node is still EOpNull! 0:42 Function Definition: main( ( global void) 0:42 Function Parameters: 0:44 Sequence -0:44 texture ( global lowp 4-component vector of int) +0:44 texture ( global lowp 4-component vector of int, operation at mediump) 0:44 sampler: direct index for structure ( global lowp isampler3D) 0:44 's' ( uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{ global mediump int a} t}) 0:44 Constant: 0:44 2 (const int) -0:44 Construct vec3 ( temp lowp 3-component vector of float) -0:44 Convert int to float ( temp lowp float) +0:44 Construct vec3 ( temp mediump 3-component vector of float) +0:44 Convert int to float ( temp mediump float) 0:44 ni: direct index for structure (layout( column_major shared) uniform mediump int) 0:44 'inst' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float ( temp lowp float) +0:44 Convert uint to float ( temp mediump float) 0:44 direct index ( temp mediump uint) 0:44 bv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) 0:44 'anon@0' (layout( column_major shared) uniform block{layout( column_major shared) uniform mediump 4-component vector of uint bv, layout( column_major shared) uniform mediump 2X2 matrix of float bm2, layout( column_major shared) uniform lowp isampler2D sampler, layout( column_major shared) uniform structure{ global mediump int a} t, layout( column_major shared) uniform structure{ global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, layout( column_major) global structure{ global mediump int a} t} fbs}) @@ -111,7 +111,7 @@ ERROR: node is still EOpNull! 0:44 0 (const uint) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float ( temp lowp float) +0:44 Convert uint to float ( temp mediump float) 0:44 direct index ( temp mediump uint) 0:44 nbv: direct index for structure (layout( column_major shared) uniform mediump 4-component vector of uint) 0:44 direct index (layout( column_major shared) temp block{layout( column_major shared) uniform mediump 4-component vector of uint nbv, layout( column_major shared) uniform mediump int ni}) diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index 85b01161..ac76cbdf 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -180,7 +180,7 @@ ERROR: node is still EOpNull! 0:91 'i' ( temp highp int) 0:92 imageStore ( global highp void) 0:92 'ii2da' ( writeonly uniform highp iimage2DArray) -0:92 Construct ivec3 ( temp 3-component vector of int) +0:92 Construct ivec3 ( temp highp 3-component vector of int) 0:92 'i' ( temp highp int) 0:92 'i' ( temp highp int) 0:92 'i' ( temp highp int) @@ -189,9 +189,9 @@ ERROR: node is still EOpNull! 0:92 0 (const int) 0:92 0 (const int) 0:92 0 (const int) -0:93 imageLoad ( global mediump 4-component vector of float) +0:93 imageLoad ( global mediump 4-component vector of float, operation at highp) 0:93 'img2Drgba' (layout( rgba32f) readonly uniform mediump image2D) -0:93 Construct ivec2 ( temp mediump 2-component vector of int) +0:93 Construct ivec2 ( temp highp 2-component vector of int) 0:93 'i' ( temp highp int) 0:93 'i' ( temp highp int) 0:94 imageLoad ( global highp 4-component vector of int) diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out index 9f73c675..e43a887c 100644 --- a/Test/baseResults/310.frag.out +++ b/Test/baseResults/310.frag.out @@ -270,7 +270,7 @@ ERROR: node is still EOpNull! 0:42 Constant: 0:42 0.000000 0:42 0.000000 -0:42 Convert float to int ( temp highp 2-component vector of int) +0:42 Convert float to int ( temp mediump 2-component vector of int) 0:42 'c2D' ( smooth in mediump 2-component vector of float) 0:43 textureProjGradOffset ( global highp 4-component vector of uint) 0:43 'usamp2d' ( uniform highp usampler2D) @@ -471,7 +471,7 @@ ERROR: node is still EOpNull! 0:211 Constant: 0:211 0.100000 0:211 0.100000 -0:211 Convert float to int ( temp highp 2-component vector of int) +0:211 Convert float to int ( temp mediump 2-component vector of int) 0:211 'inf' ( smooth in mediump 2-component vector of float) 0:212 textureGatherOffsets ( global highp 4-component vector of float) 0:212 direct index ( temp highp sampler2D) @@ -507,7 +507,7 @@ ERROR: node is still EOpNull! 0:221 Constant: 0:221 0.100000 0:221 0.100000 -0:221 Convert float to int ( temp highp 2-component vector of int) +0:221 Convert float to int ( temp mediump 2-component vector of int) 0:221 'inf' ( smooth in mediump 2-component vector of float) 0:222 textureGatherOffsets ( global highp 4-component vector of float) 0:222 direct index ( temp highp sampler2D) diff --git a/Test/baseResults/310.vert.out b/Test/baseResults/310.vert.out index 1d2152dd..13a88dff 100644 --- a/Test/baseResults/310.vert.out +++ b/Test/baseResults/310.vert.out @@ -330,7 +330,7 @@ ERROR: node is still EOpNull! 0:164 'sIndex' ( uniform highp int) 0:164 Constant: 0:164 2 (const int) -0:165 textureGatherOffset ( global lowp 4-component vector of float) +0:165 textureGatherOffset ( global lowp 4-component vector of float, operation at highp) 0:165 direct index ( temp lowp sampler2D) 0:165 'sArray' ( uniform 4-element array of lowp sampler2D) 0:165 Constant: @@ -338,7 +338,7 @@ ERROR: node is still EOpNull! 0:165 Constant: 0:165 0.100000 0:165 0.100000 -0:165 Convert float to int ( temp lowp 2-component vector of int) +0:165 Convert float to int ( temp highp 2-component vector of int) 0:165 'inf' ( in highp 2-component vector of float) 0:166 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) 0:166 direct index ( temp lowp sampler2D) @@ -394,7 +394,7 @@ ERROR: node is still EOpNull! 0:179 'sIndex' ( uniform highp int) 0:179 Constant: 0:179 2 (const int) -0:180 textureGatherOffset ( global lowp 4-component vector of float) +0:180 textureGatherOffset ( global lowp 4-component vector of float, operation at highp) 0:180 direct index ( temp lowp sampler2D) 0:180 'sArray' ( uniform 4-element array of lowp sampler2D) 0:180 Constant: @@ -402,7 +402,7 @@ ERROR: node is still EOpNull! 0:180 Constant: 0:180 0.100000 0:180 0.100000 -0:180 Convert float to int ( temp lowp 2-component vector of int) +0:180 Convert float to int ( temp highp 2-component vector of int) 0:180 'inf' ( in highp 2-component vector of float) 0:181 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) 0:181 direct index ( temp lowp sampler2D) diff --git a/Test/baseResults/320.frag.out b/Test/baseResults/320.frag.out index 002aa7f6..9f4a817b 100644 --- a/Test/baseResults/320.frag.out +++ b/Test/baseResults/320.frag.out @@ -121,7 +121,7 @@ ERROR: node is still EOpNull! 0:76 'inf' ( smooth in mediump 2-component vector of float) 0:76 'ing' ( smooth in mediump 2-component vector of float) 0:76 'h' ( noContraction temp mediump 2-component vector of float) -0:77 textureGatherOffset ( global lowp 4-component vector of float) +0:77 textureGatherOffset ( global lowp 4-component vector of float, operation at mediump) 0:77 direct index ( temp lowp sampler2D) 0:77 'sArray' ( uniform 4-element array of lowp sampler2D) 0:77 Constant: @@ -129,7 +129,7 @@ ERROR: node is still EOpNull! 0:77 Constant: 0:77 0.100000 0:77 0.100000 -0:77 Convert float to int ( temp lowp 2-component vector of int) +0:77 Convert float to int ( temp mediump 2-component vector of int) 0:77 'inf' ( smooth in mediump 2-component vector of float) 0:78 textureGatherOffsets ( global lowp 4-component vector of float, operation at mediump) 0:78 direct index ( temp lowp sampler2D) diff --git a/Test/baseResults/320.vert.out b/Test/baseResults/320.vert.out index 0313b619..5e80d141 100644 --- a/Test/baseResults/320.vert.out +++ b/Test/baseResults/320.vert.out @@ -99,7 +99,7 @@ ERROR: node is still EOpNull! 0:70 'sIndex' ( uniform highp int) 0:70 Constant: 0:70 2 (const int) -0:71 textureGatherOffset ( global lowp 4-component vector of float) +0:71 textureGatherOffset ( global lowp 4-component vector of float, operation at highp) 0:71 direct index ( temp lowp sampler2D) 0:71 'sArray' ( uniform 4-element array of lowp sampler2D) 0:71 Constant: @@ -107,7 +107,7 @@ ERROR: node is still EOpNull! 0:71 Constant: 0:71 0.100000 0:71 0.100000 -0:71 Convert float to int ( temp lowp 2-component vector of int) +0:71 Convert float to int ( temp highp 2-component vector of int) 0:71 'inf' ( in highp 2-component vector of float) 0:72 textureGatherOffsets ( global lowp 4-component vector of float, operation at highp) 0:72 direct index ( temp lowp sampler2D) diff --git a/Test/baseResults/glsl.es320.subgroup.geom.out b/Test/baseResults/glsl.es320.subgroup.geom.out index 5d18d30a..eab54542 100644 --- a/Test/baseResults/glsl.es320.subgroup.geom.out +++ b/Test/baseResults/glsl.es320.subgroup.geom.out @@ -16,7 +16,7 @@ output primitive = points 0:12 Constant: 0:12 0 (const uint) 0:12 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) -0:12 Construct uvec4 ( temp highp 4-component vector of uint) +0:12 Construct uvec4 ( temp mediump 4-component vector of uint) 0:12 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:12 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:12 Constant: @@ -47,7 +47,7 @@ output primitive = points 0:12 Constant: 0:12 0 (const uint) 0:12 'gl_PrimitiveIDIn' ( in highp int PrimitiveID) -0:12 Construct uvec4 ( temp highp 4-component vector of uint) +0:12 Construct uvec4 ( temp mediump 4-component vector of uint) 0:12 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:12 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:12 Constant: diff --git a/Test/baseResults/glsl.es320.subgroup.tesc.out b/Test/baseResults/glsl.es320.subgroup.tesc.out index 9512bc53..431a3c3f 100644 --- a/Test/baseResults/glsl.es320.subgroup.tesc.out +++ b/Test/baseResults/glsl.es320.subgroup.tesc.out @@ -13,7 +13,7 @@ vertices = 1 0:11 Constant: 0:11 0 (const uint) 0:11 'gl_PrimitiveID' ( in highp int PrimitiveID) -0:11 Construct uvec4 ( temp highp 4-component vector of uint) +0:11 Construct uvec4 ( temp mediump 4-component vector of uint) 0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:11 Constant: @@ -41,7 +41,7 @@ vertices = 1 0:11 Constant: 0:11 0 (const uint) 0:11 'gl_PrimitiveID' ( in highp int PrimitiveID) -0:11 Construct uvec4 ( temp highp 4-component vector of uint) +0:11 Construct uvec4 ( temp mediump 4-component vector of uint) 0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:11 Constant: diff --git a/Test/baseResults/glsl.es320.subgroup.tese.out b/Test/baseResults/glsl.es320.subgroup.tese.out index 29f7b73c..198a757a 100644 --- a/Test/baseResults/glsl.es320.subgroup.tese.out +++ b/Test/baseResults/glsl.es320.subgroup.tese.out @@ -15,7 +15,7 @@ triangle order = none 0:11 Constant: 0:11 0 (const uint) 0:11 'gl_PrimitiveID' ( in highp int PrimitiveID) -0:11 Construct uvec4 ( temp highp 4-component vector of uint) +0:11 Construct uvec4 ( temp mediump 4-component vector of uint) 0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:11 Constant: @@ -45,7 +45,7 @@ triangle order = ccw 0:11 Constant: 0:11 0 (const uint) 0:11 'gl_PrimitiveID' ( in highp int PrimitiveID) -0:11 Construct uvec4 ( temp highp 4-component vector of uint) +0:11 Construct uvec4 ( temp mediump 4-component vector of uint) 0:11 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:11 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:11 Constant: diff --git a/Test/baseResults/glsl.es320.subgroup.vert.out b/Test/baseResults/glsl.es320.subgroup.vert.out index bf1da492..e1a6bea7 100644 --- a/Test/baseResults/glsl.es320.subgroup.vert.out +++ b/Test/baseResults/glsl.es320.subgroup.vert.out @@ -12,7 +12,7 @@ Requested GL_KHR_shader_subgroup_basic 0:10 Constant: 0:10 0 (const uint) 0:10 'gl_VertexID' ( gl_VertexId highp int VertexId) -0:10 Construct uvec4 ( temp highp 4-component vector of uint) +0:10 Construct uvec4 ( temp mediump 4-component vector of uint) 0:10 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:10 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:10 Constant: @@ -41,7 +41,7 @@ Requested GL_KHR_shader_subgroup_basic 0:10 Constant: 0:10 0 (const uint) 0:10 'gl_VertexID' ( gl_VertexId highp int VertexId) -0:10 Construct uvec4 ( temp highp 4-component vector of uint) +0:10 Construct uvec4 ( temp mediump 4-component vector of uint) 0:10 'gl_SubgroupSize' ( in mediump uint SubgroupSize) 0:10 'gl_SubgroupInvocationID' ( in mediump uint SubgroupInvocationID) 0:10 Constant: diff --git a/Test/baseResults/spv.ext.AnyHitShader.rahit.out b/Test/baseResults/spv.ext.AnyHitShader.rahit.out index 7bcf8120..880be339 100644 --- a/Test/baseResults/spv.ext.AnyHitShader.rahit.out +++ b/Test/baseResults/spv.ext.AnyHitShader.rahit.out @@ -73,6 +73,7 @@ spv.ext.AnyHitShader.rahit Decorate 98(gl_SubgroupSize) RelaxedPrecision Decorate 98(gl_SubgroupSize) BuiltIn SubgroupSize Decorate 99 RelaxedPrecision + Decorate 100 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.ext.ClosestHitShader_Subgroup.rchit.out b/Test/baseResults/spv.ext.ClosestHitShader_Subgroup.rchit.out index 14ec09b8..7f5af89d 100644 --- a/Test/baseResults/spv.ext.ClosestHitShader_Subgroup.rchit.out +++ b/Test/baseResults/spv.ext.ClosestHitShader_Subgroup.rchit.out @@ -38,10 +38,21 @@ spv.ext.ClosestHitShader_Subgroup.rchit Decorate 28(gl_SubgroupInvocationID) RelaxedPrecision Decorate 28(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 29 RelaxedPrecision + Decorate 30 RelaxedPrecision Decorate 34(gl_SubGroupGeMaskARB) BuiltIn SubgroupGeMaskKHR + Decorate 41 RelaxedPrecision + Decorate 42 RelaxedPrecision Decorate 43(gl_SubgroupGtMask) BuiltIn SubgroupGtMaskKHR + Decorate 46 RelaxedPrecision + Decorate 46 RelaxedPrecision + Decorate 47 RelaxedPrecision Decorate 48(gl_SubgroupLeMask) BuiltIn SubgroupLeMaskKHR + Decorate 51 RelaxedPrecision + Decorate 51 RelaxedPrecision + Decorate 52 RelaxedPrecision Decorate 53(gl_SubGroupLtMaskARB) BuiltIn SubgroupLtMaskKHR + Decorate 59 RelaxedPrecision + Decorate 60 RelaxedPrecision Decorate 61(gl_SMIDNV) BuiltIn SMIDNV 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.precise.tese.out b/Test/baseResults/spv.precise.tese.out index a23b0739..7db4ed01 100644 --- a/Test/baseResults/spv.precise.tese.out +++ b/Test/baseResults/spv.precise.tese.out @@ -36,10 +36,6 @@ spv.precise.tese Decorate 43 NoContraction Decorate 62(in_f_color) RelaxedPrecision Decorate 62(in_f_color) Location 0 - Decorate 67 RelaxedPrecision - Decorate 68 RelaxedPrecision - Decorate 69 RelaxedPrecision - Decorate 70 RelaxedPrecision Decorate 97 NoContraction Decorate 99 NoContraction Decorate 101 NoContraction diff --git a/Test/baseResults/spv.subgroup.frag.out b/Test/baseResults/spv.subgroup.frag.out index ad115863..a3e427f0 100644 --- a/Test/baseResults/spv.subgroup.frag.out +++ b/Test/baseResults/spv.subgroup.frag.out @@ -24,6 +24,7 @@ spv.subgroup.frag Decorate 13(gl_SubgroupInvocationID) Flat Decorate 13(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 14 RelaxedPrecision + Decorate 16 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.subgroup.geom.out b/Test/baseResults/spv.subgroup.geom.out index c866f8ec..27f05b2f 100644 --- a/Test/baseResults/spv.subgroup.geom.out +++ b/Test/baseResults/spv.subgroup.geom.out @@ -33,6 +33,7 @@ spv.subgroup.geom Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 21 RelaxedPrecision + Decorate 23 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.subgroup.tesc.out b/Test/baseResults/spv.subgroup.tesc.out index ed6b5c1e..8322a4a1 100644 --- a/Test/baseResults/spv.subgroup.tesc.out +++ b/Test/baseResults/spv.subgroup.tesc.out @@ -30,6 +30,7 @@ spv.subgroup.tesc Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 21 RelaxedPrecision + Decorate 23 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.subgroup.tese.out b/Test/baseResults/spv.subgroup.tese.out index 70cdc962..360f98be 100644 --- a/Test/baseResults/spv.subgroup.tese.out +++ b/Test/baseResults/spv.subgroup.tese.out @@ -32,6 +32,7 @@ spv.subgroup.tese Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 21 RelaxedPrecision + Decorate 23 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.subgroup.vert.out b/Test/baseResults/spv.subgroup.vert.out index 34b090d4..6de8a0ae 100644 --- a/Test/baseResults/spv.subgroup.vert.out +++ b/Test/baseResults/spv.subgroup.vert.out @@ -29,6 +29,7 @@ spv.subgroup.vert Decorate 20(gl_SubgroupInvocationID) RelaxedPrecision Decorate 20(gl_SubgroupInvocationID) BuiltIn SubgroupLocalInvocationId Decorate 21 RelaxedPrecision + Decorate 23 RelaxedPrecision 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.uint.frag.out b/Test/baseResults/spv.uint.frag.out index c19064d4..7dbc3b37 100644 --- a/Test/baseResults/spv.uint.frag.out +++ b/Test/baseResults/spv.uint.frag.out @@ -75,6 +75,7 @@ spv.uint.frag Decorate 90 RelaxedPrecision Decorate 91 RelaxedPrecision Decorate 92 RelaxedPrecision + Decorate 93 RelaxedPrecision Decorate 97 RelaxedPrecision Decorate 98 RelaxedPrecision Decorate 101 RelaxedPrecision diff --git a/Test/baseResults/uint.frag.out b/Test/baseResults/uint.frag.out index 3a12d6b7..ce6d02d3 100644 --- a/Test/baseResults/uint.frag.out +++ b/Test/baseResults/uint.frag.out @@ -134,7 +134,7 @@ ERROR: node is still EOpNull! 0:59 Condition 0:59 Compare Equal ( temp bool) 0:59 'shiftedii' ( temp mediump int) -0:59 Convert uint to int ( temp int) +0:59 Convert uint to int ( temp mediump int) 0:59 'shiftedui' ( temp mediump uint) 0:59 true case 0:60 move second child to first child ( temp mediump 4-component vector of uint) @@ -433,7 +433,7 @@ ERROR: node is still EOpNull! 0:59 Condition 0:59 Compare Equal ( temp bool) 0:59 'shiftedii' ( temp mediump int) -0:59 Convert uint to int ( temp int) +0:59 Convert uint to int ( temp mediump int) 0:59 'shiftedui' ( temp mediump uint) 0:59 true case 0:60 move second child to first child ( temp mediump 4-component vector of uint) diff --git a/Test/baseResults/vulkan.ast.vert.out b/Test/baseResults/vulkan.ast.vert.out index 05a63553..68e892b4 100644 --- a/Test/baseResults/vulkan.ast.vert.out +++ b/Test/baseResults/vulkan.ast.vert.out @@ -19,10 +19,10 @@ Shader version: 450 0:14 Convert bool to float ( temp float) 0:14 'scbt' ( specialization-constant const bool) 0:14 true (const bool) -0:15 Convert int to float ( temp float) +0:15 Convert int to float ( temp highp float) 0:15 'sci2' ( specialization-constant const highp int) 0:15 2 (const int) -0:17 Convert float to int ( temp int) +0:17 Convert float to int ( temp highp int) 0:17 'scf1' ( specialization-constant const highp float) 0:17 1.000000 0:18 Convert bool to int ( specialization-constant const int) @@ -86,34 +86,34 @@ Shader version: 450 0:35 2 (const int) 0:35 'sci2' ( specialization-constant const highp int) 0:35 2 (const int) -0:37 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:37 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:37 'sci2' ( specialization-constant const highp int) 0:37 2 (const int) 0:37 'sci2' ( specialization-constant const highp int) 0:37 2 (const int) -0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int) -0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 Construct ivec2 ( temp 2-element array of highp 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) -0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) -0:40 Construct vec2 ( specialization-constant const 2-component vector of float) +0:40 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:40 'scf1' ( specialization-constant const highp float) 0:40 1.000000 0:40 'scf1' ( specialization-constant const highp float) 0:40 1.000000 -0:41 Construct vec2 ( temp 2-element array of 2-component vector of float) -0:41 Construct vec2 ( specialization-constant const 2-component vector of float) +0:41 Construct vec2 ( temp 2-element array of highp 2-component vector of float) +0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 -0:41 Construct vec2 ( specialization-constant const 2-component vector of float) +0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 0:41 'scf1' ( specialization-constant const highp float) @@ -150,10 +150,10 @@ Shader version: 450 0:14 Convert bool to float ( temp float) 0:14 'scbt' ( specialization-constant const bool) 0:14 true (const bool) -0:15 Convert int to float ( temp float) +0:15 Convert int to float ( temp highp float) 0:15 'sci2' ( specialization-constant const highp int) 0:15 2 (const int) -0:17 Convert float to int ( temp int) +0:17 Convert float to int ( temp highp int) 0:17 'scf1' ( specialization-constant const highp float) 0:17 1.000000 0:18 Convert bool to int ( specialization-constant const int) @@ -217,34 +217,34 @@ Shader version: 450 0:35 2 (const int) 0:35 'sci2' ( specialization-constant const highp int) 0:35 2 (const int) -0:37 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:37 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:37 'sci2' ( specialization-constant const highp int) 0:37 2 (const int) 0:37 'sci2' ( specialization-constant const highp int) 0:37 2 (const int) -0:38 Construct ivec2 ( temp 2-element array of 2-component vector of int) -0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 Construct ivec2 ( temp 2-element array of highp 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) -0:38 Construct ivec2 ( specialization-constant const 2-component vector of int) +0:38 Construct ivec2 ( specialization-constant const highp 2-component vector of int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) 0:38 'sci2' ( specialization-constant const highp int) 0:38 2 (const int) -0:40 Construct vec2 ( specialization-constant const 2-component vector of float) +0:40 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:40 'scf1' ( specialization-constant const highp float) 0:40 1.000000 0:40 'scf1' ( specialization-constant const highp float) 0:40 1.000000 -0:41 Construct vec2 ( temp 2-element array of 2-component vector of float) -0:41 Construct vec2 ( specialization-constant const 2-component vector of float) +0:41 Construct vec2 ( temp 2-element array of highp 2-component vector of float) +0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 -0:41 Construct vec2 ( specialization-constant const 2-component vector of float) +0:41 Construct vec2 ( specialization-constant const highp 2-component vector of float) 0:41 'scf1' ( specialization-constant const highp float) 0:41 1.000000 0:41 'scf1' ( specialization-constant const highp float) diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index 1e6ab4aa..595bd623 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -1643,6 +1643,7 @@ public: ~TIntermAggregate() { delete pragmaTable; } virtual TIntermAggregate* getAsAggregate() { return this; } virtual const TIntermAggregate* getAsAggregate() const { return this; } + virtual void updatePrecision(); virtual void setOperator(TOperator o) { op = o; } virtual TIntermSequence& getSequence() { return sequence; } virtual const TIntermSequence& getSequence() const { return sequence; } diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 02784459..1283f449 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -416,20 +416,24 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, // TODO: but, did this bypass constant folding? // switch (op) { - case EOpConstructInt8: - case EOpConstructUint8: - case EOpConstructInt16: - case EOpConstructUint16: - case EOpConstructInt: - case EOpConstructUint: - case EOpConstructInt64: - case EOpConstructUint64: - case EOpConstructBool: - case EOpConstructFloat: - case EOpConstructDouble: - case EOpConstructFloat16: - return child; - default: break; // some compilers want this + case EOpConstructInt8: + case EOpConstructUint8: + case EOpConstructInt16: + case EOpConstructUint16: + case EOpConstructInt: + case EOpConstructUint: + case EOpConstructInt64: + case EOpConstructUint64: + case EOpConstructBool: + case EOpConstructFloat: + case EOpConstructDouble: + case EOpConstructFloat16: { + TIntermUnary* unary_node = child->getAsUnaryNode(); + if (unary_node != nullptr) + unary_node->updatePrecision(); + return child; + } + default: break; // some compilers want this } // @@ -3776,6 +3780,28 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node) return false; } +// Propagate precision qualifiers *up* from children to parent, and then +// back *down* again to the children's subtrees. +void TIntermAggregate::updatePrecision() +{ + if (getBasicType() == EbtInt || getBasicType() == EbtUint || + getBasicType() == EbtFloat || getBasicType() == EbtFloat16) { + TPrecisionQualifier maxPrecision = EpqNone; + TIntermSequence operands = getSequence(); + for (unsigned int i = 0; i < operands.size(); ++i) { + TIntermTyped* typedNode = operands[i]->getAsTyped(); + assert(typedNode); + maxPrecision = std::max(maxPrecision, typedNode->getQualifier().precision); + } + getQualifier().precision = maxPrecision; + for (unsigned int i = 0; i < operands.size(); ++i) { + TIntermTyped* typedNode = operands[i]->getAsTyped(); + assert(typedNode); + typedNode->propagatePrecision(maxPrecision); + } + } +} + // Propagate precision qualifiers *up* from children to parent, and then // back *down* again to the children's subtrees. void TIntermBinary::updatePrecision() diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index b957bb87..a2dd5a65 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -7691,7 +7691,13 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* return nullptr; } - return intermediate.setAggregateOperator(aggrNode, op, type, loc); + TIntermTyped *ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc); + + TIntermAggregate *agg_node = ret_node->getAsAggregate(); + if (agg_node && agg_node->isVector()) + agg_node->updatePrecision(); + + return ret_node; } // Function for constructor implementation. Calls addUnaryMath with appropriate EOp value From 12e27e17deb3102f1f6f08ec19caf5e32becb3f8 Mon Sep 17 00:00:00 2001 From: InsertAReallyCreativeNameHere Date: Thu, 9 Sep 2021 06:43:23 +1000 Subject: [PATCH 15/64] Change MINGW_HAS_SECURE_API checks. MINGW_HAS_SECURE_API can be defined as 0, but this will be ignored here without this change. Without these *_s "safe" functions, this code will also build on Windows XP. --- glslang/Include/Common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 1e47239a..e7b5e072 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -61,7 +61,7 @@ std::string to_string(const T& val) { } #endif -#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API +#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || MINGW_HAS_SECURE_API #include #ifndef snprintf #define snprintf sprintf_s @@ -213,7 +213,7 @@ template T Max(const T a, const T b) { return a > b ? a : b; } // // Create a TString object from an integer. // -#if defined _MSC_VER || defined MINGW_HAS_SECURE_API +#if defined _MSC_VER || MINGW_HAS_SECURE_API inline const TString String(const int i, const int base = 10) { char text[16]; // 32 bit ints are at most 10 digits in base 10 From 62ed14518fdfb5e264b5efecf0a182a069acff84 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Tue, 14 Sep 2021 12:17:58 -0600 Subject: [PATCH 16/64] Run update_precision() on array and matrix constructors. --- glslang/MachineIndependent/ParseHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index a2dd5a65..b2b187b4 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -7694,7 +7694,7 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* TIntermTyped *ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc); TIntermAggregate *agg_node = ret_node->getAsAggregate(); - if (agg_node && agg_node->isVector()) + if (agg_node && (agg_node->isVector() || agg_node->isArray() || agg_node->isMatrix())) agg_node->updatePrecision(); return ret_node; From d3bff63caedced00e022ca046b547598f5d1c25d Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Wed, 15 Sep 2021 23:39:02 -0400 Subject: [PATCH 17/64] avoid growing the global uniform block with duplicates When using GL_EXT_vulkan_glsl_relaxed, check to see if a uniform already exists in the block uniform block, and if so, ensure they are the same type. Otherwise, avoid growing the block with a duplicate. --- glslang/MachineIndependent/ParseContextBase.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/glslang/MachineIndependent/ParseContextBase.cpp b/glslang/MachineIndependent/ParseContextBase.cpp index 02cca409..1da50d62 100644 --- a/glslang/MachineIndependent/ParseContextBase.cpp +++ b/glslang/MachineIndependent/ParseContextBase.cpp @@ -622,6 +622,19 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem globalUniformBlock->getWritableType().getQualifier().layoutBinding = globalUniformBinding; globalUniformBlock->getWritableType().getQualifier().layoutSet = globalUniformSet; + // Check for declarations of this default uniform that already exist due to other compilation units. + TSymbol* symbol = symbolTable.find(memberName); + if (symbol) { + if (memberType != symbol->getType()) { + TString err; + err += "\"" + memberType.getCompleteString() + "\""; + err += " versus "; + err += "\"" + symbol->getType().getCompleteString() + "\""; + error(loc, "Types must match:", memberType.getFieldName().c_str(), err.c_str()); + } + return; + } + // Add the requested member as a member to the global block. TType* type = new TType; type->shallowCopy(memberType); From 05794b46a73add190282014443dff92fd4c179bc Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Thu, 16 Sep 2021 17:40:49 -0400 Subject: [PATCH 18/64] GL_EXT_vulkan_glsl_relaxed - retarget gl_VertexID to gl_VertexIndex instead of allowing for multiple declarations of the variable in the resulting SPIR-V, instead use a retargeted mechanism to cause references to gl_VertexID and gl_InstanceID to use the gl_VertexIndex and gl_InstanceIndex symbol. --- .../baseResults/vk.relaxed.changeSet.vert.out | 20 ++--- .../vk.relaxed.errorcheck.vert.out | 8 +- .../baseResults/vk.relaxed.stagelink.vert.out | 82 +++++++++++-------- Test/vk.relaxed.stagelink.vert | 6 +- glslang/MachineIndependent/Initialize.cpp | 9 +- glslang/MachineIndependent/SymbolTable.cpp | 38 ++++++++- glslang/MachineIndependent/SymbolTable.h | 29 ++++++- 7 files changed, 133 insertions(+), 59 deletions(-) diff --git a/Test/baseResults/vk.relaxed.changeSet.vert.out b/Test/baseResults/vk.relaxed.changeSet.vert.out index f6bce292..d2beff93 100755 --- a/Test/baseResults/vk.relaxed.changeSet.vert.out +++ b/Test/baseResults/vk.relaxed.changeSet.vert.out @@ -34,8 +34,8 @@ Shader version: 460 0:? 'Color' ( smooth out highp 4-component vector of float) 0:? 'UV' ( smooth out highp 2-component vector of float) 0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance, out unsized 1-element array of float CullDistance gl_CullDistance}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) vk.relaxed.changeSet.frag Shader version: 460 @@ -108,8 +108,8 @@ Shader version: 460 0:? 'Color' ( smooth out highp 4-component vector of float) 0:? 'UV' ( smooth out highp 2-component vector of float) 0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, out 1-element array of float CullDistance gl_CullDistance}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) Shader version: 460 gl_FragCoord origin is upper left 0:? Sequence @@ -162,8 +162,8 @@ gl_FragCoord origin is upper left MemberName 28(gl_DefaultUniformBlock) 0 "projectionMatrix" Name 30 "" Name 34 "aPos" - Name 44 "gl_VertexID" - Name 45 "gl_InstanceID" + Name 44 "gl_VertexIndex" + Name 45 "gl_InstanceIndex" Decorate 9(Color) Location 0 Decorate 11(aColor) Location 2 Decorate 15(UV) Location 1 @@ -180,8 +180,8 @@ gl_FragCoord origin is upper left Decorate 30 DescriptorSet 0 Decorate 30 Binding 0 Decorate 34(aPos) Location 0 - Decorate 44(gl_VertexID) BuiltIn VertexIndex - Decorate 45(gl_InstanceID) BuiltIn InstanceIndex + Decorate 44(gl_VertexIndex) BuiltIn VertexIndex + Decorate 45(gl_InstanceIndex) BuiltIn InstanceIndex 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -212,8 +212,8 @@ gl_FragCoord origin is upper left 36: 6(float) Constant 0 37: 6(float) Constant 1065353216 43: TypePointer Input 25(int) - 44(gl_VertexID): 43(ptr) Variable Input -45(gl_InstanceID): 43(ptr) Variable Input +44(gl_VertexIndex): 43(ptr) Variable Input +45(gl_InstanceIndex): 43(ptr) Variable Input 4(main): 2 Function None 3 5: Label 12: 7(fvec4) Load 11(aColor) diff --git a/Test/baseResults/vk.relaxed.errorcheck.vert.out b/Test/baseResults/vk.relaxed.errorcheck.vert.out index f19eae64..5c6ecf92 100644 --- a/Test/baseResults/vk.relaxed.errorcheck.vert.out +++ b/Test/baseResults/vk.relaxed.errorcheck.vert.out @@ -28,8 +28,8 @@ Shader version: 460 0:? Linker Objects 0:? 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 2-component vector of float a}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) vk.relaxed.errorcheck.frag Shader version: 460 @@ -94,8 +94,8 @@ Shader version: 460 0:? Linker Objects 0:? 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 2-component vector of float a}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) Shader version: 460 gl_FragCoord origin is upper left 0:? Sequence diff --git a/Test/baseResults/vk.relaxed.stagelink.vert.out b/Test/baseResults/vk.relaxed.stagelink.vert.out index a63f10c3..b9173f24 100644 --- a/Test/baseResults/vk.relaxed.stagelink.vert.out +++ b/Test/baseResults/vk.relaxed.stagelink.vert.out @@ -93,7 +93,9 @@ Shader version: 460 0:28 'anon@0' (layout( column_major std140) uniform block{ uniform highp 4-component vector of float a, uniform highp 2-component vector of float b2, uniform highp 2-component vector of float b1, uniform highp 4-component vector of float c2, uniform highp 4-component vector of float d, uniform 4-element array of highp 4-component vector of float s}) 0:28 Constant: 0:28 5 (const uint) -0:28 'gl_VertexID' ( in int VertexIndex) +0:28 subtract ( temp int) +0:28 'gl_VertexIndex' ( in int VertexIndex) +0:28 'gl_VertexIndex' ( in int VertexIndex) 0:29 move second child to first child ( temp highp float) 0:29 direct index ( temp highp float) 0:29 'v' ( temp highp 4-component vector of float) @@ -105,7 +107,9 @@ Shader version: 460 0:29 Constant: 0:29 0 (const int) 0:29 Convert int to float ( temp highp float) -0:29 'gl_InstanceID' ( in highp int InstanceIndex) +0:29 subtract ( temp highp int) +0:29 'gl_InstanceIndex' ( in highp int InstanceIndex) +0:29 'gl_InstanceIndex' ( in highp int InstanceIndex) 0:30 move second child to first child ( temp highp 4-component vector of float) 0:30 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:30 'v' ( temp highp 4-component vector of float) @@ -113,8 +117,8 @@ Shader version: 460 0:? 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 4-component vector of float a, uniform highp 2-component vector of float b2, uniform highp 2-component vector of float b1, uniform highp 4-component vector of float c2, uniform highp 4-component vector of float d, uniform 4-element array of highp 4-component vector of float s}) 0:? 'anon@1' (layout( column_major std430) buffer block{ coherent volatile buffer highp uint counter3, coherent volatile buffer highp uint counter2}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) vk.relaxed.stagelink.frag Shader version: 460 @@ -311,7 +315,9 @@ Shader version: 460 0:28 'anon@0' (layout( column_major std140) uniform block{ uniform highp 4-component vector of float a, uniform highp 2-component vector of float b2, uniform highp 2-component vector of float b1, uniform highp 4-component vector of float c2, uniform highp 4-component vector of float d, uniform 4-element array of highp 4-component vector of float s}) 0:28 Constant: 0:28 5 (const uint) -0:28 'gl_VertexID' ( in int VertexIndex) +0:28 subtract ( temp int) +0:28 'gl_VertexIndex' ( in int VertexIndex) +0:28 'gl_VertexIndex' ( in int VertexIndex) 0:29 move second child to first child ( temp highp float) 0:29 direct index ( temp highp float) 0:29 'v' ( temp highp 4-component vector of float) @@ -323,7 +329,9 @@ Shader version: 460 0:29 Constant: 0:29 0 (const int) 0:29 Convert int to float ( temp highp float) -0:29 'gl_InstanceID' ( in highp int InstanceIndex) +0:29 subtract ( temp highp int) +0:29 'gl_InstanceIndex' ( in highp int InstanceIndex) +0:29 'gl_InstanceIndex' ( in highp int InstanceIndex) 0:30 move second child to first child ( temp highp 4-component vector of float) 0:30 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:30 'v' ( temp highp 4-component vector of float) @@ -331,8 +339,8 @@ Shader version: 460 0:? 'io' (layout( location=0) smooth out highp 4-component vector of float) 0:? 'anon@0' (layout( column_major std140) uniform block{ uniform highp 4-component vector of float a, uniform highp 2-component vector of float b2, uniform highp 2-component vector of float b1, uniform highp 4-component vector of float c2, uniform highp 4-component vector of float d, uniform 4-element array of highp 4-component vector of float s}) 0:? 'anon@1' (layout( column_major std430) buffer block{ coherent volatile buffer highp uint counter3, coherent volatile buffer highp uint counter2}) -0:? 'gl_VertexID' ( in int VertexIndex) -0:? 'gl_InstanceID' ( in int InstanceIndex) +0:? 'gl_VertexIndex' ( in int VertexIndex) +0:? 'gl_InstanceIndex' ( in int InstanceIndex) Shader version: 460 gl_FragCoord origin is upper left 0:? Sequence @@ -428,12 +436,12 @@ gl_FragCoord origin is upper left // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 88 +// Id's are bound by 92 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 72 80 86 + EntryPoint Vertex 4 "main" 72 82 90 Source GLSL 460 Name 4 "main" Name 9 "foo(" @@ -454,9 +462,9 @@ gl_FragCoord origin is upper left MemberName 35(gl_DefaultUniformBlock) 6 "c1" Name 37 "" Name 67 "v" - Name 72 "gl_VertexID" - Name 80 "gl_InstanceID" - Name 86 "io" + Name 72 "gl_VertexIndex" + Name 82 "gl_InstanceIndex" + Name 90 "io" MemberDecorate 14(gl_AtomicCounterBlock_0) 0 Coherent MemberDecorate 14(gl_AtomicCounterBlock_0) 0 Volatile MemberDecorate 14(gl_AtomicCounterBlock_0) 0 Coherent @@ -483,9 +491,9 @@ gl_FragCoord origin is upper left Decorate 35(gl_DefaultUniformBlock) Block Decorate 37 DescriptorSet 0 Decorate 37 Binding 0 - Decorate 72(gl_VertexID) BuiltIn VertexIndex - Decorate 80(gl_InstanceID) BuiltIn InstanceIndex - Decorate 86(io) Location 0 + Decorate 72(gl_VertexIndex) BuiltIn VertexIndex + Decorate 82(gl_InstanceIndex) BuiltIn InstanceIndex + Decorate 90(io) Location 0 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -517,31 +525,35 @@ gl_FragCoord origin is upper left 57: 17(int) Constant 4 70: 17(int) Constant 5 71: TypePointer Input 17(int) - 72(gl_VertexID): 71(ptr) Variable Input - 77: TypePointer Function 6(float) -80(gl_InstanceID): 71(ptr) Variable Input - 85: TypePointer Output 7(fvec4) - 86(io): 85(ptr) Variable Output +72(gl_VertexIndex): 71(ptr) Variable Input + 79: TypePointer Function 6(float) +82(gl_InstanceIndex): 71(ptr) Variable Input + 89: TypePointer Output 7(fvec4) + 90(io): 89(ptr) Variable Output 4(main): 2 Function None 3 5: Label 67(v): 30(ptr) Variable Function 68: 7(fvec4) FunctionCall 9(foo() Store 67(v) 68 69: 7(fvec4) Load 67(v) - 73: 17(int) Load 72(gl_VertexID) - 74: 38(ptr) AccessChain 37 70 73 - 75: 7(fvec4) Load 74 - 76: 7(fvec4) FAdd 69 75 - Store 67(v) 76 - 78: 77(ptr) AccessChain 67(v) 22 - 79: 6(float) Load 78 - 81: 17(int) Load 80(gl_InstanceID) - 82: 6(float) ConvertSToF 81 - 83: 6(float) FSub 79 82 - 84: 77(ptr) AccessChain 67(v) 22 - Store 84 83 - 87: 7(fvec4) Load 67(v) - Store 86(io) 87 + 73: 17(int) Load 72(gl_VertexIndex) + 74: 17(int) Load 72(gl_VertexIndex) + 75: 17(int) ISub 73 74 + 76: 38(ptr) AccessChain 37 70 75 + 77: 7(fvec4) Load 76 + 78: 7(fvec4) FAdd 69 77 + Store 67(v) 78 + 80: 79(ptr) AccessChain 67(v) 22 + 81: 6(float) Load 80 + 83: 17(int) Load 82(gl_InstanceIndex) + 84: 17(int) Load 82(gl_InstanceIndex) + 85: 17(int) ISub 83 84 + 86: 6(float) ConvertSToF 85 + 87: 6(float) FSub 81 86 + 88: 79(ptr) AccessChain 67(v) 22 + Store 88 87 + 91: 7(fvec4) Load 67(v) + Store 90(io) 91 Return FunctionEnd 9(foo(): 7(fvec4) Function None 8 diff --git a/Test/vk.relaxed.stagelink.vert b/Test/vk.relaxed.stagelink.vert index 52396ac5..d2ac6af6 100644 --- a/Test/vk.relaxed.stagelink.vert +++ b/Test/vk.relaxed.stagelink.vert @@ -25,7 +25,7 @@ vec4 foo() { void main() { vec4 v = foo(); - v = v + s[gl_VertexID]; - v.x = v.x - float(gl_InstanceID); + v = v + s[gl_VertexID - gl_VertexIndex]; + v.x = v.x - float(gl_InstanceID - gl_InstanceIndex); io = v; -} \ No newline at end of file +} diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 823406c1..ee4e2cab 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -7701,6 +7701,11 @@ static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolT symQualifier.builtIn = builtIn; } +static void RetargetVariable(const char* from, const char* to, TSymbolTable& symbolTable) +{ + symbolTable.retargetSymbol(from, to); +} + // // For built-in variables inside a named block. // SpecialQualifier() won't ever go inside a block; their member's qualifier come @@ -7768,8 +7773,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) { // treat these built-ins as aliases of VertexIndex and InstanceIndex - BuiltInVariable("gl_VertexID", EbvVertexIndex, symbolTable); - BuiltInVariable("gl_InstanceID", EbvInstanceIndex, symbolTable); + RetargetVariable("gl_InstanceID", "gl_InstanceIndex", symbolTable); + RetargetVariable("gl_VertexID", "gl_VertexIndex", symbolTable); } if (profile != EEsProfile) { diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 747b4366..5b7e27fa 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -279,8 +279,14 @@ TFunction::~TFunction() // TSymbolTableLevel::~TSymbolTableLevel() { - for (tLevel::iterator it = level.begin(); it != level.end(); ++it) - delete (*it).second; + for (tLevel::iterator it = level.begin(); it != level.end(); ++it) { + const TString& name = it->first; + auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(), + [&name](const std::pair& i) { return i.first == name; }); + if (retargetIter == retargetedSymbols.end()) + delete (*it).second; + } + delete [] defaultPrecision; } @@ -418,6 +424,15 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const TSymbolTableLevel *symTableLevel = new TSymbolTableLevel(); symTableLevel->anonId = anonId; symTableLevel->thisLevel = thisLevel; + symTableLevel->retargetedSymbols.clear(); + for (auto &s : retargetedSymbols) { + // Extra constructions to make sure they use the correct allocator pool + TString newFrom; + newFrom = s.first; + TString newTo; + newTo = s.second; + symTableLevel->retargetedSymbols.push_back({std::move(newFrom), std::move(newTo)}); + } std::vector containerCopied(anonId, false); tLevel::const_iterator iter; for (iter = level.begin(); iter != level.end(); ++iter) { @@ -433,8 +448,25 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const symTableLevel->insert(*container, false); containerCopied[anon->getAnonId()] = true; } - } else + } else { + const TString& name = iter->first; + auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(), + [&name](const std::pair& i) { return i.first == name; }); + if (retargetIter != retargetedSymbols.end()) + continue; symTableLevel->insert(*iter->second->clone(), false); + } + } + // Now point retargeted symbols to the newly created versions of them + for (auto &s : retargetedSymbols) { + TSymbol* sym = symTableLevel->find(s.second); + if (!sym) + continue; + + // Need to declare and assign so newS is using the correct pool allocator + TString newS; + newS = s.first; + symTableLevel->insert(newS, sym); } return symTableLevel; diff --git a/glslang/MachineIndependent/SymbolTable.h b/glslang/MachineIndependent/SymbolTable.h index 21960930..720999a3 100644 --- a/glslang/MachineIndependent/SymbolTable.h +++ b/glslang/MachineIndependent/SymbolTable.h @@ -413,13 +413,20 @@ public: TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { } ~TSymbolTableLevel(); - bool insert(TSymbol& symbol, bool separateNameSpaces) + bool insert(const TString& name, TSymbol* symbol) { + return level.insert(tLevelPair(name, symbol)).second; + } + + bool insert(TSymbol& symbol, bool separateNameSpaces, const TString& forcedKeyName = TString()) { // // returning true means symbol was added to the table with no semantic errors // const TString& name = symbol.getName(); - if (name == "") { + if (forcedKeyName.length()) { + return level.insert(tLevelPair(forcedKeyName, &symbol)).second; + } + else if (name == "") { symbol.getAsVariable()->setAnonId(anonId++); // An empty name means an anonymous container, exposing its members to the external scope. // Give it a name and insert its members in the symbol table, pointing to the container. @@ -471,6 +478,16 @@ public: return true; } + void retargetSymbol(const TString& from, const TString& to) { + tLevel::const_iterator fromIt = level.find(from); + tLevel::const_iterator toIt = level.find(to); + if (fromIt == level.end() || toIt == level.end()) + return; + delete fromIt->second; + level[from] = toIt->second; + retargetedSymbols.push_back({from, to}); + } + TSymbol* find(const TString& name) const { tLevel::const_iterator it = level.find(name); @@ -583,6 +600,8 @@ protected: tLevel level; // named mappings TPrecisionQualifier *defaultPrecision; + // pair + TVector> retargetedSymbols; int anonId; bool thisLevel; // True if this level of the symbol table is a structure scope containing member function // that are supposed to see anonymous access to member variables. @@ -788,6 +807,12 @@ public: return symbol; } + void retargetSymbol(const TString& from, const TString& to) { + int level = currentLevel(); + table[level]->retargetSymbol(from, to); + } + + // Find of a symbol that returns how many layers deep of nested // structures-with-member-functions ('this' scopes) deep the symbol was // found in. From 8b87b840011b724cf76afc7241d5c4c26901910a Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Fri, 17 Sep 2021 17:14:36 -0600 Subject: [PATCH 19/64] Fix SPIR-V for SampleBias Fixes #2757 --- .../hlsl.samplebias.offset.dx10.frag.out | 147 +++++++++--------- .../hlsl.samplebias.offsetarray.dx10.frag.out | 99 ++++++------ glslang/HLSL/hlslParseHelper.cpp | 6 +- glslang/HLSL/hlslParseables.cpp | 4 +- 4 files changed, 127 insertions(+), 129 deletions(-) diff --git a/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out b/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out index 478091db..291f6248 100644 --- a/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out +++ b/Test/baseResults/hlsl.samplebias.offset.dx10.frag.out @@ -16,9 +16,9 @@ using depth_any 0:31 Constant: 0:31 0.100000 0:31 Constant: -0:31 0.500000 -0:31 Constant: 0:31 1 (const int) +0:31 Constant: +0:31 0.500000 0:32 Sequence 0:32 move second child to first child ( temp 4-component vector of int) 0:32 'txval11' ( temp 4-component vector of int) @@ -29,9 +29,9 @@ using depth_any 0:32 Constant: 0:32 0.200000 0:32 Constant: -0:32 0.500000 -0:32 Constant: 0:32 1 (const int) +0:32 Constant: +0:32 0.500000 0:33 Sequence 0:33 move second child to first child ( temp 4-component vector of uint) 0:33 'txval12' ( temp 4-component vector of uint) @@ -42,9 +42,9 @@ using depth_any 0:33 Constant: 0:33 0.300000 0:33 Constant: -0:33 0.500000 -0:33 Constant: 0:33 1 (const int) +0:33 Constant: +0:33 0.500000 0:35 Sequence 0:35 move second child to first child ( temp 4-component vector of float) 0:35 'txval20' ( temp 4-component vector of float) @@ -56,10 +56,10 @@ using depth_any 0:35 0.100000 0:35 0.200000 0:35 Constant: -0:35 0.500000 -0:35 Constant: 0:35 1 (const int) 0:35 0 (const int) +0:35 Constant: +0:35 0.500000 0:36 Sequence 0:36 move second child to first child ( temp 4-component vector of int) 0:36 'txval21' ( temp 4-component vector of int) @@ -71,10 +71,10 @@ using depth_any 0:36 0.300000 0:36 0.400000 0:36 Constant: -0:36 0.500000 +0:36 1 (const int) +0:36 1 (const int) 0:36 Constant: -0:36 1 (const int) -0:36 1 (const int) +0:36 0.500000 0:37 Sequence 0:37 move second child to first child ( temp 4-component vector of uint) 0:37 'txval22' ( temp 4-component vector of uint) @@ -86,10 +86,10 @@ using depth_any 0:37 0.500000 0:37 0.600000 0:37 Constant: -0:37 0.500000 -0:37 Constant: 0:37 1 (const int) 0:37 -1 (const int) +0:37 Constant: +0:37 0.500000 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) 0:39 'txval30' ( temp 4-component vector of float) @@ -102,11 +102,11 @@ using depth_any 0:39 0.200000 0:39 0.300000 0:39 Constant: -0:39 0.500000 -0:39 Constant: 0:39 1 (const int) 0:39 0 (const int) 0:39 1 (const int) +0:39 Constant: +0:39 0.500000 0:40 Sequence 0:40 move second child to first child ( temp 4-component vector of int) 0:40 'txval31' ( temp 4-component vector of int) @@ -119,11 +119,11 @@ using depth_any 0:40 0.500000 0:40 0.600000 0:40 Constant: -0:40 0.500000 +0:40 1 (const int) +0:40 1 (const int) +0:40 1 (const int) 0:40 Constant: -0:40 1 (const int) -0:40 1 (const int) -0:40 1 (const int) +0:40 0.500000 0:41 Sequence 0:41 move second child to first child ( temp 4-component vector of uint) 0:41 'txval32' ( temp 4-component vector of uint) @@ -136,11 +136,11 @@ using depth_any 0:41 0.800000 0:41 0.900000 0:41 Constant: -0:41 0.500000 -0:41 Constant: 0:41 1 (const int) 0:41 0 (const int) 0:41 -1 (const int) +0:41 Constant: +0:41 0.500000 0:45 move second child to first child ( temp 4-component vector of float) 0:45 Color: direct index for structure ( temp 4-component vector of float) 0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) @@ -218,9 +218,9 @@ using depth_any 0:31 Constant: 0:31 0.100000 0:31 Constant: -0:31 0.500000 -0:31 Constant: 0:31 1 (const int) +0:31 Constant: +0:31 0.500000 0:32 Sequence 0:32 move second child to first child ( temp 4-component vector of int) 0:32 'txval11' ( temp 4-component vector of int) @@ -231,9 +231,9 @@ using depth_any 0:32 Constant: 0:32 0.200000 0:32 Constant: -0:32 0.500000 -0:32 Constant: 0:32 1 (const int) +0:32 Constant: +0:32 0.500000 0:33 Sequence 0:33 move second child to first child ( temp 4-component vector of uint) 0:33 'txval12' ( temp 4-component vector of uint) @@ -244,9 +244,9 @@ using depth_any 0:33 Constant: 0:33 0.300000 0:33 Constant: -0:33 0.500000 -0:33 Constant: 0:33 1 (const int) +0:33 Constant: +0:33 0.500000 0:35 Sequence 0:35 move second child to first child ( temp 4-component vector of float) 0:35 'txval20' ( temp 4-component vector of float) @@ -258,10 +258,10 @@ using depth_any 0:35 0.100000 0:35 0.200000 0:35 Constant: -0:35 0.500000 -0:35 Constant: 0:35 1 (const int) 0:35 0 (const int) +0:35 Constant: +0:35 0.500000 0:36 Sequence 0:36 move second child to first child ( temp 4-component vector of int) 0:36 'txval21' ( temp 4-component vector of int) @@ -273,10 +273,10 @@ using depth_any 0:36 0.300000 0:36 0.400000 0:36 Constant: -0:36 0.500000 +0:36 1 (const int) +0:36 1 (const int) 0:36 Constant: -0:36 1 (const int) -0:36 1 (const int) +0:36 0.500000 0:37 Sequence 0:37 move second child to first child ( temp 4-component vector of uint) 0:37 'txval22' ( temp 4-component vector of uint) @@ -288,10 +288,10 @@ using depth_any 0:37 0.500000 0:37 0.600000 0:37 Constant: -0:37 0.500000 -0:37 Constant: 0:37 1 (const int) 0:37 -1 (const int) +0:37 Constant: +0:37 0.500000 0:39 Sequence 0:39 move second child to first child ( temp 4-component vector of float) 0:39 'txval30' ( temp 4-component vector of float) @@ -304,11 +304,11 @@ using depth_any 0:39 0.200000 0:39 0.300000 0:39 Constant: -0:39 0.500000 -0:39 Constant: 0:39 1 (const int) 0:39 0 (const int) 0:39 1 (const int) +0:39 Constant: +0:39 0.500000 0:40 Sequence 0:40 move second child to first child ( temp 4-component vector of int) 0:40 'txval31' ( temp 4-component vector of int) @@ -321,11 +321,11 @@ using depth_any 0:40 0.500000 0:40 0.600000 0:40 Constant: -0:40 0.500000 +0:40 1 (const int) +0:40 1 (const int) +0:40 1 (const int) 0:40 Constant: -0:40 1 (const int) -0:40 1 (const int) -0:40 1 (const int) +0:40 0.500000 0:41 Sequence 0:41 move second child to first child ( temp 4-component vector of uint) 0:41 'txval32' ( temp 4-component vector of uint) @@ -338,11 +338,11 @@ using depth_any 0:41 0.800000 0:41 0.900000 0:41 Constant: -0:41 0.500000 -0:41 Constant: 0:41 1 (const int) 0:41 0 (const int) 0:41 -1 (const int) +0:41 Constant: +0:41 0.500000 0:45 move second child to first child ( temp 4-component vector of float) 0:45 Color: direct index for structure ( temp 4-component vector of float) 0:45 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) @@ -399,7 +399,6 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -Validation failed // Module Version 10000 // Generated by (magic number): 8000a // Id's are bound by 161 @@ -489,12 +488,12 @@ Validation failed 20(g_sSamp): 19(ptr) Variable UniformConstant 22: TypeSampledImage 14 24: 6(float) Constant 1036831949 - 25: 6(float) Constant 1056964608 - 26: TypeInt 32 1 - 27: 26(int) Constant 1 - 29: TypeVector 26(int) 4 + 25: TypeInt 32 1 + 26: 25(int) Constant 1 + 27: 6(float) Constant 1056964608 + 29: TypeVector 25(int) 4 30: TypePointer Function 29(ivec4) - 32: TypeImage 26(int) 1D sampled format:Unknown + 32: TypeImage 25(int) 1D sampled format:Unknown 33: TypePointer UniformConstant 32 34(g_tTex1di4): 33(ptr) Variable UniformConstant 37: TypeSampledImage 32 @@ -513,38 +512,38 @@ Validation failed 60: TypeSampledImage 55 62: TypeVector 6(float) 2 63: 62(fvec2) ConstantComposite 24 39 - 64: TypeVector 26(int) 2 - 65: 26(int) Constant 0 - 66: 64(ivec2) ConstantComposite 27 65 - 69: TypeImage 26(int) 2D sampled format:Unknown + 64: TypeVector 25(int) 2 + 65: 25(int) Constant 0 + 66: 64(ivec2) ConstantComposite 26 65 + 69: TypeImage 25(int) 2D sampled format:Unknown 70: TypePointer UniformConstant 69 71(g_tTex2di4): 70(ptr) Variable UniformConstant 74: TypeSampledImage 69 76: 6(float) Constant 1053609165 77: 62(fvec2) ConstantComposite 52 76 - 78: 64(ivec2) ConstantComposite 27 27 + 78: 64(ivec2) ConstantComposite 26 26 81: TypeImage 41(int) 2D sampled format:Unknown 82: TypePointer UniformConstant 81 83(g_tTex2du4): 82(ptr) Variable UniformConstant 86: TypeSampledImage 81 88: 6(float) Constant 1058642330 - 89: 62(fvec2) ConstantComposite 25 88 - 90: 26(int) Constant 4294967295 - 91: 64(ivec2) ConstantComposite 27 90 + 89: 62(fvec2) ConstantComposite 27 88 + 90: 25(int) Constant 4294967295 + 91: 64(ivec2) ConstantComposite 26 90 94: TypeImage 6(float) 3D sampled format:Unknown 95: TypePointer UniformConstant 94 96(g_tTex3df4): 95(ptr) Variable UniformConstant 99: TypeSampledImage 94 101: TypeVector 6(float) 3 102: 101(fvec3) ConstantComposite 24 39 52 - 103: TypeVector 26(int) 3 - 104: 103(ivec3) ConstantComposite 27 65 27 - 107: TypeImage 26(int) 3D sampled format:Unknown + 103: TypeVector 25(int) 3 + 104: 103(ivec3) ConstantComposite 26 65 26 + 107: TypeImage 25(int) 3D sampled format:Unknown 108: TypePointer UniformConstant 107 109(g_tTex3di4): 108(ptr) Variable UniformConstant 112: TypeSampledImage 107 - 114: 101(fvec3) ConstantComposite 76 25 88 - 115: 103(ivec3) ConstantComposite 27 27 27 + 114: 101(fvec3) ConstantComposite 76 27 88 + 115: 103(ivec3) ConstantComposite 26 26 26 118: TypeImage 41(int) 3D sampled format:Unknown 119: TypePointer UniformConstant 118 120(g_tTex3du4): 119(ptr) Variable UniformConstant @@ -553,7 +552,7 @@ Validation failed 126: 6(float) Constant 1061997773 127: 6(float) Constant 1063675494 128: 101(fvec3) ConstantComposite 125 126 127 - 129: 103(ivec3) ConstantComposite 27 65 90 + 129: 103(ivec3) ConstantComposite 26 65 90 131: TypePointer Function 8(PS_OUTPUT) 133: 6(float) Constant 1065353216 134: 7(fvec4) ConstantComposite 133 133 133 133 @@ -566,7 +565,7 @@ Validation failed 152: TypeImage 6(float) Cube sampled format:Unknown 153: TypePointer UniformConstant 152 154(g_tTexcdf4): 153(ptr) Variable UniformConstant - 155: TypeImage 26(int) Cube sampled format:Unknown + 155: TypeImage 25(int) Cube sampled format:Unknown 156: TypePointer UniformConstant 155 157(g_tTexcdi4): 156(ptr) Variable UniformConstant 158: TypeImage 41(int) Cube sampled format:Unknown @@ -580,7 +579,7 @@ Validation failed 145: 12(ptr) AccessChain 141(flattenTemp) 65 146: 7(fvec4) Load 145 Store 144(@entryPointOutput.Color) 146 - 149: 136(ptr) AccessChain 141(flattenTemp) 27 + 149: 136(ptr) AccessChain 141(flattenTemp) 26 150: 6(float) Load 149 Store 148(@entryPointOutput.Depth) 150 Return @@ -600,51 +599,51 @@ Validation failed 17: 14 Load 16(g_tTex1df4) 21: 18 Load 20(g_sSamp) 23: 22 SampledImage 17 21 - 28: 7(fvec4) ImageSampleImplicitLod 23 24 Bias ConstOffset 27 25 + 28: 7(fvec4) ImageSampleImplicitLod 23 24 Bias ConstOffset 27 26 Store 13(txval10) 28 35: 32 Load 34(g_tTex1di4) 36: 18 Load 20(g_sSamp) 38: 37 SampledImage 35 36 - 40: 29(ivec4) ImageSampleImplicitLod 38 39 Bias ConstOffset 27 25 + 40: 29(ivec4) ImageSampleImplicitLod 38 39 Bias ConstOffset 27 26 Store 31(txval11) 40 48: 45 Load 47(g_tTex1du4) 49: 18 Load 20(g_sSamp) 51: 50 SampledImage 48 49 - 53: 42(ivec4) ImageSampleImplicitLod 51 52 Bias ConstOffset 27 25 + 53: 42(ivec4) ImageSampleImplicitLod 51 52 Bias ConstOffset 27 26 Store 44(txval12) 53 58: 55 Load 57(g_tTex2df4) 59: 18 Load 20(g_sSamp) 61: 60 SampledImage 58 59 - 67: 7(fvec4) ImageSampleImplicitLod 61 63 Bias ConstOffset 66 25 + 67: 7(fvec4) ImageSampleImplicitLod 61 63 Bias ConstOffset 27 66 Store 54(txval20) 67 72: 69 Load 71(g_tTex2di4) 73: 18 Load 20(g_sSamp) 75: 74 SampledImage 72 73 - 79: 29(ivec4) ImageSampleImplicitLod 75 77 Bias ConstOffset 78 25 + 79: 29(ivec4) ImageSampleImplicitLod 75 77 Bias ConstOffset 27 78 Store 68(txval21) 79 84: 81 Load 83(g_tTex2du4) 85: 18 Load 20(g_sSamp) 87: 86 SampledImage 84 85 - 92: 42(ivec4) ImageSampleImplicitLod 87 89 Bias ConstOffset 91 25 + 92: 42(ivec4) ImageSampleImplicitLod 87 89 Bias ConstOffset 27 91 Store 80(txval22) 92 97: 94 Load 96(g_tTex3df4) 98: 18 Load 20(g_sSamp) 100: 99 SampledImage 97 98 - 105: 7(fvec4) ImageSampleImplicitLod 100 102 Bias ConstOffset 104 25 + 105: 7(fvec4) ImageSampleImplicitLod 100 102 Bias ConstOffset 27 104 Store 93(txval30) 105 110: 107 Load 109(g_tTex3di4) 111: 18 Load 20(g_sSamp) 113: 112 SampledImage 110 111 - 116: 29(ivec4) ImageSampleImplicitLod 113 114 Bias ConstOffset 115 25 + 116: 29(ivec4) ImageSampleImplicitLod 113 114 Bias ConstOffset 27 115 Store 106(txval31) 116 121: 118 Load 120(g_tTex3du4) 122: 18 Load 20(g_sSamp) 124: 123 SampledImage 121 122 - 130: 42(ivec4) ImageSampleImplicitLod 124 128 Bias ConstOffset 129 25 + 130: 42(ivec4) ImageSampleImplicitLod 124 128 Bias ConstOffset 27 129 Store 117(txval32) 130 135: 12(ptr) AccessChain 132(psout) 65 Store 135 134 - 137: 136(ptr) AccessChain 132(psout) 27 + 137: 136(ptr) AccessChain 132(psout) 26 Store 137 133 138:8(PS_OUTPUT) Load 132(psout) ReturnValue 138 diff --git a/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out b/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out index f5aff67f..a5bb6139 100644 --- a/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out +++ b/Test/baseResults/hlsl.samplebias.offsetarray.dx10.frag.out @@ -17,9 +17,9 @@ using depth_any 0:23 0.100000 0:23 0.200000 0:23 Constant: -0:23 0.500000 -0:23 Constant: 0:23 0 (const int) +0:23 Constant: +0:23 0.500000 0:24 Sequence 0:24 move second child to first child ( temp 4-component vector of int) 0:24 'txval11' ( temp 4-component vector of int) @@ -31,9 +31,9 @@ using depth_any 0:24 0.200000 0:24 0.300000 0:24 Constant: -0:24 0.500000 -0:24 Constant: 0:24 1 (const int) +0:24 Constant: +0:24 0.500000 0:25 Sequence 0:25 move second child to first child ( temp 4-component vector of uint) 0:25 'txval12' ( temp 4-component vector of uint) @@ -45,9 +45,9 @@ using depth_any 0:25 0.300000 0:25 0.400000 0:25 Constant: -0:25 0.500000 -0:25 Constant: 0:25 2 (const int) +0:25 Constant: +0:25 0.500000 0:27 Sequence 0:27 move second child to first child ( temp 4-component vector of float) 0:27 'txval20' ( temp 4-component vector of float) @@ -60,10 +60,10 @@ using depth_any 0:27 0.200000 0:27 0.300000 0:27 Constant: -0:27 0.500000 +0:27 0 (const int) +0:27 0 (const int) 0:27 Constant: -0:27 0 (const int) -0:27 0 (const int) +0:27 0.500000 0:28 Sequence 0:28 move second child to first child ( temp 4-component vector of int) 0:28 'txval21' ( temp 4-component vector of int) @@ -76,10 +76,10 @@ using depth_any 0:28 0.400000 0:28 0.500000 0:28 Constant: -0:28 0.500000 +0:28 0 (const int) +0:28 0 (const int) 0:28 Constant: -0:28 0 (const int) -0:28 0 (const int) +0:28 0.500000 0:29 Sequence 0:29 move second child to first child ( temp 4-component vector of uint) 0:29 'txval22' ( temp 4-component vector of uint) @@ -92,10 +92,10 @@ using depth_any 0:29 0.600000 0:29 0.700000 0:29 Constant: -0:29 0.500000 -0:29 Constant: 0:29 0 (const int) 0:29 1 (const int) +0:29 Constant: +0:29 0.500000 0:33 move second child to first child ( temp 4-component vector of float) 0:33 Color: direct index for structure ( temp 4-component vector of float) 0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) @@ -168,9 +168,9 @@ using depth_any 0:23 0.100000 0:23 0.200000 0:23 Constant: -0:23 0.500000 -0:23 Constant: 0:23 0 (const int) +0:23 Constant: +0:23 0.500000 0:24 Sequence 0:24 move second child to first child ( temp 4-component vector of int) 0:24 'txval11' ( temp 4-component vector of int) @@ -182,9 +182,9 @@ using depth_any 0:24 0.200000 0:24 0.300000 0:24 Constant: -0:24 0.500000 -0:24 Constant: 0:24 1 (const int) +0:24 Constant: +0:24 0.500000 0:25 Sequence 0:25 move second child to first child ( temp 4-component vector of uint) 0:25 'txval12' ( temp 4-component vector of uint) @@ -196,9 +196,9 @@ using depth_any 0:25 0.300000 0:25 0.400000 0:25 Constant: -0:25 0.500000 -0:25 Constant: 0:25 2 (const int) +0:25 Constant: +0:25 0.500000 0:27 Sequence 0:27 move second child to first child ( temp 4-component vector of float) 0:27 'txval20' ( temp 4-component vector of float) @@ -211,10 +211,10 @@ using depth_any 0:27 0.200000 0:27 0.300000 0:27 Constant: -0:27 0.500000 +0:27 0 (const int) +0:27 0 (const int) 0:27 Constant: -0:27 0 (const int) -0:27 0 (const int) +0:27 0.500000 0:28 Sequence 0:28 move second child to first child ( temp 4-component vector of int) 0:28 'txval21' ( temp 4-component vector of int) @@ -227,10 +227,10 @@ using depth_any 0:28 0.400000 0:28 0.500000 0:28 Constant: -0:28 0.500000 +0:28 0 (const int) +0:28 0 (const int) 0:28 Constant: -0:28 0 (const int) -0:28 0 (const int) +0:28 0.500000 0:29 Sequence 0:29 move second child to first child ( temp 4-component vector of uint) 0:29 'txval22' ( temp 4-component vector of uint) @@ -243,10 +243,10 @@ using depth_any 0:29 0.600000 0:29 0.700000 0:29 Constant: -0:29 0.500000 -0:29 Constant: 0:29 0 (const int) 0:29 1 (const int) +0:29 Constant: +0:29 0.500000 0:33 move second child to first child ( temp 4-component vector of float) 0:33 Color: direct index for structure ( temp 4-component vector of float) 0:33 'psout' ( temp structure{ temp 4-component vector of float Color, temp float Depth}) @@ -297,7 +297,6 @@ using depth_any 0:? '@entryPointOutput.Depth' ( out float FragDepth) 0:? '@entryPointOutput.Color' (layout( location=0) out 4-component vector of float) -Validation failed // Module Version 10000 // Generated by (magic number): 8000a // Id's are bound by 118 @@ -369,18 +368,18 @@ Validation failed 25: 6(float) Constant 1036831949 26: 6(float) Constant 1045220557 27: 24(fvec2) ConstantComposite 25 26 - 28: 6(float) Constant 1056964608 - 29: TypeInt 32 1 - 30: 29(int) Constant 0 - 32: TypeVector 29(int) 4 + 28: TypeInt 32 1 + 29: 28(int) Constant 0 + 30: 6(float) Constant 1056964608 + 32: TypeVector 28(int) 4 33: TypePointer Function 32(ivec4) - 35: TypeImage 29(int) 1D array sampled format:Unknown + 35: TypeImage 28(int) 1D array sampled format:Unknown 36: TypePointer UniformConstant 35 37(g_tTex1di4): 36(ptr) Variable UniformConstant 40: TypeSampledImage 35 42: 6(float) Constant 1050253722 43: 24(fvec2) ConstantComposite 26 42 - 44: 29(int) Constant 1 + 44: 28(int) Constant 1 46: TypeInt 32 0 47: TypeVector 46(int) 4 48: TypePointer Function 47(ivec4) @@ -390,28 +389,28 @@ Validation failed 55: TypeSampledImage 50 57: 6(float) Constant 1053609165 58: 24(fvec2) ConstantComposite 42 57 - 59: 29(int) Constant 2 + 59: 28(int) Constant 2 62: TypeImage 6(float) 2D array sampled format:Unknown 63: TypePointer UniformConstant 62 64(g_tTex2df4): 63(ptr) Variable UniformConstant 67: TypeSampledImage 62 69: TypeVector 6(float) 3 70: 69(fvec3) ConstantComposite 25 26 42 - 71: TypeVector 29(int) 2 - 72: 71(ivec2) ConstantComposite 30 30 - 75: TypeImage 29(int) 2D array sampled format:Unknown + 71: TypeVector 28(int) 2 + 72: 71(ivec2) ConstantComposite 29 29 + 75: TypeImage 28(int) 2D array sampled format:Unknown 76: TypePointer UniformConstant 75 77(g_tTex2di4): 76(ptr) Variable UniformConstant 80: TypeSampledImage 75 - 82: 69(fvec3) ConstantComposite 42 57 28 + 82: 69(fvec3) ConstantComposite 42 57 30 85: TypeImage 46(int) 2D array sampled format:Unknown 86: TypePointer UniformConstant 85 87(g_tTex2du4): 86(ptr) Variable UniformConstant 90: TypeSampledImage 85 92: 6(float) Constant 1058642330 93: 6(float) Constant 1060320051 - 94: 69(fvec3) ConstantComposite 28 92 93 - 95: 71(ivec2) ConstantComposite 30 44 + 94: 69(fvec3) ConstantComposite 30 92 93 + 95: 71(ivec2) ConstantComposite 29 44 97: TypePointer Function 8(PS_OUTPUT) 99: 6(float) Constant 1065353216 100: 7(fvec4) ConstantComposite 99 99 99 99 @@ -426,7 +425,7 @@ Validation failed 107(flattenTemp): 97(ptr) Variable Function 108:8(PS_OUTPUT) FunctionCall 10(@main() Store 107(flattenTemp) 108 - 111: 12(ptr) AccessChain 107(flattenTemp) 30 + 111: 12(ptr) AccessChain 107(flattenTemp) 29 112: 7(fvec4) Load 111 Store 110(@entryPointOutput.Color) 112 115: 102(ptr) AccessChain 107(flattenTemp) 44 @@ -446,34 +445,34 @@ Validation failed 17: 14 Load 16(g_tTex1df4) 21: 18 Load 20(g_sSamp) 23: 22 SampledImage 17 21 - 31: 7(fvec4) ImageSampleImplicitLod 23 27 Bias ConstOffset 30 28 + 31: 7(fvec4) ImageSampleImplicitLod 23 27 Bias ConstOffset 30 29 Store 13(txval10) 31 38: 35 Load 37(g_tTex1di4) 39: 18 Load 20(g_sSamp) 41: 40 SampledImage 38 39 - 45: 32(ivec4) ImageSampleImplicitLod 41 43 Bias ConstOffset 44 28 + 45: 32(ivec4) ImageSampleImplicitLod 41 43 Bias ConstOffset 30 44 Store 34(txval11) 45 53: 50 Load 52(g_tTex1du4) 54: 18 Load 20(g_sSamp) 56: 55 SampledImage 53 54 - 60: 47(ivec4) ImageSampleImplicitLod 56 58 Bias ConstOffset 59 28 + 60: 47(ivec4) ImageSampleImplicitLod 56 58 Bias ConstOffset 30 59 Store 49(txval12) 60 65: 62 Load 64(g_tTex2df4) 66: 18 Load 20(g_sSamp) 68: 67 SampledImage 65 66 - 73: 7(fvec4) ImageSampleImplicitLod 68 70 Bias ConstOffset 72 28 + 73: 7(fvec4) ImageSampleImplicitLod 68 70 Bias ConstOffset 30 72 Store 61(txval20) 73 78: 75 Load 77(g_tTex2di4) 79: 18 Load 20(g_sSamp) 81: 80 SampledImage 78 79 - 83: 32(ivec4) ImageSampleImplicitLod 81 82 Bias ConstOffset 72 28 + 83: 32(ivec4) ImageSampleImplicitLod 81 82 Bias ConstOffset 30 72 Store 74(txval21) 83 88: 85 Load 87(g_tTex2du4) 89: 18 Load 20(g_sSamp) 91: 90 SampledImage 88 89 - 96: 47(ivec4) ImageSampleImplicitLod 91 94 Bias ConstOffset 95 28 + 96: 47(ivec4) ImageSampleImplicitLod 91 94 Bias ConstOffset 30 95 Store 84(txval22) 96 - 101: 12(ptr) AccessChain 98(psout) 30 + 101: 12(ptr) AccessChain 98(psout) 29 Store 101 100 103: 102(ptr) AccessChain 98(psout) 44 Store 103 99 diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index 02aac3c6..39b3ecac 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -4017,12 +4017,12 @@ void HlslParseContext::decomposeSampleMethods(const TSourceLoc& loc, TIntermType txsample->getSequence().push_back(txcombine); txsample->getSequence().push_back(argCoord); - if (argBias != nullptr) - txsample->getSequence().push_back(argBias); - if (argOffset != nullptr) txsample->getSequence().push_back(argOffset); + if (argBias != nullptr) + txsample->getSequence().push_back(argBias); + node = convertReturn(txsample, sampler); break; diff --git a/glslang/HLSL/hlslParseables.cpp b/glslang/HLSL/hlslParseables.cpp index 4673b460..15918dc3 100644 --- a/glslang/HLSL/hlslParseables.cpp +++ b/glslang/HLSL/hlslParseables.cpp @@ -665,8 +665,8 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c { "Sample", /*!O*/ "V4", nullptr, "%@,S,V", "FIU,S,F", EShLangPS, true }, { "Sample", /* O*/ "V4", nullptr, "%@,S,V,", "FIU,S,F,I", EShLangPS, true }, - { "SampleBias", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,S,F,", EShLangPS, true }, - { "SampleBias", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,S,F,,I", EShLangPS, true }, + { "SampleBias", /*!O*/ "V4", nullptr, "%@,S,V,S", "FIU,S,F,F", EShLangPS, true }, + { "SampleBias", /* O*/ "V4", nullptr, "%@,S,V,S,V", "FIU,S,F,F,I", EShLangPS, true }, // TODO: FXC accepts int/uint samplers here. unclear what that means. { "SampleCmp", /*!O*/ "S", "F", "%@,S,V,S", "FIU,s,F,", EShLangPS, true }, From 3f04389a1806c74355236ecd0a2493d701b19d87 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Wed, 22 Sep 2021 13:41:10 -0400 Subject: [PATCH 20/64] Auto push constant blocks (#2764) * add ability to upgrade uniform block to push constants assuming it fits within the size limit imposed by the caller * allow selecting the packing for the auto push constants * check the size using the potential layout packing of the push constants --- glslang/Include/Types.h | 10 +++++++ glslang/MachineIndependent/iomapper.cpp | 31 +++++++++++++++++++++ glslang/MachineIndependent/iomapper.h | 16 ++++++++++- glslang/MachineIndependent/linkValidate.cpp | 2 +- 4 files changed, 57 insertions(+), 2 deletions(-) diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index a6bf191d..f4f3f341 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -741,6 +741,16 @@ public: } } + bool isUniform() const + { + switch (storage) { + case EvqUniform: + return true; + default: + return false; + } + } + bool isIo() const { switch (storage) { diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp index 7e12864f..3486ea6d 100644 --- a/glslang/MachineIndependent/iomapper.cpp +++ b/glslang/MachineIndependent/iomapper.cpp @@ -1633,6 +1633,37 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) { return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second); }); resolver->endResolve(EShLangCount); + if (autoPushConstantBlockName.length()) { + bool upgraded = false; + for (size_t stage = 0; stage < EShLangCount; stage++) { + if (intermediates[stage] != nullptr) { + TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap; + auto at = pUniformVarMap[stage]->find(autoPushConstantBlockName); + if (at == pUniformVarMap[stage]->end()) + continue; + TQualifier& qualifier = at->second.symbol->getQualifier(); + if (!qualifier.isUniform()) + continue; + TType& t = at->second.symbol->getWritableType(); + int size, stride; + TIntermediate::getBaseAlignment(t, size, stride, autoPushConstantBlockPacking, + qualifier.layoutMatrix == ElmRowMajor); + if (size <= int(autoPushConstantMaxSize)) { + qualifier.setBlockStorage(EbsPushConstant); + qualifier.layoutPacking = autoPushConstantBlockPacking; + upgraded = true; + } + } + } + // If it's been upgraded to push_constant, then remove it from the uniformVector + // so it doesn't get a set/binding assigned to it. + if (upgraded) { + auto at = std::find_if(uniformVector.begin(), uniformVector.end(), + [this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; }); + if (at != uniformVector.end()) + uniformVector.erase(at); + } + } for (size_t stage = 0; stage < EShLangCount; stage++) { if (intermediates[stage] != nullptr) { // traverse each stage, set new location to each input/output and unifom symbol, set new binding to diff --git a/glslang/MachineIndependent/iomapper.h b/glslang/MachineIndependent/iomapper.h index 07357c2e..843ea73c 100644 --- a/glslang/MachineIndependent/iomapper.h +++ b/glslang/MachineIndependent/iomapper.h @@ -291,7 +291,7 @@ public: bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; } }; -// I/O mapper for OpenGL +// I/O mapper for GLSL class TGlslIoMapper : public TIoMapper { public: TGlslIoMapper() { @@ -301,6 +301,8 @@ public: memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1)); profile = ENoProfile; version = 0; + autoPushConstantMaxSize = 128; + autoPushConstantBlockPacking = ElpStd430; } virtual ~TGlslIoMapper() { for (size_t stage = 0; stage < EShLangCount; stage++) { @@ -319,6 +321,13 @@ public: if (intermediates[stage] != nullptr) intermediates[stage] = nullptr; } + } + // If set, the uniform block with the given name will be changed to be backed by + // push_constant if it's size is <= maxSize + void setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) { + autoPushConstantBlockName = name; + autoPushConstantMaxSize = maxSize; + autoPushConstantBlockPacking = packing; } // grow the reflection stage by stage bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override; @@ -329,6 +338,11 @@ public: bool hadError = false; EProfile profile; int version; + +private: + TString autoPushConstantBlockName; + unsigned int autoPushConstantMaxSize; + TLayoutPacking autoPushConstantBlockPacking; }; } // end namespace glslang diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 4a68130a..4edd2a90 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -1934,7 +1934,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, T } // rule 9 - if (type.getBasicType() == EbtStruct) { + if (type.getBasicType() == EbtStruct || type.getBasicType() == EbtBlock) { const TTypeList& memberList = *type.getStruct(); size = 0; From 4ea41b650d2f2465b64e169e42e27e20928bbcad Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 22 Sep 2021 15:12:49 -0600 Subject: [PATCH 21/64] Fix unreachable code in getSampledType() Fixed #2763 --- SPIRV/GlslangToSpv.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 71b00d72..421e650e 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -3940,12 +3940,14 @@ spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler) builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float_fetch); builder.addCapability(spv::CapabilityFloat16ImageAMD); return builder.makeFloatType(16); - case glslang::EbtInt64: return builder.makeIntType(64); + case glslang::EbtInt64: builder.addExtension(spv::E_SPV_EXT_shader_image_int64); - builder.addCapability(spv::CapabilityFloat16ImageAMD); - case glslang::EbtUint64: return builder.makeUintType(64); + builder.addCapability(spv::CapabilityInt64ImageEXT); + return builder.makeIntType(64); + case glslang::EbtUint64: builder.addExtension(spv::E_SPV_EXT_shader_image_int64); - builder.addCapability(spv::CapabilityFloat16ImageAMD); + builder.addCapability(spv::CapabilityInt64ImageEXT); + return builder.makeUintType(64); #endif default: assert(0); From 3d03b7822e88cdd78512598560378ed589abe428 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 23 Sep 2021 10:40:43 -0600 Subject: [PATCH 22/64] Scalarize vector readFirstInvocationARB (#2766) Fixes #2761 --- SPIRV/GlslangToSpv.cpp | 6 +- Test/baseResults/spv.shaderBallot.comp.out | 258 +++++++++++++-------- 2 files changed, 161 insertions(+), 103 deletions(-) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 71b00d72..11174709 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -7506,6 +7506,8 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op break; case glslang::EOpReadFirstInvocation: opCode = spv::OpSubgroupFirstInvocationKHR; + if (builder.isVectorType(typeId)) + return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands); break; case glslang::EOpBallot: { @@ -7630,7 +7632,7 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv assert(op == spv::OpGroupFMin || op == spv::OpGroupUMin || op == spv::OpGroupSMin || op == spv::OpGroupFMax || op == spv::OpGroupUMax || op == spv::OpGroupSMax || op == spv::OpGroupFAdd || op == spv::OpGroupIAdd || op == spv::OpGroupBroadcast || - op == spv::OpSubgroupReadInvocationKHR || + op == spv::OpSubgroupReadInvocationKHR || op == spv::OpSubgroupFirstInvocationKHR || op == spv::OpGroupFMinNonUniformAMD || op == spv::OpGroupUMinNonUniformAMD || op == spv::OpGroupSMinNonUniformAMD || op == spv::OpGroupFMaxNonUniformAMD || op == spv::OpGroupUMaxNonUniformAMD || @@ -7659,6 +7661,8 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv spvGroupOperands.push_back(scalar); spv::IdImmediate operand = { true, operands[1] }; spvGroupOperands.push_back(operand); + } else if (op == spv::OpSubgroupFirstInvocationKHR) { + spvGroupOperands.push_back(scalar); } else if (op == spv::OpGroupBroadcast) { spv::IdImmediate scope = { true, builder.makeUintConstant(spv::ScopeSubgroup) }; spvGroupOperands.push_back(scope); diff --git a/Test/baseResults/spv.shaderBallot.comp.out b/Test/baseResults/spv.shaderBallot.comp.out index 93385297..2a0106e6 100644 --- a/Test/baseResults/spv.shaderBallot.comp.out +++ b/Test/baseResults/spv.shaderBallot.comp.out @@ -1,7 +1,7 @@ spv.shaderBallot.comp // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 343 +// Id's are bound by 397 Capability Shader Capability Int64 @@ -42,7 +42,7 @@ spv.shaderBallot.comp Decorate 72(Buffers) BufferBlock Decorate 75(data) DescriptorSet 0 Decorate 75(data) Binding 0 - Decorate 342 BuiltIn WorkgroupSize + Decorate 396 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -89,8 +89,8 @@ spv.shaderBallot.comp 196: TypePointer Uniform 6(int) 203: TypePointer Uniform 20(ivec4) 218: TypeVector 6(int) 3 - 341: 6(int) Constant 8 - 342: 218(ivec3) ConstantComposite 341 341 100 + 395: 6(int) Constant 8 + 396: 218(ivec3) ConstantComposite 395 395 100 4(main): 2 Function None 3 5: Label 8(invocation): 7(ptr) Variable Function @@ -329,107 +329,161 @@ spv.shaderBallot.comp 257: 88(ptr) AccessChain 75(data) 86 77 258: 69(fvec4) Load 257 259: 87(fvec2) VectorShuffle 258 258 0 1 - 260: 87(fvec2) SubgroupFirstInvocationKHR 259 - 261: 79(ptr) AccessChain 75(data) 256 77 78 - 262: 68(float) CompositeExtract 260 0 - Store 261 262 - 263: 79(ptr) AccessChain 75(data) 256 77 100 - 264: 68(float) CompositeExtract 260 1 - Store 263 264 - 265: 6(int) Load 8(invocation) - 266: 88(ptr) AccessChain 75(data) 104 77 - 267: 69(fvec4) Load 266 - 268: 105(fvec3) VectorShuffle 267 267 0 1 2 - 269: 105(fvec3) SubgroupFirstInvocationKHR 268 - 270: 79(ptr) AccessChain 75(data) 265 77 78 - 271: 68(float) CompositeExtract 269 0 - Store 270 271 - 272: 79(ptr) AccessChain 75(data) 265 77 100 - 273: 68(float) CompositeExtract 269 1 - Store 272 273 - 274: 79(ptr) AccessChain 75(data) 265 77 121 - 275: 68(float) CompositeExtract 269 2 - Store 274 275 - 276: 6(int) Load 8(invocation) - 277: 88(ptr) AccessChain 75(data) 125 77 - 278: 69(fvec4) Load 277 - 279: 69(fvec4) SubgroupFirstInvocationKHR 278 - 280: 88(ptr) AccessChain 75(data) 276 77 - Store 280 279 - 281: 6(int) Load 8(invocation) - 282: 140(ptr) AccessChain 75(data) 77 86 78 - 283: 70(int) Load 282 - 284: 70(int) SubgroupFirstInvocationKHR 283 - 285: 140(ptr) AccessChain 75(data) 281 86 78 - Store 285 284 + 260: 68(float) CompositeExtract 259 0 + 261: 68(float) SubgroupFirstInvocationKHR 260 + 262: 68(float) CompositeExtract 259 1 + 263: 68(float) SubgroupFirstInvocationKHR 262 + 264: 87(fvec2) CompositeConstruct 261 263 + 265: 79(ptr) AccessChain 75(data) 256 77 78 + 266: 68(float) CompositeExtract 264 0 + Store 265 266 + 267: 79(ptr) AccessChain 75(data) 256 77 100 + 268: 68(float) CompositeExtract 264 1 + Store 267 268 + 269: 6(int) Load 8(invocation) + 270: 88(ptr) AccessChain 75(data) 104 77 + 271: 69(fvec4) Load 270 + 272: 105(fvec3) VectorShuffle 271 271 0 1 2 + 273: 68(float) CompositeExtract 272 0 + 274: 68(float) SubgroupFirstInvocationKHR 273 + 275: 68(float) CompositeExtract 272 1 + 276: 68(float) SubgroupFirstInvocationKHR 275 + 277: 68(float) CompositeExtract 272 2 + 278: 68(float) SubgroupFirstInvocationKHR 277 + 279: 105(fvec3) CompositeConstruct 274 276 278 + 280: 79(ptr) AccessChain 75(data) 269 77 78 + 281: 68(float) CompositeExtract 279 0 + Store 280 281 + 282: 79(ptr) AccessChain 75(data) 269 77 100 + 283: 68(float) CompositeExtract 279 1 + Store 282 283 + 284: 79(ptr) AccessChain 75(data) 269 77 121 + 285: 68(float) CompositeExtract 279 2 + Store 284 285 286: 6(int) Load 8(invocation) - 287: 148(ptr) AccessChain 75(data) 86 86 - 288: 71(ivec4) Load 287 - 289: 147(ivec2) VectorShuffle 288 288 0 1 - 290: 147(ivec2) SubgroupFirstInvocationKHR 289 - 291: 140(ptr) AccessChain 75(data) 286 86 78 - 292: 70(int) CompositeExtract 290 0 - Store 291 292 - 293: 140(ptr) AccessChain 75(data) 286 86 100 - 294: 70(int) CompositeExtract 290 1 - Store 293 294 - 295: 6(int) Load 8(invocation) - 296: 148(ptr) AccessChain 75(data) 104 86 - 297: 71(ivec4) Load 296 - 298: 163(ivec3) VectorShuffle 297 297 0 1 2 - 299: 163(ivec3) SubgroupFirstInvocationKHR 298 - 300: 140(ptr) AccessChain 75(data) 295 86 78 - 301: 70(int) CompositeExtract 299 0 - Store 300 301 - 302: 140(ptr) AccessChain 75(data) 295 86 100 - 303: 70(int) CompositeExtract 299 1 - Store 302 303 - 304: 140(ptr) AccessChain 75(data) 295 86 121 - 305: 70(int) CompositeExtract 299 2 - Store 304 305 - 306: 6(int) Load 8(invocation) - 307: 148(ptr) AccessChain 75(data) 125 86 - 308: 71(ivec4) Load 307 - 309: 71(ivec4) SubgroupFirstInvocationKHR 308 - 310: 148(ptr) AccessChain 75(data) 306 86 - Store 310 309 - 311: 6(int) Load 8(invocation) - 312: 196(ptr) AccessChain 75(data) 77 104 78 - 313: 6(int) Load 312 - 314: 6(int) SubgroupFirstInvocationKHR 313 - 315: 196(ptr) AccessChain 75(data) 311 104 78 - Store 315 314 - 316: 6(int) Load 8(invocation) - 317: 203(ptr) AccessChain 75(data) 86 104 - 318: 20(ivec4) Load 317 - 319: 26(ivec2) VectorShuffle 318 318 0 1 - 320: 26(ivec2) SubgroupFirstInvocationKHR 319 - 321: 196(ptr) AccessChain 75(data) 316 104 78 - 322: 6(int) CompositeExtract 320 0 - Store 321 322 - 323: 196(ptr) AccessChain 75(data) 316 104 100 - 324: 6(int) CompositeExtract 320 1 - Store 323 324 - 325: 6(int) Load 8(invocation) - 326: 203(ptr) AccessChain 75(data) 104 104 - 327: 20(ivec4) Load 326 - 328: 218(ivec3) VectorShuffle 327 327 0 1 2 - 329: 218(ivec3) SubgroupFirstInvocationKHR 328 - 330: 196(ptr) AccessChain 75(data) 325 104 78 - 331: 6(int) CompositeExtract 329 0 + 287: 88(ptr) AccessChain 75(data) 125 77 + 288: 69(fvec4) Load 287 + 289: 68(float) CompositeExtract 288 0 + 290: 68(float) SubgroupFirstInvocationKHR 289 + 291: 68(float) CompositeExtract 288 1 + 292: 68(float) SubgroupFirstInvocationKHR 291 + 293: 68(float) CompositeExtract 288 2 + 294: 68(float) SubgroupFirstInvocationKHR 293 + 295: 68(float) CompositeExtract 288 3 + 296: 68(float) SubgroupFirstInvocationKHR 295 + 297: 69(fvec4) CompositeConstruct 290 292 294 296 + 298: 88(ptr) AccessChain 75(data) 286 77 + Store 298 297 + 299: 6(int) Load 8(invocation) + 300: 140(ptr) AccessChain 75(data) 77 86 78 + 301: 70(int) Load 300 + 302: 70(int) SubgroupFirstInvocationKHR 301 + 303: 140(ptr) AccessChain 75(data) 299 86 78 + Store 303 302 + 304: 6(int) Load 8(invocation) + 305: 148(ptr) AccessChain 75(data) 86 86 + 306: 71(ivec4) Load 305 + 307: 147(ivec2) VectorShuffle 306 306 0 1 + 308: 70(int) CompositeExtract 307 0 + 309: 70(int) SubgroupFirstInvocationKHR 308 + 310: 70(int) CompositeExtract 307 1 + 311: 70(int) SubgroupFirstInvocationKHR 310 + 312: 147(ivec2) CompositeConstruct 309 311 + 313: 140(ptr) AccessChain 75(data) 304 86 78 + 314: 70(int) CompositeExtract 312 0 + Store 313 314 + 315: 140(ptr) AccessChain 75(data) 304 86 100 + 316: 70(int) CompositeExtract 312 1 + Store 315 316 + 317: 6(int) Load 8(invocation) + 318: 148(ptr) AccessChain 75(data) 104 86 + 319: 71(ivec4) Load 318 + 320: 163(ivec3) VectorShuffle 319 319 0 1 2 + 321: 70(int) CompositeExtract 320 0 + 322: 70(int) SubgroupFirstInvocationKHR 321 + 323: 70(int) CompositeExtract 320 1 + 324: 70(int) SubgroupFirstInvocationKHR 323 + 325: 70(int) CompositeExtract 320 2 + 326: 70(int) SubgroupFirstInvocationKHR 325 + 327: 163(ivec3) CompositeConstruct 322 324 326 + 328: 140(ptr) AccessChain 75(data) 317 86 78 + 329: 70(int) CompositeExtract 327 0 + Store 328 329 + 330: 140(ptr) AccessChain 75(data) 317 86 100 + 331: 70(int) CompositeExtract 327 1 Store 330 331 - 332: 196(ptr) AccessChain 75(data) 325 104 100 - 333: 6(int) CompositeExtract 329 1 + 332: 140(ptr) AccessChain 75(data) 317 86 121 + 333: 70(int) CompositeExtract 327 2 Store 332 333 - 334: 196(ptr) AccessChain 75(data) 325 104 121 - 335: 6(int) CompositeExtract 329 2 - Store 334 335 - 336: 6(int) Load 8(invocation) - 337: 203(ptr) AccessChain 75(data) 125 104 - 338: 20(ivec4) Load 337 - 339: 20(ivec4) SubgroupFirstInvocationKHR 338 - 340: 203(ptr) AccessChain 75(data) 336 104 - Store 340 339 + 334: 6(int) Load 8(invocation) + 335: 148(ptr) AccessChain 75(data) 125 86 + 336: 71(ivec4) Load 335 + 337: 70(int) CompositeExtract 336 0 + 338: 70(int) SubgroupFirstInvocationKHR 337 + 339: 70(int) CompositeExtract 336 1 + 340: 70(int) SubgroupFirstInvocationKHR 339 + 341: 70(int) CompositeExtract 336 2 + 342: 70(int) SubgroupFirstInvocationKHR 341 + 343: 70(int) CompositeExtract 336 3 + 344: 70(int) SubgroupFirstInvocationKHR 343 + 345: 71(ivec4) CompositeConstruct 338 340 342 344 + 346: 148(ptr) AccessChain 75(data) 334 86 + Store 346 345 + 347: 6(int) Load 8(invocation) + 348: 196(ptr) AccessChain 75(data) 77 104 78 + 349: 6(int) Load 348 + 350: 6(int) SubgroupFirstInvocationKHR 349 + 351: 196(ptr) AccessChain 75(data) 347 104 78 + Store 351 350 + 352: 6(int) Load 8(invocation) + 353: 203(ptr) AccessChain 75(data) 86 104 + 354: 20(ivec4) Load 353 + 355: 26(ivec2) VectorShuffle 354 354 0 1 + 356: 6(int) CompositeExtract 355 0 + 357: 6(int) SubgroupFirstInvocationKHR 356 + 358: 6(int) CompositeExtract 355 1 + 359: 6(int) SubgroupFirstInvocationKHR 358 + 360: 26(ivec2) CompositeConstruct 357 359 + 361: 196(ptr) AccessChain 75(data) 352 104 78 + 362: 6(int) CompositeExtract 360 0 + Store 361 362 + 363: 196(ptr) AccessChain 75(data) 352 104 100 + 364: 6(int) CompositeExtract 360 1 + Store 363 364 + 365: 6(int) Load 8(invocation) + 366: 203(ptr) AccessChain 75(data) 104 104 + 367: 20(ivec4) Load 366 + 368: 218(ivec3) VectorShuffle 367 367 0 1 2 + 369: 6(int) CompositeExtract 368 0 + 370: 6(int) SubgroupFirstInvocationKHR 369 + 371: 6(int) CompositeExtract 368 1 + 372: 6(int) SubgroupFirstInvocationKHR 371 + 373: 6(int) CompositeExtract 368 2 + 374: 6(int) SubgroupFirstInvocationKHR 373 + 375: 218(ivec3) CompositeConstruct 370 372 374 + 376: 196(ptr) AccessChain 75(data) 365 104 78 + 377: 6(int) CompositeExtract 375 0 + Store 376 377 + 378: 196(ptr) AccessChain 75(data) 365 104 100 + 379: 6(int) CompositeExtract 375 1 + Store 378 379 + 380: 196(ptr) AccessChain 75(data) 365 104 121 + 381: 6(int) CompositeExtract 375 2 + Store 380 381 + 382: 6(int) Load 8(invocation) + 383: 203(ptr) AccessChain 75(data) 125 104 + 384: 20(ivec4) Load 383 + 385: 6(int) CompositeExtract 384 0 + 386: 6(int) SubgroupFirstInvocationKHR 385 + 387: 6(int) CompositeExtract 384 1 + 388: 6(int) SubgroupFirstInvocationKHR 387 + 389: 6(int) CompositeExtract 384 2 + 390: 6(int) SubgroupFirstInvocationKHR 389 + 391: 6(int) CompositeExtract 384 3 + 392: 6(int) SubgroupFirstInvocationKHR 391 + 393: 20(ivec4) CompositeConstruct 386 388 390 392 + 394: 203(ptr) AccessChain 75(data) 382 104 + Store 394 393 Branch 67 67: Label Return From 994987bc90c2231079bdab983675bac2e69df3b6 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Fri, 24 Sep 2021 10:12:37 -0600 Subject: [PATCH 23/64] Fix variable scoping of do-while Fixes #2744 --- glslang/MachineIndependent/glslang.m4 | 2 + glslang/MachineIndependent/glslang.y | 2 + glslang/MachineIndependent/glslang_tab.cpp | 370 +++++++++++---------- 3 files changed, 190 insertions(+), 184 deletions(-) diff --git a/glslang/MachineIndependent/glslang.m4 b/glslang/MachineIndependent/glslang.m4 index b30c734e..36265029 100644 --- a/glslang/MachineIndependent/glslang.m4 +++ b/glslang/MachineIndependent/glslang.m4 @@ -3926,6 +3926,7 @@ iteration_statement_nonattributed --parseContext.controlFlowNestingLevel; } | DO { + parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; @@ -3937,6 +3938,7 @@ iteration_statement_nonattributed parseContext.boolCheck($8.loc, $6); $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index c535ecc2..ad483863 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -3926,6 +3926,7 @@ iteration_statement_nonattributed --parseContext.controlFlowNestingLevel; } | DO { + parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; @@ -3937,6 +3938,7 @@ iteration_statement_nonattributed parseContext.boolCheck($8.loc, $6); $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp index 648bc370..33b8a924 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -1197,15 +1197,15 @@ static const yytype_int16 yyrline[] = 3732, 3739, 3739, 3753, 3756, 3764, 3772, 3783, 3784, 3788, 3792, 3800, 3807, 3811, 3819, 3823, 3836, 3840, 3848, 3848, 3868, 3871, 3877, 3889, 3901, 3905, 3913, 3913, 3928, 3928, - 3944, 3944, 3965, 3968, 3974, 3977, 3983, 3987, 3994, 3999, - 4004, 4011, 4014, 4018, 4023, 4027, 4037, 4041, 4050, 4053, - 4057, 4066, 4066, 4108, 4113, 4116, 4121, 4124, 4131, 4134, - 4139, 4142, 4147, 4150, 4155, 4158, 4163, 4167, 4172, 4176, - 4181, 4185, 4192, 4195, 4200, 4203, 4206, 4209, 4212, 4217, - 4226, 4237, 4242, 4250, 4254, 4259, 4263, 4268, 4272, 4277, - 4281, 4288, 4291, 4296, 4299, 4302, 4305, 4310, 4318, 4328, - 4332, 4337, 4341, 4346, 4350, 4357, 4360, 4365, 4368, 4373, - 4376, 4382, 4385, 4390, 4393 + 3946, 3946, 3967, 3970, 3976, 3979, 3985, 3989, 3996, 4001, + 4006, 4013, 4016, 4020, 4025, 4029, 4039, 4043, 4052, 4055, + 4059, 4068, 4068, 4110, 4115, 4118, 4123, 4126, 4133, 4136, + 4141, 4144, 4149, 4152, 4157, 4160, 4165, 4169, 4174, 4178, + 4183, 4187, 4194, 4197, 4202, 4205, 4208, 4211, 4214, 4219, + 4228, 4239, 4244, 4252, 4256, 4261, 4265, 4270, 4274, 4279, + 4283, 4290, 4293, 4298, 4301, 4304, 4307, 4312, 4320, 4330, + 4334, 4339, 4343, 4348, 4352, 4359, 4362, 4367, 4370, 4375, + 4378, 4384, 4387, 4392, 4395 }; #endif @@ -11387,15 +11387,16 @@ yyreduce: case 598: /* $@11: %empty */ #line 3928 "MachineIndependent/glslang.y" { + parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11395 "MachineIndependent/glslang_tab.cpp" +#line 11396 "MachineIndependent/glslang_tab.cpp" break; case 599: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 3933 "MachineIndependent/glslang.y" +#line 3934 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11403,26 +11404,27 @@ yyreduce: parseContext.boolCheck((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, false, (yyvsp[-4].lex).loc); + parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11411 "MachineIndependent/glslang_tab.cpp" +#line 11413 "MachineIndependent/glslang_tab.cpp" break; case 600: /* $@12: %empty */ -#line 3944 "MachineIndependent/glslang.y" +#line 3946 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11422 "MachineIndependent/glslang_tab.cpp" +#line 11424 "MachineIndependent/glslang_tab.cpp" break; case 601: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 3950 "MachineIndependent/glslang.y" +#line 3952 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11435,81 +11437,81 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11439 "MachineIndependent/glslang_tab.cpp" +#line 11441 "MachineIndependent/glslang_tab.cpp" break; case 602: /* for_init_statement: expression_statement */ -#line 3965 "MachineIndependent/glslang.y" +#line 3967 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11447 "MachineIndependent/glslang_tab.cpp" +#line 11449 "MachineIndependent/glslang_tab.cpp" break; case 603: /* for_init_statement: declaration_statement */ -#line 3968 "MachineIndependent/glslang.y" +#line 3970 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11455 "MachineIndependent/glslang_tab.cpp" +#line 11457 "MachineIndependent/glslang_tab.cpp" break; case 604: /* conditionopt: condition */ -#line 3974 "MachineIndependent/glslang.y" +#line 3976 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11463 "MachineIndependent/glslang_tab.cpp" +#line 11465 "MachineIndependent/glslang_tab.cpp" break; case 605: /* conditionopt: %empty */ -#line 3977 "MachineIndependent/glslang.y" +#line 3979 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = 0; } -#line 11471 "MachineIndependent/glslang_tab.cpp" +#line 11473 "MachineIndependent/glslang_tab.cpp" break; case 606: /* for_rest_statement: conditionopt SEMICOLON */ -#line 3983 "MachineIndependent/glslang.y" +#line 3985 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); (yyval.interm.nodePair).node2 = 0; } -#line 11480 "MachineIndependent/glslang_tab.cpp" +#line 11482 "MachineIndependent/glslang_tab.cpp" break; case 607: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 3987 "MachineIndependent/glslang.y" +#line 3989 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 11489 "MachineIndependent/glslang_tab.cpp" +#line 11491 "MachineIndependent/glslang_tab.cpp" break; case 608: /* jump_statement: CONTINUE SEMICOLON */ -#line 3994 "MachineIndependent/glslang.y" +#line 3996 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel <= 0) parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); } -#line 11499 "MachineIndependent/glslang_tab.cpp" +#line 11501 "MachineIndependent/glslang_tab.cpp" break; case 609: /* jump_statement: BREAK SEMICOLON */ -#line 3999 "MachineIndependent/glslang.y" +#line 4001 "MachineIndependent/glslang.y" { if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); } -#line 11509 "MachineIndependent/glslang_tab.cpp" +#line 11511 "MachineIndependent/glslang_tab.cpp" break; case 610: /* jump_statement: RETURN SEMICOLON */ -#line 4004 "MachineIndependent/glslang.y" +#line 4006 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -11517,101 +11519,101 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 11521 "MachineIndependent/glslang_tab.cpp" +#line 11523 "MachineIndependent/glslang_tab.cpp" break; case 611: /* jump_statement: RETURN expression SEMICOLON */ -#line 4011 "MachineIndependent/glslang.y" +#line 4013 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 11529 "MachineIndependent/glslang_tab.cpp" +#line 11531 "MachineIndependent/glslang_tab.cpp" break; case 612: /* jump_statement: DISCARD SEMICOLON */ -#line 4014 "MachineIndependent/glslang.y" +#line 4016 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 11538 "MachineIndependent/glslang_tab.cpp" +#line 11540 "MachineIndependent/glslang_tab.cpp" break; case 613: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4018 "MachineIndependent/glslang.y" +#line 4020 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 11547 "MachineIndependent/glslang_tab.cpp" +#line 11549 "MachineIndependent/glslang_tab.cpp" break; case 614: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4023 "MachineIndependent/glslang.y" +#line 4025 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 11556 "MachineIndependent/glslang_tab.cpp" +#line 11558 "MachineIndependent/glslang_tab.cpp" break; case 615: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4027 "MachineIndependent/glslang.y" +#line 4029 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 11565 "MachineIndependent/glslang_tab.cpp" +#line 11567 "MachineIndependent/glslang_tab.cpp" break; case 616: /* translation_unit: external_declaration */ -#line 4037 "MachineIndependent/glslang.y" +#line 4039 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 11574 "MachineIndependent/glslang_tab.cpp" +#line 11576 "MachineIndependent/glslang_tab.cpp" break; case 617: /* translation_unit: translation_unit external_declaration */ -#line 4041 "MachineIndependent/glslang.y" +#line 4043 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) != nullptr) { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } } -#line 11585 "MachineIndependent/glslang_tab.cpp" +#line 11587 "MachineIndependent/glslang_tab.cpp" break; case 618: /* external_declaration: function_definition */ -#line 4050 "MachineIndependent/glslang.y" +#line 4052 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11593 "MachineIndependent/glslang_tab.cpp" +#line 11595 "MachineIndependent/glslang_tab.cpp" break; case 619: /* external_declaration: declaration */ -#line 4053 "MachineIndependent/glslang.y" +#line 4055 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11601 "MachineIndependent/glslang_tab.cpp" +#line 11603 "MachineIndependent/glslang_tab.cpp" break; case 620: /* external_declaration: SEMICOLON */ -#line 4057 "MachineIndependent/glslang.y" +#line 4059 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "extraneous semicolon"); parseContext.profileRequires((yyvsp[0].lex).loc, ~EEsProfile, 460, nullptr, "extraneous semicolon"); (yyval.interm.intermNode) = nullptr; } -#line 11611 "MachineIndependent/glslang_tab.cpp" +#line 11613 "MachineIndependent/glslang_tab.cpp" break; case 621: /* $@13: %empty */ -#line 4066 "MachineIndependent/glslang.y" +#line 4068 "MachineIndependent/glslang.y" { (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); @@ -11624,11 +11626,11 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 11628 "MachineIndependent/glslang_tab.cpp" +#line 11630 "MachineIndependent/glslang_tab.cpp" break; case 622: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4078 "MachineIndependent/glslang.y" +#line 4080 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -11655,228 +11657,228 @@ yyreduce: --parseContext.statementNestingLevel; } } -#line 11659 "MachineIndependent/glslang_tab.cpp" +#line 11661 "MachineIndependent/glslang_tab.cpp" break; case 623: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4108 "MachineIndependent/glslang.y" +#line 4110 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } -#line 11667 "MachineIndependent/glslang_tab.cpp" +#line 11669 "MachineIndependent/glslang_tab.cpp" break; case 624: /* attribute_list: single_attribute */ -#line 4113 "MachineIndependent/glslang.y" +#line 4115 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 11675 "MachineIndependent/glslang_tab.cpp" +#line 11677 "MachineIndependent/glslang_tab.cpp" break; case 625: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4116 "MachineIndependent/glslang.y" +#line 4118 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 11683 "MachineIndependent/glslang_tab.cpp" +#line 11685 "MachineIndependent/glslang_tab.cpp" break; case 626: /* single_attribute: IDENTIFIER */ -#line 4121 "MachineIndependent/glslang.y" +#line 4123 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 11691 "MachineIndependent/glslang_tab.cpp" +#line 11693 "MachineIndependent/glslang_tab.cpp" break; case 627: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4124 "MachineIndependent/glslang.y" +#line 4126 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 11699 "MachineIndependent/glslang_tab.cpp" +#line 11701 "MachineIndependent/glslang_tab.cpp" break; case 628: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4131 "MachineIndependent/glslang.y" +#line 4133 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } -#line 11707 "MachineIndependent/glslang_tab.cpp" +#line 11709 "MachineIndependent/glslang_tab.cpp" break; case 629: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4134 "MachineIndependent/glslang.y" +#line 4136 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } -#line 11715 "MachineIndependent/glslang_tab.cpp" +#line 11717 "MachineIndependent/glslang_tab.cpp" break; case 630: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4139 "MachineIndependent/glslang.y" +#line 4141 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } -#line 11723 "MachineIndependent/glslang_tab.cpp" +#line 11725 "MachineIndependent/glslang_tab.cpp" break; case 631: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4142 "MachineIndependent/glslang.y" +#line 4144 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11731 "MachineIndependent/glslang_tab.cpp" +#line 11733 "MachineIndependent/glslang_tab.cpp" break; case 632: /* spirv_extension_list: STRING_LITERAL */ -#line 4147 "MachineIndependent/glslang.y" +#line 4149 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11739 "MachineIndependent/glslang_tab.cpp" +#line 11741 "MachineIndependent/glslang_tab.cpp" break; case 633: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4150 "MachineIndependent/glslang.y" +#line 4152 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 11747 "MachineIndependent/glslang_tab.cpp" +#line 11749 "MachineIndependent/glslang_tab.cpp" break; case 634: /* spirv_capability_list: INTCONSTANT */ -#line 4155 "MachineIndependent/glslang.y" +#line 4157 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11755 "MachineIndependent/glslang_tab.cpp" +#line 11757 "MachineIndependent/glslang_tab.cpp" break; case 635: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4158 "MachineIndependent/glslang.y" +#line 4160 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 11763 "MachineIndependent/glslang_tab.cpp" +#line 11765 "MachineIndependent/glslang_tab.cpp" break; case 636: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4163 "MachineIndependent/glslang.y" +#line 4165 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11772 "MachineIndependent/glslang_tab.cpp" +#line 11774 "MachineIndependent/glslang_tab.cpp" break; case 637: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4167 "MachineIndependent/glslang.y" +#line 4169 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 11782 "MachineIndependent/glslang_tab.cpp" +#line 11784 "MachineIndependent/glslang_tab.cpp" break; case 638: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4172 "MachineIndependent/glslang.y" +#line 4174 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11791 "MachineIndependent/glslang_tab.cpp" +#line 11793 "MachineIndependent/glslang_tab.cpp" break; case 639: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4176 "MachineIndependent/glslang.y" +#line 4178 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11801 "MachineIndependent/glslang_tab.cpp" +#line 11803 "MachineIndependent/glslang_tab.cpp" break; case 640: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4181 "MachineIndependent/glslang.y" +#line 4183 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11810 "MachineIndependent/glslang_tab.cpp" +#line 11812 "MachineIndependent/glslang_tab.cpp" break; case 641: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4185 "MachineIndependent/glslang.y" +#line 4187 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 11820 "MachineIndependent/glslang_tab.cpp" +#line 11822 "MachineIndependent/glslang_tab.cpp" break; case 642: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4192 "MachineIndependent/glslang.y" +#line 4194 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 11828 "MachineIndependent/glslang_tab.cpp" +#line 11830 "MachineIndependent/glslang_tab.cpp" break; case 643: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4195 "MachineIndependent/glslang.y" +#line 4197 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11836 "MachineIndependent/glslang_tab.cpp" +#line 11838 "MachineIndependent/glslang_tab.cpp" break; case 644: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4200 "MachineIndependent/glslang.y" +#line 4202 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 11844 "MachineIndependent/glslang_tab.cpp" +#line 11846 "MachineIndependent/glslang_tab.cpp" break; case 645: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4203 "MachineIndependent/glslang.y" +#line 4205 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 11852 "MachineIndependent/glslang_tab.cpp" +#line 11854 "MachineIndependent/glslang_tab.cpp" break; case 646: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4206 "MachineIndependent/glslang.y" +#line 4208 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 11860 "MachineIndependent/glslang_tab.cpp" +#line 11862 "MachineIndependent/glslang_tab.cpp" break; case 647: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4209 "MachineIndependent/glslang.y" +#line 4211 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 11868 "MachineIndependent/glslang_tab.cpp" +#line 11870 "MachineIndependent/glslang_tab.cpp" break; case 648: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4212 "MachineIndependent/glslang.y" +#line 4214 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 11876 "MachineIndependent/glslang_tab.cpp" +#line 11878 "MachineIndependent/glslang_tab.cpp" break; case 649: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4217 "MachineIndependent/glslang.y" +#line 4219 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -11886,11 +11888,11 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 11890 "MachineIndependent/glslang_tab.cpp" +#line 11892 "MachineIndependent/glslang_tab.cpp" break; case 650: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4226 "MachineIndependent/glslang.y" +#line 4228 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -11900,156 +11902,156 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11904 "MachineIndependent/glslang_tab.cpp" +#line 11906 "MachineIndependent/glslang_tab.cpp" break; case 651: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4237 "MachineIndependent/glslang.y" +#line 4239 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 11914 "MachineIndependent/glslang_tab.cpp" +#line 11916 "MachineIndependent/glslang_tab.cpp" break; case 652: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4242 "MachineIndependent/glslang.y" +#line 4244 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.storage = EvqSpirvStorageClass; (yyval.interm.type).qualifier.spirvStorageClass = (yyvsp[-1].lex).i; } -#line 11925 "MachineIndependent/glslang_tab.cpp" +#line 11927 "MachineIndependent/glslang_tab.cpp" break; case 653: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4250 "MachineIndependent/glslang.y" +#line 4252 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 11934 "MachineIndependent/glslang_tab.cpp" +#line 11936 "MachineIndependent/glslang_tab.cpp" break; case 654: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4254 "MachineIndependent/glslang.y" +#line 4256 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 11944 "MachineIndependent/glslang_tab.cpp" +#line 11946 "MachineIndependent/glslang_tab.cpp" break; case 655: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4259 "MachineIndependent/glslang.y" +#line 4261 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11953 "MachineIndependent/glslang_tab.cpp" +#line 11955 "MachineIndependent/glslang_tab.cpp" break; case 656: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4263 "MachineIndependent/glslang.y" +#line 4265 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11963 "MachineIndependent/glslang_tab.cpp" +#line 11965 "MachineIndependent/glslang_tab.cpp" break; case 657: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4268 "MachineIndependent/glslang.y" +#line 4270 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11972 "MachineIndependent/glslang_tab.cpp" +#line 11974 "MachineIndependent/glslang_tab.cpp" break; case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4272 "MachineIndependent/glslang.y" +#line 4274 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11982 "MachineIndependent/glslang_tab.cpp" +#line 11984 "MachineIndependent/glslang_tab.cpp" break; case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4277 "MachineIndependent/glslang.y" +#line 4279 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 11991 "MachineIndependent/glslang_tab.cpp" +#line 11993 "MachineIndependent/glslang_tab.cpp" break; case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4281 "MachineIndependent/glslang.y" +#line 4283 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).qualifier.setSpirvDecorateString((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12001 "MachineIndependent/glslang_tab.cpp" +#line 12003 "MachineIndependent/glslang_tab.cpp" break; case 661: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4288 "MachineIndependent/glslang.y" +#line 4290 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12009 "MachineIndependent/glslang_tab.cpp" +#line 12011 "MachineIndependent/glslang_tab.cpp" break; case 662: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4291 "MachineIndependent/glslang.y" +#line 4293 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12017 "MachineIndependent/glslang_tab.cpp" +#line 12019 "MachineIndependent/glslang_tab.cpp" break; case 663: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4296 "MachineIndependent/glslang.y" +#line 4298 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12025 "MachineIndependent/glslang_tab.cpp" +#line 12027 "MachineIndependent/glslang_tab.cpp" break; case 664: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4299 "MachineIndependent/glslang.y" +#line 4301 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12033 "MachineIndependent/glslang_tab.cpp" +#line 12035 "MachineIndependent/glslang_tab.cpp" break; case 665: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4302 "MachineIndependent/glslang.y" +#line 4304 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12041 "MachineIndependent/glslang_tab.cpp" +#line 12043 "MachineIndependent/glslang_tab.cpp" break; case 666: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4305 "MachineIndependent/glslang.y" +#line 4307 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12049 "MachineIndependent/glslang_tab.cpp" +#line 12051 "MachineIndependent/glslang_tab.cpp" break; case 667: /* spirv_decorate_id_parameter_list: constant_expression */ -#line 4310 "MachineIndependent/glslang.y" +#line 4312 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12058,11 +12060,11 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermTypedNode)); } -#line 12062 "MachineIndependent/glslang_tab.cpp" +#line 12064 "MachineIndependent/glslang_tab.cpp" break; case 668: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */ -#line 4318 "MachineIndependent/glslang.y" +#line 4320 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12071,147 +12073,147 @@ yyreduce: parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "this type not allowed", (yyvsp[0].interm.intermTypedNode)->getType().getBasicString(), ""); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermTypedNode)); } -#line 12075 "MachineIndependent/glslang_tab.cpp" +#line 12077 "MachineIndependent/glslang_tab.cpp" break; case 669: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4328 "MachineIndependent/glslang.y" +#line 4330 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12084 "MachineIndependent/glslang_tab.cpp" +#line 12086 "MachineIndependent/glslang_tab.cpp" break; case 670: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4332 "MachineIndependent/glslang.y" +#line 4334 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12092 "MachineIndependent/glslang_tab.cpp" +#line 12094 "MachineIndependent/glslang_tab.cpp" break; case 671: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4337 "MachineIndependent/glslang.y" +#line 4339 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12101 "MachineIndependent/glslang_tab.cpp" +#line 12103 "MachineIndependent/glslang_tab.cpp" break; case 672: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4341 "MachineIndependent/glslang.y" +#line 4343 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-7].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams)); } -#line 12111 "MachineIndependent/glslang_tab.cpp" +#line 12113 "MachineIndependent/glslang_tab.cpp" break; case 673: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4346 "MachineIndependent/glslang.y" +#line 4348 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12120 "MachineIndependent/glslang_tab.cpp" +#line 12122 "MachineIndependent/glslang_tab.cpp" break; case 674: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4350 "MachineIndependent/glslang.y" +#line 4352 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12130 "MachineIndependent/glslang_tab.cpp" +#line 12132 "MachineIndependent/glslang_tab.cpp" break; case 675: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4357 "MachineIndependent/glslang.y" +#line 4359 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12138 "MachineIndependent/glslang_tab.cpp" +#line 12140 "MachineIndependent/glslang_tab.cpp" break; case 676: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4360 "MachineIndependent/glslang.y" +#line 4362 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12146 "MachineIndependent/glslang_tab.cpp" +#line 12148 "MachineIndependent/glslang_tab.cpp" break; case 677: /* spirv_type_parameter: constant_expression */ -#line 4365 "MachineIndependent/glslang.y" +#line 4367 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12154 "MachineIndependent/glslang_tab.cpp" +#line 12156 "MachineIndependent/glslang_tab.cpp" break; case 678: /* spirv_type_parameter: type_specifier */ -#line 4368 "MachineIndependent/glslang.y" +#line 4370 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type)); } -#line 12162 "MachineIndependent/glslang_tab.cpp" +#line 12164 "MachineIndependent/glslang_tab.cpp" break; case 679: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4373 "MachineIndependent/glslang.y" +#line 4375 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12170 "MachineIndependent/glslang_tab.cpp" +#line 12172 "MachineIndependent/glslang_tab.cpp" break; case 680: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4376 "MachineIndependent/glslang.y" +#line 4378 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12179 "MachineIndependent/glslang_tab.cpp" +#line 12181 "MachineIndependent/glslang_tab.cpp" break; case 681: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4382 "MachineIndependent/glslang.y" +#line 4384 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12187 "MachineIndependent/glslang_tab.cpp" +#line 12189 "MachineIndependent/glslang_tab.cpp" break; case 682: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4385 "MachineIndependent/glslang.y" +#line 4387 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12195 "MachineIndependent/glslang_tab.cpp" +#line 12197 "MachineIndependent/glslang_tab.cpp" break; case 683: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4390 "MachineIndependent/glslang.y" +#line 4392 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12203 "MachineIndependent/glslang_tab.cpp" +#line 12205 "MachineIndependent/glslang_tab.cpp" break; case 684: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4393 "MachineIndependent/glslang.y" +#line 4395 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12211 "MachineIndependent/glslang_tab.cpp" +#line 12213 "MachineIndependent/glslang_tab.cpp" break; -#line 12215 "MachineIndependent/glslang_tab.cpp" +#line 12217 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12436,5 +12438,5 @@ yyreturn: return yyresult; } -#line 4398 "MachineIndependent/glslang.y" +#line 4400 "MachineIndependent/glslang.y" From 7b57c6e32a09cf297f228adf18988782b7f8cf03 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Wed, 29 Sep 2021 15:31:28 -0400 Subject: [PATCH 24/64] rename member variable for clarity it's a little strange how the resolver takes an arbitrary intermediate in it's constructor. Really this should be an 'options' object that holds the various resolve/remapping options which are read from this intermediate. At least for now rename it so it's more clear it's used differently from other intermediates that are accessed in the resolver (such as the per stage ones). --- glslang/MachineIndependent/iomapper.cpp | 28 ++++++++++++------------- glslang/MachineIndependent/iomapper.h | 6 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp index 3486ea6d..a1db5c13 100644 --- a/glslang/MachineIndependent/iomapper.cpp +++ b/glslang/MachineIndependent/iomapper.cpp @@ -748,7 +748,7 @@ private: }; TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate) - : intermediate(intermediate) + : referenceIntermediate(intermediate) , nextUniformLocation(intermediate.getUniformLocationBase()) , nextInputLocation(0) , nextOutputLocation(0) @@ -760,17 +760,17 @@ TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate int TDefaultIoResolverBase::getBaseBinding(EShLanguage stage, TResourceType res, unsigned int set) const { return stageIntermediates[stage] ? selectBaseBinding(stageIntermediates[stage]->getShiftBinding(res), stageIntermediates[stage]->getShiftBindingForSet(res, set)) - : selectBaseBinding(intermediate.getShiftBinding(res), intermediate.getShiftBindingForSet(res, set)); + : selectBaseBinding(referenceIntermediate.getShiftBinding(res), referenceIntermediate.getShiftBindingForSet(res, set)); } const std::vector& TDefaultIoResolverBase::getResourceSetBinding(EShLanguage stage) const { return stageIntermediates[stage] ? stageIntermediates[stage]->getResourceSetBinding() - : intermediate.getResourceSetBinding(); + : referenceIntermediate.getResourceSetBinding(); } -bool TDefaultIoResolverBase::doAutoBindingMapping() const { return intermediate.getAutoMapBindings(); } +bool TDefaultIoResolverBase::doAutoBindingMapping() const { return referenceIntermediate.getAutoMapBindings(); } -bool TDefaultIoResolverBase::doAutoLocationMapping() const { return intermediate.getAutoMapLocations(); } +bool TDefaultIoResolverBase::doAutoLocationMapping() const { return referenceIntermediate.getAutoMapLocations(); } TDefaultIoResolverBase::TSlotSet::iterator TDefaultIoResolverBase::findSlot(int set, int slot) { return std::lower_bound(slots[set].begin(), slots[set].end(), slot); @@ -827,7 +827,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn } // no locations added if already present, a built-in variable, a block, or an opaque if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock || - type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) { + type.isAtomic() || (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) { return ent.newLocation = -1; } // no locations on blocks of built-in variables @@ -839,7 +839,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn return ent.newLocation = -1; } } - int location = intermediate.getUniformLocationOverride(name); + int location = referenceIntermediate.getUniformLocationOverride(name); if (location != -1) { return ent.newLocation = location; } @@ -1024,7 +1024,7 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn } else { // no locations added if already present, a built-in variable, a block, or an opaque if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock || - type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) { + type.isAtomic() || (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) { return ent.newLocation = -1; } // no locations on blocks of built-in variables @@ -1037,7 +1037,7 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn } } } - int location = intermediate.getUniformLocationOverride(name.c_str()); + int location = referenceIntermediate.getUniformLocationOverride(name.c_str()); if (location != -1) { return ent.newLocation = location; } @@ -1086,7 +1086,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent const TType& type = ent.symbol->getType(); const TString& name = ent.symbol->getAccessName(); // On OpenGL arrays of opaque types take a separate binding for each element - int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; TResourceType resource = getResourceType(type); // don't need to handle uniform symbol, it will be handled in resolveUniformLocation if (resource == EResUbo && type.getBasicType() != EbtBlock) { @@ -1095,7 +1095,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent // There is no 'set' qualifier in OpenGL shading language, each resource has its own // binding name space, so remap the 'set' to resource type which make each resource // binding is valid from 0 to MAX_XXRESOURCE_BINDINGS - int set = intermediate.getSpv().openGl != 0 ? resource : ent.newSet; + int set = referenceIntermediate.getSpv().openGl != 0 ? resource : ent.newSet; int resourceKey = set; if (resource < EResCount) { if (type.getQualifier().hasBinding()) { @@ -1223,7 +1223,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& const TType& type = ent.symbol->getType(); const TString& name = ent.symbol->getAccessName(); TResourceType resource = getResourceType(type); - int set = intermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent); + int set = referenceIntermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent); int resourceKey = set; if (type.getQualifier().hasBinding()) { @@ -1233,7 +1233,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& if (iter == varSlotMap.end()) { // Reserve the slots for the ubo, ssbo and opaques who has explicit binding - int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; varSlotMap[name] = binding; reserveSlot(resourceKey, binding, numBindings); } else { @@ -1288,7 +1288,7 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase { const TType& type = ent.symbol->getType(); const int set = getLayoutSet(type); // On OpenGL arrays of opaque types take a seperate binding for each element - int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; + int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; TResourceType resource = getResourceType(type); if (resource < EResCount) { if (type.getQualifier().hasBinding()) { diff --git a/glslang/MachineIndependent/iomapper.h b/glslang/MachineIndependent/iomapper.h index 843ea73c..c43864e3 100644 --- a/glslang/MachineIndependent/iomapper.h +++ b/glslang/MachineIndependent/iomapper.h @@ -165,7 +165,7 @@ public: protected: TDefaultIoResolverBase(TDefaultIoResolverBase&); TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&); - const TIntermediate& intermediate; + const TIntermediate& referenceIntermediate; int nextUniformLocation; int nextInputLocation; int nextOutputLocation; @@ -322,8 +322,8 @@ public: intermediates[stage] = nullptr; } } - // If set, the uniform block with the given name will be changed to be backed by - // push_constant if it's size is <= maxSize + // If set, the uniform block with the given name will be changed to be backed by + // push_constant if it's size is <= maxSize void setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) { autoPushConstantBlockName = name; autoPushConstantMaxSize = maxSize; From c8ef4f8a9f8a8b76a380f46dd043cfb800d81ca7 Mon Sep 17 00:00:00 2001 From: Nathaniel Cesario Date: Tue, 28 Sep 2021 17:01:21 -0600 Subject: [PATCH 25/64] cmake: Remove "conditions" from endif See https://cmake.org/cmake/help/latest/command/endif.html and https://cmake.org/cmake/help/latest/command/if.html. If the else/endif condition does not match the if condition verbatim, an error is produced on some versions of cmake. This change removes these "legacy conditions." --- CMakeLists.txt | 22 +++++++++++----------- SPIRV/CMakeLists.txt | 6 +++--- StandAlone/CMakeLists.txt | 8 ++++---- glslang/CMakeLists.txt | 12 ++++++------ glslang/OSDependent/Unix/CMakeLists.txt | 2 +- glslang/OSDependent/Web/CMakeLists.txt | 6 +++--- glslang/OSDependent/Windows/CMakeLists.txt | 4 ++-- gtests/CMakeLists.txt | 6 +++--- hlsl/CMakeLists.txt | 2 +- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c318eef9..d5b727ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,7 @@ if(USE_CCACHE) find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - endif(CCACHE_FOUND) + endif() endif() if(ENABLE_CTEST) @@ -127,27 +127,27 @@ endif() if(ENABLE_HLSL) add_definitions(-DENABLE_HLSL) -endif(ENABLE_HLSL) +endif() if(ENABLE_GLSLANG_WEBMIN) add_definitions(-DGLSLANG_WEB) if(ENABLE_GLSLANG_WEBMIN_DEVEL) add_definitions(-DGLSLANG_WEB_DEVEL) - endif(ENABLE_GLSLANG_WEBMIN_DEVEL) -endif(ENABLE_GLSLANG_WEBMIN) + endif() +endif() if(WIN32) set(CMAKE_DEBUG_POSTFIX "d") option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON) if(MSVC AND OVERRIDE_MSVCCRT) include(ChooseMSVCCRT.cmake) - endif(MSVC) + endif() add_definitions(-DGLSLANG_OSINCLUDE_WIN32) elseif(UNIX) add_definitions(-DGLSLANG_OSINCLUDE_UNIX) -else(WIN32) +else() message("unknown platform") -endif(WIN32) +endif() if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs @@ -213,7 +213,7 @@ if(ENABLE_GLSLANG_JS) add_compile_options(-Wno-unused-variable -Wno-unused-const-variable) endif() endif() -endif(ENABLE_GLSLANG_JS) +endif() # Request C++11 if(${CMAKE_VERSION} VERSION_LESS 3.1) @@ -329,7 +329,7 @@ endif() add_subdirectory(SPIRV) if(ENABLE_HLSL) add_subdirectory(hlsl) -endif(ENABLE_HLSL) +endif() if(ENABLE_CTEST) add_subdirectory(gtests) endif() @@ -346,11 +346,11 @@ if(ENABLE_CTEST AND BUILD_TESTING) set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$/localResults) set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$/glslangValidator) set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$/spirv-remap) - else(CMAKE_CONFIGURATION_TYPES) + else() set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults) set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator) set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap) - endif(CMAKE_CONFIGURATION_TYPES) + endif() add_test(NAME glslang-testsuite COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH} diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index d699dadd..22f767d7 100644 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -101,12 +101,12 @@ if(ENABLE_OPT) $) else() target_link_libraries(SPIRV PRIVATE MachineIndependent) -endif(ENABLE_OPT) +endif() if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) source_group("Source" FILES ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -endif(WIN32) +endif() if(ENABLE_GLSLANG_INSTALL) if(BUILD_SHARED_LIBS) @@ -135,4 +135,4 @@ if(ENABLE_GLSLANG_INSTALL) install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/) -endif(ENABLE_GLSLANG_INSTALL) +endif() diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index 751d1cd7..91bec6cc 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -62,7 +62,7 @@ elseif(UNIX) if(NOT ANDROID) set(LIBRARIES ${LIBRARIES} pthread) endif() -endif(WIN32) +endif() target_link_libraries(glslangValidator ${LIBRARIES}) target_include_directories(glslangValidator PUBLIC @@ -73,7 +73,7 @@ if(ENABLE_OPT) target_include_directories(glslangValidator PRIVATE ${spirv-tools_SOURCE_DIR}/include ) -endif(ENABLE_OPT) +endif() if(ENABLE_SPVREMAPPER) set(REMAPPER_SOURCES spirv-remap.cpp) @@ -85,7 +85,7 @@ endif() if(WIN32) source_group("Source" FILES ${SOURCES}) -endif(WIN32) +endif() if(ENABLE_GLSLANG_INSTALL) install(TARGETS glslangValidator EXPORT glslangValidatorTargets @@ -108,4 +108,4 @@ if(ENABLE_GLSLANG_INSTALL) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif(ENABLE_GLSLANG_INSTALL) +endif() diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt index dab5f8bf..d0394c86 100644 --- a/glslang/CMakeLists.txt +++ b/glslang/CMakeLists.txt @@ -35,14 +35,14 @@ if(WIN32) add_subdirectory(OSDependent/Windows) elseif(UNIX OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") add_subdirectory(OSDependent/Unix) -else(WIN32) +else() message("unknown platform") -endif(WIN32) +endif() if(EMSCRIPTEN OR ENABLE_GLSLANG_JS) # May be enabled on non-Emscripten builds for binary-size testing. add_subdirectory(OSDependent/Web) -endif(EMSCRIPTEN OR ENABLE_GLSLANG_JS) +endif() ################################################################################ # GenericCodeGen @@ -129,7 +129,7 @@ if(ENABLE_HLSL) HLSL/hlslTokenStream.h HLSL/hlslGrammar.h HLSL/hlslParseables.h) -endif(ENABLE_HLSL) +endif() add_library(MachineIndependent STATIC ${MACHINEINDEPENDENT_SOURCES} ${MACHINEINDEPENDENT_HEADERS}) set_property(TARGET MachineIndependent PROPERTY POSITION_INDEPENDENT_CODE ON) @@ -194,7 +194,7 @@ if(WIN32) source_group("MachineIndependent\\Preprocessor" REGULAR_EXPRESSION "MachineIndependent/preprocessor/*") source_group("HLSL" REGULAR_EXPRESSION "HLSL/*") source_group("CInterface" REGULAR_EXPRESSION "CInterface/*") -endif(WIN32) +endif() ################################################################################ # install @@ -225,4 +225,4 @@ if(ENABLE_GLSLANG_INSTALL) install(FILES ${GLSLANG_BUILD_INFO_H} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang) -endif(ENABLE_GLSLANG_INSTALL) +endif() diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt index 354a3e97..d521da17 100644 --- a/glslang/OSDependent/Unix/CMakeLists.txt +++ b/glslang/OSDependent/Unix/CMakeLists.txt @@ -56,4 +56,4 @@ if(ENABLE_GLSLANG_INSTALL) install(TARGETS OSDependent EXPORT OSDependentTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif(ENABLE_GLSLANG_INSTALL) +endif() diff --git a/glslang/OSDependent/Web/CMakeLists.txt b/glslang/OSDependent/Web/CMakeLists.txt index 0f60dbcc..5bfbed41 100644 --- a/glslang/OSDependent/Web/CMakeLists.txt +++ b/glslang/OSDependent/Web/CMakeLists.txt @@ -55,7 +55,7 @@ if(ENABLE_GLSLANG_JS) if(ENABLE_EMSCRIPTEN_SINGLE_FILE) target_link_libraries(glslang.js "-s SINGLE_FILE=1") - endif(ENABLE_EMSCRIPTEN_SINGLE_FILE) + endif() if(ENABLE_EMSCRIPTEN_ENVIRONMENT_NODE) target_link_libraries(glslang.js "-s ENVIRONMENT=node -s BINARYEN_ASYNC_COMPILATION=0") @@ -67,5 +67,5 @@ if(ENABLE_GLSLANG_JS) add_custom_command(TARGET glslang.js POST_BUILD COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/glslang.after.js >> ${CMAKE_CURRENT_BINARY_DIR}/glslang.js) endif() - endif(EMSCRIPTEN) -endif(ENABLE_GLSLANG_JS) + endif() +endif() diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt index 9cf1b7fb..21d603e7 100644 --- a/glslang/OSDependent/Windows/CMakeLists.txt +++ b/glslang/OSDependent/Windows/CMakeLists.txt @@ -45,10 +45,10 @@ endif() if(WIN32) source_group("Source" FILES ${SOURCES}) -endif(WIN32) +endif() if(ENABLE_GLSLANG_INSTALL) install(TARGETS OSDependent EXPORT OSDependentTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(EXPORT OSDependentTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif(ENABLE_GLSLANG_INSTALL) +endif() diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt index befe240e..c8f02828 100644 --- a/gtests/CMakeLists.txt +++ b/gtests/CMakeLists.txt @@ -72,7 +72,7 @@ if(BUILD_TESTING) install(TARGETS glslangtests EXPORT glslangtestsTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(EXPORT glslangtestsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) - endif(ENABLE_GLSLANG_INSTALL) + endif() set(GLSLANG_TEST_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Test") # Supply a default test root directory, so that manual testing @@ -90,7 +90,7 @@ if(BUILD_TESTING) target_include_directories(glslangtests PRIVATE ${spirv-tools_SOURCE_DIR}/include ) - endif(ENABLE_OPT) + endif() set(LIBRARIES glslang OSDependent OGLCompiler glslang @@ -102,7 +102,7 @@ if(BUILD_TESTING) if(ENABLE_HLSL) set(LIBRARIES ${LIBRARIES} HLSL) - endif(ENABLE_HLSL) + endif() target_link_libraries(glslangtests PRIVATE ${LIBRARIES} gmock) add_test(NAME glslang-gtests diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt index 62faa195..7d5bc152 100644 --- a/hlsl/CMakeLists.txt +++ b/hlsl/CMakeLists.txt @@ -56,4 +56,4 @@ if(ENABLE_GLSLANG_INSTALL) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() install(EXPORT HLSLTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif(ENABLE_GLSLANG_INSTALL) +endif() From d3567231ebc216925ef411a3379ab629948c6184 Mon Sep 17 00:00:00 2001 From: Kevin McCullough Date: Wed, 13 Oct 2021 14:57:06 -0700 Subject: [PATCH 26/64] Fix cross-stage check to allow subsequent stage to use previous stage's binding --- glslang/MachineIndependent/linkValidate.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 4edd2a90..a790f93f 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -954,10 +954,10 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // current implementation only has one offset. if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix || symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking || - symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation || + (symbol.getQualifier().hasLocation() && unitSymbol.getQualifier().hasLocation() && symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation) || symbol.getQualifier().layoutComponent != unitSymbol.getQualifier().layoutComponent || symbol.getQualifier().layoutIndex != unitSymbol.getQualifier().layoutIndex || - symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding || + (symbol.getQualifier().hasBinding() && unitSymbol.getQualifier().hasBinding() && symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) || (symbol.getQualifier().hasBinding() && (symbol.getQualifier().layoutOffset != unitSymbol.getQualifier().layoutOffset))) { error(infoSink, "Layout qualification must match:"); writeTypeComparison = true; From dd097e5adb500785dc45bb6c7dcbb3eee4e269ca Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Thu, 14 Oct 2021 08:41:16 -0700 Subject: [PATCH 27/64] Untangle use of core glslang version enums in SpvPostProcess This is the only thing requiring GlslangToSpv.h to be included here. Change-Id: I72e9e278aa1e6d717e83f9dbf11e089aafe2eb0e --- SPIRV/SpvPostProcess.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/SPIRV/SpvPostProcess.cpp b/SPIRV/SpvPostProcess.cpp index 23d7b5a4..d283febe 100644 --- a/SPIRV/SpvPostProcess.cpp +++ b/SPIRV/SpvPostProcess.cpp @@ -44,10 +44,8 @@ #include #include "SpvBuilder.h" - #include "spirv.hpp" -#include "GlslangToSpv.h" -#include "SpvBuilder.h" + namespace spv { #include "GLSL.std.450.h" #include "GLSL.ext.KHR.h" @@ -161,13 +159,13 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) switch (inst.getImmediateOperand(1)) { case GLSLstd450Frexp: case GLSLstd450FrexpStruct: - if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeInt, 16)) + if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeInt, 16)) addExtension(spv::E_SPV_AMD_gpu_shader_int16); break; case GLSLstd450InterpolateAtCentroid: case GLSLstd450InterpolateAtSample: case GLSLstd450InterpolateAtOffset: - if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeFloat, 16)) + if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeFloat, 16)) addExtension(spv::E_SPV_AMD_gpu_shader_half_float); break; default: From 07aec25f82e32254a63dc5dda20eb0da74c01c87 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Wed, 13 Oct 2021 14:12:47 +0800 Subject: [PATCH 28/64] Make modifications of GL_EXT_spirv_intrinsics 1. spirv_execution_mode_id and spirv_decorate_id could support specialization constants. The original implementation always assume only normal frontend constants are valid. It is not true. 2. spirv_type donesn't support type_specifier as an option of spirv_type_parameter. At present, only constant_expression is the valid option. --- SPIRV/GlslangToSpv.cpp | 108 +- .../spv.intrinsicsSpecConst.vert.out | 35 + Test/spv.intrinsicsSpecConst.vert | 14 + glslang/Include/SpirvIntrinsics.h | 18 +- glslang/MachineIndependent/ParseHelper.h | 1 - .../MachineIndependent/SpirvIntrinsics.cpp | 33 +- glslang/MachineIndependent/glslang.m4 | 3 - glslang/MachineIndependent/glslang.y | 3 - glslang/MachineIndependent/glslang_tab.cpp | 3878 ++++++++--------- gtests/Spv.FromFile.cpp | 1 + 10 files changed, 2053 insertions(+), 2041 deletions(-) create mode 100644 Test/baseResults/spv.intrinsicsSpecConst.vert.out create mode 100644 Test/spv.intrinsicsSpecConst.vert diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 63932c2b..43aba9cb 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -1830,10 +1830,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, std::vector operandIds; assert(!modeId.second.empty()); for (auto extraOperand : modeId.second) { - int nextConst = 0; - spv::Id operandId = createSpvConstantFromConstUnionArray( - extraOperand->getType(), extraOperand->getConstArray(), nextConst, false); - operandIds.push_back(operandId); + if (extraOperand->getType().getQualifier().isSpecConstant()) + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); + else + operandIds.push_back(createSpvConstant(*extraOperand)); } builder.addExecutionModeId(shaderEntry, static_cast(modeId.first), operandIds); } @@ -4150,58 +4150,48 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty std::vector operands; for (const auto& typeParam : spirvType.typeParams) { - if (typeParam.isConstant) { - // Constant expression - if (typeParam.constant->isLiteral()) { - if (typeParam.constant->getBasicType() == glslang::EbtFloat) { - float floatValue = static_cast(typeParam.constant->getConstArray()[0].getDConst()); - unsigned literal = *reinterpret_cast(&floatValue); - operands.push_back(literal); - } else if (typeParam.constant->getBasicType() == glslang::EbtInt) { - unsigned literal = typeParam.constant->getConstArray()[0].getIConst(); - operands.push_back(literal); - } else if (typeParam.constant->getBasicType() == glslang::EbtUint) { - unsigned literal = typeParam.constant->getConstArray()[0].getUConst(); - operands.push_back(literal); - } else if (typeParam.constant->getBasicType() == glslang::EbtBool) { - unsigned literal = typeParam.constant->getConstArray()[0].getBConst(); - operands.push_back(literal); - } else if (typeParam.constant->getBasicType() == glslang::EbtString) { - auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str(); - unsigned literal = 0; - char* literalPtr = reinterpret_cast(&literal); - unsigned charCount = 0; - char ch = 0; - do { - ch = *(str++); - *(literalPtr++) = ch; - ++charCount; - if (charCount == 4) { - operands.push_back(literal); - literalPtr = reinterpret_cast(&literal); - charCount = 0; - } - } while (ch != 0); - - // Partial literal is padded with 0 - if (charCount > 0) { - for (; charCount < 4; ++charCount) - *(literalPtr++) = 0; + // Constant expression + if (typeParam.constant->isLiteral()) { + if (typeParam.constant->getBasicType() == glslang::EbtFloat) { + float floatValue = static_cast(typeParam.constant->getConstArray()[0].getDConst()); + unsigned literal = *reinterpret_cast(&floatValue); + operands.push_back(literal); + } else if (typeParam.constant->getBasicType() == glslang::EbtInt) { + unsigned literal = typeParam.constant->getConstArray()[0].getIConst(); + operands.push_back(literal); + } else if (typeParam.constant->getBasicType() == glslang::EbtUint) { + unsigned literal = typeParam.constant->getConstArray()[0].getUConst(); + operands.push_back(literal); + } else if (typeParam.constant->getBasicType() == glslang::EbtBool) { + unsigned literal = typeParam.constant->getConstArray()[0].getBConst(); + operands.push_back(literal); + } else if (typeParam.constant->getBasicType() == glslang::EbtString) { + auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str(); + unsigned literal = 0; + char* literalPtr = reinterpret_cast(&literal); + unsigned charCount = 0; + char ch = 0; + do { + ch = *(str++); + *(literalPtr++) = ch; + ++charCount; + if (charCount == 4) { operands.push_back(literal); + literalPtr = reinterpret_cast(&literal); + charCount = 0; } - } else - assert(0); // Unexpected type - } else { - int nextConst = 0; - spv::Id constant = createSpvConstantFromConstUnionArray( - typeParam.constant->getType(), typeParam.constant->getConstArray(), nextConst, false); - operands.push_back(constant); - } - } else { - // Type specifier - spv::Id typeId = convertGlslangToSpvType(*typeParam.type); - operands.push_back(typeId); - } + } while (ch != 0); + + // Partial literal is padded with 0 + if (charCount > 0) { + for (; charCount < 4; ++charCount) + *(literalPtr++) = 0; + operands.push_back(literal); + } + } else + assert(0); // Unexpected type + } else + operands.push_back(createSpvConstant(*typeParam.constant)); } if (spirvInst.set == "") @@ -8847,12 +8837,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol std::vector operandIds; assert(!decorateId.second.empty()); for (auto extraOperand : decorateId.second) { - int nextConst = 0; - spv::Id operandId = createSpvConstantFromConstUnionArray( - extraOperand->getType(), extraOperand->getConstArray(), nextConst, false); - operandIds.push_back(operandId); + if (extraOperand->getQualifier().isSpecConstant()) + operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode())); + else + operandIds.push_back(createSpvConstant(*extraOperand)); } - builder.addDecoration(id, static_cast(decorateId.first), operandIds); + builder.addDecorationId(id, static_cast(decorateId.first), operandIds); } // Add spirv_decorate_string diff --git a/Test/baseResults/spv.intrinsicsSpecConst.vert.out b/Test/baseResults/spv.intrinsicsSpecConst.vert.out new file mode 100644 index 00000000..11751d64 --- /dev/null +++ b/Test/baseResults/spv.intrinsicsSpecConst.vert.out @@ -0,0 +1,35 @@ +spv.intrinsicsSpecConst.vert +Validation failed +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 13 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 10 + ExecutionModeId 4 DenormFlushToZero 7 + Source GLSL 450 + SourceExtension "GL_EXT_spirv_intrinsics" + Name 4 "main" + Name 7 "targetWidth" + Name 10 "pointSize" + Name 11 "builtIn" + Decorate 7(targetWidth) SpecId 5 + Decorate 10(pointSize) Location 0 + Decorate 11(builtIn) SpecId 6 + DecorateId 10(pointSize) BuiltIn 11(builtIn) + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7(targetWidth): 6(int) SpecConstant 32 + 8: TypeFloat 32 + 9: TypePointer Output 8(float) + 10(pointSize): 9(ptr) Variable Output + 11(builtIn): 6(int) SpecConstant 1 + 12: 8(float) Constant 1082130432 + 4(main): 2 Function None 3 + 5: Label + Store 10(pointSize) 12 + Return + FunctionEnd diff --git a/Test/spv.intrinsicsSpecConst.vert b/Test/spv.intrinsicsSpecConst.vert new file mode 100644 index 00000000..19cc5ef4 --- /dev/null +++ b/Test/spv.intrinsicsSpecConst.vert @@ -0,0 +1,14 @@ +#version 450 core + +#extension GL_EXT_spirv_intrinsics: enable + +layout(constant_id = 5) const uint targetWidth = 32; +spirv_execution_mode_id(4460/*=DenormFlushToZero*/, targetWidth); + +layout(constant_id = 6) const uint builtIn = 1; +spirv_decorate_id(11/*=BuiltIn*/, builtIn) out float pointSize; + +void main() +{ + pointSize = 4.0; +} diff --git a/glslang/Include/SpirvIntrinsics.h b/glslang/Include/SpirvIntrinsics.h index e7a999d4..3c7d72ce 100644 --- a/glslang/Include/SpirvIntrinsics.h +++ b/glslang/Include/SpirvIntrinsics.h @@ -65,7 +65,7 @@ struct TSpirvExecutionMode { // spirv_execution_mode TMap> modes; // spirv_execution_mode_id - TMap > modeIds; + TMap > modeIds; }; // SPIR-V decorations @@ -75,7 +75,7 @@ struct TSpirvDecorate { // spirv_decorate TMap > decorates; // spirv_decorate_id - TMap > decorateIds; + TMap> decorateIds; // spirv_decorate_string TMap > decorateStrings; }; @@ -98,20 +98,12 @@ struct TSpirvInstruction { struct TSpirvTypeParameter { POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - TSpirvTypeParameter(const TIntermConstantUnion* arg) { isConstant = true; constant = arg; } - TSpirvTypeParameter(const TType* arg) { isConstant = false; type = arg; } + TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; } - bool operator==(const TSpirvTypeParameter& rhs) const - { - return isConstant == rhs.isConstant && ((isConstant && constant == rhs.constant) || (!isConstant && type == rhs.type)); - } + bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; } bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); } - bool isConstant; - union { - const TIntermConstantUnion* constant; - const TType* type; - }; + const TIntermConstantUnion* constant; }; typedef TVector TSpirvTypeParameters; diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index 442741d6..885fd908 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -480,7 +480,6 @@ public: TSpirvRequirement* mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1, TSpirvRequirement* spirvReq2); TSpirvTypeParameters* makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant); - TSpirvTypeParameters* makeSpirvTypeParameters(const TPublicType& type); TSpirvTypeParameters* mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, TSpirvTypeParameters* spirvTypeParams2); TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value); diff --git a/glslang/MachineIndependent/SpirvIntrinsics.cpp b/glslang/MachineIndependent/SpirvIntrinsics.cpp index 38094eaa..6650f7d9 100644 --- a/glslang/MachineIndependent/SpirvIntrinsics.cpp +++ b/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -130,11 +130,11 @@ void TIntermediate::insertSpirvExecutionModeId(int executionMode, const TIntermA spirvExecutionMode = new TSpirvExecutionMode; assert(args); - TVector extraOperands; + TVector extraOperands; for (auto arg : args->getSequence()) { - auto extraOperand = arg->getAsConstantUnion(); - assert(extraOperand != nullptr); + auto extraOperand = arg->getAsTyped(); + assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant()); extraOperands.push_back(extraOperand); } spirvExecutionMode->modeIds[executionMode] = extraOperands; @@ -165,10 +165,10 @@ void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args spirvDecorate = new TSpirvDecorate; assert(args); - TVector extraOperands; + TVector extraOperands; for (auto arg : args->getSequence()) { - auto extraOperand = arg->getAsConstantUnion(); - assert(extraOperand != nullptr); + auto extraOperand = arg->getAsTyped(); + assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant()); extraOperands.push_back(extraOperand); } spirvDecorate->decorateIds[decoration] = extraOperands; @@ -201,25 +201,27 @@ TString TQualifier::getSpirvDecorateQualifierString() const const auto appendBool = [&](bool b) { qualifierString.append(std::to_string(b).c_str()); }; const auto appendStr = [&](const char* s) { qualifierString.append(s); }; - const auto appendDecorate = [&](const TIntermConstantUnion* constant) { + const auto appendDecorate = [&](const TIntermTyped* constant) { + auto& constArray = constant->getAsConstantUnion() != nullptr ? constant->getAsConstantUnion()->getConstArray() + : constant->getAsSymbolNode()->getConstArray(); if (constant->getBasicType() == EbtFloat) { - float value = static_cast(constant->getConstArray()[0].getDConst()); + float value = static_cast(constArray[0].getDConst()); appendFloat(value); } else if (constant->getBasicType() == EbtInt) { - int value = constant->getConstArray()[0].getIConst(); + int value = constArray[0].getIConst(); appendInt(value); } else if (constant->getBasicType() == EbtUint) { - unsigned value = constant->getConstArray()[0].getUConst(); + unsigned value = constArray[0].getUConst(); appendUint(value); } else if (constant->getBasicType() == EbtBool) { - bool value = constant->getConstArray()[0].getBConst(); + bool value = constArray[0].getBConst(); appendBool(value); } else if (constant->getBasicType() == EbtString) { - const TString* value = constant->getConstArray()[0].getSConst(); + const TString* value = constArray[0].getSConst(); appendStr(value->c_str()); } else @@ -290,13 +292,6 @@ TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& l return spirvTypeParams; } -TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TPublicType& type) -{ - TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters; - spirvTypeParams->push_back(TSpirvTypeParameter(new TType(type))); - return spirvTypeParams; -} - TSpirvTypeParameters* TParseContext::mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, TSpirvTypeParameters* spirvTypeParams2) { // Merge SPIR-V type parameters of the second one to the first one diff --git a/glslang/MachineIndependent/glslang.m4 b/glslang/MachineIndependent/glslang.m4 index 36265029..d4cc5bc9 100644 --- a/glslang/MachineIndependent/glslang.m4 +++ b/glslang/MachineIndependent/glslang.m4 @@ -4367,9 +4367,6 @@ spirv_type_parameter : constant_expression { $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion()); } - | type_specifier { - $$ = parseContext.makeSpirvTypeParameters($1); - } spirv_instruction_qualifier : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN { diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index ad483863..df53eb5b 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -4367,9 +4367,6 @@ spirv_type_parameter : constant_expression { $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion()); } - | type_specifier { - $$ = parseContext.makeSpirvTypeParameters($1); - } spirv_instruction_qualifier : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN { diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp index 33b8a924..5ba6a6d4 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -1034,16 +1034,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 442 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 12453 +#define YYLAST 12452 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 455 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 131 /* YYNRULES -- Number of rules. */ -#define YYNRULES 684 +#define YYNRULES 683 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 930 +#define YYNSTATES 929 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 709 @@ -1204,8 +1204,8 @@ static const yytype_int16 yyrline[] = 4183, 4187, 4194, 4197, 4202, 4205, 4208, 4211, 4214, 4219, 4228, 4239, 4244, 4252, 4256, 4261, 4265, 4270, 4274, 4279, 4283, 4290, 4293, 4298, 4301, 4304, 4307, 4312, 4320, 4330, - 4334, 4339, 4343, 4348, 4352, 4359, 4362, 4367, 4370, 4375, - 4378, 4384, 4387, 4392, 4395 + 4334, 4339, 4343, 4348, 4352, 4359, 4362, 4367, 4372, 4375, + 4381, 4384, 4389, 4392 }; #endif @@ -1433,7 +1433,7 @@ static const yytype_int16 yytoknum[] = }; #endif -#define YYPACT_NINF (-863) +#define YYPACT_NINF (-859) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) @@ -1447,99 +1447,99 @@ static const yytype_int16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - 4549, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -260, -182, -177, -163, -130, - -115, -100, -89, -863, -863, -196, -863, -863, -863, -863, - -863, -324, -863, -863, -863, -863, -863, -306, -863, -863, - -863, -863, -863, -863, -77, -66, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -332, -175, - -153, -161, 7713, -266, -863, -71, -863, -863, -863, -863, - 5453, -863, -863, -863, -863, -116, -863, -863, 933, -863, - -863, 7713, -35, -863, -863, -863, 5905, -54, -139, -138, - -137, -128, -124, -54, -123, -51, 12061, -863, -15, -347, - -44, -863, -295, -863, -9, -6, 7713, -863, -863, -863, - 7713, -39, -38, -863, -303, -863, -226, -863, -863, 10762, - -3, -863, -863, -863, 1, -32, 7713, -863, -5, -8, - -1, -863, -230, -863, -219, -2, 3, 4, 5, -215, - 6, 8, 10, 11, 12, 15, -214, 13, 16, 21, - -134, -863, 17, 7713, -863, 19, -863, -212, -863, -863, - -211, 9030, -863, -273, 1385, -863, -863, -863, -863, -863, - -3, -263, -863, 9463, -236, -863, -28, -863, -106, 10762, - 10762, -863, 10762, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -264, -863, -863, -863, 23, -203, 11195, 25, - -863, 10762, -863, -863, -311, 24, -6, 29, -863, -309, - -54, -863, -20, -863, -323, 28, -118, 10762, -112, -863, - -155, -111, 10762, -103, 35, -98, -54, -863, 11628, -863, - -94, 10762, 32, -51, -863, 7713, 18, 6357, -863, 7713, - 10762, -863, -347, -863, 33, -863, -863, -72, -254, -86, - -297, -68, -13, 26, 20, 50, 49, -300, 42, 9896, - -863, 43, -863, -863, 55, 58, 60, -863, 65, 71, - 62, 10329, 73, 10762, 66, 69, 70, 72, 74, -241, - -863, -863, -41, -863, -175, 83, 85, -863, -863, -863, - -863, -863, 1837, -863, -863, -863, -863, -863, -863, -863, - -863, -863, 5001, 24, 9463, -233, 8164, -863, -863, 9463, - 7713, -863, 51, -863, -863, -863, -194, -863, -863, 10762, - 52, -863, -863, 10762, 88, -863, -863, -863, 10762, -863, - -863, -863, -315, -863, -863, -191, 82, -863, -863, -863, - -863, -863, -863, -190, -863, -187, -863, -863, -186, 86, - -863, -863, -863, -863, -169, -863, -168, -863, -167, 89, - -863, -165, 91, -157, 82, -863, 85, -156, -863, 94, - 98, -863, -863, 18, -3, -40, -863, -863, -863, 6809, - -863, -863, -863, 10762, 10762, 10762, 10762, 10762, 10762, 10762, - 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762, - 10762, 10762, -863, -863, -863, 97, -863, 2289, -863, -863, - -863, 2289, -863, 10762, -863, -863, -34, 10762, -79, -863, - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, 10762, 10762, -863, -863, -863, - -863, -863, -863, -863, 9463, -863, -863, -208, -863, 7261, - -863, -863, 99, 96, -863, -863, -863, -863, -863, -132, - -131, -863, -307, -863, -323, -863, -323, -863, 10762, 10762, - -863, -155, -863, -155, -863, 10762, 10762, -863, 93, 35, - -863, 11628, -863, 10762, -863, -863, -33, 24, 18, -863, - -863, -863, -863, -863, -72, -72, -254, -254, -86, -86, - -86, -86, -297, -297, -68, -13, 26, 20, 50, 49, - 10762, -863, 2289, 4097, 57, 3645, -154, -863, -152, -863, - -863, -863, -863, -863, 8597, -863, -863, -863, 105, -863, - 75, -863, -145, -863, -144, -863, -143, -863, -142, -863, - -141, -140, -863, -863, -863, -27, 100, 96, 76, 106, - 109, -863, -863, 4097, 107, -863, -863, -863, -863, -863, - -863, -863, -863, -863, -863, -863, 10762, -863, 101, 2741, - 10762, -863, 103, 113, 67, 112, 3193, -863, 114, -863, - 9463, -863, -863, -863, -133, 10762, 2741, 107, -863, -863, - 2289, -863, 110, 96, -863, -863, 2289, 116, -863, -863 + 4548, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -312, -274, -244, -212, -208, + -201, -181, -169, -859, -859, -194, -859, -859, -859, -859, + -859, -285, -859, -859, -859, -859, -859, -317, -859, -859, + -859, -859, -859, -859, -132, -73, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -329, -70, + -158, -145, 7712, -221, -859, -164, -859, -859, -859, -859, + 5452, -859, -859, -859, -859, -68, -859, -859, 932, -859, + -859, 7712, -55, -859, -859, -859, 5904, -80, -154, -150, + -142, -135, -130, -80, -129, -79, 12060, -859, -45, -354, + -76, -859, -308, -859, -43, -40, 7712, -859, -859, -859, + 7712, -72, -71, -859, -265, -859, -257, -859, -859, 10761, + -39, -859, -859, -859, -35, -69, 7712, -859, -42, -38, + -37, -859, -302, -859, -235, -32, -33, -28, -27, -217, + -26, -23, -22, -21, -20, -16, -216, -29, -15, -31, + -303, -859, -13, 7712, -859, -14, -859, -214, -859, -859, + -205, 9029, -859, -279, 1384, -859, -859, -859, -859, -859, + -39, -299, -859, 9462, -275, -859, -34, -859, -137, 10761, + 10761, -859, 10761, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -248, -859, -859, -859, -3, -203, 11194, -1, + -859, 10761, -859, -859, -310, 3, -40, 1, -859, -309, + -80, -859, -30, -859, -319, 5, -128, 10761, -124, -859, + -157, -122, 10761, -120, 10, -118, -80, -859, 11627, -859, + -116, 10761, 7, -79, -859, 7712, -25, 6356, -859, 7712, + 10761, -859, -354, -859, -19, -859, -859, -78, -263, -94, + -298, -52, -18, -8, -12, 29, 28, -301, 15, 9895, + -859, 16, -859, -859, 19, 12, 17, -859, 20, 23, + 18, 10328, 24, 10761, 21, 22, 25, 27, 30, -215, + -859, -859, -117, -859, -70, 26, 34, -859, -859, -859, + -859, -859, 1836, -859, -859, -859, -859, -859, -859, -859, + -859, -859, 5000, 3, 9462, -264, 8163, -859, -859, 9462, + 7712, -859, -11, -859, -859, -859, -195, -859, -859, 10761, + -6, -859, -859, 10761, 37, -859, -859, -859, 10761, -859, + -859, -859, -322, -859, -859, -192, 35, -859, -859, -859, + -859, -859, -859, -179, -859, -178, -859, -859, -177, 32, + -859, -859, -859, -859, -175, -859, -174, -859, -167, 36, + -859, -166, 38, -165, 35, -859, -163, -859, 45, 46, + -859, -859, -25, -39, -115, -859, -859, -859, 6808, -859, + -859, -859, 10761, 10761, 10761, 10761, 10761, 10761, 10761, 10761, + 10761, 10761, 10761, 10761, 10761, 10761, 10761, 10761, 10761, 10761, + 10761, -859, -859, -859, 51, -859, 2288, -859, -859, -859, + 2288, -859, 10761, -859, -859, -88, 10761, -63, -859, -859, + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, 10761, 10761, -859, -859, -859, -859, + -859, -859, -859, 9462, -859, -859, -108, -859, 7260, -859, + -859, 52, 53, -859, -859, -859, -859, -859, -138, -136, + -859, -304, -859, -319, -859, -319, -859, 10761, 10761, -859, + -157, -859, -157, -859, 10761, 10761, -859, 65, 10, -859, + 11627, -859, 10761, -859, -859, -86, 3, -25, -859, -859, + -859, -859, -859, -78, -78, -263, -263, -94, -94, -94, + -94, -298, -298, -52, -18, -8, -12, 29, 28, 10761, + -859, 2288, 4096, 31, 3644, -156, -859, -155, -859, -859, + -859, -859, -859, 8596, -859, -859, -859, 66, -859, 39, + -859, -153, -859, -151, -859, -148, -859, -146, -859, -144, + -143, -859, -859, -859, -61, 64, 53, 40, 72, 74, + -859, -859, 4096, 75, -859, -859, -859, -859, -859, -859, + -859, -859, -859, -859, -859, 10761, -859, 71, 2740, 10761, + -859, 73, 81, 41, 80, 3192, -859, 83, -859, 9462, + -859, -859, -859, -141, 10761, 2740, 75, -859, -859, 2288, + -859, 78, 53, -859, -859, 2288, 86, -859, -859 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1592,7 +1592,7 @@ static const yytype_int16 yydefact[] = 0, 99, 0, 94, 0, 109, 0, 121, 115, 123, 0, 124, 0, 97, 131, 102, 0, 154, 136, 0, 204, 210, 1, 617, 0, 0, 0, 96, 0, 0, - 0, 628, 0, 681, 0, 0, 0, 0, 0, 0, + 0, 628, 0, 680, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 626, 0, 624, 0, 0, 533, 149, 151, 0, 147, 202, 0, 0, 100, 0, 0, 622, 110, 116, 120, 122, @@ -1601,7 +1601,7 @@ static const yytype_int16 yydefact[] = 8, 2, 16, 14, 15, 17, 10, 11, 12, 13, 3, 18, 37, 20, 25, 26, 0, 0, 30, 0, 213, 0, 36, 34, 0, 205, 111, 0, 95, 0, - 0, 679, 0, 636, 0, 0, 0, 0, 0, 653, + 0, 678, 0, 636, 0, 0, 0, 0, 0, 653, 0, 0, 0, 0, 0, 0, 0, 673, 0, 651, 0, 0, 0, 0, 98, 0, 0, 0, 537, 0, 0, 146, 0, 200, 0, 206, 45, 49, 52, 55, @@ -1613,70 +1613,70 @@ static const yytype_int16 yydefact[] = 594, 560, 0, 119, 0, 127, 0, 545, 134, 0, 0, 107, 0, 104, 38, 39, 0, 22, 23, 0, 0, 28, 27, 0, 215, 31, 33, 40, 0, 212, - 112, 683, 0, 684, 629, 0, 0, 682, 648, 644, + 112, 682, 0, 683, 629, 0, 0, 681, 648, 644, 645, 646, 647, 0, 642, 0, 93, 649, 0, 0, 663, 664, 665, 666, 0, 661, 0, 667, 0, 0, - 669, 0, 0, 0, 2, 677, 678, 0, 675, 0, - 0, 623, 625, 0, 543, 0, 541, 536, 538, 0, - 150, 148, 203, 0, 0, 0, 0, 0, 0, 0, + 669, 0, 0, 0, 2, 677, 0, 675, 0, 0, + 623, 625, 0, 543, 0, 541, 536, 538, 0, 150, + 148, 203, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 76, 207, 208, 0, 563, 0, 596, 609, - 608, 0, 600, 0, 612, 610, 0, 0, 0, 593, - 613, 614, 615, 562, 81, 82, 84, 83, 86, 87, - 88, 89, 90, 85, 80, 0, 0, 578, 574, 576, - 580, 587, 595, 129, 0, 548, 549, 0, 133, 0, - 108, 4, 0, 24, 21, 32, 214, 632, 634, 0, - 0, 680, 0, 638, 0, 637, 0, 640, 0, 0, - 655, 0, 654, 0, 657, 0, 0, 659, 0, 0, - 674, 0, 671, 0, 652, 627, 0, 544, 0, 539, - 534, 46, 47, 48, 51, 50, 53, 54, 58, 59, - 56, 57, 61, 62, 64, 66, 68, 70, 72, 74, - 0, 209, 565, 0, 0, 0, 0, 611, 0, 592, - 79, 92, 128, 546, 0, 106, 19, 630, 0, 631, - 0, 643, 0, 650, 0, 662, 0, 668, 0, 670, - 0, 0, 676, 540, 542, 0, 0, 584, 0, 0, - 0, 603, 602, 605, 571, 588, 547, 550, 633, 635, - 639, 641, 656, 658, 660, 672, 0, 566, 0, 0, - 0, 604, 0, 0, 583, 0, 0, 581, 0, 77, - 0, 568, 597, 567, 0, 606, 0, 571, 570, 572, - 590, 585, 0, 607, 601, 582, 591, 0, 599, 589 + 0, 76, 207, 208, 0, 563, 0, 596, 609, 608, + 0, 600, 0, 612, 610, 0, 0, 0, 593, 613, + 614, 615, 562, 81, 82, 84, 83, 86, 87, 88, + 89, 90, 85, 80, 0, 0, 578, 574, 576, 580, + 587, 595, 129, 0, 548, 549, 0, 133, 0, 108, + 4, 0, 24, 21, 32, 214, 632, 634, 0, 0, + 679, 0, 638, 0, 637, 0, 640, 0, 0, 655, + 0, 654, 0, 657, 0, 0, 659, 0, 0, 674, + 0, 671, 0, 652, 627, 0, 544, 0, 539, 534, + 46, 47, 48, 51, 50, 53, 54, 58, 59, 56, + 57, 61, 62, 64, 66, 68, 70, 72, 74, 0, + 209, 565, 0, 0, 0, 0, 611, 0, 592, 79, + 92, 128, 546, 0, 106, 19, 630, 0, 631, 0, + 643, 0, 650, 0, 662, 0, 668, 0, 670, 0, + 0, 676, 540, 542, 0, 0, 584, 0, 0, 0, + 603, 602, 605, 571, 588, 547, 550, 633, 635, 639, + 641, 656, 658, 660, 672, 0, 566, 0, 0, 0, + 604, 0, 0, 583, 0, 0, 581, 0, 77, 0, + 568, 597, 567, 0, 606, 0, 571, 570, 572, 590, + 585, 0, 607, 601, 582, 591, 0, 599, 589 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -863, -863, -863, -863, -863, -863, -863, -863, -863, -863, - -863, -863, -418, -863, -380, -379, -484, -382, -258, -256, - -253, -257, -252, -255, -863, -478, -863, -485, -863, -491, - -530, 14, -863, -863, -863, 7, -397, -863, -863, 44, - 53, 47, -863, -863, -400, -863, -863, -863, -863, -92, - -863, -377, -362, -863, 9, -863, 0, -414, -863, -863, - -863, -863, 150, -863, -863, -863, -546, -548, -218, -331, - -624, -863, -359, -609, -862, -863, -417, -863, -863, -427, - -426, -863, -863, 68, -719, -355, -863, -136, -863, -389, - -863, -135, -863, -863, -863, -863, -129, -863, -863, -863, - -863, -863, -863, -863, -863, 102, -863, -863, 2, -863, - -65, -234, -432, -863, -863, -863, -301, -293, -294, -863, - -863, -304, -299, -302, -298, -863, -296, -305, -863, -383, - -526 + -859, -859, -859, -859, -859, -859, -859, -859, -859, -859, + -859, -859, -209, -859, -418, -417, -602, -421, -291, -284, + -286, -283, -281, -287, -859, -473, -859, -490, -859, -497, + -520, 13, -859, -859, -859, 14, -394, -859, -859, 33, + 42, 44, -859, -859, -395, -859, -859, -859, -859, -121, + -859, -381, -369, -859, 9, -859, 0, -424, -859, -859, + -859, -859, 113, -859, -859, -859, -545, -549, -252, -365, + -617, -859, -391, -618, -858, -859, -450, -859, -859, -459, + -458, -859, -859, 43, -721, -387, -859, -173, -859, -422, + -859, -170, -859, -859, -859, -859, -168, -859, -859, -859, + -859, -859, -859, -859, -859, 67, -859, -859, 2, -859, + -97, -300, -386, -859, -859, -859, -326, -323, -327, -859, + -859, -330, -325, -328, -332, -859, -331, -334, -859, -390, + -530 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 520, 521, 522, 782, 523, 524, 525, 526, 527, + -1, 520, 521, 522, 781, 523, 524, 525, 526, 527, 528, 529, 609, 531, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 610, 840, 611, 765, 612, + 583, 584, 585, 586, 587, 610, 839, 611, 764, 612, 695, 613, 378, 640, 498, 614, 380, 381, 382, 427, 428, 429, 383, 384, 385, 386, 387, 388, 477, 478, 389, 390, 391, 392, 532, 480, 533, 483, 440, 441, - 534, 395, 396, 397, 569, 473, 567, 568, 705, 706, - 638, 777, 617, 618, 619, 620, 621, 737, 876, 912, - 904, 905, 906, 913, 622, 623, 624, 625, 907, 879, - 626, 627, 908, 927, 628, 629, 630, 843, 741, 845, - 883, 902, 903, 631, 398, 399, 400, 424, 632, 470, - 471, 450, 451, 789, 790, 402, 673, 674, 678, 403, - 404, 684, 685, 688, 691, 405, 697, 698, 406, 452, + 534, 395, 396, 397, 569, 473, 567, 568, 704, 705, + 638, 776, 617, 618, 619, 620, 621, 736, 875, 911, + 903, 904, 905, 912, 622, 623, 624, 625, 906, 878, + 626, 627, 907, 926, 628, 629, 630, 842, 740, 844, + 882, 901, 902, 631, 398, 399, 400, 424, 632, 470, + 471, 450, 451, 788, 789, 402, 673, 674, 678, 403, + 404, 684, 685, 688, 691, 405, 696, 697, 406, 452, 453 }; @@ -1685,67 +1685,67 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 394, 445, 401, 588, 444, 430, 445, 379, 637, 393, - 773, 646, 776, 769, 377, 778, 667, 677, 842, 708, - 494, 530, 687, 709, 446, 668, 535, 421, 437, 446, - 466, 700, 667, 787, 720, 721, 731, 911, 475, 661, - 710, 661, 662, 655, 919, 658, 492, 417, 481, 430, - 328, 329, 330, 422, 911, 493, 481, 659, 669, 670, - 671, 672, 476, 576, 482, 647, 648, 788, 437, 676, - 722, 723, 732, 663, 676, 663, 633, 635, 589, 418, - 676, 644, 645, 676, 437, -35, 590, 649, 481, 407, - 432, 650, 676, 433, 779, 634, 565, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 716, 664, 717, - 746, 735, 748, 657, 664, 589, 664, 764, 589, 664, - 541, 664, 639, 664, 664, 774, 542, 495, 664, 576, - 496, 543, 844, 497, 576, 549, 557, 544, 571, 573, - 576, 550, 558, 576, 572, 574, 853, 652, 854, 637, - 852, 637, 576, 653, 637, 415, 781, 665, 783, 791, - 793, 708, 766, 795, 797, 542, 794, 408, 785, 796, - 798, 576, 409, 693, 456, 458, 460, 462, 464, 465, - 468, 800, 802, 804, 423, 807, 410, 801, 803, 805, - 565, 808, 565, 810, 812, 426, 884, 425, 885, 811, - 813, 926, 766, 437, 766, 890, 891, 892, 893, 894, - 895, 794, 798, 801, 805, 808, 813, 922, 562, 411, - 857, 859, 563, 766, 858, 860, 680, 681, 682, 683, - 887, 708, 445, 769, 412, 444, 828, 829, 830, 831, - 786, 718, 719, 454, 457, 459, 455, 455, 455, 413, - 642, 439, 846, 643, 461, 446, 848, 455, 463, 467, - 414, 455, 455, 565, 675, 724, 725, 455, 863, 677, - 679, 686, 419, 455, 455, 867, 687, 766, 849, 689, - 850, 851, 455, 420, 692, 667, 921, 455, 699, 637, - 817, 455, 713, 714, 715, 821, 822, 823, 576, 576, + 394, 430, 401, 637, 768, 646, 445, 444, 588, 393, + 494, 445, 667, 377, 379, 841, 535, 772, 707, 775, + 446, 437, 777, 466, 708, 446, 786, 677, 667, 668, + 421, 475, 687, 719, 720, 730, 417, 407, 655, 661, + 910, 699, 662, 481, 661, 430, 658, 918, 541, 562, + 709, 482, 481, 563, 542, 476, 422, 910, 659, 634, + 787, 437, 669, 670, 671, 672, 633, 635, 418, 721, + 722, 731, 589, 663, 676, 408, 589, 437, 663, 676, + 590, 647, 648, 639, 492, 676, 481, 589, 676, 328, + 329, 330, 565, 493, 773, 778, 495, 676, 715, 496, + 716, -35, 497, 649, 745, 409, 747, 650, 456, 458, + 460, 462, 464, 465, 468, 543, 734, 827, 828, 829, + 830, 544, 843, 753, 754, 755, 756, 757, 758, 759, + 760, 761, 762, 549, 557, 432, 571, 410, 433, 550, + 558, 411, 572, 763, 637, 573, 637, 652, 412, 637, + 665, 574, 782, 653, 664, 780, 851, 415, 790, 707, + 664, 765, 664, 784, 542, 664, 693, 664, 413, 664, + 664, 792, 794, 796, 664, 799, 801, 793, 795, 797, + 414, 800, 802, 803, 806, 809, 565, 811, 565, 804, + 807, 810, 425, 812, 883, 884, 437, 889, 925, 890, + 765, 765, 891, 793, 892, 797, 893, 894, 800, 921, + 804, 426, 807, 812, 856, 765, 858, 419, 857, 642, + 859, 434, 643, 768, 680, 681, 682, 683, 454, 707, + 530, 455, 457, 717, 718, 455, 886, 445, 444, 765, + 459, 817, 766, 455, 818, 845, 852, 461, 853, 847, + 455, 446, 463, 467, 675, 455, 455, 455, 679, 565, + 686, 455, 689, 455, 692, 455, 698, 455, 765, 455, + 817, 846, 576, 872, 849, 850, 420, 862, 677, 816, + 667, 723, 724, 637, 866, 687, 712, 713, 714, 423, + 644, 645, 920, 765, 848, 765, 895, 823, 824, 439, + 825, 826, 831, 832, 447, 449, 469, 768, 474, 479, + 484, 325, 481, 490, 491, 536, 537, 538, 561, 540, + 539, 559, 657, 546, 676, 676, 545, 565, 547, 548, + 551, 676, 676, 552, 553, 554, 555, 676, 576, 676, + 556, 560, 874, 576, 570, 876, 564, 651, 656, 576, + 492, 641, 576, 725, 589, 666, 662, 727, 690, 700, + 703, 576, 726, 637, 728, 729, 711, 732, 737, 741, + 735, 738, 742, 746, 779, -36, 739, 743, 748, 783, + 576, 749, 431, -34, 750, 876, 751, -29, 798, 752, + 438, 393, 805, 791, 808, 813, 814, 565, 394, 393, + 401, 394, 913, 840, 855, 908, 394, 393, 401, 765, + 393, 377, 379, 868, 887, 393, 472, 922, 896, 637, + 448, 888, 898, 899, 879, 897, 431, 486, -569, 909, + 431, 915, 914, 591, 833, 393, 919, 927, 916, 393, + 928, 835, 834, 838, 416, 836, 438, 877, 837, 785, + 815, 710, 873, 880, 917, 393, 923, 881, 924, 769, + 900, 446, 770, 488, 771, 443, 701, 485, 487, 861, + 860, 863, 865, 566, 489, 864, 869, 867, 871, 870, + 0, 0, 393, 0, 616, 0, 0, 877, 0, 0, + 0, 0, 0, 615, 0, 0, 0, 0, 0, 0, + 0, 446, 0, 820, 821, 822, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, - 576, 576, 576, 576, 434, 766, 818, 769, 767, 819, - 676, 676, 766, 818, 447, 847, 873, 676, 676, 766, - 896, 449, 565, 676, 469, 676, 824, 825, 474, 826, - 827, 479, 832, 833, 484, 325, 490, 491, 481, 875, - 539, 536, 877, 537, 538, 540, 545, 641, 726, 546, - 547, 548, 551, 559, 552, 666, 553, 554, 555, 637, - 561, 556, 560, 651, 656, 589, 564, 570, 492, 662, - 576, 576, 431, 690, 701, 729, 730, 576, 576, 728, - 438, 393, 877, 576, 733, 576, 727, 736, 394, 393, - 401, 394, 565, 704, 738, 379, 394, 393, 401, 914, - 393, 909, 377, 448, 742, 393, 472, 739, 712, 740, - 743, 744, 747, 749, 923, 637, 431, 486, 750, 751, - 431, 752, -36, 753, -34, 393, 780, 784, -29, 393, - 792, 869, 799, 878, 814, 806, 438, 809, 815, 841, - 880, 856, 766, 888, 897, 393, 899, 889, 900, 910, - -569, 898, 915, 916, 917, 591, 446, 920, 834, 928, - 929, 835, 837, 566, 488, 836, 839, 489, 838, 487, - 711, 416, 393, 878, 616, 816, 881, 874, 918, 924, - 882, 925, 485, 615, 901, 862, 770, 771, 702, 866, - 443, 861, 865, 772, 868, 864, 446, 0, 872, 0, - 0, 870, 0, 0, 0, 871, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 576, 576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 660, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 696, 0, - 0, 0, 0, 0, 0, 703, 0, 566, 0, 566, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 702, 0, 566, 0, 566, 0, 0, 0, 0, 393, 0, 393, 0, 393, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 576, 576, + 0, 0, 0, 0, 0, 576, 576, 0, 0, 0, + 0, 576, 0, 576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 616, 0, 0, 0, 0, 0, 0, 0, 0, 615, 394, 0, 0, 0, 0, 0, 0, 0, @@ -1755,759 +1755,81 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 566, - 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 566, 0, + 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 616, 0, 0, - 0, 616, 0, 0, 0, 0, 615, 0, 0, 0, - 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 566, - 0, 0, 0, 0, 0, 0, 0, 0, 393, 0, + 0, 0, 0, 0, 0, 0, 616, 0, 0, 0, + 616, 0, 0, 0, 0, 615, 0, 0, 0, 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 696, 0, 696, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 616, 616, 0, 616, 0, 401, 0, 0, - 0, 615, 615, 0, 615, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 616, 0, 0, 0, 0, 0, 0, - 0, 0, 615, 0, 0, 0, 0, 0, 0, 616, - 0, 0, 0, 0, 0, 0, 616, 0, 615, 0, - 0, 0, 0, 0, 0, 615, 616, 0, 0, 0, - 616, 0, 0, 0, 0, 615, 616, 0, 0, 615, - 0, 0, 0, 442, 0, 615, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 325, 0, 0, 0, 0, 0, - 0, 0, 326, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 327, 328, 329, 330, - 331, 0, 0, 0, 0, 0, 0, 0, 0, 332, - 333, 334, 335, 336, 337, 338, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 339, 340, 341, 342, 343, 344, 0, 0, 0, - 0, 0, 0, 0, 0, 345, 0, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 499, 500, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 501, 502, 0, 325, 0, 591, 592, - 0, 0, 0, 0, 593, 503, 504, 505, 506, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 507, 508, 509, 510, - 511, 332, 333, 334, 335, 336, 337, 338, 594, 595, - 596, 597, 0, 598, 599, 600, 601, 602, 603, 604, - 605, 606, 607, 339, 340, 341, 342, 343, 344, 512, - 513, 514, 515, 516, 517, 518, 519, 345, 608, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 0, 0, 499, 500, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 501, 502, 0, 325, 0, - 591, 768, 0, 0, 0, 0, 593, 503, 504, 505, - 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 327, 328, 329, 330, 331, 0, 0, 0, 507, 508, - 509, 510, 511, 332, 333, 334, 335, 336, 337, 338, - 594, 595, 596, 597, 0, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 339, 340, 341, 342, 343, - 344, 512, 513, 514, 515, 516, 517, 518, 519, 345, - 608, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 0, 0, 499, 500, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 501, 502, 0, - 325, 0, 591, 0, 0, 0, 0, 0, 593, 503, - 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 328, 329, 330, 331, 0, 0, 0, - 507, 508, 509, 510, 511, 332, 333, 334, 335, 336, - 337, 338, 594, 595, 596, 597, 0, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 339, 340, 341, - 342, 343, 344, 512, 513, 514, 515, 516, 517, 518, - 519, 345, 608, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, - 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, - 502, 0, 325, 0, 484, 0, 0, 0, 0, 0, - 593, 503, 504, 505, 506, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 327, 328, 329, 330, 331, 0, - 0, 0, 507, 508, 509, 510, 511, 332, 333, 334, - 335, 336, 337, 338, 594, 595, 596, 597, 0, 598, - 599, 600, 601, 602, 603, 604, 605, 606, 607, 339, - 340, 341, 342, 343, 344, 512, 513, 514, 515, 516, - 517, 518, 519, 345, 608, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 501, 502, 0, 325, 0, 0, 0, 0, 0, - 0, 0, 593, 503, 504, 505, 506, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 327, 328, 329, 330, - 331, 0, 0, 0, 507, 508, 509, 510, 511, 332, - 333, 334, 335, 336, 337, 338, 594, 595, 596, 597, - 0, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 339, 340, 341, 342, 343, 344, 512, 513, 514, - 515, 516, 517, 518, 519, 345, 608, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 499, 500, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 501, 502, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 593, 503, 504, 505, 506, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 331, 0, 0, 0, 507, 508, 509, 510, - 511, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 512, - 513, 514, 515, 516, 517, 518, 519, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 0, 0, 0, 318, 319, 320, - 321, 322, 323, 324, 0, 0, 499, 500, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 501, 502, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 503, 504, 505, - 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 327, 328, 329, 330, 0, 0, 0, 0, 507, 508, - 509, 510, 511, 332, 333, 334, 335, 336, 337, 338, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 339, 340, 341, 342, 343, - 344, 512, 513, 514, 515, 516, 517, 518, 519, 345, - 0, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 325, 0, 0, 0, 0, 0, 0, 0, 326, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 328, 329, 330, 331, 0, 0, 0, - 0, 0, 0, 0, 0, 332, 333, 334, 335, 336, - 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 339, 340, 341, - 342, 343, 344, 0, 0, 0, 0, 0, 0, 0, - 0, 345, 0, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, - 0, 318, 319, 320, 321, 322, 323, 324, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 566, 0, + 0, 0, 0, 0, 0, 0, 0, 393, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 327, 328, 329, 330, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 332, 333, 334, - 335, 336, 337, 338, 594, 0, 0, 597, 0, 598, - 599, 0, 0, 602, 0, 0, 0, 0, 0, 339, - 340, 341, 342, 343, 344, 0, 0, 0, 0, 0, - 0, 0, 0, 345, 0, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 0, 0, 0, 318, 319, 320, 321, 322, 323, 324, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 616, 616, 0, 616, 0, 401, 0, 0, 0, + 615, 615, 0, 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 435, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 327, 328, 329, 330, - 0, 0, 0, 0, 0, 0, 0, 0, 436, 332, - 333, 334, 335, 336, 337, 338, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 339, 340, 341, 342, 343, 344, 0, 0, 0, - 0, 0, 0, 0, 0, 345, 0, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 0, 0, 0, 318, 319, 320, 321, 322, - 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 325, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 327, 328, - 329, 330, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 332, 333, 334, 335, 336, 337, 338, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 340, 341, 342, 343, 344, 0, - 0, 0, 0, 0, 0, 0, 0, 345, 0, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 0, 0, 0, 318, 319, 320, - 321, 322, 323, 324, 0, 0, 0, 0, 0, 0, + 0, 0, 616, 0, 0, 0, 0, 0, 0, 0, + 0, 615, 0, 0, 0, 0, 0, 0, 616, 0, + 0, 0, 0, 0, 0, 616, 0, 615, 0, 0, + 0, 0, 0, 0, 615, 616, 0, 0, 0, 616, + 0, 0, 0, 0, 615, 616, 0, 0, 615, 0, + 0, 0, 442, 0, 615, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 707, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 325, 0, 0, 0, 0, 0, 0, + 0, 326, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 328, 329, 330, 331, + 0, 0, 0, 0, 0, 0, 0, 0, 332, 333, + 334, 335, 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 327, 328, 329, 330, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 332, 333, 334, 335, 336, 337, 338, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 339, 340, 341, 342, 343, - 344, 0, 0, 0, 0, 0, 0, 0, 0, 345, - 0, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 0, 0, 0, 318, - 319, 320, 321, 322, 323, 324, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 820, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 327, 328, 329, 330, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 332, 333, 334, 335, 336, - 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 339, 340, 341, - 342, 343, 344, 0, 0, 0, 0, 0, 0, 0, - 0, 345, 0, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 376, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, - 0, 318, 319, 320, 321, 322, 323, 324, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 855, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 327, 328, 329, 330, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 332, 333, 334, - 335, 336, 337, 338, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, - 340, 341, 342, 343, 344, 0, 0, 0, 0, 0, - 0, 0, 0, 345, 0, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 0, 0, 0, 318, 319, 320, 321, 322, 323, 324, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 327, 328, 329, 330, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 332, - 333, 334, 335, 336, 337, 338, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 339, 340, 341, 342, 343, 344, 0, 0, 0, - 0, 0, 0, 0, 0, 345, 0, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 2, 3, + 339, 340, 341, 342, 343, 344, 0, 0, 0, 0, + 0, 0, 0, 0, 345, 0, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 0, 0, 61, 62, 63, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, @@ -2533,68 +1855,343 @@ static const yytype_int16 yytable[] = 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, - 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 501, 502, 0, 0, 0, 636, 775, 0, - 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, + 0, 0, 501, 502, 0, 325, 0, 591, 592, 0, + 0, 0, 0, 593, 503, 504, 505, 506, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 328, 329, + 330, 331, 0, 0, 0, 507, 508, 509, 510, 511, + 332, 333, 334, 335, 336, 337, 338, 594, 595, 596, + 597, 0, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 339, 340, 341, 342, 343, 344, 512, 513, + 514, 515, 516, 517, 518, 519, 345, 608, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, - 332, 0, 0, 0, 0, 337, 338, 0, 0, 0, + 0, 0, 0, 0, 501, 502, 0, 325, 0, 591, + 767, 0, 0, 0, 0, 593, 503, 504, 505, 506, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, + 328, 329, 330, 331, 0, 0, 0, 507, 508, 509, + 510, 511, 332, 333, 334, 335, 336, 337, 338, 594, + 595, 596, 597, 0, 598, 599, 600, 601, 602, 603, + 604, 605, 606, 607, 339, 340, 341, 342, 343, 344, + 512, 513, 514, 515, 516, 517, 518, 519, 345, 608, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, - 514, 515, 516, 517, 518, 519, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 358, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 0, 0, 0, 0, 0, 0, - 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 501, 502, 0, 0, 0, - 636, 886, 0, 0, 0, 0, 0, 503, 504, 505, - 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, - 509, 510, 511, 332, 0, 0, 0, 0, 337, 338, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 512, 513, 514, 515, 516, 517, 518, 519, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 358, 2, 3, 4, 5, 6, 7, + 0, 0, 0, 0, 0, 0, 501, 502, 0, 325, + 0, 591, 0, 0, 0, 0, 0, 593, 503, 504, + 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 327, 328, 329, 330, 331, 0, 0, 0, 507, + 508, 509, 510, 511, 332, 333, 334, 335, 336, 337, + 338, 594, 595, 596, 597, 0, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 339, 340, 341, 342, + 343, 344, 512, 513, 514, 515, 516, 517, 518, 519, + 345, 608, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 0, 0, 61, 62, 63, 64, 65, 66, 67, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 0, 0, 499, + 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 501, 502, + 0, 325, 0, 484, 0, 0, 0, 0, 0, 593, + 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 327, 328, 329, 330, 331, 0, 0, + 0, 507, 508, 509, 510, 511, 332, 333, 334, 335, + 336, 337, 338, 594, 595, 596, 597, 0, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 339, 340, + 341, 342, 343, 344, 512, 513, 514, 515, 516, 517, + 518, 519, 345, 608, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 0, + 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 501, 502, 0, 325, 0, 0, 0, 0, 0, 0, + 0, 593, 503, 504, 505, 506, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 328, 329, 330, 331, + 0, 0, 0, 507, 508, 509, 510, 511, 332, 333, + 334, 335, 336, 337, 338, 594, 595, 596, 597, 0, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 339, 340, 341, 342, 343, 344, 512, 513, 514, 515, + 516, 517, 518, 519, 345, 608, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 0, 0, 499, 500, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 501, 502, 0, 325, 0, 0, 0, 0, + 0, 0, 0, 593, 503, 504, 505, 506, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 328, 329, + 330, 331, 0, 0, 0, 507, 508, 509, 510, 511, + 332, 333, 334, 335, 336, 337, 338, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 339, 340, 341, 342, 343, 344, 512, 513, + 514, 515, 516, 517, 518, 519, 345, 0, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 0, 0, 0, 318, 319, 320, 321, + 322, 323, 324, 0, 0, 499, 500, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 501, 502, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 503, 504, 505, 506, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, + 328, 329, 330, 0, 0, 0, 0, 507, 508, 509, + 510, 511, 332, 333, 334, 335, 336, 337, 338, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 339, 340, 341, 342, 343, 344, + 512, 513, 514, 515, 516, 517, 518, 519, 345, 0, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 325, + 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 327, 328, 329, 330, 331, 0, 0, 0, 0, + 0, 0, 0, 0, 332, 333, 334, 335, 336, 337, + 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 339, 340, 341, 342, + 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, + 345, 0, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, @@ -2620,18 +2217,291 @@ static const yytype_int16 yytable[] = 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, - 0, 0, 0, 321, 0, 0, 0, 0, 0, 499, - 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 501, 502, - 0, 0, 575, 0, 0, 0, 0, 0, 0, 0, - 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, + 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 507, 508, 509, 510, 511, 332, 0, 0, 0, - 0, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 512, 513, 514, 515, 516, 517, - 518, 519, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 358, 2, 3, 4, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, + 336, 337, 338, 594, 0, 0, 597, 0, 598, 599, + 0, 0, 602, 0, 0, 0, 0, 0, 339, 340, + 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, + 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 0, + 0, 0, 318, 319, 320, 321, 322, 323, 324, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 435, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 328, 329, 330, 0, + 0, 0, 0, 0, 0, 0, 0, 436, 332, 333, + 334, 335, 336, 337, 338, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 339, 340, 341, 342, 343, 344, 0, 0, 0, 0, + 0, 0, 0, 0, 345, 0, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 0, 0, 0, 318, 319, 320, 321, 322, 323, + 324, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 325, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 327, 328, 329, + 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 332, 333, 334, 335, 336, 337, 338, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 339, 340, 341, 342, 343, 344, 0, 0, + 0, 0, 0, 0, 0, 0, 345, 0, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, + 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 0, 0, 0, 318, 319, 320, 321, + 322, 323, 324, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 706, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, + 328, 329, 330, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 332, 333, 334, 335, 336, 337, 338, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 339, 340, 341, 342, 343, 344, + 0, 0, 0, 0, 0, 0, 0, 0, 345, 0, + 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 0, 0, 0, 318, 319, + 320, 321, 322, 323, 324, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 819, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 327, 328, 329, 330, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 332, 333, 334, 335, 336, 337, + 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 339, 340, 341, 342, + 343, 344, 0, 0, 0, 0, 0, 0, 0, 0, + 345, 0, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, + 318, 319, 320, 321, 322, 323, 324, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 854, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 327, 328, 329, 330, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 332, 333, 334, 335, + 336, 337, 338, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 339, 340, + 341, 342, 343, 344, 0, 0, 0, 0, 0, 0, + 0, 0, 345, 0, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 0, + 0, 0, 318, 319, 320, 321, 322, 323, 324, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 327, 328, 329, 330, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 332, 333, + 334, 335, 336, 337, 338, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 339, 340, 341, 342, 343, 344, 0, 0, 0, 0, + 0, 0, 0, 0, 345, 0, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, @@ -2666,7 +2536,7 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 501, 502, 0, 0, 0, 636, 0, 0, 0, + 0, 501, 502, 0, 0, 0, 636, 774, 0, 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, 332, @@ -2709,8 +2579,8 @@ static const yytype_int16 yytable[] = 312, 313, 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 501, 502, 0, 0, 734, 0, - 0, 0, 0, 0, 0, 0, 503, 504, 505, 506, + 0, 0, 0, 0, 501, 502, 0, 0, 0, 636, + 885, 0, 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, 332, 0, 0, 0, 0, 337, 338, 0, @@ -2753,7 +2623,7 @@ static const yytype_int16 yytable[] = 0, 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, 502, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 745, 503, + 0, 575, 0, 0, 0, 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, 332, 0, 0, 0, 0, @@ -2796,7 +2666,7 @@ static const yytype_int16 yytable[] = 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 501, 502, 0, 0, 0, 0, 0, 0, 0, 0, + 501, 502, 0, 0, 0, 636, 0, 0, 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, 332, 0, @@ -2839,11 +2709,11 @@ static const yytype_int16 yytable[] = 313, 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 501, 502, 0, 0, 0, 0, 0, + 0, 0, 0, 501, 502, 0, 0, 733, 0, 0, 0, 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, 509, 510, - 511, 332, 0, 0, 0, 0, 337, 654, 0, 0, + 511, 332, 0, 0, 0, 0, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, 516, 517, 518, 519, 0, 0, 0, @@ -2883,10 +2753,10 @@ static const yytype_int16 yytable[] = 0, 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, 502, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 503, 504, + 0, 0, 0, 0, 0, 0, 0, 744, 503, 504, 505, 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 507, - 508, 509, 510, 694, 332, 0, 0, 0, 0, 337, + 508, 509, 510, 511, 332, 0, 0, 0, 0, 337, 338, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, 514, 515, 516, 517, 518, 519, @@ -2924,78 +2794,208 @@ static const yytype_int16 yytable[] = 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, + 499, 500, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 501, + 502, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 503, 504, 505, 506, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 507, 508, 509, 510, 511, 332, 0, 0, + 0, 0, 337, 338, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 512, 513, 514, 515, 516, + 517, 518, 519, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 358, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 0, 0, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 0, 0, 0, 0, 0, 0, 321, 0, 0, + 0, 0, 0, 499, 500, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 501, 502, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 503, 504, 505, 506, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 507, 508, 509, 510, 511, + 332, 0, 0, 0, 0, 337, 654, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 512, 513, + 514, 515, 516, 517, 518, 519, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 358, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 0, 0, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 0, 0, 0, 0, 0, 0, + 321, 0, 0, 0, 0, 0, 499, 500, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 501, 502, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 503, 504, 505, + 506, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 507, 508, + 509, 510, 694, 332, 0, 0, 0, 0, 337, 338, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 512, 513, 514, 515, 516, 517, 518, 519, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 358, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 0, 0, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 0, 0, 0, + 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 332, 0, 0, - 0, 0, 337, 338 + 0, 0, 0, 0, 0, 0, 332, 0, 0, 0, + 0, 337, 338 }; static const yytype_int16 yycheck[] = { - 0, 401, 0, 481, 401, 382, 406, 0, 493, 0, - 634, 502, 636, 622, 0, 639, 542, 547, 737, 567, - 434, 439, 552, 569, 401, 348, 440, 359, 390, 406, - 413, 561, 558, 348, 331, 332, 336, 899, 385, 348, - 570, 348, 351, 528, 906, 356, 349, 353, 351, 426, - 374, 375, 376, 385, 916, 358, 351, 368, 381, 382, - 383, 384, 409, 481, 359, 329, 330, 382, 430, 547, - 367, 368, 372, 382, 552, 382, 490, 491, 351, 385, - 558, 499, 500, 561, 446, 349, 359, 351, 351, 349, - 356, 355, 570, 359, 640, 358, 473, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 361, 540, 363, - 601, 589, 603, 531, 546, 351, 548, 358, 351, 551, - 350, 553, 358, 555, 556, 358, 356, 353, 560, 547, - 356, 350, 741, 359, 552, 350, 350, 356, 350, 350, - 558, 356, 356, 561, 356, 356, 354, 350, 356, 634, - 774, 636, 570, 356, 639, 351, 350, 540, 649, 350, - 350, 709, 356, 350, 350, 356, 356, 349, 653, 356, - 356, 589, 349, 556, 408, 409, 410, 411, 412, 413, - 414, 350, 350, 350, 359, 350, 349, 356, 356, 356, - 567, 356, 569, 350, 350, 356, 350, 350, 350, 356, - 356, 920, 356, 565, 356, 350, 350, 350, 350, 350, - 350, 356, 356, 356, 356, 356, 356, 350, 352, 349, - 352, 352, 356, 356, 356, 356, 381, 382, 383, 384, - 854, 779, 632, 842, 349, 632, 720, 721, 722, 723, - 658, 327, 328, 382, 382, 382, 385, 385, 385, 349, - 356, 367, 743, 359, 382, 632, 747, 385, 382, 382, - 349, 385, 385, 640, 382, 333, 334, 385, 798, 799, - 382, 382, 349, 385, 385, 805, 806, 356, 357, 382, - 765, 766, 385, 349, 382, 811, 910, 385, 382, 774, - 704, 385, 364, 365, 366, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, - 728, 729, 730, 731, 385, 356, 356, 926, 359, 359, - 798, 799, 356, 356, 359, 359, 359, 805, 806, 356, - 357, 385, 709, 811, 385, 813, 716, 717, 353, 718, - 719, 385, 724, 725, 353, 351, 385, 385, 351, 840, - 358, 350, 843, 385, 359, 356, 358, 385, 371, 356, - 356, 356, 356, 350, 356, 385, 356, 356, 356, 854, - 349, 356, 356, 350, 349, 351, 359, 358, 349, 351, - 798, 799, 382, 348, 352, 335, 337, 805, 806, 369, - 390, 382, 883, 811, 352, 813, 370, 354, 398, 390, - 398, 401, 779, 385, 349, 398, 406, 398, 406, 900, - 401, 896, 398, 406, 349, 406, 416, 359, 385, 359, - 349, 359, 349, 357, 915, 910, 426, 425, 359, 359, - 430, 359, 349, 359, 349, 426, 385, 385, 350, 430, - 358, 348, 356, 843, 350, 356, 446, 356, 350, 352, - 393, 352, 356, 348, 354, 446, 350, 382, 349, 358, - 353, 385, 359, 350, 397, 353, 843, 353, 726, 359, - 354, 727, 729, 473, 430, 728, 731, 430, 730, 426, - 572, 331, 473, 883, 484, 703, 845, 818, 905, 916, - 845, 917, 424, 484, 883, 796, 632, 632, 563, 803, - 398, 794, 801, 632, 806, 799, 883, -1, 813, -1, - -1, 809, -1, -1, -1, 811, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 382, 0, 493, 622, 502, 401, 401, 481, 0, + 434, 406, 542, 0, 0, 736, 440, 634, 567, 636, + 401, 390, 639, 413, 569, 406, 348, 547, 558, 348, + 359, 385, 552, 331, 332, 336, 353, 349, 528, 348, + 898, 561, 351, 351, 348, 426, 356, 905, 350, 352, + 570, 359, 351, 356, 356, 409, 385, 915, 368, 358, + 382, 430, 381, 382, 383, 384, 490, 491, 385, 367, + 368, 372, 351, 382, 547, 349, 351, 446, 382, 552, + 359, 329, 330, 358, 349, 558, 351, 351, 561, 374, + 375, 376, 473, 358, 358, 640, 353, 570, 361, 356, + 363, 349, 359, 351, 601, 349, 603, 355, 408, 409, + 410, 411, 412, 413, 414, 350, 589, 719, 720, 721, + 722, 356, 740, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 350, 350, 356, 350, 349, 359, 356, + 356, 349, 356, 358, 634, 350, 636, 350, 349, 639, + 540, 356, 649, 356, 540, 350, 773, 351, 350, 708, + 546, 356, 548, 653, 356, 551, 556, 553, 349, 555, + 556, 350, 350, 350, 560, 350, 350, 356, 356, 356, + 349, 356, 356, 350, 350, 350, 567, 350, 569, 356, + 356, 356, 350, 356, 350, 350, 565, 350, 919, 350, + 356, 356, 350, 356, 350, 356, 350, 350, 356, 350, + 356, 356, 356, 356, 352, 356, 352, 349, 356, 356, + 356, 385, 359, 841, 381, 382, 383, 384, 382, 778, + 439, 385, 382, 327, 328, 385, 853, 632, 632, 356, + 382, 356, 359, 385, 359, 742, 354, 382, 356, 746, + 385, 632, 382, 382, 382, 385, 385, 385, 382, 640, + 382, 385, 382, 385, 382, 385, 382, 385, 356, 385, + 356, 359, 481, 359, 764, 765, 349, 797, 798, 703, + 810, 333, 334, 773, 804, 805, 364, 365, 366, 359, + 499, 500, 909, 356, 357, 356, 357, 715, 716, 367, + 717, 718, 723, 724, 359, 385, 385, 925, 353, 385, + 353, 351, 351, 385, 385, 350, 385, 359, 349, 356, + 358, 350, 531, 356, 797, 798, 358, 708, 356, 356, + 356, 804, 805, 356, 356, 356, 356, 810, 547, 812, + 356, 356, 839, 552, 358, 842, 359, 350, 349, 558, + 349, 385, 561, 371, 351, 385, 351, 369, 348, 352, + 385, 570, 370, 853, 335, 337, 385, 352, 349, 349, + 354, 359, 349, 349, 385, 349, 359, 359, 357, 385, + 589, 359, 382, 349, 359, 882, 359, 350, 356, 359, + 390, 382, 356, 358, 356, 350, 350, 778, 398, 390, + 398, 401, 899, 352, 352, 895, 406, 398, 406, 356, + 401, 398, 398, 348, 348, 406, 416, 914, 354, 909, + 406, 382, 350, 349, 393, 385, 426, 425, 353, 358, + 430, 350, 359, 353, 725, 426, 353, 359, 397, 430, + 354, 727, 726, 730, 331, 728, 446, 842, 729, 658, + 702, 572, 817, 844, 904, 446, 915, 844, 916, 632, + 882, 842, 632, 430, 632, 398, 563, 424, 426, 795, + 793, 798, 802, 473, 430, 800, 808, 805, 812, 810, + -1, -1, 473, -1, 484, -1, -1, 882, -1, -1, + -1, -1, -1, 484, -1, -1, -1, -1, -1, -1, + -1, 882, -1, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 558, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 565, -1, 567, -1, 569, -1, -1, -1, -1, 565, -1, 567, -1, 569, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 797, 798, + -1, -1, -1, -1, -1, 804, 805, -1, -1, -1, + -1, 810, -1, 812, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 622, -1, -1, -1, -1, -1, -1, -1, -1, 622, 632, -1, -1, -1, -1, -1, -1, -1, @@ -3005,759 +3005,81 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 709, - -1, -1, -1, -1, -1, -1, -1, -1, 709, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 708, -1, + -1, -1, -1, -1, -1, -1, -1, 708, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 737, -1, -1, - -1, 741, -1, -1, -1, -1, 737, -1, -1, -1, - 741, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 779, - -1, -1, -1, -1, -1, -1, -1, -1, 779, -1, + -1, -1, -1, -1, -1, -1, 736, -1, -1, -1, + 740, -1, -1, -1, -1, 736, -1, -1, -1, 740, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 811, -1, 813, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 842, 843, -1, 845, -1, 845, -1, -1, - -1, 842, 843, -1, 845, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 883, -1, -1, -1, -1, -1, -1, - -1, -1, 883, -1, -1, -1, -1, -1, -1, 899, - -1, -1, -1, -1, -1, -1, 906, -1, 899, -1, - -1, -1, -1, -1, -1, 906, 916, -1, -1, -1, - 920, -1, -1, -1, -1, 916, 926, -1, -1, 920, - -1, -1, -1, 0, -1, 926, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, - -1, -1, 359, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 373, 374, 375, 376, - 377, -1, -1, -1, -1, -1, -1, -1, -1, 386, - 387, 388, 389, 390, 391, 392, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 408, 409, 410, 411, 412, 413, -1, -1, -1, - -1, -1, -1, -1, -1, 422, -1, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, 351, -1, 353, 354, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, -1, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, -1, -1, 329, 330, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 348, 349, -1, 351, -1, - 353, 354, -1, -1, -1, -1, 359, 360, 361, 362, - 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 373, 374, 375, 376, 377, -1, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, -1, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, -1, -1, 329, 330, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, - 351, -1, 353, -1, -1, -1, -1, -1, 359, 360, - 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 373, 374, 375, 376, 377, -1, -1, -1, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, -1, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, -1, -1, - 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, - 349, -1, 351, -1, 353, -1, -1, -1, -1, -1, - 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, 374, 375, 376, 377, -1, - -1, -1, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, -1, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 348, 349, -1, 351, -1, -1, -1, -1, -1, - -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 373, 374, 375, 376, - 377, -1, -1, -1, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - -1, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, 351, -1, -1, -1, - -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, 377, -1, -1, -1, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, -1, -1, -1, 320, 321, 322, - 323, 324, 325, 326, -1, -1, 329, 330, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 348, 349, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 360, 361, 362, - 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 373, 374, 375, 376, -1, -1, -1, -1, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - -1, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 351, -1, -1, -1, -1, -1, -1, -1, 359, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 373, 374, 375, 376, 377, -1, -1, -1, - -1, -1, -1, -1, -1, 386, 387, 388, 389, 390, - 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 408, 409, 410, - 411, 412, 413, -1, -1, -1, -1, -1, -1, -1, - -1, 422, -1, 424, 425, 426, 427, 428, 429, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, -1, -1, - -1, 320, 321, 322, 323, 324, 325, 326, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 778, -1, + -1, -1, -1, -1, -1, -1, -1, 778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, 374, 375, 376, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 386, 387, 388, - 389, 390, 391, 392, 393, -1, -1, 396, -1, 398, - 399, -1, -1, 402, -1, -1, -1, -1, -1, 408, - 409, 410, 411, 412, 413, -1, -1, -1, -1, -1, - -1, -1, -1, 422, -1, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 841, 842, -1, 844, -1, 844, -1, -1, -1, + 841, 842, -1, 844, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 359, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 373, 374, 375, 376, - -1, -1, -1, -1, -1, -1, -1, -1, 385, 386, - 387, 388, 389, 390, 391, 392, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 408, 409, 410, 411, 412, 413, -1, -1, -1, - -1, -1, -1, -1, -1, 422, -1, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, -1, -1, -1, 320, 321, 322, 323, 324, - 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 373, 374, - 375, 376, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 386, 387, 388, 389, 390, 391, 392, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, 422, -1, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, -1, -1, -1, 320, 321, 322, - 323, 324, 325, 326, -1, -1, -1, -1, -1, -1, + -1, -1, 882, -1, -1, -1, -1, -1, -1, -1, + -1, 882, -1, -1, -1, -1, -1, -1, 898, -1, + -1, -1, -1, -1, -1, 905, -1, 898, -1, -1, + -1, -1, -1, -1, 905, 915, -1, -1, -1, 919, + -1, -1, -1, -1, 915, 925, -1, -1, 919, -1, + -1, -1, 0, -1, 925, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 354, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, + -1, 359, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 373, 374, 375, 376, 377, + -1, -1, -1, -1, -1, -1, -1, -1, 386, 387, + 388, 389, 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 373, 374, 375, 376, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 386, 387, 388, 389, 390, 391, 392, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 408, 409, 410, 411, 412, - 413, -1, -1, -1, -1, -1, -1, -1, -1, 422, - -1, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, -1, -1, -1, 320, - 321, 322, 323, 324, 325, 326, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 354, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 373, 374, 375, 376, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 386, 387, 388, 389, 390, - 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 408, 409, 410, - 411, 412, 413, -1, -1, -1, -1, -1, -1, -1, - -1, 422, -1, 424, 425, 426, 427, 428, 429, 430, - 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, -1, -1, - -1, 320, 321, 322, 323, 324, 325, 326, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 354, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 373, 374, 375, 376, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 386, 387, 388, - 389, 390, 391, 392, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 408, - 409, 410, 411, 412, 413, -1, -1, -1, -1, -1, - -1, -1, -1, 422, -1, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - -1, -1, -1, 320, 321, 322, 323, 324, 325, 326, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 373, 374, 375, 376, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 386, - 387, 388, 389, 390, 391, 392, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 408, 409, 410, 411, 412, 413, -1, -1, -1, - -1, -1, -1, -1, -1, 422, -1, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 4, 5, + 408, 409, 410, 411, 412, 413, -1, -1, -1, -1, + -1, -1, -1, -1, 422, -1, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, -1, -1, 63, 64, 65, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, @@ -3783,68 +3105,343 @@ static const yytype_int16 yycheck[] = 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, - -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 348, 349, -1, -1, -1, 353, 354, -1, - -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, + -1, -1, 348, 349, -1, 351, -1, 353, 354, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, 375, + 376, 377, -1, -1, -1, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, -1, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, + 324, 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, - 386, -1, -1, -1, -1, 391, 392, -1, -1, -1, + -1, -1, -1, -1, 348, 349, -1, 351, -1, 353, + 354, -1, -1, -1, -1, 359, 360, 361, 362, 363, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, + 374, 375, 376, 377, -1, -1, -1, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, -1, 398, 399, 400, 401, 402, 403, + 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, + 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 414, 415, - 416, 417, 418, 419, 420, 421, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 436, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, -1, -1, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, -1, -1, -1, -1, -1, -1, - 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 348, 349, -1, -1, -1, - 353, 354, -1, -1, -1, -1, -1, 360, 361, 362, - 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, - 383, 384, 385, 386, -1, -1, -1, -1, 391, 392, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 414, 415, 416, 417, 418, 419, 420, 421, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 436, 4, 5, 6, 7, 8, 9, + -1, -1, -1, -1, -1, -1, 348, 349, -1, 351, + -1, 353, -1, -1, -1, -1, -1, 359, 360, 361, + 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 373, 374, 375, 376, 377, -1, -1, -1, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, -1, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, + 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, -1, -1, 63, 64, 65, 66, 67, 68, 69, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, -1, -1, 329, + 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, + -1, 351, -1, 353, -1, -1, -1, -1, -1, 359, + 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 373, 374, 375, 376, 377, -1, -1, + -1, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, -1, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, -1, + -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 348, 349, -1, 351, -1, -1, -1, -1, -1, -1, + -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 373, 374, 375, 376, 377, + -1, -1, -1, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, -1, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, -1, -1, 329, 330, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 348, 349, -1, 351, -1, -1, -1, -1, + -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, 375, + 376, 377, -1, -1, -1, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, -1, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, -1, -1, -1, 320, 321, 322, 323, + 324, 325, 326, -1, -1, 329, 330, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 348, 349, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, + 374, 375, 376, -1, -1, -1, -1, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, -1, + 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, + -1, -1, -1, -1, -1, -1, -1, 359, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 373, 374, 375, 376, 377, -1, -1, -1, -1, + -1, -1, -1, -1, 386, 387, 388, 389, 390, 391, + 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 408, 409, 410, 411, + 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, + 422, -1, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, @@ -3870,18 +3467,291 @@ static const yytype_int16 yycheck[] = 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, - -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, - 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, - -1, -1, 352, -1, -1, -1, -1, -1, -1, -1, - 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, + 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 381, 382, 383, 384, 385, 386, -1, -1, -1, - -1, 391, 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 414, 415, 416, 417, 418, 419, - 420, 421, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 436, 4, 5, 6, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, + 390, 391, 392, 393, -1, -1, 396, -1, 398, 399, + -1, -1, 402, -1, -1, -1, -1, -1, 408, 409, + 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, + -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, + -1, -1, 320, 321, 322, 323, 324, 325, 326, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 359, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 373, 374, 375, 376, -1, + -1, -1, -1, -1, -1, -1, -1, 385, 386, 387, + 388, 389, 390, 391, 392, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 408, 409, 410, 411, 412, 413, -1, -1, -1, -1, + -1, -1, -1, -1, 422, -1, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, -1, -1, -1, 320, 321, 322, 323, 324, 325, + 326, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, 375, + 376, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 386, 387, 388, 389, 390, 391, 392, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 408, 409, 410, 411, 412, 413, -1, -1, + -1, -1, -1, -1, -1, -1, 422, -1, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, -1, -1, -1, 320, 321, 322, 323, + 324, 325, 326, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 354, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 373, + 374, 375, 376, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 386, 387, 388, 389, 390, 391, 392, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 408, 409, 410, 411, 412, 413, + -1, -1, -1, -1, -1, -1, -1, -1, 422, -1, + 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, -1, -1, -1, 320, 321, + 322, 323, 324, 325, 326, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 354, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 373, 374, 375, 376, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 386, 387, 388, 389, 390, 391, + 392, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 408, 409, 410, 411, + 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, + 422, -1, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, + 320, 321, 322, 323, 324, 325, 326, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 354, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 373, 374, 375, 376, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 386, 387, 388, 389, + 390, 391, 392, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 408, 409, + 410, 411, 412, 413, -1, -1, -1, -1, -1, -1, + -1, -1, 422, -1, 424, 425, 426, 427, 428, 429, + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, + -1, -1, 320, 321, 322, 323, 324, 325, 326, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 373, 374, 375, 376, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 386, 387, + 388, 389, 390, 391, 392, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 408, 409, 410, 411, 412, 413, -1, -1, -1, -1, + -1, -1, -1, -1, 422, -1, 424, 425, 426, 427, + 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -3916,7 +3786,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 348, 349, -1, -1, -1, 353, -1, -1, -1, + -1, 348, 349, -1, -1, -1, 353, 354, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, @@ -3959,8 +3829,8 @@ static const yytype_int16 yycheck[] = 314, 315, 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 348, 349, -1, -1, 352, -1, - -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, + -1, -1, -1, -1, 348, 349, -1, -1, -1, 353, + 354, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, -1, -1, -1, -1, 391, 392, -1, @@ -4003,7 +3873,7 @@ static const yytype_int16 yycheck[] = -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 359, 360, + -1, 352, -1, -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, -1, -1, -1, -1, @@ -4046,7 +3916,7 @@ static const yytype_int16 yycheck[] = -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 348, 349, -1, -1, -1, -1, -1, -1, -1, -1, + 348, 349, -1, -1, -1, 353, -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, -1, @@ -4089,7 +3959,7 @@ static const yytype_int16 yycheck[] = 315, 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 348, 349, -1, -1, -1, -1, -1, + -1, -1, -1, 348, 349, -1, -1, 352, -1, -1, -1, -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, @@ -4133,7 +4003,7 @@ static const yytype_int16 yycheck[] = -1, 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, 349, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 360, 361, + -1, -1, -1, -1, -1, -1, -1, 359, 360, 361, 362, 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, 386, -1, -1, -1, -1, 391, @@ -4174,13 +4044,143 @@ static const yytype_int16 yycheck[] = 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, -1, -1, -1, + 329, 330, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 348, + 349, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 360, 361, 362, 363, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 381, 382, 383, 384, 385, 386, -1, -1, + -1, -1, 391, 392, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 414, 415, 416, 417, 418, + 419, 420, 421, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 436, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, -1, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, -1, -1, -1, -1, -1, -1, 323, -1, -1, + -1, -1, -1, 329, 330, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 348, 349, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 360, 361, 362, 363, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 381, 382, 383, 384, 385, + 386, -1, -1, -1, -1, 391, 392, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 414, 415, + 416, 417, 418, 419, 420, 421, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 436, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, -1, -1, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, -1, -1, -1, -1, -1, -1, + 323, -1, -1, -1, -1, -1, 329, 330, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 348, 349, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 360, 361, 362, + 363, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 381, 382, + 383, 384, 385, 386, -1, -1, -1, -1, 391, 392, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 414, 415, 416, 417, 418, 419, 420, 421, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 436, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, -1, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, -1, -1, -1, + -1, -1, -1, 323, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 386, -1, -1, - -1, -1, 391, 392 + -1, -1, -1, -1, -1, -1, 386, -1, -1, -1, + -1, 391, 392 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -4256,30 +4256,30 @@ static const yytype_int16 yystos[] = 563, 348, 351, 382, 567, 584, 385, 585, 348, 381, 382, 383, 384, 571, 572, 382, 480, 485, 573, 382, 381, 382, 383, 384, 576, 577, 382, 485, 578, 382, - 348, 579, 382, 584, 385, 485, 511, 581, 582, 382, - 485, 352, 565, 511, 385, 523, 524, 354, 522, 521, - 485, 504, 385, 364, 365, 366, 361, 363, 327, 328, - 331, 332, 367, 368, 333, 334, 371, 370, 369, 335, - 337, 336, 372, 352, 352, 480, 354, 532, 349, 359, - 359, 553, 349, 349, 359, 359, 484, 349, 484, 357, - 359, 359, 359, 359, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 358, 483, 356, 359, 354, 528, - 542, 546, 551, 525, 358, 354, 525, 526, 525, 521, - 385, 350, 459, 484, 385, 482, 467, 348, 382, 568, - 569, 350, 358, 350, 356, 350, 356, 350, 356, 356, - 350, 356, 350, 356, 350, 356, 356, 350, 356, 356, - 350, 356, 350, 356, 350, 350, 523, 512, 356, 359, - 354, 467, 467, 467, 469, 469, 470, 470, 471, 471, - 471, 471, 472, 472, 473, 474, 475, 476, 477, 478, - 481, 352, 539, 552, 528, 554, 484, 359, 484, 357, - 482, 482, 525, 354, 356, 354, 352, 352, 356, 352, - 356, 572, 571, 485, 573, 577, 576, 485, 578, 348, - 579, 581, 582, 359, 524, 484, 533, 484, 499, 544, - 393, 527, 540, 555, 350, 350, 354, 525, 348, 382, - 350, 350, 350, 350, 350, 350, 357, 354, 385, 350, - 349, 544, 556, 557, 535, 536, 537, 543, 547, 482, - 358, 529, 534, 538, 484, 359, 350, 397, 531, 529, - 353, 525, 350, 484, 534, 535, 539, 548, 359, 354 + 348, 579, 382, 584, 385, 485, 581, 582, 382, 485, + 352, 565, 511, 385, 523, 524, 354, 522, 521, 485, + 504, 385, 364, 365, 366, 361, 363, 327, 328, 331, + 332, 367, 368, 333, 334, 371, 370, 369, 335, 337, + 336, 372, 352, 352, 480, 354, 532, 349, 359, 359, + 553, 349, 349, 359, 359, 484, 349, 484, 357, 359, + 359, 359, 359, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 358, 483, 356, 359, 354, 528, 542, + 546, 551, 525, 358, 354, 525, 526, 525, 521, 385, + 350, 459, 484, 385, 482, 467, 348, 382, 568, 569, + 350, 358, 350, 356, 350, 356, 350, 356, 356, 350, + 356, 350, 356, 350, 356, 356, 350, 356, 356, 350, + 356, 350, 356, 350, 350, 523, 512, 356, 359, 354, + 467, 467, 467, 469, 469, 470, 470, 471, 471, 471, + 471, 472, 472, 473, 474, 475, 476, 477, 478, 481, + 352, 539, 552, 528, 554, 484, 359, 484, 357, 482, + 482, 525, 354, 356, 354, 352, 352, 356, 352, 356, + 572, 571, 485, 573, 577, 576, 485, 578, 348, 579, + 581, 582, 359, 524, 484, 533, 484, 499, 544, 393, + 527, 540, 555, 350, 350, 354, 525, 348, 382, 350, + 350, 350, 350, 350, 350, 357, 354, 385, 350, 349, + 544, 556, 557, 535, 536, 537, 543, 547, 482, 358, + 529, 534, 538, 484, 359, 350, 397, 531, 529, 353, + 525, 350, 484, 534, 535, 539, 548, 359, 354 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -4352,8 +4352,8 @@ static const yytype_int16 yyr1[] = 570, 570, 571, 571, 572, 572, 572, 572, 572, 573, 573, 574, 574, 575, 575, 575, 575, 575, 575, 575, 575, 576, 576, 577, 577, 577, 577, 578, 578, 579, - 579, 580, 580, 580, 580, 581, 581, 582, 582, 583, - 583, 584, 584, 585, 585 + 579, 580, 580, 580, 580, 581, 581, 582, 583, 583, + 584, 584, 585, 585 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -4426,8 +4426,8 @@ static const yytype_int8 yyr2[] = 6, 8, 1, 3, 1, 1, 1, 1, 1, 1, 3, 4, 6, 4, 6, 6, 8, 6, 8, 6, 8, 1, 3, 1, 1, 1, 1, 1, 3, 1, - 3, 6, 8, 4, 6, 1, 3, 1, 1, 4, - 6, 1, 3, 3, 3 + 3, 6, 8, 4, 6, 1, 3, 1, 4, 6, + 1, 3, 3, 3 }; @@ -12155,65 +12155,57 @@ yyreduce: #line 12156 "MachineIndependent/glslang_tab.cpp" break; - case 678: /* spirv_type_parameter: type_specifier */ -#line 4370 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type)); + case 678: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4372 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } #line 12164 "MachineIndependent/glslang_tab.cpp" break; - case 679: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ + case 679: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ #line 4375 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); - } -#line 12172 "MachineIndependent/glslang_tab.cpp" - break; - - case 680: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4378 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } +#line 12173 "MachineIndependent/glslang_tab.cpp" + break; + + case 680: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4381 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); + } #line 12181 "MachineIndependent/glslang_tab.cpp" break; - case 681: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ + case 681: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ #line 4384 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); + { + (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } #line 12189 "MachineIndependent/glslang_tab.cpp" break; - case 682: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4387 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); + case 682: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4389 "MachineIndependent/glslang.y" + { + (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } #line 12197 "MachineIndependent/glslang_tab.cpp" break; - case 683: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ + case 683: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ #line 4392 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); + { + (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } #line 12205 "MachineIndependent/glslang_tab.cpp" break; - case 684: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4395 "MachineIndependent/glslang.y" - { - (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); - } -#line 12213 "MachineIndependent/glslang_tab.cpp" - break; - -#line 12217 "MachineIndependent/glslang_tab.cpp" +#line 12209 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12438,5 +12430,5 @@ yyreturn: return yyresult; } -#line 4400 "MachineIndependent/glslang.y" +#line 4397 "MachineIndependent/glslang.y" diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index 29740f31..ef117640 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -365,6 +365,7 @@ INSTANTIATE_TEST_SUITE_P( "spv.int64.frag", "spv.intcoopmat.comp", "spv.intOps.vert", + "spv.intrinsicsSpecConst.vert", "spv.intrinsicsSpirvByReference.vert", "spv.intrinsicsSpirvDecorate.frag", "spv.intrinsicsSpirvExecutionMode.frag", From 035a3bbc4afeac30876dae533d22a034ac64dbc1 Mon Sep 17 00:00:00 2001 From: amhagan Date: Wed, 1 Sep 2021 11:33:21 -0400 Subject: [PATCH 29/64] GL_EXT_spirv_intrinsics - Port extensions Add mechanism to use GL_EXT_spirv_intrinsics headers in glslang. Ported GL_EXT_shader_realtime_clock as an example. --- BUILD.bazel | 14 +++ BUILD.gn | 18 ++++ StandAlone/CMakeLists.txt | 20 +++- StandAlone/StandAlone.cpp | 15 ++- gen_extension_headers.py | 98 +++++++++++++++++++ .../GL_EXT_shader_realtime_clock.glsl | 54 ++++++++++ glslang/MachineIndependent/Initialize.cpp | 9 +- 7 files changed, 218 insertions(+), 10 deletions(-) create mode 100644 gen_extension_headers.py create mode 100644 glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl diff --git a/BUILD.bazel b/BUILD.bazel index e8cf6a86..1115b7de 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -49,6 +49,11 @@ py_binary( srcs = ["build_info.py"], ) +py_binary( + name = "gen_extension_headers", + srcs = ["gen_extension_headers.py"], +) + genrule( name = "gen_build_info_h", srcs = ["CHANGES.md", "build_info.h.tmpl"], @@ -58,6 +63,14 @@ genrule( tools = [":build_info"], ) +genrule( + name = "gen_extension_headers_h", + srcs = ["glslang/ExtensionHeaders", "gen_extension_headers.py"], + outs = ["glslang/glsl_intrinsic_header.h"], + cmd_bash = "$(location gen_extension_headers) -i $(location glslang/ExtensionHeaders) -o $(location glslang/glsl_intrinsic_header.h)", + tools = [":gen_extension_headers"], +) + COMMON_COPTS = select({ "@bazel_tools//src/conditions:windows": [""], "//conditions:default": [ @@ -206,6 +219,7 @@ cc_binary( srcs = [ "StandAlone/StandAlone.cpp", "StandAlone/Worklist.h", + ":glslang/glsl_intrinsic_header.h" ], copts = COMMON_COPTS, deps = [ diff --git a/BUILD.gn b/BUILD.gn index a37e1d25..06d3c4b8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -69,6 +69,23 @@ action("glslang_build_info") { ] } +action("glslang_extension_headers") { + script = "gen_extension_headers.py" + + out_file = "${target_gen_dir}/include/glslang/glsl_intrinsic_header.h" + + inputs = [ + script + ] + outputs = [ out_file ] + args = [ + "-i", + rebase_path("glslang/ExtensionHeaders", root_build_dir), + "-o", + rebase_path(out_file, root_build_dir), + ] +} + spirv_tools_dir = glslang_spirv_tools_dir if (!defined(glslang_angle)) { glslang_angle = false @@ -302,6 +319,7 @@ executable("glslang_validator") { ":glslang_build_info", ":glslang_default_resource_limits_sources", ":glslang_sources", + ":glslang_extension_headers", ] public_configs = [ ":glslang_hlsl" ] diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index 91bec6cc..4d5545c7 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -31,6 +31,22 @@ # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. +find_host_package(PythonInterp 3 REQUIRED) + +set(GLSLANG_INTRINSIC_H "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/glsl_intrinsic_header.h") +set(GLSLANG_INTRINSIC_PY "${CMAKE_SOURCE_DIR}/gen_extension_headers.py") +set(GLSLANG_INTRINSIC_HEADER_DIR "${CMAKE_SOURCE_DIR}/glslang/ExtensionHeaders") + +add_custom_command( + OUTPUT ${GLSLANG_INTRINSIC_H} + COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_INTRINSIC_PY}" + "-i" ${GLSLANG_INTRINSIC_HEADER_DIR} + "-o" ${GLSLANG_INTRINSIC_H} + DEPENDS ${GLSLANG_INTRINSIC_PY} + COMMENT "Generating ${GLSLANG_INTRINSIC_H}") + +#add_custom_target(glslangValidator DEPENDS ${GLSLANG_INTRINSIC_H}) + add_library(glslang-default-resource-limits ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp ${CMAKE_CURRENT_SOURCE_DIR}/resource_limits_c.cpp) @@ -41,7 +57,7 @@ target_include_directories(glslang-default-resource-limits PUBLIC $ PUBLIC $) -set(SOURCES StandAlone.cpp DirStackFileIncluder.h) +set(SOURCES StandAlone.cpp DirStackFileIncluder.h ${GLSLANG_INTRINSIC_H}) add_executable(glslangValidator ${SOURCES}) set_property(TARGET glslangValidator PROPERTY FOLDER tools) @@ -108,4 +124,4 @@ if(ENABLE_GLSLANG_INSTALL) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif() +endif() \ No newline at end of file diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index e62f92f7..23e510c2 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -2,6 +2,7 @@ // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. // Copyright (C) 2013-2016 LunarG, Inc. // Copyright (C) 2016-2020 Google, Inc. +// Modifications Copyright(C) 2021 Advanced Micro Devices, Inc.All rights reserved. // // All rights reserved. // @@ -65,6 +66,8 @@ // Build-time generated includes #include "glslang/build_info.h" +#include "glslang/glsl_intrinsic_header.h" + extern "C" { GLSLANG_EXPORT void ShOutputHtml(); } @@ -263,6 +266,7 @@ protected: // Track the user's #define and #undef from the command line. TPreamble UserPreamble; +std::string PreambleString; // // Create the default name for saving a binary if -o is not provided. @@ -1204,8 +1208,17 @@ void CompileAndLinkShaderUnits(std::vector compUnits) "Use '-e '.\n"); shader->setSourceEntryPoint(sourceEntryPointName); } + + std::string intrinsicString = getIntrinsic(compUnit.text, compUnit.count); + + PreambleString = ""; if (UserPreamble.isSet()) - shader->setPreamble(UserPreamble.get()); + PreambleString.append(UserPreamble.get()); + + if (!intrinsicString.empty()) + PreambleString.append(intrinsicString); + + shader->setPreamble(PreambleString.c_str()); shader->addProcesses(Processes); #ifndef GLSLANG_WEB diff --git a/gen_extension_headers.py b/gen_extension_headers.py new file mode 100644 index 00000000..a787f9a9 --- /dev/null +++ b/gen_extension_headers.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python + +# Copyright (c) 2020 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import glob +import sys +import os + +def generate_main(glsl_files, output_header_file): + # Write commit ID to output header file + with open(output_header_file, "w") as header_file: + # Copyright Notice + header_string = '/***************************************************************************\n' + header_string += ' *\n' + header_string += ' * Copyright (c) 2015-2021 The Khronos Group Inc.\n' + header_string += ' * Copyright (c) 2015-2021 Valve Corporation\n' + header_string += ' * Copyright (c) 2015-2021 LunarG, Inc.\n' + header_string += ' * Copyright (c) 2015-2021 Google Inc.\n' + header_string += ' * Copyright (c) 2021 Advanced Micro Devices, Inc.All rights reserved.\n' + header_string += ' *\n' + header_string += ' ****************************************************************************/\n' + header_string += '#pragma once\n\n' + header_string += '#ifndef _INTRINSIC_EXTENSION_HEADER_H_\n' + header_string += '#define _INTRINSIC_EXTENSION_HEADER_H_\n\n' + header_file.write(header_string) + + symbol_name_list = [] + + for i in glsl_files: + glsl_contents = open(i,"r").read() + + filename = os.path.basename(i) + symbol_name = filename.split(".")[0] + symbol_name_list.append(symbol_name) + header_name = symbol_name + ".h" + header_str = 'std::string %s_GLSL = R"(\n%s\n)";\n' % (symbol_name, glsl_contents) + header_str += '\n' + header_file.write(header_str) + + contents = '' + contents += '\n' + contents += 'std::string getIntrinsic(const char* const* shaders, int n) {\n' + contents += '\tstd::string shaderString = "";\n'; + + contents += '\tfor (int i = 0; i < n; i++) {\n' + + for symbol_name in symbol_name_list: + contents += '\t\tif (strstr(shaders[i], "%s") != NULL) {\n' % (symbol_name) + contents += '\t\t shaderString.append(%s_GLSL);\n' % (symbol_name) + contents += '\t\t}\n' + + contents += '\t}\n' + contents += '\treturn shaderString;\n'; + contents += '}\n' + + contents += '\n#endif\n' + header_file.write(contents) + +def main(): + if len(sys.argv) < 2: + raise Exception("Invalid number of arguments") + + i = 0 + while i < len(sys.argv): + opt = sys.argv[i] + i = i + 1 + + if opt == "-i" or opt == "-o": + if i == len(sys.argv): + raise Exception("Expected path after {}".format(opt)) + val = sys.argv[i] + i = i + 1 + if (opt == "-i"): + input_dir = val + elif (opt == "-o"): + output_file = val + else: + raise Exception("Unknown flag {}".format(opt)) + + glsl_files = glob.glob(input_dir + '/*.glsl') + + # Generate main header + generate_main(glsl_files, output_file) + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl b/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl new file mode 100644 index 00000000..f74df6fc --- /dev/null +++ b/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl @@ -0,0 +1,54 @@ +// +// Copyright (C) 2002-2005 3Dlabs Inc. Ltd. +// Copyright (C) 2013-2016 LunarG, Inc. +// Copyright (C) 2016-2020 Google, Inc. +// Modifications Copyright(C) 2021 Advanced Micro Devices, Inc.All rights reserved. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +// + +#extension GL_EXT_spirv_intrinsics : enable +#extension GL_ARB_gpu_shader_int64 : enable + +uvec2 clockRealtime2x32EXT(void) { + spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056) + uvec2 clockRealtime2x32EXT_internal(uint scope); + + return clockRealtime2x32EXT_internal(1 /*Device scope*/); +} + +uint64_t clockRealtimeEXT(void) { + spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056) + uint64_t clockRealtimeEXT_internal(uint scope); + + return clockRealtimeEXT_internal(1 /*Device scope*/); +} \ No newline at end of file diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index ee4e2cab..9f925299 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -3,7 +3,7 @@ // Copyright (C) 2012-2016 LunarG, Inc. // Copyright (C) 2015-2020 Google, Inc. // Copyright (C) 2017 ARM Limited. -// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved. +// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved. // // All rights reserved. // @@ -4653,13 +4653,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // GL_ARB_shader_clock & GL_EXT_shader_realtime_clock + // GL_ARB_shader_clock if (profile != EEsProfile && version >= 450) { commonBuiltins.append( "uvec2 clock2x32ARB();" "uint64_t clockARB();" - "uvec2 clockRealtime2x32EXT();" - "uint64_t clockRealtimeEXT();" "\n"); } @@ -8408,9 +8406,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock); symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock); - symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock); - symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock); - if (profile == EEsProfile && version < 320) { symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader); symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader); From 36333d1fb9f2375ca3595315e7643968aa6b3a29 Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 19 Oct 2021 17:32:52 -0400 Subject: [PATCH 30/64] Fix Cmake rule for extension header generation Allow glslang to be embedded in an enclosing project (such as Shaderc) --- StandAlone/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index 4d5545c7..2b163e7f 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -34,8 +34,8 @@ find_host_package(PythonInterp 3 REQUIRED) set(GLSLANG_INTRINSIC_H "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/glsl_intrinsic_header.h") -set(GLSLANG_INTRINSIC_PY "${CMAKE_SOURCE_DIR}/gen_extension_headers.py") -set(GLSLANG_INTRINSIC_HEADER_DIR "${CMAKE_SOURCE_DIR}/glslang/ExtensionHeaders") +set(GLSLANG_INTRINSIC_PY "${CMAKE_CURRENT_SOURCE_DIR}/../gen_extension_headers.py") +set(GLSLANG_INTRINSIC_HEADER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../glslang/ExtensionHeaders") add_custom_command( OUTPUT ${GLSLANG_INTRINSIC_H} @@ -124,4 +124,4 @@ if(ENABLE_GLSLANG_INSTALL) ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() install(EXPORT glslang-default-resource-limitsTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) -endif() \ No newline at end of file +endif() From c571cd8f890aa16f1791ef0e58ee26eec58edf67 Mon Sep 17 00:00:00 2001 From: alelenv Date: Tue, 19 Oct 2021 20:59:35 -0700 Subject: [PATCH 31/64] Skip auto decorating shader record buffer blocks with 'set' and 'binding'. --- Test/baseResults/rayQuery.rgen.out | 2 -- Test/baseResults/spv.RayGenShader.rgen.out | 2 -- Test/baseResults/spv.RayGenShader11.rgen.out | 2 -- Test/baseResults/spv.RayGenShaderArray.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenSBTlayout.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenSBTlayout140.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenSBTlayout430.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenSBTlayoutscalar.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenShader.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenShader11.rgen.out | 2 -- Test/baseResults/spv.ext.RayGenShaderArray.rgen.out | 2 -- glslang/MachineIndependent/iomapper.cpp | 2 +- 12 files changed, 1 insertion(+), 23 deletions(-) diff --git a/Test/baseResults/rayQuery.rgen.out b/Test/baseResults/rayQuery.rgen.out index 80e9916e..06a1a5a8 100644 --- a/Test/baseResults/rayQuery.rgen.out +++ b/Test/baseResults/rayQuery.rgen.out @@ -28,8 +28,6 @@ rayQuery.rgen MemberDecorate 26(block) 0 Offset 0 MemberDecorate 26(block) 1 Offset 16 Decorate 26(block) BufferBlock - Decorate 28 DescriptorSet 0 - Decorate 28 Binding 1 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 diff --git a/Test/baseResults/spv.RayGenShader.rgen.out b/Test/baseResults/spv.RayGenShader.rgen.out index f8f3fd65..b7085378 100644 --- a/Test/baseResults/spv.RayGenShader.rgen.out +++ b/Test/baseResults/spv.RayGenShader.rgen.out @@ -31,8 +31,6 @@ spv.RayGenShader.rgen MemberDecorate 37(block) 0 Offset 0 MemberDecorate 37(block) 1 Offset 16 Decorate 37(block) BufferBlock - Decorate 39 DescriptorSet 0 - Decorate 39 Binding 2 Decorate 50(accNV1) DescriptorSet 0 Decorate 50(accNV1) Binding 1 Decorate 53(payload) Location 0 diff --git a/Test/baseResults/spv.RayGenShader11.rgen.out b/Test/baseResults/spv.RayGenShader11.rgen.out index f6b79c57..48509b0d 100644 --- a/Test/baseResults/spv.RayGenShader11.rgen.out +++ b/Test/baseResults/spv.RayGenShader11.rgen.out @@ -30,8 +30,6 @@ spv.RayGenShader11.rgen MemberDecorate 37(block) 0 Offset 0 MemberDecorate 37(block) 1 Offset 16 Decorate 37(block) Block - Decorate 39 DescriptorSet 0 - Decorate 39 Binding 1 Decorate 52(payload) Location 0 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.RayGenShaderArray.rgen.out b/Test/baseResults/spv.RayGenShaderArray.rgen.out index 63a04b3e..8ddfca97 100644 --- a/Test/baseResults/spv.RayGenShaderArray.rgen.out +++ b/Test/baseResults/spv.RayGenShaderArray.rgen.out @@ -37,8 +37,6 @@ spv.RayGenShaderArray.rgen MemberDecorate 34(block) 1 Offset 16 MemberDecorate 34(block) 2 Offset 28 Decorate 34(block) BufferBlock - Decorate 36 DescriptorSet 0 - Decorate 36 Binding 2 Decorate 60(accNV1) DescriptorSet 0 Decorate 60(accNV1) Binding 1 Decorate 75 DecorationNonUniformEXT diff --git a/Test/baseResults/spv.ext.RayGenSBTlayout.rgen.out b/Test/baseResults/spv.ext.RayGenSBTlayout.rgen.out index 60b5e937..95d92136 100644 --- a/Test/baseResults/spv.ext.RayGenSBTlayout.rgen.out +++ b/Test/baseResults/spv.ext.RayGenSBTlayout.rgen.out @@ -49,8 +49,6 @@ spv.ext.RayGenSBTlayout.rgen MemberDecorate 36(block) 9 Offset 120 MemberDecorate 36(block) 10 Offset 128 Decorate 36(block) Block - Decorate 38 DescriptorSet 0 - Decorate 38 Binding 0 Decorate 60(payload) Location 1 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.ext.RayGenSBTlayout140.rgen.out b/Test/baseResults/spv.ext.RayGenSBTlayout140.rgen.out index cc175f71..f5e32c13 100644 --- a/Test/baseResults/spv.ext.RayGenSBTlayout140.rgen.out +++ b/Test/baseResults/spv.ext.RayGenSBTlayout140.rgen.out @@ -49,8 +49,6 @@ spv.ext.RayGenSBTlayout140.rgen MemberDecorate 36(block) 9 Offset 136 MemberDecorate 36(block) 10 Offset 144 Decorate 36(block) Block - Decorate 38 DescriptorSet 0 - Decorate 38 Binding 0 Decorate 60(payload) Location 1 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.ext.RayGenSBTlayout430.rgen.out b/Test/baseResults/spv.ext.RayGenSBTlayout430.rgen.out index afcfa9cd..d952adfd 100644 --- a/Test/baseResults/spv.ext.RayGenSBTlayout430.rgen.out +++ b/Test/baseResults/spv.ext.RayGenSBTlayout430.rgen.out @@ -49,8 +49,6 @@ spv.ext.RayGenSBTlayout430.rgen MemberDecorate 36(block) 9 Offset 120 MemberDecorate 36(block) 10 Offset 128 Decorate 36(block) Block - Decorate 38 DescriptorSet 0 - Decorate 38 Binding 0 Decorate 60(payload) Location 1 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.ext.RayGenSBTlayoutscalar.rgen.out b/Test/baseResults/spv.ext.RayGenSBTlayoutscalar.rgen.out index eac481ac..c6d65304 100644 --- a/Test/baseResults/spv.ext.RayGenSBTlayoutscalar.rgen.out +++ b/Test/baseResults/spv.ext.RayGenSBTlayoutscalar.rgen.out @@ -50,8 +50,6 @@ spv.ext.RayGenSBTlayoutscalar.rgen MemberDecorate 36(block) 9 Offset 96 MemberDecorate 36(block) 10 Offset 104 Decorate 36(block) Block - Decorate 38 DescriptorSet 0 - Decorate 38 Binding 0 Decorate 60(payload) Location 1 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.ext.RayGenShader.rgen.out b/Test/baseResults/spv.ext.RayGenShader.rgen.out index da516f38..bfaf64b1 100644 --- a/Test/baseResults/spv.ext.RayGenShader.rgen.out +++ b/Test/baseResults/spv.ext.RayGenShader.rgen.out @@ -34,8 +34,6 @@ spv.ext.RayGenShader.rgen MemberDecorate 38(block) 0 Offset 0 MemberDecorate 38(block) 1 Offset 16 Decorate 38(block) Block - Decorate 40 DescriptorSet 0 - Decorate 40 Binding 3 Decorate 53(payload) Location 1 Decorate 54(accEXT1) DescriptorSet 0 Decorate 54(accEXT1) Binding 1 diff --git a/Test/baseResults/spv.ext.RayGenShader11.rgen.out b/Test/baseResults/spv.ext.RayGenShader11.rgen.out index 00262ac2..048b02b2 100644 --- a/Test/baseResults/spv.ext.RayGenShader11.rgen.out +++ b/Test/baseResults/spv.ext.RayGenShader11.rgen.out @@ -30,8 +30,6 @@ spv.ext.RayGenShader11.rgen MemberDecorate 37(block) 0 Offset 0 MemberDecorate 37(block) 1 Offset 16 Decorate 37(block) Block - Decorate 39 DescriptorSet 0 - Decorate 39 Binding 1 Decorate 52(payload) Location 1 2: TypeVoid 3: TypeFunction 2 diff --git a/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out b/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out index 473937df..ee39e358 100644 --- a/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out +++ b/Test/baseResults/spv.ext.RayGenShaderArray.rgen.out @@ -43,8 +43,6 @@ spv.ext.RayGenShaderArray.rgen MemberDecorate 36(block) 3 Offset 32 MemberDecorate 36(block) 4 Offset 40 Decorate 36(block) Block - Decorate 38 DescriptorSet 0 - Decorate 38 Binding 2 Decorate 61(payload) Location 1 Decorate 65(accEXT1) DescriptorSet 0 Decorate 65(accEXT1) Binding 1 diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp index a1db5c13..19eabdf4 100644 --- a/glslang/MachineIndependent/iomapper.cpp +++ b/glslang/MachineIndependent/iomapper.cpp @@ -79,7 +79,7 @@ public: target = &inputList; else if (base->getQualifier().storage == EvqVaryingOut) target = &outputList; - else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant()) + else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant() && !base->getQualifier().isShaderRecord()) target = &uniformList; // If a global is being visited, then we should also traverse it incase it's evaluation // ends up visiting inputs we want to tag as live From 6639be7c2dd1332c4fad66b95886f7e6745532e8 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 20 Oct 2021 13:48:22 -0600 Subject: [PATCH 32/64] Accept gl_ViewportMask in version 430 and later Was previously accepted only in 450 or later. Fixes #2785 --- Test/baseResults/spv.viewportArray2.tesc.out | 20 ++++++---------- Test/spv.viewportArray2.tesc | 3 +-- glslang/MachineIndependent/Initialize.cpp | 24 +++++++++++++++++--- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Test/baseResults/spv.viewportArray2.tesc.out b/Test/baseResults/spv.viewportArray2.tesc.out index 74235a57..e95ada49 100644 --- a/Test/baseResults/spv.viewportArray2.tesc.out +++ b/Test/baseResults/spv.viewportArray2.tesc.out @@ -1,8 +1,7 @@ spv.viewportArray2.tesc -Validation failed // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 25 +// Id's are bound by 23 Capability Tessellation Capability ShaderViewportIndexLayerNV @@ -11,23 +10,21 @@ Validation failed Extension "SPV_NV_viewport_array2" 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 14 16 22 24 + EntryPoint TessellationControl 4 "main" 14 16 22 ExecutionMode 4 OutputVertices 4 - Source GLSL 450 + Source GLSL 430 SourceExtension "GL_NV_viewport_array2" Name 4 "main" Name 10 "gl_PerVertex" MemberName 10(gl_PerVertex) 0 "gl_ViewportMask" Name 14 "gl_out" Name 16 "gl_InvocationID" - Name 22 "gl_ViewportIndex" - Name 24 "gl_Layer" + Name 22 "gl_Layer" MemberDecorate 10(gl_PerVertex) 0 BuiltIn ViewportMaskNV Decorate 10(gl_PerVertex) Block Decorate 16(gl_InvocationID) BuiltIn InvocationId - Decorate 22(gl_ViewportIndex) BuiltIn ViewportIndex - Decorate 24(gl_Layer) BuiltIn Layer - Decorate 24(gl_Layer) ViewportRelativeNV + Decorate 22(gl_Layer) BuiltIn Layer + Decorate 22(gl_Layer) ViewportRelativeNV 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -44,14 +41,11 @@ Validation failed 18: 6(int) Constant 0 19: 6(int) Constant 1 20: TypePointer Output 6(int) -22(gl_ViewportIndex): 20(ptr) Variable Output - 23: 6(int) Constant 2 - 24(gl_Layer): 20(ptr) Variable Output + 22(gl_Layer): 20(ptr) Variable Output 4(main): 2 Function None 3 5: Label 17: 6(int) Load 16(gl_InvocationID) 21: 20(ptr) AccessChain 14(gl_out) 17 18 18 Store 21 19 - Store 22(gl_ViewportIndex) 23 Return FunctionEnd diff --git a/Test/spv.viewportArray2.tesc b/Test/spv.viewportArray2.tesc index 7fc208a4..24a1d8c9 100644 --- a/Test/spv.viewportArray2.tesc +++ b/Test/spv.viewportArray2.tesc @@ -1,4 +1,4 @@ -#version 450 +#version 430 #extension GL_NV_viewport_array2 :require layout(vertices = 4) out; @@ -12,5 +12,4 @@ layout (viewport_relative) out highp int gl_Layer; void main() { gl_out[gl_InvocationID].gl_ViewportMask[0] = 1; - gl_ViewportIndex = 2; } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 9f925299..b633331a 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -5172,9 +5172,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV ); } - if (version >= 450) + if (version >= 430) stageBuiltins[EShLangVertex].append( "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangVertex].append( "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes @@ -5310,9 +5314,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "in int gl_InvocationID;" ); - if (version >= 450) + if (version >= 430) stageBuiltins[EShLangGeometry].append( "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangGeometry].append( "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes @@ -5388,7 +5396,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV if (version >= 450) stageBuiltins[EShLangTessControl].append( "float gl_CullDistance[];" + ); + if (version >= 430) + stageBuiltins[EShLangTessControl].append( "int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + if (version >= 450) + stageBuiltins[EShLangTessControl].append( "vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering "vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes @@ -5491,9 +5505,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "out int gl_Layer;" "\n"); - if (version >= 450) + if (version >= 430) stageBuiltins[EShLangTessEvaluation].append( "out int gl_ViewportMask[];" // GL_NV_viewport_array2 + ); + + if (version >= 450) + stageBuiltins[EShLangTessEvaluation].append( "out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering "out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering "out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes From 82b2668d584a23766c54e0d387c471c05515293c Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Mon, 18 Oct 2021 18:28:01 -0600 Subject: [PATCH 33/64] Allow 8/16-bit integer as array index Also enable 8/16 bit int capability in SPIR-V in such cases. Also enable 64 bit capabilities when used in operations. Fixes #2779 --- SPIRV/SpvPostProcess.cpp | 31 +- Test/baseResults/spv.int16.frag.out | 934 +++++++++++---------- Test/baseResults/spv.int8.frag.out | 930 ++++++++++---------- Test/spv.int16.frag | 5 + Test/spv.int8.frag | 5 + glslang/MachineIndependent/ParseHelper.cpp | 7 +- 6 files changed, 988 insertions(+), 924 deletions(-) diff --git a/SPIRV/SpvPostProcess.cpp b/SPIRV/SpvPostProcess.cpp index d283febe..dd6dabce 100644 --- a/SPIRV/SpvPostProcess.cpp +++ b/SPIRV/SpvPostProcess.cpp @@ -111,8 +111,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) } } break; - case OpAccessChain: - case OpPtrAccessChain: case OpCopyObject: break; case OpFConvert: @@ -172,13 +170,30 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) break; } break; + case OpAccessChain: + case OpPtrAccessChain: + if (isPointerType(typeId)) + break; + if (basicTypeOp == OpTypeInt) { + if (width == 16) + addCapability(CapabilityInt16); + else if (width == 8) + addCapability(CapabilityInt8); + } default: - if (basicTypeOp == OpTypeFloat && width == 16) - addCapability(CapabilityFloat16); - if (basicTypeOp == OpTypeInt && width == 16) - addCapability(CapabilityInt16); - if (basicTypeOp == OpTypeInt && width == 8) - addCapability(CapabilityInt8); + if (basicTypeOp == OpTypeInt) { + if (width == 16) + addCapability(CapabilityInt16); + else if (width == 8) + addCapability(CapabilityInt8); + else if (width == 64) + addCapability(CapabilityInt64); + } else if (basicTypeOp == OpTypeFloat) { + if (width == 16) + addCapability(CapabilityFloat16); + else if (width == 64) + addCapability(CapabilityFloat64); + } break; } } diff --git a/Test/baseResults/spv.int16.frag.out b/Test/baseResults/spv.int16.frag.out index 43cb09fe..3e10a7db 100644 --- a/Test/baseResults/spv.int16.frag.out +++ b/Test/baseResults/spv.int16.frag.out @@ -1,7 +1,7 @@ spv.int16.frag // Module Version 10000 // Generated by (magic number): 8000a -// Id's are bound by 535 +// Id's are bound by 549 Capability Shader Capability Float16 @@ -48,53 +48,55 @@ spv.int16.frag Name 154 "i8v" Name 163 "u8v" Name 176 "bv" - Name 195 "u16v" - Name 200 "i16" - Name 220 "i" - Name 227 "uv" - Name 243 "i64" - Name 281 "b" - Name 343 "i16v" - Name 346 "i16" - Name 356 "u16v" - Name 358 "u16" - Name 428 "i32" - Name 431 "i64" - Name 434 "i16v4" - Name 437 "u32" - Name 438 "u16v2" - Name 442 "u64" - Name 445 "u16v4" - Name 457 "bv" - Name 530 "Block" - MemberName 530(Block) 0 "i16" - MemberName 530(Block) 1 "i16v2" - MemberName 530(Block) 2 "i16v3" - MemberName 530(Block) 3 "i16v4" - MemberName 530(Block) 4 "u16" - MemberName 530(Block) 5 "u16v2" - MemberName 530(Block) 6 "u16v3" - MemberName 530(Block) 7 "u16v4" - Name 532 "block" - Name 533 "si16" - Name 534 "su16" + Name 196 "arr" + Name 204 "u16v" + Name 209 "i16" + Name 229 "i" + Name 236 "uv" + Name 252 "i64" + Name 290 "b" + Name 353 "f" + Name 357 "i16v" + Name 360 "i16" + Name 370 "u16v" + Name 372 "u16" + Name 442 "i32" + Name 445 "i64" + Name 448 "i16v4" + Name 451 "u32" + Name 452 "u16v2" + Name 456 "u64" + Name 459 "u16v4" + Name 471 "bv" + Name 544 "Block" + MemberName 544(Block) 0 "i16" + MemberName 544(Block) 1 "i16v2" + MemberName 544(Block) 2 "i16v3" + MemberName 544(Block) 3 "i16v4" + MemberName 544(Block) 4 "u16" + MemberName 544(Block) 5 "u16v2" + MemberName 544(Block) 6 "u16v3" + MemberName 544(Block) 7 "u16v4" + Name 546 "block" + Name 547 "si16" + Name 548 "su16" MemberDecorate 24(Uniforms) 0 Offset 0 Decorate 24(Uniforms) Block Decorate 26 DescriptorSet 0 Decorate 26 Binding 0 - MemberDecorate 530(Block) 0 Offset 0 - MemberDecorate 530(Block) 1 Offset 4 - MemberDecorate 530(Block) 2 Offset 8 - MemberDecorate 530(Block) 3 Offset 16 - MemberDecorate 530(Block) 4 Offset 24 - MemberDecorate 530(Block) 5 Offset 28 - MemberDecorate 530(Block) 6 Offset 32 - MemberDecorate 530(Block) 7 Offset 40 - Decorate 530(Block) Block - Decorate 532(block) DescriptorSet 0 - Decorate 532(block) Binding 1 - Decorate 533(si16) SpecId 100 - Decorate 534(su16) SpecId 101 + MemberDecorate 544(Block) 0 Offset 0 + MemberDecorate 544(Block) 1 Offset 4 + MemberDecorate 544(Block) 2 Offset 8 + MemberDecorate 544(Block) 3 Offset 16 + MemberDecorate 544(Block) 4 Offset 24 + MemberDecorate 544(Block) 5 Offset 28 + MemberDecorate 544(Block) 6 Offset 32 + MemberDecorate 544(Block) 7 Offset 40 + Decorate 544(Block) Block + Decorate 546(block) DescriptorSet 0 + Decorate 546(block) Binding 1 + Decorate 547(si16) SpecId 100 + Decorate 548(su16) SpecId 101 2: TypeVoid 3: TypeFunction 2 14: TypeInt 16 1 @@ -160,37 +162,46 @@ spv.int16.frag 185: 36(int16_t) Constant 1 186: 57(i16vec2) ConstantComposite 184 184 187: 57(i16vec2) ConstantComposite 185 185 - 193: TypeVector 36(int16_t) 3 - 194: TypePointer Function 193(i16vec3) - 197: TypeVector 14(int16_t) 3 - 219: TypePointer Function 27(int) - 225: TypeVector 17(int) 3 - 226: TypePointer Function 225(ivec3) - 242: TypePointer Function 71(int64_t) - 264: 17(int) Constant 1 - 270: 17(int) Constant 2 - 276: TypeVector 27(int) 3 - 280: TypePointer Function 173(bool) - 282: 17(int) Constant 0 - 296: TypePointer Function 17(int) - 354: 52(i16vec2) ConstantComposite 21 21 - 363:193(i16vec3) ConstantComposite 184 184 184 - 405: 173(bool) ConstantTrue - 412: 173(bool) ConstantFalse - 413: 174(bvec2) ConstantComposite 412 412 - 425: TypeVector 173(bool) 3 - 426: 425(bvec3) ConstantComposite 412 412 412 - 432: TypeVector 14(int16_t) 4 - 433: TypePointer Function 432(i16vec4) - 441: TypePointer Function 77(int64_t) - 443: TypeVector 36(int16_t) 4 - 444: TypePointer Function 443(i16vec4) - 456: TypePointer Function 425(bvec3) - 530(Block): TypeStruct 14(int16_t) 52(i16vec2) 197(i16vec3) 432(i16vec4) 36(int16_t) 57(i16vec2) 193(i16vec3) 443(i16vec4) - 531: TypePointer Uniform 530(Block) - 532(block): 531(ptr) Variable Uniform - 533(si16): 14(int16_t) SpecConstant 4294967286 - 534(su16): 36(int16_t) SpecConstant 20 + 193: 17(int) Constant 4 + 194: TypeArray 97(float) 193 + 195: TypePointer Function 194 + 197: 97(float) Constant 1065353216 + 198: 97(float) Constant 1073741824 + 199: 97(float) Constant 1077936128 + 200: 97(float) Constant 1082130432 + 201: 194 ConstantComposite 197 198 199 200 + 202: TypeVector 36(int16_t) 3 + 203: TypePointer Function 202(i16vec3) + 206: TypeVector 14(int16_t) 3 + 228: TypePointer Function 27(int) + 234: TypeVector 17(int) 3 + 235: TypePointer Function 234(ivec3) + 251: TypePointer Function 71(int64_t) + 273: 17(int) Constant 1 + 279: 17(int) Constant 2 + 285: TypeVector 27(int) 3 + 289: TypePointer Function 173(bool) + 291: 17(int) Constant 0 + 305: TypePointer Function 17(int) + 352: TypePointer Function 97(float) + 368: 52(i16vec2) ConstantComposite 21 21 + 377:202(i16vec3) ConstantComposite 184 184 184 + 419: 173(bool) ConstantTrue + 426: 173(bool) ConstantFalse + 427: 174(bvec2) ConstantComposite 426 426 + 439: TypeVector 173(bool) 3 + 440: 439(bvec3) ConstantComposite 426 426 426 + 446: TypeVector 14(int16_t) 4 + 447: TypePointer Function 446(i16vec4) + 455: TypePointer Function 77(int64_t) + 457: TypeVector 36(int16_t) 4 + 458: TypePointer Function 457(i16vec4) + 470: TypePointer Function 439(bvec3) + 544(Block): TypeStruct 14(int16_t) 52(i16vec2) 206(i16vec3) 446(i16vec4) 36(int16_t) 57(i16vec2) 202(i16vec3) 457(i16vec4) + 545: TypePointer Uniform 544(Block) + 546(block): 545(ptr) Variable Uniform + 547(si16): 14(int16_t) SpecConstant 4294967286 + 548(su16): 36(int16_t) SpecConstant 20 4(main): 2 Function None 3 5: Label Return @@ -364,397 +375,404 @@ spv.int16.frag FunctionEnd 10(operators(): 2 Function None 3 11: Label - 195(u16v): 194(ptr) Variable Function - 200(i16): 15(ptr) Variable Function - 220(i): 219(ptr) Variable Function - 227(uv): 226(ptr) Variable Function - 243(i64): 242(ptr) Variable Function - 281(b): 280(ptr) Variable Function - 196:193(i16vec3) Load 195(u16v) - 198:197(i16vec3) CompositeConstruct 179 179 179 - 199:193(i16vec3) IAdd 196 198 - Store 195(u16v) 199 - 201: 14(int16_t) Load 200(i16) - 202: 14(int16_t) ISub 201 179 - Store 200(i16) 202 - 203: 14(int16_t) Load 200(i16) - 204: 14(int16_t) IAdd 203 179 - Store 200(i16) 204 - 205:193(i16vec3) Load 195(u16v) - 206:197(i16vec3) CompositeConstruct 179 179 179 - 207:193(i16vec3) ISub 205 206 - Store 195(u16v) 207 - 208:193(i16vec3) Load 195(u16v) - 209:193(i16vec3) Not 208 - Store 195(u16v) 209 - 210: 14(int16_t) Load 200(i16) - Store 200(i16) 210 - 211:193(i16vec3) Load 195(u16v) - 212:193(i16vec3) SNegate 211 - Store 195(u16v) 212 - 213: 14(int16_t) Load 200(i16) - 214: 14(int16_t) Load 200(i16) - 215: 14(int16_t) IAdd 214 213 - Store 200(i16) 215 - 216:193(i16vec3) Load 195(u16v) - 217:193(i16vec3) Load 195(u16v) - 218:193(i16vec3) ISub 217 216 - Store 195(u16v) 218 - 221: 14(int16_t) Load 200(i16) - 222: 27(int) SConvert 221 - 223: 27(int) Load 220(i) - 224: 27(int) IMul 223 222 - Store 220(i) 224 - 228:193(i16vec3) Load 195(u16v) - 229: 225(ivec3) UConvert 228 - 230: 225(ivec3) Load 227(uv) - 231: 225(ivec3) UDiv 230 229 - Store 227(uv) 231 - 232: 14(int16_t) Load 200(i16) - 233: 27(int) SConvert 232 - 234: 17(int) Bitcast 233 - 235: 225(ivec3) Load 227(uv) - 236: 225(ivec3) CompositeConstruct 234 234 234 - 237: 225(ivec3) UMod 235 236 - Store 227(uv) 237 - 238:193(i16vec3) Load 195(u16v) - 239: 225(ivec3) UConvert 238 - 240: 225(ivec3) Load 227(uv) - 241: 225(ivec3) IAdd 239 240 - Store 227(uv) 241 - 244: 14(int16_t) Load 200(i16) - 245: 71(int64_t) SConvert 244 - 246: 71(int64_t) Load 243(i64) - 247: 71(int64_t) ISub 245 246 - Store 243(i64) 247 - 248:193(i16vec3) Load 195(u16v) - 249: 225(ivec3) UConvert 248 - 250: 225(ivec3) Load 227(uv) - 251: 225(ivec3) IMul 249 250 - Store 227(uv) 251 - 252: 14(int16_t) Load 200(i16) - 253: 71(int64_t) SConvert 252 - 254: 71(int64_t) Load 243(i64) - 255: 71(int64_t) IMul 253 254 - Store 243(i64) 255 - 256: 14(int16_t) Load 200(i16) - 257: 27(int) SConvert 256 - 258: 27(int) Load 220(i) - 259: 27(int) SMod 257 258 - Store 220(i) 259 - 260: 14(int16_t) Load 200(i16) - 261:193(i16vec3) Load 195(u16v) - 262:197(i16vec3) CompositeConstruct 260 260 260 - 263:193(i16vec3) ShiftLeftLogical 261 262 - Store 195(u16v) 263 - 265: 37(ptr) AccessChain 195(u16v) 264 - 266: 36(int16_t) Load 265 - 267: 14(int16_t) Load 200(i16) - 268: 14(int16_t) ShiftRightArithmetic 267 266 - Store 200(i16) 268 - 269: 14(int16_t) Load 200(i16) - 271: 37(ptr) AccessChain 195(u16v) 270 - 272: 36(int16_t) Load 271 - 273: 14(int16_t) ShiftLeftLogical 269 272 - Store 200(i16) 273 - 274:193(i16vec3) Load 195(u16v) - 275: 27(int) Load 220(i) - 277: 276(ivec3) CompositeConstruct 275 275 275 - 278:193(i16vec3) ShiftLeftLogical 274 277 - 279: 225(ivec3) UConvert 278 - Store 227(uv) 279 - 283: 37(ptr) AccessChain 195(u16v) 282 - 284: 36(int16_t) Load 283 - 285: 14(int16_t) Load 200(i16) - 286: 36(int16_t) Bitcast 285 - 287: 173(bool) INotEqual 284 286 - Store 281(b) 287 - 288: 14(int16_t) Load 200(i16) - 289: 36(int16_t) Bitcast 288 - 290: 37(ptr) AccessChain 195(u16v) 282 - 291: 36(int16_t) Load 290 - 292: 173(bool) IEqual 289 291 - Store 281(b) 292 - 293: 37(ptr) AccessChain 195(u16v) 282 - 294: 36(int16_t) Load 293 - 295: 17(int) UConvert 294 - 297: 296(ptr) AccessChain 227(uv) 264 - 298: 17(int) Load 297 - 299: 173(bool) UGreaterThan 295 298 - Store 281(b) 299 - 300: 14(int16_t) Load 200(i16) - 301: 27(int) SConvert 300 - 302: 27(int) Load 220(i) - 303: 173(bool) SLessThan 301 302 - Store 281(b) 303 - 304: 37(ptr) AccessChain 195(u16v) 264 - 305: 36(int16_t) Load 304 - 306: 17(int) UConvert 305 - 307: 296(ptr) AccessChain 227(uv) 282 - 308: 17(int) Load 307 - 309: 173(bool) UGreaterThanEqual 306 308 - Store 281(b) 309 - 310: 14(int16_t) Load 200(i16) - 311: 27(int) SConvert 310 - 312: 27(int) Load 220(i) - 313: 173(bool) SLessThanEqual 311 312 - Store 281(b) 313 - 314: 14(int16_t) Load 200(i16) - 315: 27(int) SConvert 314 - 316: 17(int) Bitcast 315 - 317: 225(ivec3) Load 227(uv) - 318: 225(ivec3) CompositeConstruct 316 316 316 - 319: 225(ivec3) BitwiseOr 317 318 - Store 227(uv) 319 - 320: 14(int16_t) Load 200(i16) - 321: 27(int) SConvert 320 - 322: 27(int) Load 220(i) - 323: 27(int) BitwiseOr 321 322 - Store 220(i) 323 - 324: 14(int16_t) Load 200(i16) - 325: 71(int64_t) SConvert 324 - 326: 71(int64_t) Load 243(i64) - 327: 71(int64_t) BitwiseAnd 326 325 - Store 243(i64) 327 - 328:193(i16vec3) Load 195(u16v) - 329: 225(ivec3) UConvert 328 - 330: 225(ivec3) Load 227(uv) - 331: 225(ivec3) BitwiseAnd 329 330 - Store 227(uv) 331 - 332: 14(int16_t) Load 200(i16) - 333: 27(int) SConvert 332 - 334: 17(int) Bitcast 333 - 335: 225(ivec3) Load 227(uv) - 336: 225(ivec3) CompositeConstruct 334 334 334 - 337: 225(ivec3) BitwiseXor 335 336 - Store 227(uv) 337 - 338:193(i16vec3) Load 195(u16v) - 339: 14(int16_t) Load 200(i16) - 340: 36(int16_t) Bitcast 339 - 341:193(i16vec3) CompositeConstruct 340 340 340 - 342:193(i16vec3) BitwiseXor 338 341 - Store 195(u16v) 342 + 196(arr): 195(ptr) Variable Function + 204(u16v): 203(ptr) Variable Function + 209(i16): 15(ptr) Variable Function + 229(i): 228(ptr) Variable Function + 236(uv): 235(ptr) Variable Function + 252(i64): 251(ptr) Variable Function + 290(b): 289(ptr) Variable Function + 353(f): 352(ptr) Variable Function + Store 196(arr) 201 + 205:202(i16vec3) Load 204(u16v) + 207:206(i16vec3) CompositeConstruct 179 179 179 + 208:202(i16vec3) IAdd 205 207 + Store 204(u16v) 208 + 210: 14(int16_t) Load 209(i16) + 211: 14(int16_t) ISub 210 179 + Store 209(i16) 211 + 212: 14(int16_t) Load 209(i16) + 213: 14(int16_t) IAdd 212 179 + Store 209(i16) 213 + 214:202(i16vec3) Load 204(u16v) + 215:206(i16vec3) CompositeConstruct 179 179 179 + 216:202(i16vec3) ISub 214 215 + Store 204(u16v) 216 + 217:202(i16vec3) Load 204(u16v) + 218:202(i16vec3) Not 217 + Store 204(u16v) 218 + 219: 14(int16_t) Load 209(i16) + Store 209(i16) 219 + 220:202(i16vec3) Load 204(u16v) + 221:202(i16vec3) SNegate 220 + Store 204(u16v) 221 + 222: 14(int16_t) Load 209(i16) + 223: 14(int16_t) Load 209(i16) + 224: 14(int16_t) IAdd 223 222 + Store 209(i16) 224 + 225:202(i16vec3) Load 204(u16v) + 226:202(i16vec3) Load 204(u16v) + 227:202(i16vec3) ISub 226 225 + Store 204(u16v) 227 + 230: 14(int16_t) Load 209(i16) + 231: 27(int) SConvert 230 + 232: 27(int) Load 229(i) + 233: 27(int) IMul 232 231 + Store 229(i) 233 + 237:202(i16vec3) Load 204(u16v) + 238: 234(ivec3) UConvert 237 + 239: 234(ivec3) Load 236(uv) + 240: 234(ivec3) UDiv 239 238 + Store 236(uv) 240 + 241: 14(int16_t) Load 209(i16) + 242: 27(int) SConvert 241 + 243: 17(int) Bitcast 242 + 244: 234(ivec3) Load 236(uv) + 245: 234(ivec3) CompositeConstruct 243 243 243 + 246: 234(ivec3) UMod 244 245 + Store 236(uv) 246 + 247:202(i16vec3) Load 204(u16v) + 248: 234(ivec3) UConvert 247 + 249: 234(ivec3) Load 236(uv) + 250: 234(ivec3) IAdd 248 249 + Store 236(uv) 250 + 253: 14(int16_t) Load 209(i16) + 254: 71(int64_t) SConvert 253 + 255: 71(int64_t) Load 252(i64) + 256: 71(int64_t) ISub 254 255 + Store 252(i64) 256 + 257:202(i16vec3) Load 204(u16v) + 258: 234(ivec3) UConvert 257 + 259: 234(ivec3) Load 236(uv) + 260: 234(ivec3) IMul 258 259 + Store 236(uv) 260 + 261: 14(int16_t) Load 209(i16) + 262: 71(int64_t) SConvert 261 + 263: 71(int64_t) Load 252(i64) + 264: 71(int64_t) IMul 262 263 + Store 252(i64) 264 + 265: 14(int16_t) Load 209(i16) + 266: 27(int) SConvert 265 + 267: 27(int) Load 229(i) + 268: 27(int) SMod 266 267 + Store 229(i) 268 + 269: 14(int16_t) Load 209(i16) + 270:202(i16vec3) Load 204(u16v) + 271:206(i16vec3) CompositeConstruct 269 269 269 + 272:202(i16vec3) ShiftLeftLogical 270 271 + Store 204(u16v) 272 + 274: 37(ptr) AccessChain 204(u16v) 273 + 275: 36(int16_t) Load 274 + 276: 14(int16_t) Load 209(i16) + 277: 14(int16_t) ShiftRightArithmetic 276 275 + Store 209(i16) 277 + 278: 14(int16_t) Load 209(i16) + 280: 37(ptr) AccessChain 204(u16v) 279 + 281: 36(int16_t) Load 280 + 282: 14(int16_t) ShiftLeftLogical 278 281 + Store 209(i16) 282 + 283:202(i16vec3) Load 204(u16v) + 284: 27(int) Load 229(i) + 286: 285(ivec3) CompositeConstruct 284 284 284 + 287:202(i16vec3) ShiftLeftLogical 283 286 + 288: 234(ivec3) UConvert 287 + Store 236(uv) 288 + 292: 37(ptr) AccessChain 204(u16v) 291 + 293: 36(int16_t) Load 292 + 294: 14(int16_t) Load 209(i16) + 295: 36(int16_t) Bitcast 294 + 296: 173(bool) INotEqual 293 295 + Store 290(b) 296 + 297: 14(int16_t) Load 209(i16) + 298: 36(int16_t) Bitcast 297 + 299: 37(ptr) AccessChain 204(u16v) 291 + 300: 36(int16_t) Load 299 + 301: 173(bool) IEqual 298 300 + Store 290(b) 301 + 302: 37(ptr) AccessChain 204(u16v) 291 + 303: 36(int16_t) Load 302 + 304: 17(int) UConvert 303 + 306: 305(ptr) AccessChain 236(uv) 273 + 307: 17(int) Load 306 + 308: 173(bool) UGreaterThan 304 307 + Store 290(b) 308 + 309: 14(int16_t) Load 209(i16) + 310: 27(int) SConvert 309 + 311: 27(int) Load 229(i) + 312: 173(bool) SLessThan 310 311 + Store 290(b) 312 + 313: 37(ptr) AccessChain 204(u16v) 273 + 314: 36(int16_t) Load 313 + 315: 17(int) UConvert 314 + 316: 305(ptr) AccessChain 236(uv) 291 + 317: 17(int) Load 316 + 318: 173(bool) UGreaterThanEqual 315 317 + Store 290(b) 318 + 319: 14(int16_t) Load 209(i16) + 320: 27(int) SConvert 319 + 321: 27(int) Load 229(i) + 322: 173(bool) SLessThanEqual 320 321 + Store 290(b) 322 + 323: 14(int16_t) Load 209(i16) + 324: 27(int) SConvert 323 + 325: 17(int) Bitcast 324 + 326: 234(ivec3) Load 236(uv) + 327: 234(ivec3) CompositeConstruct 325 325 325 + 328: 234(ivec3) BitwiseOr 326 327 + Store 236(uv) 328 + 329: 14(int16_t) Load 209(i16) + 330: 27(int) SConvert 329 + 331: 27(int) Load 229(i) + 332: 27(int) BitwiseOr 330 331 + Store 229(i) 332 + 333: 14(int16_t) Load 209(i16) + 334: 71(int64_t) SConvert 333 + 335: 71(int64_t) Load 252(i64) + 336: 71(int64_t) BitwiseAnd 335 334 + Store 252(i64) 336 + 337:202(i16vec3) Load 204(u16v) + 338: 234(ivec3) UConvert 337 + 339: 234(ivec3) Load 236(uv) + 340: 234(ivec3) BitwiseAnd 338 339 + Store 236(uv) 340 + 341: 14(int16_t) Load 209(i16) + 342: 27(int) SConvert 341 + 343: 17(int) Bitcast 342 + 344: 234(ivec3) Load 236(uv) + 345: 234(ivec3) CompositeConstruct 343 343 343 + 346: 234(ivec3) BitwiseXor 344 345 + Store 236(uv) 346 + 347:202(i16vec3) Load 204(u16v) + 348: 14(int16_t) Load 209(i16) + 349: 36(int16_t) Bitcast 348 + 350:202(i16vec3) CompositeConstruct 349 349 349 + 351:202(i16vec3) BitwiseXor 347 350 + Store 204(u16v) 351 + 354: 14(int16_t) Load 209(i16) + 355: 352(ptr) AccessChain 196(arr) 354 + 356: 97(float) Load 355 + Store 353(f) 356 Return FunctionEnd 12(builtinFuncs(): 2 Function None 3 13: Label - 343(i16v): 53(ptr) Variable Function - 346(i16): 15(ptr) Variable Function - 356(u16v): 194(ptr) Variable Function - 358(u16): 37(ptr) Variable Function - 428(i32): 219(ptr) Variable Function - 431(i64): 242(ptr) Variable Function - 434(i16v4): 433(ptr) Variable Function - 437(u32): 296(ptr) Variable Function - 438(u16v2): 58(ptr) Variable Function - 442(u64): 441(ptr) Variable Function - 445(u16v4): 444(ptr) Variable Function - 457(bv): 456(ptr) Variable Function - 344: 52(i16vec2) Load 343(i16v) - 345: 52(i16vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 344 - Store 343(i16v) 345 - 347: 14(int16_t) Load 346(i16) - 348: 14(int16_t) ExtInst 1(GLSL.std.450) 7(SSign) 347 - Store 346(i16) 348 - 349: 52(i16vec2) Load 343(i16v) - 350: 14(int16_t) Load 346(i16) - 351: 52(i16vec2) CompositeConstruct 350 350 - 352: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 349 351 - Store 343(i16v) 352 - 353: 52(i16vec2) Load 343(i16v) - 355: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 353 354 - Store 343(i16v) 355 - 357:193(i16vec3) Load 356(u16v) - 359: 36(int16_t) Load 358(u16) - 360:193(i16vec3) CompositeConstruct 359 359 359 - 361:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 360 - Store 356(u16v) 361 - 362:193(i16vec3) Load 356(u16v) - 364:193(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 362 363 - Store 356(u16v) 364 - 365: 52(i16vec2) Load 343(i16v) - 366: 14(int16_t) Load 346(i16) - 367: 52(i16vec2) CompositeConstruct 366 366 - 368: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 365 367 - Store 343(i16v) 368 - 369: 52(i16vec2) Load 343(i16v) - 370: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 369 354 - Store 343(i16v) 370 - 371:193(i16vec3) Load 356(u16v) - 372: 36(int16_t) Load 358(u16) - 373:193(i16vec3) CompositeConstruct 372 372 372 - 374:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 371 373 - Store 356(u16v) 374 - 375:193(i16vec3) Load 356(u16v) - 376:193(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 375 363 - Store 356(u16v) 376 - 377: 52(i16vec2) Load 343(i16v) - 378: 14(int16_t) Load 346(i16) - 379: 14(int16_t) SNegate 378 - 380: 14(int16_t) Load 346(i16) - 381: 52(i16vec2) CompositeConstruct 379 379 - 382: 52(i16vec2) CompositeConstruct 380 380 - 383: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 377 381 382 - Store 343(i16v) 383 - 384: 52(i16vec2) Load 343(i16v) - 385: 52(i16vec2) Load 343(i16v) - 386: 52(i16vec2) SNegate 385 - 387: 52(i16vec2) Load 343(i16v) - 388: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 384 386 387 - Store 343(i16v) 388 - 389:193(i16vec3) Load 356(u16v) - 390: 36(int16_t) Load 358(u16) - 391: 36(int16_t) SNegate 390 - 392: 36(int16_t) Load 358(u16) - 393:193(i16vec3) CompositeConstruct 391 391 391 - 394:193(i16vec3) CompositeConstruct 392 392 392 - 395:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 389 393 394 - Store 356(u16v) 395 - 396:193(i16vec3) Load 356(u16v) - 397:193(i16vec3) Load 356(u16v) - 398:193(i16vec3) SNegate 397 - 399:193(i16vec3) Load 356(u16v) - 400:193(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 396 398 399 - Store 356(u16v) 400 - 401: 15(ptr) AccessChain 343(i16v) 282 - 402: 14(int16_t) Load 401 - 403: 15(ptr) AccessChain 343(i16v) 264 - 404: 14(int16_t) Load 403 - 406: 14(int16_t) Select 405 404 402 - Store 346(i16) 406 - 407: 14(int16_t) Load 346(i16) - 408: 52(i16vec2) CompositeConstruct 407 407 - 409: 14(int16_t) Load 346(i16) - 410: 14(int16_t) SNegate 409 - 411: 52(i16vec2) CompositeConstruct 410 410 - 414: 52(i16vec2) Select 413 411 408 - Store 343(i16v) 414 - 415: 37(ptr) AccessChain 356(u16v) 282 - 416: 36(int16_t) Load 415 - 417: 37(ptr) AccessChain 356(u16v) 264 - 418: 36(int16_t) Load 417 - 419: 36(int16_t) Select 405 418 416 - Store 358(u16) 419 - 420: 36(int16_t) Load 358(u16) - 421:193(i16vec3) CompositeConstruct 420 420 420 - 422: 36(int16_t) Load 358(u16) - 423: 36(int16_t) SNegate 422 - 424:193(i16vec3) CompositeConstruct 423 423 423 - 427:193(i16vec3) Select 426 424 421 - Store 356(u16v) 427 - 429: 52(i16vec2) Load 343(i16v) - 430: 27(int) Bitcast 429 - Store 428(i32) 430 - 435:432(i16vec4) Load 434(i16v4) - 436: 71(int64_t) Bitcast 435 - Store 431(i64) 436 - 439: 57(i16vec2) Load 438(u16v2) - 440: 17(int) Bitcast 439 - Store 437(u32) 440 - 446:443(i16vec4) Load 445(u16v4) - 447: 77(int64_t) Bitcast 446 - Store 442(u64) 447 - 448: 27(int) Load 428(i32) - 449: 52(i16vec2) Bitcast 448 - Store 343(i16v) 449 - 450: 71(int64_t) Load 431(i64) - 451:432(i16vec4) Bitcast 450 - Store 434(i16v4) 451 - 452: 17(int) Load 437(u32) - 453: 57(i16vec2) Bitcast 452 - Store 438(u16v2) 453 - 454: 77(int64_t) Load 442(u64) - 455:443(i16vec4) Bitcast 454 - Store 445(u16v4) 455 - 458:193(i16vec3) Load 356(u16v) - 459: 36(int16_t) Load 358(u16) - 460:193(i16vec3) CompositeConstruct 459 459 459 - 461: 425(bvec3) ULessThan 458 460 - Store 457(bv) 461 - 462: 52(i16vec2) Load 343(i16v) - 463: 14(int16_t) Load 346(i16) - 464: 52(i16vec2) CompositeConstruct 463 463 - 465: 174(bvec2) SLessThan 462 464 - 466: 280(ptr) AccessChain 457(bv) 282 - 467: 173(bool) CompositeExtract 465 0 - Store 466 467 - 468: 280(ptr) AccessChain 457(bv) 264 - 469: 173(bool) CompositeExtract 465 1 - Store 468 469 - 470:193(i16vec3) Load 356(u16v) - 471: 36(int16_t) Load 358(u16) - 472:193(i16vec3) CompositeConstruct 471 471 471 - 473: 425(bvec3) ULessThanEqual 470 472 - Store 457(bv) 473 - 474: 52(i16vec2) Load 343(i16v) - 475: 14(int16_t) Load 346(i16) - 476: 52(i16vec2) CompositeConstruct 475 475 - 477: 174(bvec2) SLessThanEqual 474 476 - 478: 280(ptr) AccessChain 457(bv) 282 - 479: 173(bool) CompositeExtract 477 0 - Store 478 479 - 480: 280(ptr) AccessChain 457(bv) 264 - 481: 173(bool) CompositeExtract 477 1 + 357(i16v): 53(ptr) Variable Function + 360(i16): 15(ptr) Variable Function + 370(u16v): 203(ptr) Variable Function + 372(u16): 37(ptr) Variable Function + 442(i32): 228(ptr) Variable Function + 445(i64): 251(ptr) Variable Function + 448(i16v4): 447(ptr) Variable Function + 451(u32): 305(ptr) Variable Function + 452(u16v2): 58(ptr) Variable Function + 456(u64): 455(ptr) Variable Function + 459(u16v4): 458(ptr) Variable Function + 471(bv): 470(ptr) Variable Function + 358: 52(i16vec2) Load 357(i16v) + 359: 52(i16vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 358 + Store 357(i16v) 359 + 361: 14(int16_t) Load 360(i16) + 362: 14(int16_t) ExtInst 1(GLSL.std.450) 7(SSign) 361 + Store 360(i16) 362 + 363: 52(i16vec2) Load 357(i16v) + 364: 14(int16_t) Load 360(i16) + 365: 52(i16vec2) CompositeConstruct 364 364 + 366: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 363 365 + Store 357(i16v) 366 + 367: 52(i16vec2) Load 357(i16v) + 369: 52(i16vec2) ExtInst 1(GLSL.std.450) 39(SMin) 367 368 + Store 357(i16v) 369 + 371:202(i16vec3) Load 370(u16v) + 373: 36(int16_t) Load 372(u16) + 374:202(i16vec3) CompositeConstruct 373 373 373 + 375:202(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 371 374 + Store 370(u16v) 375 + 376:202(i16vec3) Load 370(u16v) + 378:202(i16vec3) ExtInst 1(GLSL.std.450) 38(UMin) 376 377 + Store 370(u16v) 378 + 379: 52(i16vec2) Load 357(i16v) + 380: 14(int16_t) Load 360(i16) + 381: 52(i16vec2) CompositeConstruct 380 380 + 382: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 379 381 + Store 357(i16v) 382 + 383: 52(i16vec2) Load 357(i16v) + 384: 52(i16vec2) ExtInst 1(GLSL.std.450) 42(SMax) 383 368 + Store 357(i16v) 384 + 385:202(i16vec3) Load 370(u16v) + 386: 36(int16_t) Load 372(u16) + 387:202(i16vec3) CompositeConstruct 386 386 386 + 388:202(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 385 387 + Store 370(u16v) 388 + 389:202(i16vec3) Load 370(u16v) + 390:202(i16vec3) ExtInst 1(GLSL.std.450) 41(UMax) 389 377 + Store 370(u16v) 390 + 391: 52(i16vec2) Load 357(i16v) + 392: 14(int16_t) Load 360(i16) + 393: 14(int16_t) SNegate 392 + 394: 14(int16_t) Load 360(i16) + 395: 52(i16vec2) CompositeConstruct 393 393 + 396: 52(i16vec2) CompositeConstruct 394 394 + 397: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 391 395 396 + Store 357(i16v) 397 + 398: 52(i16vec2) Load 357(i16v) + 399: 52(i16vec2) Load 357(i16v) + 400: 52(i16vec2) SNegate 399 + 401: 52(i16vec2) Load 357(i16v) + 402: 52(i16vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 398 400 401 + Store 357(i16v) 402 + 403:202(i16vec3) Load 370(u16v) + 404: 36(int16_t) Load 372(u16) + 405: 36(int16_t) SNegate 404 + 406: 36(int16_t) Load 372(u16) + 407:202(i16vec3) CompositeConstruct 405 405 405 + 408:202(i16vec3) CompositeConstruct 406 406 406 + 409:202(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 403 407 408 + Store 370(u16v) 409 + 410:202(i16vec3) Load 370(u16v) + 411:202(i16vec3) Load 370(u16v) + 412:202(i16vec3) SNegate 411 + 413:202(i16vec3) Load 370(u16v) + 414:202(i16vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 410 412 413 + Store 370(u16v) 414 + 415: 15(ptr) AccessChain 357(i16v) 291 + 416: 14(int16_t) Load 415 + 417: 15(ptr) AccessChain 357(i16v) 273 + 418: 14(int16_t) Load 417 + 420: 14(int16_t) Select 419 418 416 + Store 360(i16) 420 + 421: 14(int16_t) Load 360(i16) + 422: 52(i16vec2) CompositeConstruct 421 421 + 423: 14(int16_t) Load 360(i16) + 424: 14(int16_t) SNegate 423 + 425: 52(i16vec2) CompositeConstruct 424 424 + 428: 52(i16vec2) Select 427 425 422 + Store 357(i16v) 428 + 429: 37(ptr) AccessChain 370(u16v) 291 + 430: 36(int16_t) Load 429 + 431: 37(ptr) AccessChain 370(u16v) 273 + 432: 36(int16_t) Load 431 + 433: 36(int16_t) Select 419 432 430 + Store 372(u16) 433 + 434: 36(int16_t) Load 372(u16) + 435:202(i16vec3) CompositeConstruct 434 434 434 + 436: 36(int16_t) Load 372(u16) + 437: 36(int16_t) SNegate 436 + 438:202(i16vec3) CompositeConstruct 437 437 437 + 441:202(i16vec3) Select 440 438 435 + Store 370(u16v) 441 + 443: 52(i16vec2) Load 357(i16v) + 444: 27(int) Bitcast 443 + Store 442(i32) 444 + 449:446(i16vec4) Load 448(i16v4) + 450: 71(int64_t) Bitcast 449 + Store 445(i64) 450 + 453: 57(i16vec2) Load 452(u16v2) + 454: 17(int) Bitcast 453 + Store 451(u32) 454 + 460:457(i16vec4) Load 459(u16v4) + 461: 77(int64_t) Bitcast 460 + Store 456(u64) 461 + 462: 27(int) Load 442(i32) + 463: 52(i16vec2) Bitcast 462 + Store 357(i16v) 463 + 464: 71(int64_t) Load 445(i64) + 465:446(i16vec4) Bitcast 464 + Store 448(i16v4) 465 + 466: 17(int) Load 451(u32) + 467: 57(i16vec2) Bitcast 466 + Store 452(u16v2) 467 + 468: 77(int64_t) Load 456(u64) + 469:457(i16vec4) Bitcast 468 + Store 459(u16v4) 469 + 472:202(i16vec3) Load 370(u16v) + 473: 36(int16_t) Load 372(u16) + 474:202(i16vec3) CompositeConstruct 473 473 473 + 475: 439(bvec3) ULessThan 472 474 + Store 471(bv) 475 + 476: 52(i16vec2) Load 357(i16v) + 477: 14(int16_t) Load 360(i16) + 478: 52(i16vec2) CompositeConstruct 477 477 + 479: 174(bvec2) SLessThan 476 478 + 480: 289(ptr) AccessChain 471(bv) 291 + 481: 173(bool) CompositeExtract 479 0 Store 480 481 - 482:193(i16vec3) Load 356(u16v) - 483: 36(int16_t) Load 358(u16) - 484:193(i16vec3) CompositeConstruct 483 483 483 - 485: 425(bvec3) UGreaterThan 482 484 - Store 457(bv) 485 - 486: 52(i16vec2) Load 343(i16v) - 487: 14(int16_t) Load 346(i16) - 488: 52(i16vec2) CompositeConstruct 487 487 - 489: 174(bvec2) SGreaterThan 486 488 - 490: 280(ptr) AccessChain 457(bv) 282 - 491: 173(bool) CompositeExtract 489 0 - Store 490 491 - 492: 280(ptr) AccessChain 457(bv) 264 - 493: 173(bool) CompositeExtract 489 1 + 482: 289(ptr) AccessChain 471(bv) 273 + 483: 173(bool) CompositeExtract 479 1 + Store 482 483 + 484:202(i16vec3) Load 370(u16v) + 485: 36(int16_t) Load 372(u16) + 486:202(i16vec3) CompositeConstruct 485 485 485 + 487: 439(bvec3) ULessThanEqual 484 486 + Store 471(bv) 487 + 488: 52(i16vec2) Load 357(i16v) + 489: 14(int16_t) Load 360(i16) + 490: 52(i16vec2) CompositeConstruct 489 489 + 491: 174(bvec2) SLessThanEqual 488 490 + 492: 289(ptr) AccessChain 471(bv) 291 + 493: 173(bool) CompositeExtract 491 0 Store 492 493 - 494:193(i16vec3) Load 356(u16v) - 495: 36(int16_t) Load 358(u16) - 496:193(i16vec3) CompositeConstruct 495 495 495 - 497: 425(bvec3) UGreaterThanEqual 494 496 - Store 457(bv) 497 - 498: 52(i16vec2) Load 343(i16v) - 499: 14(int16_t) Load 346(i16) - 500: 52(i16vec2) CompositeConstruct 499 499 - 501: 174(bvec2) SGreaterThanEqual 498 500 - 502: 280(ptr) AccessChain 457(bv) 282 - 503: 173(bool) CompositeExtract 501 0 - Store 502 503 - 504: 280(ptr) AccessChain 457(bv) 264 - 505: 173(bool) CompositeExtract 501 1 + 494: 289(ptr) AccessChain 471(bv) 273 + 495: 173(bool) CompositeExtract 491 1 + Store 494 495 + 496:202(i16vec3) Load 370(u16v) + 497: 36(int16_t) Load 372(u16) + 498:202(i16vec3) CompositeConstruct 497 497 497 + 499: 439(bvec3) UGreaterThan 496 498 + Store 471(bv) 499 + 500: 52(i16vec2) Load 357(i16v) + 501: 14(int16_t) Load 360(i16) + 502: 52(i16vec2) CompositeConstruct 501 501 + 503: 174(bvec2) SGreaterThan 500 502 + 504: 289(ptr) AccessChain 471(bv) 291 + 505: 173(bool) CompositeExtract 503 0 Store 504 505 - 506:193(i16vec3) Load 356(u16v) - 507: 36(int16_t) Load 358(u16) - 508:193(i16vec3) CompositeConstruct 507 507 507 - 509: 425(bvec3) IEqual 506 508 - Store 457(bv) 509 - 510: 52(i16vec2) Load 343(i16v) - 511: 14(int16_t) Load 346(i16) - 512: 52(i16vec2) CompositeConstruct 511 511 - 513: 174(bvec2) IEqual 510 512 - 514: 280(ptr) AccessChain 457(bv) 282 - 515: 173(bool) CompositeExtract 513 0 - Store 514 515 - 516: 280(ptr) AccessChain 457(bv) 264 - 517: 173(bool) CompositeExtract 513 1 + 506: 289(ptr) AccessChain 471(bv) 273 + 507: 173(bool) CompositeExtract 503 1 + Store 506 507 + 508:202(i16vec3) Load 370(u16v) + 509: 36(int16_t) Load 372(u16) + 510:202(i16vec3) CompositeConstruct 509 509 509 + 511: 439(bvec3) UGreaterThanEqual 508 510 + Store 471(bv) 511 + 512: 52(i16vec2) Load 357(i16v) + 513: 14(int16_t) Load 360(i16) + 514: 52(i16vec2) CompositeConstruct 513 513 + 515: 174(bvec2) SGreaterThanEqual 512 514 + 516: 289(ptr) AccessChain 471(bv) 291 + 517: 173(bool) CompositeExtract 515 0 Store 516 517 - 518:193(i16vec3) Load 356(u16v) - 519: 36(int16_t) Load 358(u16) - 520:193(i16vec3) CompositeConstruct 519 519 519 - 521: 425(bvec3) INotEqual 518 520 - Store 457(bv) 521 - 522: 52(i16vec2) Load 343(i16v) - 523: 14(int16_t) Load 346(i16) - 524: 52(i16vec2) CompositeConstruct 523 523 - 525: 174(bvec2) INotEqual 522 524 - 526: 280(ptr) AccessChain 457(bv) 282 - 527: 173(bool) CompositeExtract 525 0 - Store 526 527 - 528: 280(ptr) AccessChain 457(bv) 264 - 529: 173(bool) CompositeExtract 525 1 + 518: 289(ptr) AccessChain 471(bv) 273 + 519: 173(bool) CompositeExtract 515 1 + Store 518 519 + 520:202(i16vec3) Load 370(u16v) + 521: 36(int16_t) Load 372(u16) + 522:202(i16vec3) CompositeConstruct 521 521 521 + 523: 439(bvec3) IEqual 520 522 + Store 471(bv) 523 + 524: 52(i16vec2) Load 357(i16v) + 525: 14(int16_t) Load 360(i16) + 526: 52(i16vec2) CompositeConstruct 525 525 + 527: 174(bvec2) IEqual 524 526 + 528: 289(ptr) AccessChain 471(bv) 291 + 529: 173(bool) CompositeExtract 527 0 Store 528 529 + 530: 289(ptr) AccessChain 471(bv) 273 + 531: 173(bool) CompositeExtract 527 1 + Store 530 531 + 532:202(i16vec3) Load 370(u16v) + 533: 36(int16_t) Load 372(u16) + 534:202(i16vec3) CompositeConstruct 533 533 533 + 535: 439(bvec3) INotEqual 532 534 + Store 471(bv) 535 + 536: 52(i16vec2) Load 357(i16v) + 537: 14(int16_t) Load 360(i16) + 538: 52(i16vec2) CompositeConstruct 537 537 + 539: 174(bvec2) INotEqual 536 538 + 540: 289(ptr) AccessChain 471(bv) 291 + 541: 173(bool) CompositeExtract 539 0 + Store 540 541 + 542: 289(ptr) AccessChain 471(bv) 273 + 543: 173(bool) CompositeExtract 539 1 + Store 542 543 Return FunctionEnd diff --git a/Test/baseResults/spv.int8.frag.out b/Test/baseResults/spv.int8.frag.out index a0da3e99..e9cd5f86 100644 --- a/Test/baseResults/spv.int8.frag.out +++ b/Test/baseResults/spv.int8.frag.out @@ -1,7 +1,7 @@ spv.int8.frag // Module Version 10300 // Generated by (magic number): 8000a -// Id's are bound by 530 +// Id's are bound by 544 Capability Shader Capability Float16 @@ -48,53 +48,55 @@ spv.int8.frag Name 117 "f64v" Name 144 "u16v" Name 174 "bv" - Name 192 "u8v" - Name 197 "i8" - Name 217 "i" - Name 224 "uv" - Name 240 "i16" - Name 276 "b" - Name 338 "i8v" - Name 341 "i8" - Name 351 "u8v" - Name 353 "u8" - Name 423 "i16" - Name 426 "i32" - Name 429 "i8v4" - Name 433 "u16" - Name 434 "u8v2" - Name 437 "u32" - Name 440 "u8v4" - Name 452 "bv" - Name 525 "Block" - MemberName 525(Block) 0 "i8" - MemberName 525(Block) 1 "i8v2" - MemberName 525(Block) 2 "i8v3" - MemberName 525(Block) 3 "i8v4" - MemberName 525(Block) 4 "u8" - MemberName 525(Block) 5 "u8v2" - MemberName 525(Block) 6 "u8v3" - MemberName 525(Block) 7 "u8v4" - Name 527 "block" - Name 528 "si8" - Name 529 "su8" + Name 193 "arr" + Name 201 "u8v" + Name 206 "i8" + Name 226 "i" + Name 233 "uv" + Name 249 "i16" + Name 285 "b" + Name 348 "f" + Name 352 "i8v" + Name 355 "i8" + Name 365 "u8v" + Name 367 "u8" + Name 437 "i16" + Name 440 "i32" + Name 443 "i8v4" + Name 447 "u16" + Name 448 "u8v2" + Name 451 "u32" + Name 454 "u8v4" + Name 466 "bv" + Name 539 "Block" + MemberName 539(Block) 0 "i8" + MemberName 539(Block) 1 "i8v2" + MemberName 539(Block) 2 "i8v3" + MemberName 539(Block) 3 "i8v4" + MemberName 539(Block) 4 "u8" + MemberName 539(Block) 5 "u8v2" + MemberName 539(Block) 6 "u8v3" + MemberName 539(Block) 7 "u8v4" + Name 541 "block" + Name 542 "si8" + Name 543 "su8" MemberDecorate 24(Uniforms) 0 Offset 0 Decorate 24(Uniforms) Block Decorate 26 DescriptorSet 0 Decorate 26 Binding 0 - MemberDecorate 525(Block) 0 Offset 0 - MemberDecorate 525(Block) 1 Offset 2 - MemberDecorate 525(Block) 2 Offset 4 - MemberDecorate 525(Block) 3 Offset 8 - MemberDecorate 525(Block) 4 Offset 12 - MemberDecorate 525(Block) 5 Offset 14 - MemberDecorate 525(Block) 6 Offset 16 - MemberDecorate 525(Block) 7 Offset 20 - Decorate 525(Block) Block - Decorate 527(block) DescriptorSet 0 - Decorate 527(block) Binding 1 - Decorate 528(si8) SpecId 100 - Decorate 529(su8) SpecId 101 + MemberDecorate 539(Block) 0 Offset 0 + MemberDecorate 539(Block) 1 Offset 2 + MemberDecorate 539(Block) 2 Offset 4 + MemberDecorate 539(Block) 3 Offset 8 + MemberDecorate 539(Block) 4 Offset 12 + MemberDecorate 539(Block) 5 Offset 14 + MemberDecorate 539(Block) 6 Offset 16 + MemberDecorate 539(Block) 7 Offset 20 + Decorate 539(Block) Block + Decorate 541(block) DescriptorSet 0 + Decorate 541(block) Binding 1 + Decorate 542(si8) SpecId 100 + Decorate 543(su8) SpecId 101 2: TypeVoid 3: TypeFunction 2 14: TypeInt 8 1 @@ -159,36 +161,45 @@ spv.int8.frag 182: 36(int8_t) Constant 1 183: 49(i8vec2) ConstantComposite 181 181 184: 49(i8vec2) ConstantComposite 182 182 - 190: TypeVector 36(int8_t) 3 - 191: TypePointer Function 190(i8vec3) - 194: TypeVector 14(int8_t) 3 - 216: TypePointer Function 27(int) - 222: TypeVector 17(int) 3 - 223: TypePointer Function 222(ivec3) - 239: TypePointer Function 57(int16_t) - 261: 17(int) Constant 1 - 267: 17(int) Constant 2 - 275: TypePointer Function 171(bool) - 277: 17(int) Constant 0 - 291: TypePointer Function 17(int) - 349: 52(i8vec2) ConstantComposite 21 21 - 358: 190(i8vec3) ConstantComposite 181 181 181 - 400: 171(bool) ConstantTrue - 407: 171(bool) ConstantFalse - 408: 172(bvec2) ConstantComposite 407 407 - 420: TypeVector 171(bool) 3 - 421: 420(bvec3) ConstantComposite 407 407 407 - 427: TypeVector 14(int8_t) 4 - 428: TypePointer Function 427(i8vec4) - 432: TypePointer Function 64(int16_t) - 438: TypeVector 36(int8_t) 4 - 439: TypePointer Function 438(i8vec4) - 451: TypePointer Function 420(bvec3) - 525(Block): TypeStruct 14(int8_t) 52(i8vec2) 194(i8vec3) 427(i8vec4) 36(int8_t) 49(i8vec2) 190(i8vec3) 438(i8vec4) - 526: TypePointer Uniform 525(Block) - 527(block): 526(ptr) Variable Uniform - 528(si8): 14(int8_t) SpecConstant 4294967286 - 529(su8): 36(int8_t) SpecConstant 20 + 190: 17(int) Constant 4 + 191: TypeArray 108(float) 190 + 192: TypePointer Function 191 + 194: 108(float) Constant 1065353216 + 195: 108(float) Constant 1073741824 + 196: 108(float) Constant 1077936128 + 197: 108(float) Constant 1082130432 + 198: 191 ConstantComposite 194 195 196 197 + 199: TypeVector 36(int8_t) 3 + 200: TypePointer Function 199(i8vec3) + 203: TypeVector 14(int8_t) 3 + 225: TypePointer Function 27(int) + 231: TypeVector 17(int) 3 + 232: TypePointer Function 231(ivec3) + 248: TypePointer Function 57(int16_t) + 270: 17(int) Constant 1 + 276: 17(int) Constant 2 + 284: TypePointer Function 171(bool) + 286: 17(int) Constant 0 + 300: TypePointer Function 17(int) + 347: TypePointer Function 108(float) + 363: 52(i8vec2) ConstantComposite 21 21 + 372: 199(i8vec3) ConstantComposite 181 181 181 + 414: 171(bool) ConstantTrue + 421: 171(bool) ConstantFalse + 422: 172(bvec2) ConstantComposite 421 421 + 434: TypeVector 171(bool) 3 + 435: 434(bvec3) ConstantComposite 421 421 421 + 441: TypeVector 14(int8_t) 4 + 442: TypePointer Function 441(i8vec4) + 446: TypePointer Function 64(int16_t) + 452: TypeVector 36(int8_t) 4 + 453: TypePointer Function 452(i8vec4) + 465: TypePointer Function 434(bvec3) + 539(Block): TypeStruct 14(int8_t) 52(i8vec2) 203(i8vec3) 441(i8vec4) 36(int8_t) 49(i8vec2) 199(i8vec3) 452(i8vec4) + 540: TypePointer Uniform 539(Block) + 541(block): 540(ptr) Variable Uniform + 542(si8): 14(int8_t) SpecConstant 4294967286 + 543(su8): 36(int8_t) SpecConstant 20 4(main): 2 Function None 3 5: Label Return @@ -360,396 +371,403 @@ spv.int8.frag FunctionEnd 10(operators(): 2 Function None 3 11: Label - 192(u8v): 191(ptr) Variable Function - 197(i8): 15(ptr) Variable Function - 217(i): 216(ptr) Variable Function - 224(uv): 223(ptr) Variable Function - 240(i16): 239(ptr) Variable Function - 276(b): 275(ptr) Variable Function - 193: 190(i8vec3) Load 192(u8v) - 195: 194(i8vec3) CompositeConstruct 176 176 176 - 196: 190(i8vec3) IAdd 193 195 - Store 192(u8v) 196 - 198: 14(int8_t) Load 197(i8) - 199: 14(int8_t) ISub 198 176 - Store 197(i8) 199 - 200: 14(int8_t) Load 197(i8) - 201: 14(int8_t) IAdd 200 176 - Store 197(i8) 201 - 202: 190(i8vec3) Load 192(u8v) - 203: 194(i8vec3) CompositeConstruct 176 176 176 - 204: 190(i8vec3) ISub 202 203 - Store 192(u8v) 204 - 205: 190(i8vec3) Load 192(u8v) - 206: 190(i8vec3) Not 205 - Store 192(u8v) 206 - 207: 14(int8_t) Load 197(i8) - Store 197(i8) 207 - 208: 190(i8vec3) Load 192(u8v) - 209: 190(i8vec3) SNegate 208 - Store 192(u8v) 209 - 210: 14(int8_t) Load 197(i8) - 211: 14(int8_t) Load 197(i8) - 212: 14(int8_t) IAdd 211 210 - Store 197(i8) 212 - 213: 190(i8vec3) Load 192(u8v) - 214: 190(i8vec3) Load 192(u8v) - 215: 190(i8vec3) ISub 214 213 - Store 192(u8v) 215 - 218: 14(int8_t) Load 197(i8) - 219: 27(int) SConvert 218 - 220: 27(int) Load 217(i) - 221: 27(int) IMul 220 219 - Store 217(i) 221 - 225: 190(i8vec3) Load 192(u8v) - 226: 222(ivec3) UConvert 225 - 227: 222(ivec3) Load 224(uv) - 228: 222(ivec3) UDiv 227 226 - Store 224(uv) 228 - 229: 14(int8_t) Load 197(i8) - 230: 27(int) SConvert 229 - 231: 17(int) Bitcast 230 - 232: 222(ivec3) Load 224(uv) - 233: 222(ivec3) CompositeConstruct 231 231 231 - 234: 222(ivec3) UMod 232 233 - Store 224(uv) 234 - 235: 190(i8vec3) Load 192(u8v) - 236: 222(ivec3) UConvert 235 - 237: 222(ivec3) Load 224(uv) - 238: 222(ivec3) IAdd 236 237 - Store 224(uv) 238 - 241: 14(int8_t) Load 197(i8) - 242: 57(int16_t) SConvert 241 - 243: 57(int16_t) Load 240(i16) - 244: 57(int16_t) ISub 242 243 - Store 240(i16) 244 - 245: 190(i8vec3) Load 192(u8v) - 246: 222(ivec3) UConvert 245 - 247: 222(ivec3) Load 224(uv) - 248: 222(ivec3) IMul 246 247 - Store 224(uv) 248 - 249: 14(int8_t) Load 197(i8) - 250: 57(int16_t) SConvert 249 - 251: 57(int16_t) Load 240(i16) - 252: 57(int16_t) IMul 250 251 - Store 240(i16) 252 - 253: 14(int8_t) Load 197(i8) - 254: 27(int) SConvert 253 - 255: 27(int) Load 217(i) - 256: 27(int) SMod 254 255 - Store 217(i) 256 - 257: 14(int8_t) Load 197(i8) - 258: 190(i8vec3) Load 192(u8v) - 259: 194(i8vec3) CompositeConstruct 257 257 257 - 260: 190(i8vec3) ShiftLeftLogical 258 259 - Store 192(u8v) 260 - 262: 37(ptr) AccessChain 192(u8v) 261 - 263: 36(int8_t) Load 262 - 264: 14(int8_t) Load 197(i8) - 265: 14(int8_t) ShiftRightArithmetic 264 263 - Store 197(i8) 265 - 266: 14(int8_t) Load 197(i8) - 268: 37(ptr) AccessChain 192(u8v) 267 - 269: 36(int8_t) Load 268 - 270: 14(int8_t) ShiftLeftLogical 266 269 - Store 197(i8) 270 - 271: 190(i8vec3) Load 192(u8v) - 272: 14(int8_t) Load 197(i8) - 273: 194(i8vec3) CompositeConstruct 272 272 272 - 274: 190(i8vec3) ShiftLeftLogical 271 273 - Store 192(u8v) 274 - 278: 37(ptr) AccessChain 192(u8v) 277 - 279: 36(int8_t) Load 278 - 280: 14(int8_t) Load 197(i8) - 281: 36(int8_t) Bitcast 280 - 282: 171(bool) INotEqual 279 281 - Store 276(b) 282 - 283: 14(int8_t) Load 197(i8) - 284: 36(int8_t) Bitcast 283 - 285: 37(ptr) AccessChain 192(u8v) 277 - 286: 36(int8_t) Load 285 - 287: 171(bool) IEqual 284 286 - Store 276(b) 287 - 288: 37(ptr) AccessChain 192(u8v) 277 - 289: 36(int8_t) Load 288 - 290: 17(int) UConvert 289 - 292: 291(ptr) AccessChain 224(uv) 261 - 293: 17(int) Load 292 - 294: 171(bool) UGreaterThan 290 293 - Store 276(b) 294 - 295: 14(int8_t) Load 197(i8) - 296: 27(int) SConvert 295 - 297: 27(int) Load 217(i) - 298: 171(bool) SLessThan 296 297 - Store 276(b) 298 - 299: 37(ptr) AccessChain 192(u8v) 261 - 300: 36(int8_t) Load 299 - 301: 17(int) UConvert 300 - 302: 291(ptr) AccessChain 224(uv) 277 - 303: 17(int) Load 302 - 304: 171(bool) UGreaterThanEqual 301 303 - Store 276(b) 304 - 305: 14(int8_t) Load 197(i8) - 306: 27(int) SConvert 305 - 307: 27(int) Load 217(i) - 308: 171(bool) SLessThanEqual 306 307 - Store 276(b) 308 - 309: 14(int8_t) Load 197(i8) - 310: 27(int) SConvert 309 - 311: 17(int) Bitcast 310 - 312: 222(ivec3) Load 224(uv) - 313: 222(ivec3) CompositeConstruct 311 311 311 - 314: 222(ivec3) BitwiseOr 312 313 - Store 224(uv) 314 - 315: 14(int8_t) Load 197(i8) - 316: 27(int) SConvert 315 - 317: 27(int) Load 217(i) - 318: 27(int) BitwiseOr 316 317 - Store 217(i) 318 - 319: 14(int8_t) Load 197(i8) - 320: 57(int16_t) SConvert 319 - 321: 57(int16_t) Load 240(i16) - 322: 57(int16_t) BitwiseAnd 321 320 - Store 240(i16) 322 - 323: 190(i8vec3) Load 192(u8v) - 324: 222(ivec3) UConvert 323 - 325: 222(ivec3) Load 224(uv) - 326: 222(ivec3) BitwiseAnd 324 325 - Store 224(uv) 326 - 327: 14(int8_t) Load 197(i8) - 328: 27(int) SConvert 327 - 329: 17(int) Bitcast 328 - 330: 222(ivec3) Load 224(uv) - 331: 222(ivec3) CompositeConstruct 329 329 329 - 332: 222(ivec3) BitwiseXor 330 331 - Store 224(uv) 332 - 333: 190(i8vec3) Load 192(u8v) - 334: 14(int8_t) Load 197(i8) - 335: 36(int8_t) Bitcast 334 - 336: 190(i8vec3) CompositeConstruct 335 335 335 - 337: 190(i8vec3) BitwiseXor 333 336 - Store 192(u8v) 337 + 193(arr): 192(ptr) Variable Function + 201(u8v): 200(ptr) Variable Function + 206(i8): 15(ptr) Variable Function + 226(i): 225(ptr) Variable Function + 233(uv): 232(ptr) Variable Function + 249(i16): 248(ptr) Variable Function + 285(b): 284(ptr) Variable Function + 348(f): 347(ptr) Variable Function + Store 193(arr) 198 + 202: 199(i8vec3) Load 201(u8v) + 204: 203(i8vec3) CompositeConstruct 176 176 176 + 205: 199(i8vec3) IAdd 202 204 + Store 201(u8v) 205 + 207: 14(int8_t) Load 206(i8) + 208: 14(int8_t) ISub 207 176 + Store 206(i8) 208 + 209: 14(int8_t) Load 206(i8) + 210: 14(int8_t) IAdd 209 176 + Store 206(i8) 210 + 211: 199(i8vec3) Load 201(u8v) + 212: 203(i8vec3) CompositeConstruct 176 176 176 + 213: 199(i8vec3) ISub 211 212 + Store 201(u8v) 213 + 214: 199(i8vec3) Load 201(u8v) + 215: 199(i8vec3) Not 214 + Store 201(u8v) 215 + 216: 14(int8_t) Load 206(i8) + Store 206(i8) 216 + 217: 199(i8vec3) Load 201(u8v) + 218: 199(i8vec3) SNegate 217 + Store 201(u8v) 218 + 219: 14(int8_t) Load 206(i8) + 220: 14(int8_t) Load 206(i8) + 221: 14(int8_t) IAdd 220 219 + Store 206(i8) 221 + 222: 199(i8vec3) Load 201(u8v) + 223: 199(i8vec3) Load 201(u8v) + 224: 199(i8vec3) ISub 223 222 + Store 201(u8v) 224 + 227: 14(int8_t) Load 206(i8) + 228: 27(int) SConvert 227 + 229: 27(int) Load 226(i) + 230: 27(int) IMul 229 228 + Store 226(i) 230 + 234: 199(i8vec3) Load 201(u8v) + 235: 231(ivec3) UConvert 234 + 236: 231(ivec3) Load 233(uv) + 237: 231(ivec3) UDiv 236 235 + Store 233(uv) 237 + 238: 14(int8_t) Load 206(i8) + 239: 27(int) SConvert 238 + 240: 17(int) Bitcast 239 + 241: 231(ivec3) Load 233(uv) + 242: 231(ivec3) CompositeConstruct 240 240 240 + 243: 231(ivec3) UMod 241 242 + Store 233(uv) 243 + 244: 199(i8vec3) Load 201(u8v) + 245: 231(ivec3) UConvert 244 + 246: 231(ivec3) Load 233(uv) + 247: 231(ivec3) IAdd 245 246 + Store 233(uv) 247 + 250: 14(int8_t) Load 206(i8) + 251: 57(int16_t) SConvert 250 + 252: 57(int16_t) Load 249(i16) + 253: 57(int16_t) ISub 251 252 + Store 249(i16) 253 + 254: 199(i8vec3) Load 201(u8v) + 255: 231(ivec3) UConvert 254 + 256: 231(ivec3) Load 233(uv) + 257: 231(ivec3) IMul 255 256 + Store 233(uv) 257 + 258: 14(int8_t) Load 206(i8) + 259: 57(int16_t) SConvert 258 + 260: 57(int16_t) Load 249(i16) + 261: 57(int16_t) IMul 259 260 + Store 249(i16) 261 + 262: 14(int8_t) Load 206(i8) + 263: 27(int) SConvert 262 + 264: 27(int) Load 226(i) + 265: 27(int) SMod 263 264 + Store 226(i) 265 + 266: 14(int8_t) Load 206(i8) + 267: 199(i8vec3) Load 201(u8v) + 268: 203(i8vec3) CompositeConstruct 266 266 266 + 269: 199(i8vec3) ShiftLeftLogical 267 268 + Store 201(u8v) 269 + 271: 37(ptr) AccessChain 201(u8v) 270 + 272: 36(int8_t) Load 271 + 273: 14(int8_t) Load 206(i8) + 274: 14(int8_t) ShiftRightArithmetic 273 272 + Store 206(i8) 274 + 275: 14(int8_t) Load 206(i8) + 277: 37(ptr) AccessChain 201(u8v) 276 + 278: 36(int8_t) Load 277 + 279: 14(int8_t) ShiftLeftLogical 275 278 + Store 206(i8) 279 + 280: 199(i8vec3) Load 201(u8v) + 281: 14(int8_t) Load 206(i8) + 282: 203(i8vec3) CompositeConstruct 281 281 281 + 283: 199(i8vec3) ShiftLeftLogical 280 282 + Store 201(u8v) 283 + 287: 37(ptr) AccessChain 201(u8v) 286 + 288: 36(int8_t) Load 287 + 289: 14(int8_t) Load 206(i8) + 290: 36(int8_t) Bitcast 289 + 291: 171(bool) INotEqual 288 290 + Store 285(b) 291 + 292: 14(int8_t) Load 206(i8) + 293: 36(int8_t) Bitcast 292 + 294: 37(ptr) AccessChain 201(u8v) 286 + 295: 36(int8_t) Load 294 + 296: 171(bool) IEqual 293 295 + Store 285(b) 296 + 297: 37(ptr) AccessChain 201(u8v) 286 + 298: 36(int8_t) Load 297 + 299: 17(int) UConvert 298 + 301: 300(ptr) AccessChain 233(uv) 270 + 302: 17(int) Load 301 + 303: 171(bool) UGreaterThan 299 302 + Store 285(b) 303 + 304: 14(int8_t) Load 206(i8) + 305: 27(int) SConvert 304 + 306: 27(int) Load 226(i) + 307: 171(bool) SLessThan 305 306 + Store 285(b) 307 + 308: 37(ptr) AccessChain 201(u8v) 270 + 309: 36(int8_t) Load 308 + 310: 17(int) UConvert 309 + 311: 300(ptr) AccessChain 233(uv) 286 + 312: 17(int) Load 311 + 313: 171(bool) UGreaterThanEqual 310 312 + Store 285(b) 313 + 314: 14(int8_t) Load 206(i8) + 315: 27(int) SConvert 314 + 316: 27(int) Load 226(i) + 317: 171(bool) SLessThanEqual 315 316 + Store 285(b) 317 + 318: 14(int8_t) Load 206(i8) + 319: 27(int) SConvert 318 + 320: 17(int) Bitcast 319 + 321: 231(ivec3) Load 233(uv) + 322: 231(ivec3) CompositeConstruct 320 320 320 + 323: 231(ivec3) BitwiseOr 321 322 + Store 233(uv) 323 + 324: 14(int8_t) Load 206(i8) + 325: 27(int) SConvert 324 + 326: 27(int) Load 226(i) + 327: 27(int) BitwiseOr 325 326 + Store 226(i) 327 + 328: 14(int8_t) Load 206(i8) + 329: 57(int16_t) SConvert 328 + 330: 57(int16_t) Load 249(i16) + 331: 57(int16_t) BitwiseAnd 330 329 + Store 249(i16) 331 + 332: 199(i8vec3) Load 201(u8v) + 333: 231(ivec3) UConvert 332 + 334: 231(ivec3) Load 233(uv) + 335: 231(ivec3) BitwiseAnd 333 334 + Store 233(uv) 335 + 336: 14(int8_t) Load 206(i8) + 337: 27(int) SConvert 336 + 338: 17(int) Bitcast 337 + 339: 231(ivec3) Load 233(uv) + 340: 231(ivec3) CompositeConstruct 338 338 338 + 341: 231(ivec3) BitwiseXor 339 340 + Store 233(uv) 341 + 342: 199(i8vec3) Load 201(u8v) + 343: 14(int8_t) Load 206(i8) + 344: 36(int8_t) Bitcast 343 + 345: 199(i8vec3) CompositeConstruct 344 344 344 + 346: 199(i8vec3) BitwiseXor 342 345 + Store 201(u8v) 346 + 349: 14(int8_t) Load 206(i8) + 350: 347(ptr) AccessChain 193(arr) 349 + 351: 108(float) Load 350 + Store 348(f) 351 Return FunctionEnd 12(builtinFuncs(): 2 Function None 3 13: Label - 338(i8v): 53(ptr) Variable Function - 341(i8): 15(ptr) Variable Function - 351(u8v): 191(ptr) Variable Function - 353(u8): 37(ptr) Variable Function - 423(i16): 239(ptr) Variable Function - 426(i32): 216(ptr) Variable Function - 429(i8v4): 428(ptr) Variable Function - 433(u16): 432(ptr) Variable Function - 434(u8v2): 50(ptr) Variable Function - 437(u32): 291(ptr) Variable Function - 440(u8v4): 439(ptr) Variable Function - 452(bv): 451(ptr) Variable Function - 339: 52(i8vec2) Load 338(i8v) - 340: 52(i8vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 339 - Store 338(i8v) 340 - 342: 14(int8_t) Load 341(i8) - 343: 14(int8_t) ExtInst 1(GLSL.std.450) 7(SSign) 342 - Store 341(i8) 343 - 344: 52(i8vec2) Load 338(i8v) - 345: 14(int8_t) Load 341(i8) - 346: 52(i8vec2) CompositeConstruct 345 345 - 347: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 344 346 - Store 338(i8v) 347 - 348: 52(i8vec2) Load 338(i8v) - 350: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 348 349 - Store 338(i8v) 350 - 352: 190(i8vec3) Load 351(u8v) - 354: 36(int8_t) Load 353(u8) - 355: 190(i8vec3) CompositeConstruct 354 354 354 - 356: 190(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 352 355 - Store 351(u8v) 356 - 357: 190(i8vec3) Load 351(u8v) - 359: 190(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 357 358 - Store 351(u8v) 359 - 360: 52(i8vec2) Load 338(i8v) - 361: 14(int8_t) Load 341(i8) - 362: 52(i8vec2) CompositeConstruct 361 361 - 363: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 360 362 - Store 338(i8v) 363 - 364: 52(i8vec2) Load 338(i8v) - 365: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 364 349 - Store 338(i8v) 365 - 366: 190(i8vec3) Load 351(u8v) - 367: 36(int8_t) Load 353(u8) - 368: 190(i8vec3) CompositeConstruct 367 367 367 - 369: 190(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 366 368 - Store 351(u8v) 369 - 370: 190(i8vec3) Load 351(u8v) - 371: 190(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 370 358 - Store 351(u8v) 371 - 372: 52(i8vec2) Load 338(i8v) - 373: 14(int8_t) Load 341(i8) - 374: 14(int8_t) SNegate 373 - 375: 14(int8_t) Load 341(i8) - 376: 52(i8vec2) CompositeConstruct 374 374 - 377: 52(i8vec2) CompositeConstruct 375 375 - 378: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 372 376 377 - Store 338(i8v) 378 - 379: 52(i8vec2) Load 338(i8v) - 380: 52(i8vec2) Load 338(i8v) - 381: 52(i8vec2) SNegate 380 - 382: 52(i8vec2) Load 338(i8v) - 383: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 379 381 382 - Store 338(i8v) 383 - 384: 190(i8vec3) Load 351(u8v) - 385: 36(int8_t) Load 353(u8) - 386: 36(int8_t) SNegate 385 - 387: 36(int8_t) Load 353(u8) - 388: 190(i8vec3) CompositeConstruct 386 386 386 - 389: 190(i8vec3) CompositeConstruct 387 387 387 - 390: 190(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 384 388 389 - Store 351(u8v) 390 - 391: 190(i8vec3) Load 351(u8v) - 392: 190(i8vec3) Load 351(u8v) - 393: 190(i8vec3) SNegate 392 - 394: 190(i8vec3) Load 351(u8v) - 395: 190(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 391 393 394 - Store 351(u8v) 395 - 396: 15(ptr) AccessChain 338(i8v) 277 - 397: 14(int8_t) Load 396 - 398: 15(ptr) AccessChain 338(i8v) 261 - 399: 14(int8_t) Load 398 - 401: 14(int8_t) Select 400 399 397 - Store 341(i8) 401 - 402: 14(int8_t) Load 341(i8) - 403: 52(i8vec2) CompositeConstruct 402 402 - 404: 14(int8_t) Load 341(i8) - 405: 14(int8_t) SNegate 404 - 406: 52(i8vec2) CompositeConstruct 405 405 - 409: 52(i8vec2) Select 408 406 403 - Store 338(i8v) 409 - 410: 37(ptr) AccessChain 351(u8v) 277 - 411: 36(int8_t) Load 410 - 412: 37(ptr) AccessChain 351(u8v) 261 - 413: 36(int8_t) Load 412 - 414: 36(int8_t) Select 400 413 411 - Store 353(u8) 414 - 415: 36(int8_t) Load 353(u8) - 416: 190(i8vec3) CompositeConstruct 415 415 415 - 417: 36(int8_t) Load 353(u8) - 418: 36(int8_t) SNegate 417 - 419: 190(i8vec3) CompositeConstruct 418 418 418 - 422: 190(i8vec3) Select 421 419 416 - Store 351(u8v) 422 - 424: 52(i8vec2) Load 338(i8v) - 425: 57(int16_t) Bitcast 424 - Store 423(i16) 425 - 430: 427(i8vec4) Load 429(i8v4) - 431: 27(int) Bitcast 430 - Store 426(i32) 431 - 435: 49(i8vec2) Load 434(u8v2) - 436: 64(int16_t) Bitcast 435 - Store 433(u16) 436 - 441: 438(i8vec4) Load 440(u8v4) - 442: 17(int) Bitcast 441 - Store 437(u32) 442 - 443: 57(int16_t) Load 423(i16) - 444: 52(i8vec2) Bitcast 443 - Store 338(i8v) 444 - 445: 27(int) Load 426(i32) - 446: 427(i8vec4) Bitcast 445 - Store 429(i8v4) 446 - 447: 64(int16_t) Load 433(u16) - 448: 49(i8vec2) Bitcast 447 - Store 434(u8v2) 448 - 449: 17(int) Load 437(u32) - 450: 438(i8vec4) Bitcast 449 - Store 440(u8v4) 450 - 453: 190(i8vec3) Load 351(u8v) - 454: 36(int8_t) Load 353(u8) - 455: 190(i8vec3) CompositeConstruct 454 454 454 - 456: 420(bvec3) ULessThan 453 455 - Store 452(bv) 456 - 457: 52(i8vec2) Load 338(i8v) - 458: 14(int8_t) Load 341(i8) - 459: 52(i8vec2) CompositeConstruct 458 458 - 460: 172(bvec2) SLessThan 457 459 - 461: 275(ptr) AccessChain 452(bv) 277 - 462: 171(bool) CompositeExtract 460 0 - Store 461 462 - 463: 275(ptr) AccessChain 452(bv) 261 - 464: 171(bool) CompositeExtract 460 1 - Store 463 464 - 465: 190(i8vec3) Load 351(u8v) - 466: 36(int8_t) Load 353(u8) - 467: 190(i8vec3) CompositeConstruct 466 466 466 - 468: 420(bvec3) ULessThanEqual 465 467 - Store 452(bv) 468 - 469: 52(i8vec2) Load 338(i8v) - 470: 14(int8_t) Load 341(i8) - 471: 52(i8vec2) CompositeConstruct 470 470 - 472: 172(bvec2) SLessThanEqual 469 471 - 473: 275(ptr) AccessChain 452(bv) 277 - 474: 171(bool) CompositeExtract 472 0 - Store 473 474 - 475: 275(ptr) AccessChain 452(bv) 261 - 476: 171(bool) CompositeExtract 472 1 + 352(i8v): 53(ptr) Variable Function + 355(i8): 15(ptr) Variable Function + 365(u8v): 200(ptr) Variable Function + 367(u8): 37(ptr) Variable Function + 437(i16): 248(ptr) Variable Function + 440(i32): 225(ptr) Variable Function + 443(i8v4): 442(ptr) Variable Function + 447(u16): 446(ptr) Variable Function + 448(u8v2): 50(ptr) Variable Function + 451(u32): 300(ptr) Variable Function + 454(u8v4): 453(ptr) Variable Function + 466(bv): 465(ptr) Variable Function + 353: 52(i8vec2) Load 352(i8v) + 354: 52(i8vec2) ExtInst 1(GLSL.std.450) 5(SAbs) 353 + Store 352(i8v) 354 + 356: 14(int8_t) Load 355(i8) + 357: 14(int8_t) ExtInst 1(GLSL.std.450) 7(SSign) 356 + Store 355(i8) 357 + 358: 52(i8vec2) Load 352(i8v) + 359: 14(int8_t) Load 355(i8) + 360: 52(i8vec2) CompositeConstruct 359 359 + 361: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 358 360 + Store 352(i8v) 361 + 362: 52(i8vec2) Load 352(i8v) + 364: 52(i8vec2) ExtInst 1(GLSL.std.450) 39(SMin) 362 363 + Store 352(i8v) 364 + 366: 199(i8vec3) Load 365(u8v) + 368: 36(int8_t) Load 367(u8) + 369: 199(i8vec3) CompositeConstruct 368 368 368 + 370: 199(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 366 369 + Store 365(u8v) 370 + 371: 199(i8vec3) Load 365(u8v) + 373: 199(i8vec3) ExtInst 1(GLSL.std.450) 38(UMin) 371 372 + Store 365(u8v) 373 + 374: 52(i8vec2) Load 352(i8v) + 375: 14(int8_t) Load 355(i8) + 376: 52(i8vec2) CompositeConstruct 375 375 + 377: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 374 376 + Store 352(i8v) 377 + 378: 52(i8vec2) Load 352(i8v) + 379: 52(i8vec2) ExtInst 1(GLSL.std.450) 42(SMax) 378 363 + Store 352(i8v) 379 + 380: 199(i8vec3) Load 365(u8v) + 381: 36(int8_t) Load 367(u8) + 382: 199(i8vec3) CompositeConstruct 381 381 381 + 383: 199(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 380 382 + Store 365(u8v) 383 + 384: 199(i8vec3) Load 365(u8v) + 385: 199(i8vec3) ExtInst 1(GLSL.std.450) 41(UMax) 384 372 + Store 365(u8v) 385 + 386: 52(i8vec2) Load 352(i8v) + 387: 14(int8_t) Load 355(i8) + 388: 14(int8_t) SNegate 387 + 389: 14(int8_t) Load 355(i8) + 390: 52(i8vec2) CompositeConstruct 388 388 + 391: 52(i8vec2) CompositeConstruct 389 389 + 392: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 386 390 391 + Store 352(i8v) 392 + 393: 52(i8vec2) Load 352(i8v) + 394: 52(i8vec2) Load 352(i8v) + 395: 52(i8vec2) SNegate 394 + 396: 52(i8vec2) Load 352(i8v) + 397: 52(i8vec2) ExtInst 1(GLSL.std.450) 45(SClamp) 393 395 396 + Store 352(i8v) 397 + 398: 199(i8vec3) Load 365(u8v) + 399: 36(int8_t) Load 367(u8) + 400: 36(int8_t) SNegate 399 + 401: 36(int8_t) Load 367(u8) + 402: 199(i8vec3) CompositeConstruct 400 400 400 + 403: 199(i8vec3) CompositeConstruct 401 401 401 + 404: 199(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 398 402 403 + Store 365(u8v) 404 + 405: 199(i8vec3) Load 365(u8v) + 406: 199(i8vec3) Load 365(u8v) + 407: 199(i8vec3) SNegate 406 + 408: 199(i8vec3) Load 365(u8v) + 409: 199(i8vec3) ExtInst 1(GLSL.std.450) 44(UClamp) 405 407 408 + Store 365(u8v) 409 + 410: 15(ptr) AccessChain 352(i8v) 286 + 411: 14(int8_t) Load 410 + 412: 15(ptr) AccessChain 352(i8v) 270 + 413: 14(int8_t) Load 412 + 415: 14(int8_t) Select 414 413 411 + Store 355(i8) 415 + 416: 14(int8_t) Load 355(i8) + 417: 52(i8vec2) CompositeConstruct 416 416 + 418: 14(int8_t) Load 355(i8) + 419: 14(int8_t) SNegate 418 + 420: 52(i8vec2) CompositeConstruct 419 419 + 423: 52(i8vec2) Select 422 420 417 + Store 352(i8v) 423 + 424: 37(ptr) AccessChain 365(u8v) 286 + 425: 36(int8_t) Load 424 + 426: 37(ptr) AccessChain 365(u8v) 270 + 427: 36(int8_t) Load 426 + 428: 36(int8_t) Select 414 427 425 + Store 367(u8) 428 + 429: 36(int8_t) Load 367(u8) + 430: 199(i8vec3) CompositeConstruct 429 429 429 + 431: 36(int8_t) Load 367(u8) + 432: 36(int8_t) SNegate 431 + 433: 199(i8vec3) CompositeConstruct 432 432 432 + 436: 199(i8vec3) Select 435 433 430 + Store 365(u8v) 436 + 438: 52(i8vec2) Load 352(i8v) + 439: 57(int16_t) Bitcast 438 + Store 437(i16) 439 + 444: 441(i8vec4) Load 443(i8v4) + 445: 27(int) Bitcast 444 + Store 440(i32) 445 + 449: 49(i8vec2) Load 448(u8v2) + 450: 64(int16_t) Bitcast 449 + Store 447(u16) 450 + 455: 452(i8vec4) Load 454(u8v4) + 456: 17(int) Bitcast 455 + Store 451(u32) 456 + 457: 57(int16_t) Load 437(i16) + 458: 52(i8vec2) Bitcast 457 + Store 352(i8v) 458 + 459: 27(int) Load 440(i32) + 460: 441(i8vec4) Bitcast 459 + Store 443(i8v4) 460 + 461: 64(int16_t) Load 447(u16) + 462: 49(i8vec2) Bitcast 461 + Store 448(u8v2) 462 + 463: 17(int) Load 451(u32) + 464: 452(i8vec4) Bitcast 463 + Store 454(u8v4) 464 + 467: 199(i8vec3) Load 365(u8v) + 468: 36(int8_t) Load 367(u8) + 469: 199(i8vec3) CompositeConstruct 468 468 468 + 470: 434(bvec3) ULessThan 467 469 + Store 466(bv) 470 + 471: 52(i8vec2) Load 352(i8v) + 472: 14(int8_t) Load 355(i8) + 473: 52(i8vec2) CompositeConstruct 472 472 + 474: 172(bvec2) SLessThan 471 473 + 475: 284(ptr) AccessChain 466(bv) 286 + 476: 171(bool) CompositeExtract 474 0 Store 475 476 - 477: 190(i8vec3) Load 351(u8v) - 478: 36(int8_t) Load 353(u8) - 479: 190(i8vec3) CompositeConstruct 478 478 478 - 480: 420(bvec3) UGreaterThan 477 479 - Store 452(bv) 480 - 481: 52(i8vec2) Load 338(i8v) - 482: 14(int8_t) Load 341(i8) - 483: 52(i8vec2) CompositeConstruct 482 482 - 484: 172(bvec2) SGreaterThan 481 483 - 485: 275(ptr) AccessChain 452(bv) 277 - 486: 171(bool) CompositeExtract 484 0 - Store 485 486 - 487: 275(ptr) AccessChain 452(bv) 261 - 488: 171(bool) CompositeExtract 484 1 + 477: 284(ptr) AccessChain 466(bv) 270 + 478: 171(bool) CompositeExtract 474 1 + Store 477 478 + 479: 199(i8vec3) Load 365(u8v) + 480: 36(int8_t) Load 367(u8) + 481: 199(i8vec3) CompositeConstruct 480 480 480 + 482: 434(bvec3) ULessThanEqual 479 481 + Store 466(bv) 482 + 483: 52(i8vec2) Load 352(i8v) + 484: 14(int8_t) Load 355(i8) + 485: 52(i8vec2) CompositeConstruct 484 484 + 486: 172(bvec2) SLessThanEqual 483 485 + 487: 284(ptr) AccessChain 466(bv) 286 + 488: 171(bool) CompositeExtract 486 0 Store 487 488 - 489: 190(i8vec3) Load 351(u8v) - 490: 36(int8_t) Load 353(u8) - 491: 190(i8vec3) CompositeConstruct 490 490 490 - 492: 420(bvec3) UGreaterThanEqual 489 491 - Store 452(bv) 492 - 493: 52(i8vec2) Load 338(i8v) - 494: 14(int8_t) Load 341(i8) - 495: 52(i8vec2) CompositeConstruct 494 494 - 496: 172(bvec2) SGreaterThanEqual 493 495 - 497: 275(ptr) AccessChain 452(bv) 277 - 498: 171(bool) CompositeExtract 496 0 - Store 497 498 - 499: 275(ptr) AccessChain 452(bv) 261 - 500: 171(bool) CompositeExtract 496 1 + 489: 284(ptr) AccessChain 466(bv) 270 + 490: 171(bool) CompositeExtract 486 1 + Store 489 490 + 491: 199(i8vec3) Load 365(u8v) + 492: 36(int8_t) Load 367(u8) + 493: 199(i8vec3) CompositeConstruct 492 492 492 + 494: 434(bvec3) UGreaterThan 491 493 + Store 466(bv) 494 + 495: 52(i8vec2) Load 352(i8v) + 496: 14(int8_t) Load 355(i8) + 497: 52(i8vec2) CompositeConstruct 496 496 + 498: 172(bvec2) SGreaterThan 495 497 + 499: 284(ptr) AccessChain 466(bv) 286 + 500: 171(bool) CompositeExtract 498 0 Store 499 500 - 501: 190(i8vec3) Load 351(u8v) - 502: 36(int8_t) Load 353(u8) - 503: 190(i8vec3) CompositeConstruct 502 502 502 - 504: 420(bvec3) IEqual 501 503 - Store 452(bv) 504 - 505: 52(i8vec2) Load 338(i8v) - 506: 14(int8_t) Load 341(i8) - 507: 52(i8vec2) CompositeConstruct 506 506 - 508: 172(bvec2) IEqual 505 507 - 509: 275(ptr) AccessChain 452(bv) 277 - 510: 171(bool) CompositeExtract 508 0 - Store 509 510 - 511: 275(ptr) AccessChain 452(bv) 261 - 512: 171(bool) CompositeExtract 508 1 + 501: 284(ptr) AccessChain 466(bv) 270 + 502: 171(bool) CompositeExtract 498 1 + Store 501 502 + 503: 199(i8vec3) Load 365(u8v) + 504: 36(int8_t) Load 367(u8) + 505: 199(i8vec3) CompositeConstruct 504 504 504 + 506: 434(bvec3) UGreaterThanEqual 503 505 + Store 466(bv) 506 + 507: 52(i8vec2) Load 352(i8v) + 508: 14(int8_t) Load 355(i8) + 509: 52(i8vec2) CompositeConstruct 508 508 + 510: 172(bvec2) SGreaterThanEqual 507 509 + 511: 284(ptr) AccessChain 466(bv) 286 + 512: 171(bool) CompositeExtract 510 0 Store 511 512 - 513: 190(i8vec3) Load 351(u8v) - 514: 36(int8_t) Load 353(u8) - 515: 190(i8vec3) CompositeConstruct 514 514 514 - 516: 420(bvec3) INotEqual 513 515 - Store 452(bv) 516 - 517: 52(i8vec2) Load 338(i8v) - 518: 14(int8_t) Load 341(i8) - 519: 52(i8vec2) CompositeConstruct 518 518 - 520: 172(bvec2) INotEqual 517 519 - 521: 275(ptr) AccessChain 452(bv) 277 - 522: 171(bool) CompositeExtract 520 0 - Store 521 522 - 523: 275(ptr) AccessChain 452(bv) 261 - 524: 171(bool) CompositeExtract 520 1 + 513: 284(ptr) AccessChain 466(bv) 270 + 514: 171(bool) CompositeExtract 510 1 + Store 513 514 + 515: 199(i8vec3) Load 365(u8v) + 516: 36(int8_t) Load 367(u8) + 517: 199(i8vec3) CompositeConstruct 516 516 516 + 518: 434(bvec3) IEqual 515 517 + Store 466(bv) 518 + 519: 52(i8vec2) Load 352(i8v) + 520: 14(int8_t) Load 355(i8) + 521: 52(i8vec2) CompositeConstruct 520 520 + 522: 172(bvec2) IEqual 519 521 + 523: 284(ptr) AccessChain 466(bv) 286 + 524: 171(bool) CompositeExtract 522 0 Store 523 524 + 525: 284(ptr) AccessChain 466(bv) 270 + 526: 171(bool) CompositeExtract 522 1 + Store 525 526 + 527: 199(i8vec3) Load 365(u8v) + 528: 36(int8_t) Load 367(u8) + 529: 199(i8vec3) CompositeConstruct 528 528 528 + 530: 434(bvec3) INotEqual 527 529 + Store 466(bv) 530 + 531: 52(i8vec2) Load 352(i8v) + 532: 14(int8_t) Load 355(i8) + 533: 52(i8vec2) CompositeConstruct 532 532 + 534: 172(bvec2) INotEqual 531 533 + 535: 284(ptr) AccessChain 466(bv) 286 + 536: 171(bool) CompositeExtract 534 0 + Store 535 536 + 537: 284(ptr) AccessChain 466(bv) 270 + 538: 171(bool) CompositeExtract 534 1 + Store 537 538 Return FunctionEnd diff --git a/Test/spv.int16.frag b/Test/spv.int16.frag index 2feff4f8..26a8c9bd 100644 --- a/Test/spv.int16.frag +++ b/Test/spv.int16.frag @@ -116,6 +116,8 @@ void operators() int32_t i; int64_t i64; bool b; + float f; + float arr[4] = {1.0, 2.0, 3.0, 4.0}; // Unary u16v++; @@ -163,6 +165,9 @@ void operators() uv = u16v & uv; uv ^= i16; u16v = u16v ^ i16; + + // Index + f = arr[i16]; } void builtinFuncs() diff --git a/Test/spv.int8.frag b/Test/spv.int8.frag index 80702b75..bd3de17a 100644 --- a/Test/spv.int8.frag +++ b/Test/spv.int8.frag @@ -117,6 +117,8 @@ void operators() int32_t i; int16_t i16; bool b; + float arr[4] = {1.0, 2.0, 3.0, 4.0}; + float f; // Unary u8v++; @@ -164,6 +166,9 @@ void operators() uv = u8v & uv; uv ^= i8; u8v = u8v ^ i8; + + // Index + f = arr[i8]; } void builtinFuncs() diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index b2b187b4..ca374217 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -3029,11 +3029,14 @@ void TParseContext::constantValueCheck(TIntermTyped* node, const char* token) // // Both test, and if necessary spit out an error, to see if the node is really -// an integer. +// a 32-bit integer or can implicitly convert to one. // void TParseContext::integerCheck(const TIntermTyped* node, const char* token) { - if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar()) + auto from_type = node->getBasicType(); + if ((from_type == EbtInt || from_type == EbtUint || + intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) || + intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar()) return; error(node->getLoc(), "scalar integer expression required", token, ""); From c9cc4845b9561784df79491b30552dbc1a6bae07 Mon Sep 17 00:00:00 2001 From: Jeremy Hayes Date: Mon, 4 Oct 2021 22:10:00 -0600 Subject: [PATCH 34/64] Return new allocator for copied containers Fix #2760. Implement the optional function select_on_container_copy_contruction to return a default-contructed allocator for containers that are copy-constructed. This gives copy-constructed containers a pool allocator for the current thead. There may be a similar problem with the copy contructor which takes allocators of type "Other" but, in practice, there is only one place where this is being used and the allocators are always the same. (i.e. executing from the same thread) --- glslang/Include/PoolAlloc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h index b8eccb88..1f5cac76 100644 --- a/glslang/Include/PoolAlloc.h +++ b/glslang/Include/PoolAlloc.h @@ -306,6 +306,8 @@ public: TPoolAllocator& getAllocator() const { return allocator; } + pool_allocator select_on_container_copy_construction() const { return pool_allocator{}; } + protected: pool_allocator& operator=(const pool_allocator&) { return *this; } TPoolAllocator& allocator; From 432a43cccb562f1761d396b04110df5ae1bdb462 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 27 Oct 2021 11:59:26 -0600 Subject: [PATCH 35/64] Remove support for double trig, pow, exp and log These are not supported in core GLSL or under any extension Fixes 2793 --- Test/baseResults/spv.float64.frag.out | 1418 ++++++++++----------- Test/spv.float64.frag | 28 +- glslang/MachineIndependent/Initialize.cpp | 100 -- 3 files changed, 675 insertions(+), 871 deletions(-) diff --git a/Test/baseResults/spv.float64.frag.out b/Test/baseResults/spv.float64.frag.out index dfcfc2d7..cd5f80d6 100644 --- a/Test/baseResults/spv.float64.frag.out +++ b/Test/baseResults/spv.float64.frag.out @@ -2,7 +2,7 @@ spv.float64.frag Validation failed // Module Version 10300 // Generated by (magic number): 8000a -// Id's are bound by 532 +// Id's are bound by 485 Capability Shader Capability Float16 @@ -14,7 +14,7 @@ Validation failed Capability InterpolationFunction 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 461 + EntryPoint Fragment 4 "main" 414 ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_EXT_shader_explicit_arithmetic_types" @@ -29,782 +29,710 @@ Validation failed Name 6 "literal(" Name 8 "operators(" Name 10 "typeCast(" - Name 12 "builtinAngleTrigFuncs(" - Name 14 "builtinExpFuncs(" - Name 16 "builtinCommonFuncs(" - Name 18 "builtinGeometryFuncs(" - Name 20 "builtinMatrixFuncs(" - Name 22 "builtinVecRelFuncs(" - Name 24 "builtinFragProcFuncs(" - Name 29 "f64v" - Name 40 "f64v" - Name 62 "f64m" - Name 85 "f64" - Name 109 "b" - Name 151 "f64v" - Name 154 "bv" - Name 165 "f16v" - Name 173 "i8v" - Name 179 "i16v" - Name 185 "i32v" - Name 191 "i64v" - Name 197 "u8v" - Name 203 "u16v" - Name 208 "u32v" - Name 214 "u64v" - Name 219 "f64v2" - Name 220 "f64v1" - Name 252 "f64v2" - Name 253 "f64v1" - Name 269 "f64v2" - Name 270 "f64v1" - Name 291 "f64" - Name 295 "f64v3" - Name 335 "bv" - Name 356 "b" - Name 366 "iv" - Name 367 "ResType" - Name 374 "f64" - Name 375 "f64v1" - Name 379 "f64v2" - Name 385 "f64v3" - Name 404 "f64m3" - Name 405 "f64m1" - Name 407 "f64m2" - Name 416 "f64v1" - Name 418 "f64v2" - Name 423 "f64m4" - Name 426 "f64" - Name 429 "f64m5" - Name 434 "f64m6" - Name 435 "f64m7" - Name 438 "bv" - Name 439 "f64v1" - Name 441 "f64v2" - Name 459 "f64v" - Name 461 "if64v" - Name 518 "S" - MemberName 518(S) 0 "x" - MemberName 518(S) 1 "y" - MemberName 518(S) 2 "z" - Name 520 "B1" - MemberName 520(B1) 0 "a" - MemberName 520(B1) 1 "b" - MemberName 520(B1) 2 "c" - MemberName 520(B1) 3 "d" - MemberName 520(B1) 4 "e" - MemberName 520(B1) 5 "f" - MemberName 520(B1) 6 "g" - MemberName 520(B1) 7 "h" - Name 522 "" - Name 523 "sf16" - Name 525 "sf" - Name 526 "sd" - Name 527 "f16_to_f" - Name 529 "f16_to_d" - Name 530 "f_to_f16" - Name 531 "d_to_f16" - Decorate 461(if64v) Flat - Decorate 461(if64v) Location 0 - Decorate 516 ArrayStride 16 - Decorate 517 ArrayStride 64 - MemberDecorate 518(S) 0 Offset 0 - MemberDecorate 518(S) 1 Offset 16 - MemberDecorate 518(S) 2 Offset 32 - Decorate 519 ArrayStride 64 - MemberDecorate 520(B1) 0 Offset 0 - MemberDecorate 520(B1) 1 Offset 16 - MemberDecorate 520(B1) 2 Offset 32 - MemberDecorate 520(B1) 3 Offset 64 - MemberDecorate 520(B1) 4 ColMajor - MemberDecorate 520(B1) 4 Offset 96 - MemberDecorate 520(B1) 4 MatrixStride 32 - MemberDecorate 520(B1) 5 ColMajor - MemberDecorate 520(B1) 5 Offset 160 - MemberDecorate 520(B1) 5 MatrixStride 32 - MemberDecorate 520(B1) 6 Offset 288 - MemberDecorate 520(B1) 7 Offset 352 - Decorate 520(B1) Block - Decorate 522 DescriptorSet 0 - Decorate 522 Binding 0 - Decorate 523(sf16) SpecId 100 - Decorate 525(sf) SpecId 101 - Decorate 526(sd) SpecId 102 + Name 12 "builtinTranscendentalFuncs(" + Name 14 "builtinCommonFuncs(" + Name 16 "builtinGeometryFuncs(" + Name 18 "builtinMatrixFuncs(" + Name 20 "builtinVecRelFuncs(" + Name 22 "builtinFragProcFuncs(" + Name 27 "f64v" + Name 38 "f64v" + Name 60 "f64m" + Name 83 "f64" + Name 107 "b" + Name 149 "f64v" + Name 152 "bv" + Name 163 "f16v" + Name 171 "i8v" + Name 177 "i16v" + Name 183 "i32v" + Name 189 "i64v" + Name 195 "u8v" + Name 201 "u16v" + Name 206 "u32v" + Name 212 "u64v" + Name 215 "f64v2" + Name 216 "f64v1" + Name 221 "f64v2" + Name 222 "f64v1" + Name 243 "f64" + Name 247 "f64v3" + Name 287 "bv" + Name 308 "b" + Name 318 "iv" + Name 319 "ResType" + Name 326 "f64" + Name 327 "f64v1" + Name 331 "f64v2" + Name 337 "f64v3" + Name 356 "f64m3" + Name 357 "f64m1" + Name 359 "f64m2" + Name 368 "f64v1" + Name 370 "f64v2" + Name 375 "f64m4" + Name 378 "f64" + Name 381 "f64m5" + Name 387 "f64m6" + Name 388 "f64m7" + Name 391 "bv" + Name 392 "f64v1" + Name 394 "f64v2" + Name 412 "f64v" + Name 414 "if64v" + Name 471 "S" + MemberName 471(S) 0 "x" + MemberName 471(S) 1 "y" + MemberName 471(S) 2 "z" + Name 473 "B1" + MemberName 473(B1) 0 "a" + MemberName 473(B1) 1 "b" + MemberName 473(B1) 2 "c" + MemberName 473(B1) 3 "d" + MemberName 473(B1) 4 "e" + MemberName 473(B1) 5 "f" + MemberName 473(B1) 6 "g" + MemberName 473(B1) 7 "h" + Name 475 "" + Name 476 "sf16" + Name 478 "sf" + Name 479 "sd" + Name 480 "f16_to_f" + Name 482 "f16_to_d" + Name 483 "f_to_f16" + Name 484 "d_to_f16" + Decorate 414(if64v) Flat + Decorate 414(if64v) Location 0 + Decorate 469 ArrayStride 16 + Decorate 470 ArrayStride 64 + MemberDecorate 471(S) 0 Offset 0 + MemberDecorate 471(S) 1 Offset 16 + MemberDecorate 471(S) 2 Offset 32 + Decorate 472 ArrayStride 64 + MemberDecorate 473(B1) 0 Offset 0 + MemberDecorate 473(B1) 1 Offset 16 + MemberDecorate 473(B1) 2 Offset 32 + MemberDecorate 473(B1) 3 Offset 64 + MemberDecorate 473(B1) 4 ColMajor + MemberDecorate 473(B1) 4 Offset 96 + MemberDecorate 473(B1) 4 MatrixStride 32 + MemberDecorate 473(B1) 5 ColMajor + MemberDecorate 473(B1) 5 Offset 160 + MemberDecorate 473(B1) 5 MatrixStride 32 + MemberDecorate 473(B1) 6 Offset 288 + MemberDecorate 473(B1) 7 Offset 352 + Decorate 473(B1) Block + Decorate 475 DescriptorSet 0 + Decorate 475 Binding 0 + Decorate 476(sf16) SpecId 100 + Decorate 478(sf) SpecId 101 + Decorate 479(sd) SpecId 102 2: TypeVoid 3: TypeFunction 2 - 26: TypeFloat 64 - 27: TypeVector 26(float64_t) 2 - 28: TypePointer Function 27(f64vec2) - 30:26(float64_t) Constant 2696277389 1051772663 - 31: TypeInt 32 0 - 32: 31(int) Constant 0 - 33: TypePointer Function 26(float64_t) - 35:26(float64_t) Constant 0 3218079744 - 36:26(float64_t) Constant 3951369912 1067366481 - 37: 27(f64vec2) ConstantComposite 35 36 - 54:26(float64_t) Constant 0 1072693248 - 60: TypeMatrix 27(f64vec2) 2 - 61: TypePointer Function 60 - 88: 31(int) Constant 1 - 107: TypeBool - 108: TypePointer Function 107(bool) - 149: TypeVector 26(float64_t) 3 - 150: TypePointer Function 149(f64vec3) - 152: TypeVector 107(bool) 3 - 153: TypePointer Function 152(bvec3) - 156:26(float64_t) Constant 0 0 - 157:149(f64vec3) ConstantComposite 156 156 156 - 158:149(f64vec3) ConstantComposite 54 54 54 - 162: TypeFloat 16 - 163: TypeVector 162(float16_t) 3 - 164: TypePointer Function 163(f16vec3) - 170: TypeInt 8 1 - 171: TypeVector 170(int8_t) 3 - 172: TypePointer Function 171(i8vec3) - 176: TypeInt 16 1 - 177: TypeVector 176(int16_t) 3 - 178: TypePointer Function 177(i16vec3) - 182: TypeInt 32 1 - 183: TypeVector 182(int) 3 - 184: TypePointer Function 183(ivec3) - 188: TypeInt 64 1 - 189: TypeVector 188(int64_t) 3 - 190: TypePointer Function 189(i64vec3) - 194: TypeInt 8 0 - 195: TypeVector 194(int8_t) 3 - 196: TypePointer Function 195(i8vec3) - 200: TypeInt 16 0 - 201: TypeVector 200(int16_t) 3 - 202: TypePointer Function 201(i16vec3) - 206: TypeVector 31(int) 3 - 207: TypePointer Function 206(ivec3) - 211: TypeInt 64 0 - 212: TypeVector 211(int64_t) 3 - 213: TypePointer Function 212(i64vec3) - 217: TypeVector 26(float64_t) 4 - 218: TypePointer Function 217(f64vec4) - 367(ResType): TypeStruct 149(f64vec3) 183(ivec3) - 402: TypeMatrix 149(f64vec3) 2 - 403: TypePointer Function 402 - 421: TypeMatrix 27(f64vec2) 3 - 422: TypePointer Function 421 - 427: TypeMatrix 149(f64vec3) 3 - 428: TypePointer Function 427 - 432: TypeMatrix 217(f64vec4) 4 - 433: TypePointer Function 432 - 460: TypePointer Input 149(f64vec3) - 461(if64v): 460(ptr) Variable Input - 462: TypePointer Input 26(float64_t) - 505: 182(int) Constant 1 - 512:26(float64_t) Constant 0 1071644672 - 513: 27(f64vec2) ConstantComposite 512 512 - 515: 31(int) Constant 2 - 516: TypeArray 26(float64_t) 515 - 517: TypeArray 402 515 - 518(S): TypeStruct 26(float64_t) 27(f64vec2) 149(f64vec3) - 519: TypeArray 518(S) 515 - 520(B1): TypeStruct 26(float64_t) 27(f64vec2) 149(f64vec3) 516 402 517 518(S) 519 - 521: TypePointer Uniform 520(B1) - 522: 521(ptr) Variable Uniform - 523(sf16):162(float16_t) SpecConstant 12288 - 524: TypeFloat 32 - 525(sf): 524(float) SpecConstant 1048576000 - 526(sd):26(float64_t) SpecConstant 0 1071644672 - 527(f16_to_f): 524(float) SpecConstantOp 115 523(sf16) - 528: 524(float) SpecConstantOp 115 523(sf16) - 529(f16_to_d):26(float64_t) SpecConstantOp 115 528 - 530(f_to_f16):162(float16_t) SpecConstantOp 115 525(sf) - 531(d_to_f16):162(float16_t) SpecConstantOp 115 526(sd) + 24: TypeFloat 64 + 25: TypeVector 24(float64_t) 2 + 26: TypePointer Function 25(f64vec2) + 28:24(float64_t) Constant 2696277389 1051772663 + 29: TypeInt 32 0 + 30: 29(int) Constant 0 + 31: TypePointer Function 24(float64_t) + 33:24(float64_t) Constant 0 3218079744 + 34:24(float64_t) Constant 3951369912 1067366481 + 35: 25(f64vec2) ConstantComposite 33 34 + 52:24(float64_t) Constant 0 1072693248 + 58: TypeMatrix 25(f64vec2) 2 + 59: TypePointer Function 58 + 86: 29(int) Constant 1 + 105: TypeBool + 106: TypePointer Function 105(bool) + 147: TypeVector 24(float64_t) 3 + 148: TypePointer Function 147(f64vec3) + 150: TypeVector 105(bool) 3 + 151: TypePointer Function 150(bvec3) + 154:24(float64_t) Constant 0 0 + 155:147(f64vec3) ConstantComposite 154 154 154 + 156:147(f64vec3) ConstantComposite 52 52 52 + 160: TypeFloat 16 + 161: TypeVector 160(float16_t) 3 + 162: TypePointer Function 161(f16vec3) + 168: TypeInt 8 1 + 169: TypeVector 168(int8_t) 3 + 170: TypePointer Function 169(i8vec3) + 174: TypeInt 16 1 + 175: TypeVector 174(int16_t) 3 + 176: TypePointer Function 175(i16vec3) + 180: TypeInt 32 1 + 181: TypeVector 180(int) 3 + 182: TypePointer Function 181(ivec3) + 186: TypeInt 64 1 + 187: TypeVector 186(int64_t) 3 + 188: TypePointer Function 187(i64vec3) + 192: TypeInt 8 0 + 193: TypeVector 192(int8_t) 3 + 194: TypePointer Function 193(i8vec3) + 198: TypeInt 16 0 + 199: TypeVector 198(int16_t) 3 + 200: TypePointer Function 199(i16vec3) + 204: TypeVector 29(int) 3 + 205: TypePointer Function 204(ivec3) + 209: TypeInt 64 0 + 210: TypeVector 209(int64_t) 3 + 211: TypePointer Function 210(i64vec3) + 319(ResType): TypeStruct 147(f64vec3) 181(ivec3) + 354: TypeMatrix 147(f64vec3) 2 + 355: TypePointer Function 354 + 373: TypeMatrix 25(f64vec2) 3 + 374: TypePointer Function 373 + 379: TypeMatrix 147(f64vec3) 3 + 380: TypePointer Function 379 + 384: TypeVector 24(float64_t) 4 + 385: TypeMatrix 384(f64vec4) 4 + 386: TypePointer Function 385 + 413: TypePointer Input 147(f64vec3) + 414(if64v): 413(ptr) Variable Input + 415: TypePointer Input 24(float64_t) + 458: 180(int) Constant 1 + 465:24(float64_t) Constant 0 1071644672 + 466: 25(f64vec2) ConstantComposite 465 465 + 468: 29(int) Constant 2 + 469: TypeArray 24(float64_t) 468 + 470: TypeArray 354 468 + 471(S): TypeStruct 24(float64_t) 25(f64vec2) 147(f64vec3) + 472: TypeArray 471(S) 468 + 473(B1): TypeStruct 24(float64_t) 25(f64vec2) 147(f64vec3) 469 354 470 471(S) 472 + 474: TypePointer Uniform 473(B1) + 475: 474(ptr) Variable Uniform + 476(sf16):160(float16_t) SpecConstant 12288 + 477: TypeFloat 32 + 478(sf): 477(float) SpecConstant 1048576000 + 479(sd):24(float64_t) SpecConstant 0 1071644672 + 480(f16_to_f): 477(float) SpecConstantOp 115 476(sf16) + 481: 477(float) SpecConstantOp 115 476(sf16) + 482(f16_to_d):24(float64_t) SpecConstantOp 115 481 + 483(f_to_f16):160(float16_t) SpecConstantOp 115 478(sf) + 484(d_to_f16):160(float16_t) SpecConstantOp 115 479(sd) 4(main): 2 Function None 3 5: Label Return FunctionEnd 6(literal(): 2 Function None 3 7: Label - 29(f64v): 28(ptr) Variable Function - 34: 33(ptr) AccessChain 29(f64v) 32 - Store 34 30 - 38: 27(f64vec2) Load 29(f64v) - 39: 27(f64vec2) FAdd 38 37 - Store 29(f64v) 39 + 27(f64v): 26(ptr) Variable Function + 32: 31(ptr) AccessChain 27(f64v) 30 + Store 32 28 + 36: 25(f64vec2) Load 27(f64v) + 37: 25(f64vec2) FAdd 36 35 + Store 27(f64v) 37 Return FunctionEnd 8(operators(): 2 Function None 3 9: Label - 40(f64v): 28(ptr) Variable Function - 62(f64m): 61(ptr) Variable Function - 85(f64): 33(ptr) Variable Function - 109(b): 108(ptr) Variable Function - 41: 27(f64vec2) Load 40(f64v) - 42: 27(f64vec2) Load 40(f64v) - 43: 27(f64vec2) FAdd 42 41 - Store 40(f64v) 43 - 44: 27(f64vec2) Load 40(f64v) - 45: 27(f64vec2) Load 40(f64v) - 46: 27(f64vec2) FSub 45 44 - Store 40(f64v) 46 - 47: 27(f64vec2) Load 40(f64v) - 48: 27(f64vec2) Load 40(f64v) - 49: 27(f64vec2) FMul 48 47 - Store 40(f64v) 49 - 50: 27(f64vec2) Load 40(f64v) - 51: 27(f64vec2) Load 40(f64v) - 52: 27(f64vec2) FDiv 51 50 - Store 40(f64v) 52 - 53: 27(f64vec2) Load 40(f64v) - 55: 27(f64vec2) CompositeConstruct 54 54 - 56: 27(f64vec2) FAdd 53 55 - Store 40(f64v) 56 - 57: 27(f64vec2) Load 40(f64v) - 58: 27(f64vec2) CompositeConstruct 54 54 - 59: 27(f64vec2) FSub 57 58 - Store 40(f64v) 59 - 63: 60 Load 62(f64m) - 64: 27(f64vec2) CompositeConstruct 54 54 - 65: 27(f64vec2) CompositeExtract 63 0 - 66: 27(f64vec2) FAdd 65 64 - 67: 27(f64vec2) CompositeExtract 63 1 - 68: 27(f64vec2) FAdd 67 64 - 69: 60 CompositeConstruct 66 68 - Store 62(f64m) 69 - 70: 60 Load 62(f64m) - 71: 27(f64vec2) CompositeConstruct 54 54 - 72: 27(f64vec2) CompositeExtract 70 0 - 73: 27(f64vec2) FSub 72 71 - 74: 27(f64vec2) CompositeExtract 70 1 - 75: 27(f64vec2) FSub 74 71 - 76: 60 CompositeConstruct 73 75 - Store 62(f64m) 76 - 77: 27(f64vec2) Load 40(f64v) - 78: 27(f64vec2) FNegate 77 - Store 40(f64v) 78 - 79: 60 Load 62(f64m) - 80: 27(f64vec2) CompositeExtract 79 0 - 81: 27(f64vec2) FNegate 80 - 82: 27(f64vec2) CompositeExtract 79 1 - 83: 27(f64vec2) FNegate 82 - 84: 60 CompositeConstruct 81 83 - Store 62(f64m) 84 - 86: 33(ptr) AccessChain 40(f64v) 32 - 87:26(float64_t) Load 86 - 89: 33(ptr) AccessChain 40(f64v) 88 - 90:26(float64_t) Load 89 - 91:26(float64_t) FAdd 87 90 - Store 85(f64) 91 - 92: 33(ptr) AccessChain 40(f64v) 32 - 93:26(float64_t) Load 92 - 94: 33(ptr) AccessChain 40(f64v) 88 - 95:26(float64_t) Load 94 - 96:26(float64_t) FSub 93 95 - Store 85(f64) 96 - 97: 33(ptr) AccessChain 40(f64v) 32 - 98:26(float64_t) Load 97 - 99: 33(ptr) AccessChain 40(f64v) 88 - 100:26(float64_t) Load 99 - 101:26(float64_t) FMul 98 100 - Store 85(f64) 101 - 102: 33(ptr) AccessChain 40(f64v) 32 - 103:26(float64_t) Load 102 - 104: 33(ptr) AccessChain 40(f64v) 88 - 105:26(float64_t) Load 104 - 106:26(float64_t) FDiv 103 105 - Store 85(f64) 106 - 110: 33(ptr) AccessChain 40(f64v) 32 - 111:26(float64_t) Load 110 - 112:26(float64_t) Load 85(f64) - 113: 107(bool) FUnordNotEqual 111 112 - Store 109(b) 113 - 114: 33(ptr) AccessChain 40(f64v) 88 - 115:26(float64_t) Load 114 - 116:26(float64_t) Load 85(f64) - 117: 107(bool) FOrdEqual 115 116 - Store 109(b) 117 - 118: 33(ptr) AccessChain 40(f64v) 32 - 119:26(float64_t) Load 118 - 120:26(float64_t) Load 85(f64) - 121: 107(bool) FOrdGreaterThan 119 120 - Store 109(b) 121 - 122: 33(ptr) AccessChain 40(f64v) 88 - 123:26(float64_t) Load 122 - 124:26(float64_t) Load 85(f64) - 125: 107(bool) FOrdLessThan 123 124 - Store 109(b) 125 - 126: 33(ptr) AccessChain 40(f64v) 32 - 127:26(float64_t) Load 126 - 128:26(float64_t) Load 85(f64) - 129: 107(bool) FOrdGreaterThanEqual 127 128 - Store 109(b) 129 - 130: 33(ptr) AccessChain 40(f64v) 88 - 131:26(float64_t) Load 130 - 132:26(float64_t) Load 85(f64) - 133: 107(bool) FOrdLessThanEqual 131 132 - Store 109(b) 133 - 134: 27(f64vec2) Load 40(f64v) - 135:26(float64_t) Load 85(f64) - 136: 27(f64vec2) VectorTimesScalar 134 135 - Store 40(f64v) 136 - 137: 60 Load 62(f64m) - 138:26(float64_t) Load 85(f64) - 139: 60 MatrixTimesScalar 137 138 - Store 62(f64m) 139 - 140: 60 Load 62(f64m) - 141: 27(f64vec2) Load 40(f64v) - 142: 27(f64vec2) MatrixTimesVector 140 141 - Store 40(f64v) 142 - 143: 27(f64vec2) Load 40(f64v) - 144: 60 Load 62(f64m) - 145: 27(f64vec2) VectorTimesMatrix 143 144 - Store 40(f64v) 145 - 146: 60 Load 62(f64m) - 147: 60 Load 62(f64m) - 148: 60 MatrixTimesMatrix 146 147 - Store 62(f64m) 148 + 38(f64v): 26(ptr) Variable Function + 60(f64m): 59(ptr) Variable Function + 83(f64): 31(ptr) Variable Function + 107(b): 106(ptr) Variable Function + 39: 25(f64vec2) Load 38(f64v) + 40: 25(f64vec2) Load 38(f64v) + 41: 25(f64vec2) FAdd 40 39 + Store 38(f64v) 41 + 42: 25(f64vec2) Load 38(f64v) + 43: 25(f64vec2) Load 38(f64v) + 44: 25(f64vec2) FSub 43 42 + Store 38(f64v) 44 + 45: 25(f64vec2) Load 38(f64v) + 46: 25(f64vec2) Load 38(f64v) + 47: 25(f64vec2) FMul 46 45 + Store 38(f64v) 47 + 48: 25(f64vec2) Load 38(f64v) + 49: 25(f64vec2) Load 38(f64v) + 50: 25(f64vec2) FDiv 49 48 + Store 38(f64v) 50 + 51: 25(f64vec2) Load 38(f64v) + 53: 25(f64vec2) CompositeConstruct 52 52 + 54: 25(f64vec2) FAdd 51 53 + Store 38(f64v) 54 + 55: 25(f64vec2) Load 38(f64v) + 56: 25(f64vec2) CompositeConstruct 52 52 + 57: 25(f64vec2) FSub 55 56 + Store 38(f64v) 57 + 61: 58 Load 60(f64m) + 62: 25(f64vec2) CompositeConstruct 52 52 + 63: 25(f64vec2) CompositeExtract 61 0 + 64: 25(f64vec2) FAdd 63 62 + 65: 25(f64vec2) CompositeExtract 61 1 + 66: 25(f64vec2) FAdd 65 62 + 67: 58 CompositeConstruct 64 66 + Store 60(f64m) 67 + 68: 58 Load 60(f64m) + 69: 25(f64vec2) CompositeConstruct 52 52 + 70: 25(f64vec2) CompositeExtract 68 0 + 71: 25(f64vec2) FSub 70 69 + 72: 25(f64vec2) CompositeExtract 68 1 + 73: 25(f64vec2) FSub 72 69 + 74: 58 CompositeConstruct 71 73 + Store 60(f64m) 74 + 75: 25(f64vec2) Load 38(f64v) + 76: 25(f64vec2) FNegate 75 + Store 38(f64v) 76 + 77: 58 Load 60(f64m) + 78: 25(f64vec2) CompositeExtract 77 0 + 79: 25(f64vec2) FNegate 78 + 80: 25(f64vec2) CompositeExtract 77 1 + 81: 25(f64vec2) FNegate 80 + 82: 58 CompositeConstruct 79 81 + Store 60(f64m) 82 + 84: 31(ptr) AccessChain 38(f64v) 30 + 85:24(float64_t) Load 84 + 87: 31(ptr) AccessChain 38(f64v) 86 + 88:24(float64_t) Load 87 + 89:24(float64_t) FAdd 85 88 + Store 83(f64) 89 + 90: 31(ptr) AccessChain 38(f64v) 30 + 91:24(float64_t) Load 90 + 92: 31(ptr) AccessChain 38(f64v) 86 + 93:24(float64_t) Load 92 + 94:24(float64_t) FSub 91 93 + Store 83(f64) 94 + 95: 31(ptr) AccessChain 38(f64v) 30 + 96:24(float64_t) Load 95 + 97: 31(ptr) AccessChain 38(f64v) 86 + 98:24(float64_t) Load 97 + 99:24(float64_t) FMul 96 98 + Store 83(f64) 99 + 100: 31(ptr) AccessChain 38(f64v) 30 + 101:24(float64_t) Load 100 + 102: 31(ptr) AccessChain 38(f64v) 86 + 103:24(float64_t) Load 102 + 104:24(float64_t) FDiv 101 103 + Store 83(f64) 104 + 108: 31(ptr) AccessChain 38(f64v) 30 + 109:24(float64_t) Load 108 + 110:24(float64_t) Load 83(f64) + 111: 105(bool) FUnordNotEqual 109 110 + Store 107(b) 111 + 112: 31(ptr) AccessChain 38(f64v) 86 + 113:24(float64_t) Load 112 + 114:24(float64_t) Load 83(f64) + 115: 105(bool) FOrdEqual 113 114 + Store 107(b) 115 + 116: 31(ptr) AccessChain 38(f64v) 30 + 117:24(float64_t) Load 116 + 118:24(float64_t) Load 83(f64) + 119: 105(bool) FOrdGreaterThan 117 118 + Store 107(b) 119 + 120: 31(ptr) AccessChain 38(f64v) 86 + 121:24(float64_t) Load 120 + 122:24(float64_t) Load 83(f64) + 123: 105(bool) FOrdLessThan 121 122 + Store 107(b) 123 + 124: 31(ptr) AccessChain 38(f64v) 30 + 125:24(float64_t) Load 124 + 126:24(float64_t) Load 83(f64) + 127: 105(bool) FOrdGreaterThanEqual 125 126 + Store 107(b) 127 + 128: 31(ptr) AccessChain 38(f64v) 86 + 129:24(float64_t) Load 128 + 130:24(float64_t) Load 83(f64) + 131: 105(bool) FOrdLessThanEqual 129 130 + Store 107(b) 131 + 132: 25(f64vec2) Load 38(f64v) + 133:24(float64_t) Load 83(f64) + 134: 25(f64vec2) VectorTimesScalar 132 133 + Store 38(f64v) 134 + 135: 58 Load 60(f64m) + 136:24(float64_t) Load 83(f64) + 137: 58 MatrixTimesScalar 135 136 + Store 60(f64m) 137 + 138: 58 Load 60(f64m) + 139: 25(f64vec2) Load 38(f64v) + 140: 25(f64vec2) MatrixTimesVector 138 139 + Store 38(f64v) 140 + 141: 25(f64vec2) Load 38(f64v) + 142: 58 Load 60(f64m) + 143: 25(f64vec2) VectorTimesMatrix 141 142 + Store 38(f64v) 143 + 144: 58 Load 60(f64m) + 145: 58 Load 60(f64m) + 146: 58 MatrixTimesMatrix 144 145 + Store 60(f64m) 146 Return FunctionEnd 10(typeCast(): 2 Function None 3 11: Label - 151(f64v): 150(ptr) Variable Function - 154(bv): 153(ptr) Variable Function - 165(f16v): 164(ptr) Variable Function - 173(i8v): 172(ptr) Variable Function - 179(i16v): 178(ptr) Variable Function - 185(i32v): 184(ptr) Variable Function - 191(i64v): 190(ptr) Variable Function - 197(u8v): 196(ptr) Variable Function - 203(u16v): 202(ptr) Variable Function - 208(u32v): 207(ptr) Variable Function - 214(u64v): 213(ptr) Variable Function - 155: 152(bvec3) Load 154(bv) - 159:149(f64vec3) Select 155 158 157 - Store 151(f64v) 159 - 160:149(f64vec3) Load 151(f64v) - 161: 152(bvec3) FUnordNotEqual 160 157 - Store 154(bv) 161 - 166:163(f16vec3) Load 165(f16v) - 167:149(f64vec3) FConvert 166 - Store 151(f64v) 167 - 168:149(f64vec3) Load 151(f64v) - 169:163(f16vec3) FConvert 168 - Store 165(f16v) 169 - 174:149(f64vec3) Load 151(f64v) - 175: 171(i8vec3) ConvertFToS 174 - Store 173(i8v) 175 - 180:149(f64vec3) Load 151(f64v) - 181:177(i16vec3) ConvertFToS 180 - Store 179(i16v) 181 - 186:149(f64vec3) Load 151(f64v) - 187: 183(ivec3) ConvertFToS 186 - Store 185(i32v) 187 - 192:149(f64vec3) Load 151(f64v) - 193:189(i64vec3) ConvertFToS 192 - Store 191(i64v) 193 - 198:149(f64vec3) Load 151(f64v) - 199: 195(i8vec3) ConvertFToU 198 - Store 197(u8v) 199 - 204:149(f64vec3) Load 151(f64v) - 205:201(i16vec3) ConvertFToU 204 - Store 203(u16v) 205 - 209:149(f64vec3) Load 151(f64v) - 210: 206(ivec3) ConvertFToU 209 - Store 208(u32v) 210 - 215:149(f64vec3) Load 151(f64v) - 216:212(i64vec3) ConvertFToU 215 - Store 214(u64v) 216 + 149(f64v): 148(ptr) Variable Function + 152(bv): 151(ptr) Variable Function + 163(f16v): 162(ptr) Variable Function + 171(i8v): 170(ptr) Variable Function + 177(i16v): 176(ptr) Variable Function + 183(i32v): 182(ptr) Variable Function + 189(i64v): 188(ptr) Variable Function + 195(u8v): 194(ptr) Variable Function + 201(u16v): 200(ptr) Variable Function + 206(u32v): 205(ptr) Variable Function + 212(u64v): 211(ptr) Variable Function + 153: 150(bvec3) Load 152(bv) + 157:147(f64vec3) Select 153 156 155 + Store 149(f64v) 157 + 158:147(f64vec3) Load 149(f64v) + 159: 150(bvec3) FUnordNotEqual 158 155 + Store 152(bv) 159 + 164:161(f16vec3) Load 163(f16v) + 165:147(f64vec3) FConvert 164 + Store 149(f64v) 165 + 166:147(f64vec3) Load 149(f64v) + 167:161(f16vec3) FConvert 166 + Store 163(f16v) 167 + 172:147(f64vec3) Load 149(f64v) + 173: 169(i8vec3) ConvertFToS 172 + Store 171(i8v) 173 + 178:147(f64vec3) Load 149(f64v) + 179:175(i16vec3) ConvertFToS 178 + Store 177(i16v) 179 + 184:147(f64vec3) Load 149(f64v) + 185: 181(ivec3) ConvertFToS 184 + Store 183(i32v) 185 + 190:147(f64vec3) Load 149(f64v) + 191:187(i64vec3) ConvertFToS 190 + Store 189(i64v) 191 + 196:147(f64vec3) Load 149(f64v) + 197: 193(i8vec3) ConvertFToU 196 + Store 195(u8v) 197 + 202:147(f64vec3) Load 149(f64v) + 203:199(i16vec3) ConvertFToU 202 + Store 201(u16v) 203 + 207:147(f64vec3) Load 149(f64v) + 208: 204(ivec3) ConvertFToU 207 + Store 206(u32v) 208 + 213:147(f64vec3) Load 149(f64v) + 214:210(i64vec3) ConvertFToU 213 + Store 212(u64v) 214 Return FunctionEnd -12(builtinAngleTrigFuncs(): 2 Function None 3 +12(builtinTranscendentalFuncs(): 2 Function None 3 13: Label - 219(f64v2): 218(ptr) Variable Function - 220(f64v1): 218(ptr) Variable Function - 221:217(f64vec4) Load 220(f64v1) - 222:217(f64vec4) ExtInst 1(GLSL.std.450) 11(Radians) 221 - Store 219(f64v2) 222 - 223:217(f64vec4) Load 220(f64v1) - 224:217(f64vec4) ExtInst 1(GLSL.std.450) 12(Degrees) 223 - Store 219(f64v2) 224 - 225:217(f64vec4) Load 220(f64v1) - 226:217(f64vec4) ExtInst 1(GLSL.std.450) 13(Sin) 225 - Store 219(f64v2) 226 - 227:217(f64vec4) Load 220(f64v1) - 228:217(f64vec4) ExtInst 1(GLSL.std.450) 14(Cos) 227 - Store 219(f64v2) 228 - 229:217(f64vec4) Load 220(f64v1) - 230:217(f64vec4) ExtInst 1(GLSL.std.450) 15(Tan) 229 - Store 219(f64v2) 230 - 231:217(f64vec4) Load 220(f64v1) - 232:217(f64vec4) ExtInst 1(GLSL.std.450) 16(Asin) 231 - Store 219(f64v2) 232 - 233:217(f64vec4) Load 220(f64v1) - 234:217(f64vec4) ExtInst 1(GLSL.std.450) 17(Acos) 233 - Store 219(f64v2) 234 - 235:217(f64vec4) Load 220(f64v1) - 236:217(f64vec4) Load 219(f64v2) - 237:217(f64vec4) ExtInst 1(GLSL.std.450) 25(Atan2) 235 236 - Store 219(f64v2) 237 - 238:217(f64vec4) Load 220(f64v1) - 239:217(f64vec4) ExtInst 1(GLSL.std.450) 18(Atan) 238 - Store 219(f64v2) 239 - 240:217(f64vec4) Load 220(f64v1) - 241:217(f64vec4) ExtInst 1(GLSL.std.450) 19(Sinh) 240 - Store 219(f64v2) 241 - 242:217(f64vec4) Load 220(f64v1) - 243:217(f64vec4) ExtInst 1(GLSL.std.450) 20(Cosh) 242 - Store 219(f64v2) 243 - 244:217(f64vec4) Load 220(f64v1) - 245:217(f64vec4) ExtInst 1(GLSL.std.450) 21(Tanh) 244 - Store 219(f64v2) 245 - 246:217(f64vec4) Load 220(f64v1) - 247:217(f64vec4) ExtInst 1(GLSL.std.450) 22(Asinh) 246 - Store 219(f64v2) 247 - 248:217(f64vec4) Load 220(f64v1) - 249:217(f64vec4) ExtInst 1(GLSL.std.450) 23(Acosh) 248 - Store 219(f64v2) 249 - 250:217(f64vec4) Load 220(f64v1) - 251:217(f64vec4) ExtInst 1(GLSL.std.450) 24(Atanh) 250 - Store 219(f64v2) 251 + 215(f64v2): 26(ptr) Variable Function + 216(f64v1): 26(ptr) Variable Function + 217: 25(f64vec2) Load 216(f64v1) + 218: 25(f64vec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 217 + Store 215(f64v2) 218 + 219: 25(f64vec2) Load 216(f64v1) + 220: 25(f64vec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 219 + Store 215(f64v2) 220 Return FunctionEnd -14(builtinExpFuncs(): 2 Function None 3 +14(builtinCommonFuncs(): 2 Function None 3 15: Label - 252(f64v2): 28(ptr) Variable Function - 253(f64v1): 28(ptr) Variable Function - 254: 27(f64vec2) Load 253(f64v1) - 255: 27(f64vec2) Load 252(f64v2) - 256: 27(f64vec2) ExtInst 1(GLSL.std.450) 26(Pow) 254 255 - Store 252(f64v2) 256 - 257: 27(f64vec2) Load 253(f64v1) - 258: 27(f64vec2) ExtInst 1(GLSL.std.450) 27(Exp) 257 - Store 252(f64v2) 258 - 259: 27(f64vec2) Load 253(f64v1) - 260: 27(f64vec2) ExtInst 1(GLSL.std.450) 28(Log) 259 - Store 252(f64v2) 260 - 261: 27(f64vec2) Load 253(f64v1) - 262: 27(f64vec2) ExtInst 1(GLSL.std.450) 29(Exp2) 261 - Store 252(f64v2) 262 - 263: 27(f64vec2) Load 253(f64v1) - 264: 27(f64vec2) ExtInst 1(GLSL.std.450) 30(Log2) 263 - Store 252(f64v2) 264 - 265: 27(f64vec2) Load 253(f64v1) - 266: 27(f64vec2) ExtInst 1(GLSL.std.450) 31(Sqrt) 265 - Store 252(f64v2) 266 - 267: 27(f64vec2) Load 253(f64v1) - 268: 27(f64vec2) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 267 - Store 252(f64v2) 268 + 221(f64v2): 148(ptr) Variable Function + 222(f64v1): 148(ptr) Variable Function + 243(f64): 31(ptr) Variable Function + 247(f64v3): 148(ptr) Variable Function + 287(bv): 151(ptr) Variable Function + 308(b): 106(ptr) Variable Function + 318(iv): 182(ptr) Variable Function + 223:147(f64vec3) Load 222(f64v1) + 224:147(f64vec3) ExtInst 1(GLSL.std.450) 4(FAbs) 223 + Store 221(f64v2) 224 + 225:147(f64vec3) Load 222(f64v1) + 226:147(f64vec3) ExtInst 1(GLSL.std.450) 6(FSign) 225 + Store 221(f64v2) 226 + 227:147(f64vec3) Load 222(f64v1) + 228:147(f64vec3) ExtInst 1(GLSL.std.450) 8(Floor) 227 + Store 221(f64v2) 228 + 229:147(f64vec3) Load 222(f64v1) + 230:147(f64vec3) ExtInst 1(GLSL.std.450) 3(Trunc) 229 + Store 221(f64v2) 230 + 231:147(f64vec3) Load 222(f64v1) + 232:147(f64vec3) ExtInst 1(GLSL.std.450) 1(Round) 231 + Store 221(f64v2) 232 + 233:147(f64vec3) Load 222(f64v1) + 234:147(f64vec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 233 + Store 221(f64v2) 234 + 235:147(f64vec3) Load 222(f64v1) + 236:147(f64vec3) ExtInst 1(GLSL.std.450) 9(Ceil) 235 + Store 221(f64v2) 236 + 237:147(f64vec3) Load 222(f64v1) + 238:147(f64vec3) ExtInst 1(GLSL.std.450) 10(Fract) 237 + Store 221(f64v2) 238 + 239:147(f64vec3) Load 222(f64v1) + 240:147(f64vec3) Load 221(f64v2) + 241:147(f64vec3) FMod 239 240 + Store 221(f64v2) 241 + 242:147(f64vec3) Load 222(f64v1) + 244:24(float64_t) Load 243(f64) + 245:147(f64vec3) CompositeConstruct 244 244 244 + 246:147(f64vec3) FMod 242 245 + Store 221(f64v2) 246 + 248:147(f64vec3) Load 222(f64v1) + 249:147(f64vec3) ExtInst 1(GLSL.std.450) 35(Modf) 248 221(f64v2) + Store 247(f64v3) 249 + 250:147(f64vec3) Load 222(f64v1) + 251:147(f64vec3) Load 221(f64v2) + 252:147(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 250 251 + Store 247(f64v3) 252 + 253:147(f64vec3) Load 222(f64v1) + 254:24(float64_t) Load 243(f64) + 255:147(f64vec3) CompositeConstruct 254 254 254 + 256:147(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 253 255 + Store 247(f64v3) 256 + 257:147(f64vec3) Load 222(f64v1) + 258:147(f64vec3) Load 221(f64v2) + 259:147(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 257 258 + Store 247(f64v3) 259 + 260:147(f64vec3) Load 222(f64v1) + 261:24(float64_t) Load 243(f64) + 262:147(f64vec3) CompositeConstruct 261 261 261 + 263:147(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 260 262 + Store 247(f64v3) 263 + 264:147(f64vec3) Load 222(f64v1) + 265:24(float64_t) Load 243(f64) + 266: 31(ptr) AccessChain 221(f64v2) 30 + 267:24(float64_t) Load 266 + 268:147(f64vec3) CompositeConstruct 265 265 265 + 269:147(f64vec3) CompositeConstruct 267 267 267 + 270:147(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 264 268 269 + Store 247(f64v3) 270 + 271:147(f64vec3) Load 222(f64v1) + 272:147(f64vec3) Load 221(f64v2) + 273:24(float64_t) Load 243(f64) + 274:147(f64vec3) CompositeConstruct 273 273 273 + 275:147(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 271 272 274 + Store 247(f64v3) 275 + 276:147(f64vec3) Load 222(f64v1) + 277:147(f64vec3) Load 221(f64v2) + 278:24(float64_t) Load 243(f64) + 279:147(f64vec3) CompositeConstruct 278 278 278 + 280:147(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 276 277 279 + Store 247(f64v3) 280 + 281:147(f64vec3) Load 222(f64v1) + 282:147(f64vec3) Load 221(f64v2) + 283:147(f64vec3) Load 247(f64v3) + 284:147(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 281 282 283 + Store 247(f64v3) 284 + 285:147(f64vec3) Load 222(f64v1) + 286:147(f64vec3) Load 221(f64v2) + 288: 150(bvec3) Load 287(bv) + 289:147(f64vec3) Select 288 286 285 + Store 247(f64v3) 289 + 290:147(f64vec3) Load 222(f64v1) + 291:147(f64vec3) Load 221(f64v2) + 292:147(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 290 291 + Store 247(f64v3) 292 + 293:24(float64_t) Load 243(f64) + 294:147(f64vec3) Load 247(f64v3) + 295:147(f64vec3) CompositeConstruct 293 293 293 + 296:147(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 295 294 + Store 247(f64v3) 296 + 297:147(f64vec3) Load 222(f64v1) + 298:147(f64vec3) Load 221(f64v2) + 299:147(f64vec3) Load 247(f64v3) + 300:147(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 297 298 299 + Store 247(f64v3) 300 + 301:24(float64_t) Load 243(f64) + 302: 31(ptr) AccessChain 222(f64v1) 30 + 303:24(float64_t) Load 302 + 304:147(f64vec3) Load 221(f64v2) + 305:147(f64vec3) CompositeConstruct 301 301 301 + 306:147(f64vec3) CompositeConstruct 303 303 303 + 307:147(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 305 306 304 + Store 247(f64v3) 307 + 309:24(float64_t) Load 243(f64) + 310: 105(bool) IsNan 309 + Store 308(b) 310 + 311:147(f64vec3) Load 222(f64v1) + 312: 150(bvec3) IsInf 311 + Store 287(bv) 312 + 313:147(f64vec3) Load 222(f64v1) + 314:147(f64vec3) Load 221(f64v2) + 315:147(f64vec3) Load 247(f64v3) + 316:147(f64vec3) ExtInst 1(GLSL.std.450) 50(Fma) 313 314 315 + Store 247(f64v3) 316 + 317:147(f64vec3) Load 222(f64v1) + 320:319(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 317 + 321: 181(ivec3) CompositeExtract 320 1 + Store 318(iv) 321 + 322:147(f64vec3) CompositeExtract 320 0 + Store 221(f64v2) 322 + 323:147(f64vec3) Load 222(f64v1) + 324: 181(ivec3) Load 318(iv) + 325:147(f64vec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 323 324 + Store 221(f64v2) 325 Return FunctionEnd -16(builtinCommonFuncs(): 2 Function None 3 +16(builtinGeometryFuncs(): 2 Function None 3 17: Label - 269(f64v2): 150(ptr) Variable Function - 270(f64v1): 150(ptr) Variable Function - 291(f64): 33(ptr) Variable Function - 295(f64v3): 150(ptr) Variable Function - 335(bv): 153(ptr) Variable Function - 356(b): 108(ptr) Variable Function - 366(iv): 184(ptr) Variable Function - 271:149(f64vec3) Load 270(f64v1) - 272:149(f64vec3) ExtInst 1(GLSL.std.450) 4(FAbs) 271 - Store 269(f64v2) 272 - 273:149(f64vec3) Load 270(f64v1) - 274:149(f64vec3) ExtInst 1(GLSL.std.450) 6(FSign) 273 - Store 269(f64v2) 274 - 275:149(f64vec3) Load 270(f64v1) - 276:149(f64vec3) ExtInst 1(GLSL.std.450) 8(Floor) 275 - Store 269(f64v2) 276 - 277:149(f64vec3) Load 270(f64v1) - 278:149(f64vec3) ExtInst 1(GLSL.std.450) 3(Trunc) 277 - Store 269(f64v2) 278 - 279:149(f64vec3) Load 270(f64v1) - 280:149(f64vec3) ExtInst 1(GLSL.std.450) 1(Round) 279 - Store 269(f64v2) 280 - 281:149(f64vec3) Load 270(f64v1) - 282:149(f64vec3) ExtInst 1(GLSL.std.450) 2(RoundEven) 281 - Store 269(f64v2) 282 - 283:149(f64vec3) Load 270(f64v1) - 284:149(f64vec3) ExtInst 1(GLSL.std.450) 9(Ceil) 283 - Store 269(f64v2) 284 - 285:149(f64vec3) Load 270(f64v1) - 286:149(f64vec3) ExtInst 1(GLSL.std.450) 10(Fract) 285 - Store 269(f64v2) 286 - 287:149(f64vec3) Load 270(f64v1) - 288:149(f64vec3) Load 269(f64v2) - 289:149(f64vec3) FMod 287 288 - Store 269(f64v2) 289 - 290:149(f64vec3) Load 270(f64v1) - 292:26(float64_t) Load 291(f64) - 293:149(f64vec3) CompositeConstruct 292 292 292 - 294:149(f64vec3) FMod 290 293 - Store 269(f64v2) 294 - 296:149(f64vec3) Load 270(f64v1) - 297:149(f64vec3) ExtInst 1(GLSL.std.450) 35(Modf) 296 269(f64v2) - Store 295(f64v3) 297 - 298:149(f64vec3) Load 270(f64v1) - 299:149(f64vec3) Load 269(f64v2) - 300:149(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 298 299 - Store 295(f64v3) 300 - 301:149(f64vec3) Load 270(f64v1) - 302:26(float64_t) Load 291(f64) - 303:149(f64vec3) CompositeConstruct 302 302 302 - 304:149(f64vec3) ExtInst 1(GLSL.std.450) 37(FMin) 301 303 - Store 295(f64v3) 304 - 305:149(f64vec3) Load 270(f64v1) - 306:149(f64vec3) Load 269(f64v2) - 307:149(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 305 306 - Store 295(f64v3) 307 - 308:149(f64vec3) Load 270(f64v1) - 309:26(float64_t) Load 291(f64) - 310:149(f64vec3) CompositeConstruct 309 309 309 - 311:149(f64vec3) ExtInst 1(GLSL.std.450) 40(FMax) 308 310 - Store 295(f64v3) 311 - 312:149(f64vec3) Load 270(f64v1) - 313:26(float64_t) Load 291(f64) - 314: 33(ptr) AccessChain 269(f64v2) 32 - 315:26(float64_t) Load 314 - 316:149(f64vec3) CompositeConstruct 313 313 313 - 317:149(f64vec3) CompositeConstruct 315 315 315 - 318:149(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 312 316 317 - Store 295(f64v3) 318 - 319:149(f64vec3) Load 270(f64v1) - 320:149(f64vec3) Load 269(f64v2) - 321:26(float64_t) Load 291(f64) - 322:149(f64vec3) CompositeConstruct 321 321 321 - 323:149(f64vec3) ExtInst 1(GLSL.std.450) 43(FClamp) 319 320 322 - Store 295(f64v3) 323 - 324:149(f64vec3) Load 270(f64v1) - 325:149(f64vec3) Load 269(f64v2) - 326:26(float64_t) Load 291(f64) - 327:149(f64vec3) CompositeConstruct 326 326 326 - 328:149(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 324 325 327 - Store 295(f64v3) 328 - 329:149(f64vec3) Load 270(f64v1) - 330:149(f64vec3) Load 269(f64v2) - 331:149(f64vec3) Load 295(f64v3) - 332:149(f64vec3) ExtInst 1(GLSL.std.450) 46(FMix) 329 330 331 - Store 295(f64v3) 332 - 333:149(f64vec3) Load 270(f64v1) - 334:149(f64vec3) Load 269(f64v2) - 336: 152(bvec3) Load 335(bv) - 337:149(f64vec3) Select 336 334 333 - Store 295(f64v3) 337 - 338:149(f64vec3) Load 270(f64v1) - 339:149(f64vec3) Load 269(f64v2) - 340:149(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 338 339 - Store 295(f64v3) 340 - 341:26(float64_t) Load 291(f64) - 342:149(f64vec3) Load 295(f64v3) - 343:149(f64vec3) CompositeConstruct 341 341 341 - 344:149(f64vec3) ExtInst 1(GLSL.std.450) 48(Step) 343 342 - Store 295(f64v3) 344 - 345:149(f64vec3) Load 270(f64v1) - 346:149(f64vec3) Load 269(f64v2) - 347:149(f64vec3) Load 295(f64v3) - 348:149(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 345 346 347 - Store 295(f64v3) 348 - 349:26(float64_t) Load 291(f64) - 350: 33(ptr) AccessChain 270(f64v1) 32 - 351:26(float64_t) Load 350 - 352:149(f64vec3) Load 269(f64v2) - 353:149(f64vec3) CompositeConstruct 349 349 349 - 354:149(f64vec3) CompositeConstruct 351 351 351 - 355:149(f64vec3) ExtInst 1(GLSL.std.450) 49(SmoothStep) 353 354 352 - Store 295(f64v3) 355 - 357:26(float64_t) Load 291(f64) - 358: 107(bool) IsNan 357 - Store 356(b) 358 - 359:149(f64vec3) Load 270(f64v1) - 360: 152(bvec3) IsInf 359 - Store 335(bv) 360 - 361:149(f64vec3) Load 270(f64v1) - 362:149(f64vec3) Load 269(f64v2) - 363:149(f64vec3) Load 295(f64v3) - 364:149(f64vec3) ExtInst 1(GLSL.std.450) 50(Fma) 361 362 363 - Store 295(f64v3) 364 - 365:149(f64vec3) Load 270(f64v1) - 368:367(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 365 - 369: 183(ivec3) CompositeExtract 368 1 - Store 366(iv) 369 - 370:149(f64vec3) CompositeExtract 368 0 - Store 269(f64v2) 370 - 371:149(f64vec3) Load 270(f64v1) - 372: 183(ivec3) Load 366(iv) - 373:149(f64vec3) ExtInst 1(GLSL.std.450) 53(Ldexp) 371 372 - Store 269(f64v2) 373 + 326(f64): 31(ptr) Variable Function + 327(f64v1): 148(ptr) Variable Function + 331(f64v2): 148(ptr) Variable Function + 337(f64v3): 148(ptr) Variable Function + 328:147(f64vec3) Load 327(f64v1) + 329:24(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 328 + Store 326(f64) 329 + 330:147(f64vec3) Load 327(f64v1) + 332:147(f64vec3) Load 331(f64v2) + 333:24(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 330 332 + Store 326(f64) 333 + 334:147(f64vec3) Load 327(f64v1) + 335:147(f64vec3) Load 331(f64v2) + 336:24(float64_t) Dot 334 335 + Store 326(f64) 336 + 338:147(f64vec3) Load 327(f64v1) + 339:147(f64vec3) Load 331(f64v2) + 340:147(f64vec3) ExtInst 1(GLSL.std.450) 68(Cross) 338 339 + Store 337(f64v3) 340 + 341:147(f64vec3) Load 327(f64v1) + 342:147(f64vec3) ExtInst 1(GLSL.std.450) 69(Normalize) 341 + Store 331(f64v2) 342 + 343:147(f64vec3) Load 327(f64v1) + 344:147(f64vec3) Load 331(f64v2) + 345:147(f64vec3) Load 337(f64v3) + 346:147(f64vec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 343 344 345 + Store 337(f64v3) 346 + 347:147(f64vec3) Load 327(f64v1) + 348:147(f64vec3) Load 331(f64v2) + 349:147(f64vec3) ExtInst 1(GLSL.std.450) 71(Reflect) 347 348 + Store 337(f64v3) 349 + 350:147(f64vec3) Load 327(f64v1) + 351:147(f64vec3) Load 331(f64v2) + 352:24(float64_t) Load 326(f64) + 353:147(f64vec3) ExtInst 1(GLSL.std.450) 72(Refract) 350 351 352 + Store 337(f64v3) 353 Return FunctionEnd -18(builtinGeometryFuncs(): 2 Function None 3 +18(builtinMatrixFuncs(): 2 Function None 3 19: Label - 374(f64): 33(ptr) Variable Function - 375(f64v1): 150(ptr) Variable Function - 379(f64v2): 150(ptr) Variable Function - 385(f64v3): 150(ptr) Variable Function - 376:149(f64vec3) Load 375(f64v1) - 377:26(float64_t) ExtInst 1(GLSL.std.450) 66(Length) 376 - Store 374(f64) 377 - 378:149(f64vec3) Load 375(f64v1) - 380:149(f64vec3) Load 379(f64v2) - 381:26(float64_t) ExtInst 1(GLSL.std.450) 67(Distance) 378 380 - Store 374(f64) 381 - 382:149(f64vec3) Load 375(f64v1) - 383:149(f64vec3) Load 379(f64v2) - 384:26(float64_t) Dot 382 383 - Store 374(f64) 384 - 386:149(f64vec3) Load 375(f64v1) - 387:149(f64vec3) Load 379(f64v2) - 388:149(f64vec3) ExtInst 1(GLSL.std.450) 68(Cross) 386 387 - Store 385(f64v3) 388 - 389:149(f64vec3) Load 375(f64v1) - 390:149(f64vec3) ExtInst 1(GLSL.std.450) 69(Normalize) 389 - Store 379(f64v2) 390 - 391:149(f64vec3) Load 375(f64v1) - 392:149(f64vec3) Load 379(f64v2) - 393:149(f64vec3) Load 385(f64v3) - 394:149(f64vec3) ExtInst 1(GLSL.std.450) 70(FaceForward) 391 392 393 - Store 385(f64v3) 394 - 395:149(f64vec3) Load 375(f64v1) - 396:149(f64vec3) Load 379(f64v2) - 397:149(f64vec3) ExtInst 1(GLSL.std.450) 71(Reflect) 395 396 - Store 385(f64v3) 397 - 398:149(f64vec3) Load 375(f64v1) - 399:149(f64vec3) Load 379(f64v2) - 400:26(float64_t) Load 374(f64) - 401:149(f64vec3) ExtInst 1(GLSL.std.450) 72(Refract) 398 399 400 - Store 385(f64v3) 401 + 356(f64m3): 355(ptr) Variable Function + 357(f64m1): 355(ptr) Variable Function + 359(f64m2): 355(ptr) Variable Function + 368(f64v1): 148(ptr) Variable Function + 370(f64v2): 26(ptr) Variable Function + 375(f64m4): 374(ptr) Variable Function + 378(f64): 31(ptr) Variable Function + 381(f64m5): 380(ptr) Variable Function + 387(f64m6): 386(ptr) Variable Function + 388(f64m7): 386(ptr) Variable Function + 358: 354 Load 357(f64m1) + 360: 354 Load 359(f64m2) + 361:147(f64vec3) CompositeExtract 358 0 + 362:147(f64vec3) CompositeExtract 360 0 + 363:147(f64vec3) FMul 361 362 + 364:147(f64vec3) CompositeExtract 358 1 + 365:147(f64vec3) CompositeExtract 360 1 + 366:147(f64vec3) FMul 364 365 + 367: 354 CompositeConstruct 363 366 + Store 356(f64m3) 367 + 369:147(f64vec3) Load 368(f64v1) + 371: 25(f64vec2) Load 370(f64v2) + 372: 354 OuterProduct 369 371 + Store 357(f64m1) 372 + 376: 354 Load 357(f64m1) + 377: 373 Transpose 376 + Store 375(f64m4) 377 + 382: 379 Load 381(f64m5) + 383:24(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 382 + Store 378(f64) 383 + 389: 385 Load 388(f64m7) + 390: 385 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 389 + Store 387(f64m6) 390 Return FunctionEnd -20(builtinMatrixFuncs(): 2 Function None 3 +20(builtinVecRelFuncs(): 2 Function None 3 21: Label - 404(f64m3): 403(ptr) Variable Function - 405(f64m1): 403(ptr) Variable Function - 407(f64m2): 403(ptr) Variable Function - 416(f64v1): 150(ptr) Variable Function - 418(f64v2): 28(ptr) Variable Function - 423(f64m4): 422(ptr) Variable Function - 426(f64): 33(ptr) Variable Function - 429(f64m5): 428(ptr) Variable Function - 434(f64m6): 433(ptr) Variable Function - 435(f64m7): 433(ptr) Variable Function - 406: 402 Load 405(f64m1) - 408: 402 Load 407(f64m2) - 409:149(f64vec3) CompositeExtract 406 0 - 410:149(f64vec3) CompositeExtract 408 0 - 411:149(f64vec3) FMul 409 410 - 412:149(f64vec3) CompositeExtract 406 1 - 413:149(f64vec3) CompositeExtract 408 1 - 414:149(f64vec3) FMul 412 413 - 415: 402 CompositeConstruct 411 414 - Store 404(f64m3) 415 - 417:149(f64vec3) Load 416(f64v1) - 419: 27(f64vec2) Load 418(f64v2) - 420: 402 OuterProduct 417 419 - Store 405(f64m1) 420 - 424: 402 Load 405(f64m1) - 425: 421 Transpose 424 - Store 423(f64m4) 425 - 430: 427 Load 429(f64m5) - 431:26(float64_t) ExtInst 1(GLSL.std.450) 33(Determinant) 430 - Store 426(f64) 431 - 436: 432 Load 435(f64m7) - 437: 432 ExtInst 1(GLSL.std.450) 34(MatrixInverse) 436 - Store 434(f64m6) 437 + 391(bv): 151(ptr) Variable Function + 392(f64v1): 148(ptr) Variable Function + 394(f64v2): 148(ptr) Variable Function + 393:147(f64vec3) Load 392(f64v1) + 395:147(f64vec3) Load 394(f64v2) + 396: 150(bvec3) FOrdLessThan 393 395 + Store 391(bv) 396 + 397:147(f64vec3) Load 392(f64v1) + 398:147(f64vec3) Load 394(f64v2) + 399: 150(bvec3) FOrdLessThanEqual 397 398 + Store 391(bv) 399 + 400:147(f64vec3) Load 392(f64v1) + 401:147(f64vec3) Load 394(f64v2) + 402: 150(bvec3) FOrdGreaterThan 400 401 + Store 391(bv) 402 + 403:147(f64vec3) Load 392(f64v1) + 404:147(f64vec3) Load 394(f64v2) + 405: 150(bvec3) FOrdGreaterThanEqual 403 404 + Store 391(bv) 405 + 406:147(f64vec3) Load 392(f64v1) + 407:147(f64vec3) Load 394(f64v2) + 408: 150(bvec3) FOrdEqual 406 407 + Store 391(bv) 408 + 409:147(f64vec3) Load 392(f64v1) + 410:147(f64vec3) Load 394(f64v2) + 411: 150(bvec3) FUnordNotEqual 409 410 + Store 391(bv) 411 Return FunctionEnd -22(builtinVecRelFuncs(): 2 Function None 3 +22(builtinFragProcFuncs(): 2 Function None 3 23: Label - 438(bv): 153(ptr) Variable Function - 439(f64v1): 150(ptr) Variable Function - 441(f64v2): 150(ptr) Variable Function - 440:149(f64vec3) Load 439(f64v1) - 442:149(f64vec3) Load 441(f64v2) - 443: 152(bvec3) FOrdLessThan 440 442 - Store 438(bv) 443 - 444:149(f64vec3) Load 439(f64v1) - 445:149(f64vec3) Load 441(f64v2) - 446: 152(bvec3) FOrdLessThanEqual 444 445 - Store 438(bv) 446 - 447:149(f64vec3) Load 439(f64v1) - 448:149(f64vec3) Load 441(f64v2) - 449: 152(bvec3) FOrdGreaterThan 447 448 - Store 438(bv) 449 - 450:149(f64vec3) Load 439(f64v1) - 451:149(f64vec3) Load 441(f64v2) - 452: 152(bvec3) FOrdGreaterThanEqual 450 451 - Store 438(bv) 452 - 453:149(f64vec3) Load 439(f64v1) - 454:149(f64vec3) Load 441(f64v2) - 455: 152(bvec3) FOrdEqual 453 454 - Store 438(bv) 455 - 456:149(f64vec3) Load 439(f64v1) - 457:149(f64vec3) Load 441(f64v2) - 458: 152(bvec3) FUnordNotEqual 456 457 - Store 438(bv) 458 - Return - FunctionEnd -24(builtinFragProcFuncs(): 2 Function None 3 - 25: Label - 459(f64v): 150(ptr) Variable Function - 463: 462(ptr) AccessChain 461(if64v) 32 - 464:26(float64_t) Load 463 - 465:26(float64_t) DPdx 464 - 466: 33(ptr) AccessChain 459(f64v) 32 - Store 466 465 - 467: 462(ptr) AccessChain 461(if64v) 88 - 468:26(float64_t) Load 467 - 469:26(float64_t) DPdy 468 - 470: 33(ptr) AccessChain 459(f64v) 88 - Store 470 469 - 471:149(f64vec3) Load 461(if64v) - 472: 27(f64vec2) VectorShuffle 471 471 0 1 - 473: 27(f64vec2) DPdxFine 472 - 474: 33(ptr) AccessChain 459(f64v) 32 - 475:26(float64_t) CompositeExtract 473 0 - Store 474 475 - 476: 33(ptr) AccessChain 459(f64v) 88 - 477:26(float64_t) CompositeExtract 473 1 - Store 476 477 - 478:149(f64vec3) Load 461(if64v) - 479: 27(f64vec2) VectorShuffle 478 478 0 1 - 480: 27(f64vec2) DPdyFine 479 - 481: 33(ptr) AccessChain 459(f64v) 32 - 482:26(float64_t) CompositeExtract 480 0 - Store 481 482 - 483: 33(ptr) AccessChain 459(f64v) 88 - 484:26(float64_t) CompositeExtract 480 1 - Store 483 484 - 485:149(f64vec3) Load 461(if64v) - 486:149(f64vec3) DPdxCoarse 485 - Store 459(f64v) 486 - 487:149(f64vec3) Load 461(if64v) - 488:149(f64vec3) DPdxCoarse 487 - Store 459(f64v) 488 - 489: 462(ptr) AccessChain 461(if64v) 32 - 490:26(float64_t) Load 489 - 491:26(float64_t) Fwidth 490 - 492: 33(ptr) AccessChain 459(f64v) 32 - Store 492 491 - 493:149(f64vec3) Load 461(if64v) - 494: 27(f64vec2) VectorShuffle 493 493 0 1 - 495: 27(f64vec2) FwidthFine 494 - 496: 33(ptr) AccessChain 459(f64v) 32 - 497:26(float64_t) CompositeExtract 495 0 - Store 496 497 - 498: 33(ptr) AccessChain 459(f64v) 88 - 499:26(float64_t) CompositeExtract 495 1 - Store 498 499 - 500:149(f64vec3) Load 461(if64v) - 501:149(f64vec3) FwidthCoarse 500 - Store 459(f64v) 501 - 502: 462(ptr) AccessChain 461(if64v) 32 - 503:26(float64_t) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 502 - 504: 33(ptr) AccessChain 459(f64v) 32 - Store 504 503 - 506:149(f64vec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 461(if64v) 505 - 507: 27(f64vec2) VectorShuffle 506 506 0 1 - 508: 33(ptr) AccessChain 459(f64v) 32 - 509:26(float64_t) CompositeExtract 507 0 - Store 508 509 - 510: 33(ptr) AccessChain 459(f64v) 88 - 511:26(float64_t) CompositeExtract 507 1 - Store 510 511 - 514:149(f64vec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 461(if64v) 513 - Store 459(f64v) 514 + 412(f64v): 148(ptr) Variable Function + 416: 415(ptr) AccessChain 414(if64v) 30 + 417:24(float64_t) Load 416 + 418:24(float64_t) DPdx 417 + 419: 31(ptr) AccessChain 412(f64v) 30 + Store 419 418 + 420: 415(ptr) AccessChain 414(if64v) 86 + 421:24(float64_t) Load 420 + 422:24(float64_t) DPdy 421 + 423: 31(ptr) AccessChain 412(f64v) 86 + Store 423 422 + 424:147(f64vec3) Load 414(if64v) + 425: 25(f64vec2) VectorShuffle 424 424 0 1 + 426: 25(f64vec2) DPdxFine 425 + 427: 31(ptr) AccessChain 412(f64v) 30 + 428:24(float64_t) CompositeExtract 426 0 + Store 427 428 + 429: 31(ptr) AccessChain 412(f64v) 86 + 430:24(float64_t) CompositeExtract 426 1 + Store 429 430 + 431:147(f64vec3) Load 414(if64v) + 432: 25(f64vec2) VectorShuffle 431 431 0 1 + 433: 25(f64vec2) DPdyFine 432 + 434: 31(ptr) AccessChain 412(f64v) 30 + 435:24(float64_t) CompositeExtract 433 0 + Store 434 435 + 436: 31(ptr) AccessChain 412(f64v) 86 + 437:24(float64_t) CompositeExtract 433 1 + Store 436 437 + 438:147(f64vec3) Load 414(if64v) + 439:147(f64vec3) DPdxCoarse 438 + Store 412(f64v) 439 + 440:147(f64vec3) Load 414(if64v) + 441:147(f64vec3) DPdxCoarse 440 + Store 412(f64v) 441 + 442: 415(ptr) AccessChain 414(if64v) 30 + 443:24(float64_t) Load 442 + 444:24(float64_t) Fwidth 443 + 445: 31(ptr) AccessChain 412(f64v) 30 + Store 445 444 + 446:147(f64vec3) Load 414(if64v) + 447: 25(f64vec2) VectorShuffle 446 446 0 1 + 448: 25(f64vec2) FwidthFine 447 + 449: 31(ptr) AccessChain 412(f64v) 30 + 450:24(float64_t) CompositeExtract 448 0 + Store 449 450 + 451: 31(ptr) AccessChain 412(f64v) 86 + 452:24(float64_t) CompositeExtract 448 1 + Store 451 452 + 453:147(f64vec3) Load 414(if64v) + 454:147(f64vec3) FwidthCoarse 453 + Store 412(f64v) 454 + 455: 415(ptr) AccessChain 414(if64v) 30 + 456:24(float64_t) ExtInst 1(GLSL.std.450) 76(InterpolateAtCentroid) 455 + 457: 31(ptr) AccessChain 412(f64v) 30 + Store 457 456 + 459:147(f64vec3) ExtInst 1(GLSL.std.450) 77(InterpolateAtSample) 414(if64v) 458 + 460: 25(f64vec2) VectorShuffle 459 459 0 1 + 461: 31(ptr) AccessChain 412(f64v) 30 + 462:24(float64_t) CompositeExtract 460 0 + Store 461 462 + 463: 31(ptr) AccessChain 412(f64v) 86 + 464:24(float64_t) CompositeExtract 460 1 + Store 463 464 + 467:147(f64vec3) ExtInst 1(GLSL.std.450) 78(InterpolateAtOffset) 414(if64v) 466 + Store 412(f64v) 467 Return FunctionEnd diff --git a/Test/spv.float64.frag b/Test/spv.float64.frag index faaac236..6e9f22df 100644 --- a/Test/spv.float64.frag +++ b/Test/spv.float64.frag @@ -127,36 +127,12 @@ void typeCast() u64v = u64vec3(f64v); // float64 -> uint64 } -void builtinAngleTrigFuncs() -{ - f64vec4 f64v1, f64v2; +// Trig, pow, exp and log are not supported for f64 - f64v2 = radians(f64v1); - f64v2 = degrees(f64v1); - f64v2 = sin(f64v1); - f64v2 = cos(f64v1); - f64v2 = tan(f64v1); - f64v2 = asin(f64v1); - f64v2 = acos(f64v1); - f64v2 = atan(f64v1, f64v2); - f64v2 = atan(f64v1); - f64v2 = sinh(f64v1); - f64v2 = cosh(f64v1); - f64v2 = tanh(f64v1); - f64v2 = asinh(f64v1); - f64v2 = acosh(f64v1); - f64v2 = atanh(f64v1); -} - -void builtinExpFuncs() +void builtinTranscendentalFuncs() { f64vec2 f64v1, f64v2; - f64v2 = pow(f64v1, f64v2); - f64v2 = exp(f64v1); - f64v2 = log(f64v1); - f64v2 = exp2(f64v1); - f64v2 = log2(f64v1); f64v2 = sqrt(f64v1); f64v2 = inversesqrt(f64v1); } diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index b633331a..728cd4a6 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -4159,106 +4159,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "u16vec4 unpack16(uint64_t);" "i32vec2 unpack32(int64_t);" "u32vec2 unpack32(uint64_t);" - - "float64_t radians(float64_t);" - "f64vec2 radians(f64vec2);" - "f64vec3 radians(f64vec3);" - "f64vec4 radians(f64vec4);" - - "float64_t degrees(float64_t);" - "f64vec2 degrees(f64vec2);" - "f64vec3 degrees(f64vec3);" - "f64vec4 degrees(f64vec4);" - - "float64_t sin(float64_t);" - "f64vec2 sin(f64vec2);" - "f64vec3 sin(f64vec3);" - "f64vec4 sin(f64vec4);" - - "float64_t cos(float64_t);" - "f64vec2 cos(f64vec2);" - "f64vec3 cos(f64vec3);" - "f64vec4 cos(f64vec4);" - - "float64_t tan(float64_t);" - "f64vec2 tan(f64vec2);" - "f64vec3 tan(f64vec3);" - "f64vec4 tan(f64vec4);" - - "float64_t asin(float64_t);" - "f64vec2 asin(f64vec2);" - "f64vec3 asin(f64vec3);" - "f64vec4 asin(f64vec4);" - - "float64_t acos(float64_t);" - "f64vec2 acos(f64vec2);" - "f64vec3 acos(f64vec3);" - "f64vec4 acos(f64vec4);" - - "float64_t atan(float64_t, float64_t);" - "f64vec2 atan(f64vec2, f64vec2);" - "f64vec3 atan(f64vec3, f64vec3);" - "f64vec4 atan(f64vec4, f64vec4);" - - "float64_t atan(float64_t);" - "f64vec2 atan(f64vec2);" - "f64vec3 atan(f64vec3);" - "f64vec4 atan(f64vec4);" - - "float64_t sinh(float64_t);" - "f64vec2 sinh(f64vec2);" - "f64vec3 sinh(f64vec3);" - "f64vec4 sinh(f64vec4);" - - "float64_t cosh(float64_t);" - "f64vec2 cosh(f64vec2);" - "f64vec3 cosh(f64vec3);" - "f64vec4 cosh(f64vec4);" - - "float64_t tanh(float64_t);" - "f64vec2 tanh(f64vec2);" - "f64vec3 tanh(f64vec3);" - "f64vec4 tanh(f64vec4);" - - "float64_t asinh(float64_t);" - "f64vec2 asinh(f64vec2);" - "f64vec3 asinh(f64vec3);" - "f64vec4 asinh(f64vec4);" - - "float64_t acosh(float64_t);" - "f64vec2 acosh(f64vec2);" - "f64vec3 acosh(f64vec3);" - "f64vec4 acosh(f64vec4);" - - "float64_t atanh(float64_t);" - "f64vec2 atanh(f64vec2);" - "f64vec3 atanh(f64vec3);" - "f64vec4 atanh(f64vec4);" - - "float64_t pow(float64_t, float64_t);" - "f64vec2 pow(f64vec2, f64vec2);" - "f64vec3 pow(f64vec3, f64vec3);" - "f64vec4 pow(f64vec4, f64vec4);" - - "float64_t exp(float64_t);" - "f64vec2 exp(f64vec2);" - "f64vec3 exp(f64vec3);" - "f64vec4 exp(f64vec4);" - - "float64_t log(float64_t);" - "f64vec2 log(f64vec2);" - "f64vec3 log(f64vec3);" - "f64vec4 log(f64vec4);" - - "float64_t exp2(float64_t);" - "f64vec2 exp2(f64vec2);" - "f64vec3 exp2(f64vec3);" - "f64vec4 exp2(f64vec4);" - - "float64_t log2(float64_t);" - "f64vec2 log2(f64vec2);" - "f64vec3 log2(f64vec3);" - "f64vec4 log2(f64vec4);" "\n"); } From 1de2d1745b1a99fb57a0a75714bfa08acd841427 Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Thu, 29 Jul 2021 10:01:40 +0800 Subject: [PATCH 36/64] To be compatible with Feature: 'last case/default label not followed by statements'. Signed-off-by: ZhiqianXia --- glslang/MachineIndependent/ParseHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index c2b9edcf..a7a9de24 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -9188,11 +9188,14 @@ TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expre // "it is an error to have no statement between a label and the end of the switch statement." // The specifications were updated to remove this (being ill-defined what a "statement" was), // so, this became a warning. However, 3.0 tests still check for the error. - if (isEsProfile() && version <= 300 && ! relaxedErrors()) + if (isEsProfile() && (version <= 300 || version >= 320) && ! relaxedErrors()) + error(loc, "last case/default label not followed by statements", "switch", ""); + else if (!isEsProfile() && (version <= 430 || version >= 460)) error(loc, "last case/default label not followed by statements", "switch", ""); else warn(loc, "last case/default label not followed by statements", "switch", ""); + // emulate a break for error recovery lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc)); lastStatements->setOperator(EOpSequence); From e76116982a45f8d2793d42c2d06bd0b37eb56928 Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Mon, 2 Aug 2021 11:10:33 +0800 Subject: [PATCH 37/64] Add the GL_EXT_shader_integer_mix Preamble for glsl. Signed-off-by: ZhiqianXia --- Test/GL_EXT_shader_integer_mix.vert | 13 +++++ .../GL_EXT_shader_integer_mix.vert.out | 47 +++++++++++++++++++ glslang/MachineIndependent/Versions.cpp | 1 + gtests/AST.FromFile.cpp | 3 +- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 Test/GL_EXT_shader_integer_mix.vert create mode 100644 Test/baseResults/GL_EXT_shader_integer_mix.vert.out diff --git a/Test/GL_EXT_shader_integer_mix.vert b/Test/GL_EXT_shader_integer_mix.vert new file mode 100644 index 00000000..3616e58c --- /dev/null +++ b/Test/GL_EXT_shader_integer_mix.vert @@ -0,0 +1,13 @@ +#version 330 +#extension GL_EXT_shader_integer_mix: require + + +#if !defined GL_EXT_shader_integer_mix +# error GL_EXT_shader_integer_mix is not defined +#elif GL_EXT_shader_integer_mix != 1 +# error GL_EXT_shader_integer_mix is not equal to 1 +#endif + +void main(void) { + gl_Position = vec4(0); +} diff --git a/Test/baseResults/GL_EXT_shader_integer_mix.vert.out b/Test/baseResults/GL_EXT_shader_integer_mix.vert.out new file mode 100644 index 00000000..4a62b579 --- /dev/null +++ b/Test/baseResults/GL_EXT_shader_integer_mix.vert.out @@ -0,0 +1,47 @@ +GL_EXT_shader_integer_mix.vert +Shader version: 330 +Requested GL_EXT_shader_integer_mix +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:12 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +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 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 330 +Requested GL_EXT_shader_integer_mix +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:12 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:12 Constant: +0:12 0 (const uint) +0:12 Constant: +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +0:12 0.000000 +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 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 097ee845..70a5d5e4 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -482,6 +482,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_debug_printf 1\n" "#define GL_EXT_fragment_shading_rate 1\n" "#define GL_EXT_shared_memory_block 1\n" + "#define GL_EXT_shader_integer_mix 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index 6e7a659e..0db97541 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -284,7 +284,8 @@ INSTANTIATE_TEST_SUITE_P( "textureoffset_sampler2darrayshadow.vert", "atomicAdd.comp", "GL_ARB_gpu_shader5.u2i.vert", - "atomicCounterARBOps.vert" + "atomicCounterARBOps.vert", + "GL_EXT_shader_integer_mix.vert" })), FileNameAsCustomTestSuffix ); From 855f4961701415f41dfc9049263af655f5558963 Mon Sep 17 00:00:00 2001 From: Alan Baker Date: Fri, 5 Nov 2021 14:33:31 -0400 Subject: [PATCH 38/64] Update SPIRV-Tools and SPIRV-Headers --- known_good.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/known_good.json b/known_good.json index e1c2ce81..bed5dd80 100644 --- a/known_good.json +++ b/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "1fbed83c8aab8517d821fcb4164c08567951938f" + "commit" : "339d4475c1a806c187c57678af26733575d1cecd" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "449bc986ba6f4c5e10e32828783f9daef2a77644" + "commit" : "29817199b7069bac971e5365d180295d4b077ebe" } ] } From 8092870281ee79e3383a2849764a6ca583bb5816 Mon Sep 17 00:00:00 2001 From: Alan Baker Date: Fri, 5 Nov 2021 14:33:46 -0400 Subject: [PATCH 39/64] Update test expectations --- Test/baseResults/spv.1.4.OpEntryPoint.frag.out | 1 + Test/baseResults/spv.intrinsicsSpirvLiteral.vert.out | 1 + 2 files changed, 2 insertions(+) diff --git a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out index cf5d98a0..2c6e6dcc 100644 --- a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out +++ b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out @@ -1,4 +1,5 @@ spv.1.4.OpEntryPoint.frag +Validation failed // Module Version 10400 // Generated by (magic number): 8000a // Id's are bound by 64 diff --git a/Test/baseResults/spv.intrinsicsSpirvLiteral.vert.out b/Test/baseResults/spv.intrinsicsSpirvLiteral.vert.out index af4ac167..68ad949b 100644 --- a/Test/baseResults/spv.intrinsicsSpirvLiteral.vert.out +++ b/Test/baseResults/spv.intrinsicsSpirvLiteral.vert.out @@ -1,4 +1,5 @@ spv.intrinsicsSpirvLiteral.vert +Validation failed // Module Version 10000 // Generated by (magic number): 8000a // Id's are bound by 12 From 46d3a30bd9b68a30929d7ff1587f1c38f55a04c8 Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Mon, 2 Aug 2021 14:52:11 +0800 Subject: [PATCH 40/64] Support the #extension GL_ARB_draw_instanced. Signed-off-by: ZhiqianXia --- Test/GL_ARB_draw_instanced.vert | 18 ++ .../GL_ARB_draw_instanced.vert.out | 189 ++++++++++++++++++ glslang/MachineIndependent/Versions.cpp | 2 + glslang/MachineIndependent/Versions.h | 1 + gtests/AST.FromFile.cpp | 3 +- 5 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 Test/GL_ARB_draw_instanced.vert create mode 100644 Test/baseResults/GL_ARB_draw_instanced.vert.out diff --git a/Test/GL_ARB_draw_instanced.vert b/Test/GL_ARB_draw_instanced.vert new file mode 100644 index 00000000..6e390866 --- /dev/null +++ b/Test/GL_ARB_draw_instanced.vert @@ -0,0 +1,18 @@ +#version 150 +#extension GL_ARB_draw_instanced : require +#define ID gl_InstanceID + +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform vec3 instanceOffsets[3]; +in vec4 va[gl_MaxVertexAttribs]; +out vec4 color; + +void main (void) +{ + vec4 vertex = vec4(va[0].xy / 3.0, va[0].zw) + vec4(instanceOffsets[ID], 1.0); + color = vec4(0, 0, 0, 0); + for (int i = 1; i < gl_MaxVertexAttribs; i++) + color += va[i]; + gl_Position = gtf_ModelViewProjectionMatrix * vertex; + gl_PointSize = 1.0; +} diff --git a/Test/baseResults/GL_ARB_draw_instanced.vert.out b/Test/baseResults/GL_ARB_draw_instanced.vert.out new file mode 100644 index 00000000..e601bc86 --- /dev/null +++ b/Test/baseResults/GL_ARB_draw_instanced.vert.out @@ -0,0 +1,189 @@ +GL_ARB_draw_instanced.vert +Shader version: 150 +Requested GL_ARB_draw_instanced +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'vertex' ( temp 4-component vector of float) +0:12 add ( temp 4-component vector of float) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 divide ( temp 2-component vector of float) +0:12 vector swizzle ( temp 2-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'va' ( in 64-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Sequence +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3.000000 +0:12 vector swizzle ( temp 2-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'va' ( in 64-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 indirect index ( temp 3-component vector of float) +0:12 'instanceOffsets' ( uniform 3-element array of 3-component vector of float) +0:12 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:12 Constant: +0:12 1.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'color' ( smooth out 4-component vector of float) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 1 (const int) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 Constant: +0:14 64 (const int) +0:14 Loop Body +0:15 add second child into first child ( temp 4-component vector of float) +0:15 'color' ( smooth out 4-component vector of float) +0:15 indirect index ( temp 4-component vector of float) +0:15 'va' ( in 64-element array of 4-component vector of float) +0:15 'i' ( temp int) +0:14 Loop Terminal Expression +0:14 Post-Increment ( temp int) +0:14 'i' ( temp int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:16 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 matrix-times-vector ( temp 4-component vector of float) +0:16 'gtf_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:16 'vertex' ( temp 4-component vector of float) +0:17 move second child to first child ( temp float) +0:17 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:17 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const uint) +0:17 Constant: +0:17 1.000000 +0:? Linker Objects +0:? 'gtf_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:? 'instanceOffsets' ( uniform 3-element array of 3-component vector of float) +0:? 'va' ( in 64-element array of 4-component vector of float) +0:? 'color' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 150 +Requested GL_ARB_draw_instanced +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'vertex' ( temp 4-component vector of float) +0:12 add ( temp 4-component vector of float) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 divide ( temp 2-component vector of float) +0:12 vector swizzle ( temp 2-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'va' ( in 64-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Sequence +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 Constant: +0:12 3.000000 +0:12 vector swizzle ( temp 2-component vector of float) +0:12 direct index ( temp 4-component vector of float) +0:12 'va' ( in 64-element array of 4-component vector of float) +0:12 Constant: +0:12 0 (const int) +0:12 Sequence +0:12 Constant: +0:12 2 (const int) +0:12 Constant: +0:12 3 (const int) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 indirect index ( temp 3-component vector of float) +0:12 'instanceOffsets' ( uniform 3-element array of 3-component vector of float) +0:12 'gl_InstanceID' ( gl_InstanceId int InstanceId) +0:12 Constant: +0:12 1.000000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 'color' ( smooth out 4-component vector of float) +0:13 Constant: +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:13 0.000000 +0:14 Sequence +0:14 Sequence +0:14 move second child to first child ( temp int) +0:14 'i' ( temp int) +0:14 Constant: +0:14 1 (const int) +0:14 Loop with condition tested first +0:14 Loop Condition +0:14 Compare Less Than ( temp bool) +0:14 'i' ( temp int) +0:14 Constant: +0:14 64 (const int) +0:14 Loop Body +0:15 add second child into first child ( temp 4-component vector of float) +0:15 'color' ( smooth out 4-component vector of float) +0:15 indirect index ( temp 4-component vector of float) +0:15 'va' ( in 64-element array of 4-component vector of float) +0:15 'i' ( temp int) +0:14 Loop Terminal Expression +0:14 Post-Increment ( temp int) +0:14 'i' ( temp int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:16 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 matrix-times-vector ( temp 4-component vector of float) +0:16 'gtf_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:16 'vertex' ( temp 4-component vector of float) +0:17 move second child to first child ( temp float) +0:17 gl_PointSize: direct index for structure ( gl_PointSize float PointSize) +0:17 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 1 (const uint) +0:17 Constant: +0:17 1.000000 +0:? Linker Objects +0:? 'gtf_ModelViewProjectionMatrix' ( uniform 4X4 matrix of float) +0:? 'instanceOffsets' ( uniform 3-element array of 3-component vector of float) +0:? 'va' ( in 64-element array of 4-component vector of float) +0:? 'color' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 70a5d5e4..2fc0d9e0 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -225,6 +225,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_shading_language_packing] = EBhDisable; extensionBehavior[E_GL_ARB_texture_query_lod] = EBhDisable; extensionBehavior[E_GL_ARB_vertex_attrib_64bit] = EBhDisable; + extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable; @@ -465,6 +466,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_ARB_shader_storage_buffer_object 1\n" "#define GL_ARB_texture_query_lod 1\n" "#define GL_ARB_vertex_attrib_64bit 1\n" + "#define GL_ARB_draw_instanced 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" "#define GL_EXT_post_depth_coverage 1\n" diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index 949a7a17..2dbac0b4 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -161,6 +161,7 @@ const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_language_packing"; const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod"; const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_64bit"; +const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; const char* const E_GL_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic"; const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote"; diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index 0db97541..f9680dd6 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -285,7 +285,8 @@ INSTANTIATE_TEST_SUITE_P( "atomicAdd.comp", "GL_ARB_gpu_shader5.u2i.vert", "atomicCounterARBOps.vert", - "GL_EXT_shader_integer_mix.vert" + "GL_EXT_shader_integer_mix.vert", + "GL_ARB_draw_instanced.vert", })), FileNameAsCustomTestSuffix ); From 5ec47530b7c3251cbfcd48bc1f711b75564fb7c7 Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 8 Nov 2021 10:48:38 +0100 Subject: [PATCH 41/64] Add support for targeting Vulkan 1.2 in the C API --- glslang/CInterface/glslang_c_interface.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glslang/CInterface/glslang_c_interface.cpp b/glslang/CInterface/glslang_c_interface.cpp index 2e04f53a..4fdeff7a 100644 --- a/glslang/CInterface/glslang_c_interface.cpp +++ b/glslang/CInterface/glslang_c_interface.cpp @@ -269,6 +269,8 @@ static glslang::EShTargetClientVersion c_shader_client_version(glslang_target_cl switch (client_version) { case GLSLANG_TARGET_VULKAN_1_1: return glslang::EShTargetVulkan_1_1; + case GLSLANG_TARGET_VULKAN_1_2: + return glslang::EShTargetVulkan_1_2; case GLSLANG_TARGET_OPENGL_450: return glslang::EShTargetOpenGL_450; default: From 3971424207e27a662d4416eedfb68e18ff287350 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 8 Nov 2021 14:47:32 +0100 Subject: [PATCH 42/64] Initialize global mutex in a thread-safe manner Currently, ShInitialize() and friends call glslang::InitGlobalLock() which *overwrites* the global mutex. As such, even though it ostensibly takes a mutex, this function is actually completely thread-unsafe. Fix it by using pthread_once to ensure the mutex is only initialized once, and then never again. --- glslang/OSDependent/Unix/ossource.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/glslang/OSDependent/Unix/ossource.cpp b/glslang/OSDependent/Unix/ossource.cpp index 3f029f02..81da99c2 100644 --- a/glslang/OSDependent/Unix/ossource.cpp +++ b/glslang/OSDependent/Unix/ossource.cpp @@ -172,7 +172,7 @@ namespace { pthread_mutex_t gMutex; } -void InitGlobalLock() +static void InitMutex(void) { pthread_mutexattr_t mutexattr; pthread_mutexattr_init(&mutexattr); @@ -180,6 +180,12 @@ void InitGlobalLock() pthread_mutex_init(&gMutex, &mutexattr); } +void InitGlobalLock() +{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + pthread_once(&once, InitMutex); +} + void GetGlobalLock() { pthread_mutex_lock(&gMutex); From 4302d51868daa94e81d3002073e9265397b2e444 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 8 Nov 2021 14:58:50 +0100 Subject: [PATCH 43/64] Don't release global mutex before initialize/finalize is done Otherwise this can race with other threads for access to the fields it's supposed to be initializing/finalizing. For example, imagine another thread is calling ShInitialize() while the first thread is calling ShFinalize() - the finalize function would destroy the state at the same time as the initialize function is trying to initialize it. Holding on to the global lock for the entire function prevents all of these failure modes. --- glslang/MachineIndependent/ShaderLang.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index d02eae6f..a2dd71cf 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1343,7 +1343,6 @@ int ShInitialize() glslang::GetGlobalLock(); ++NumberOfClients; - glslang::ReleaseGlobalLock(); if (PerProcessGPA == nullptr) PerProcessGPA = new TPoolAllocator(); @@ -1353,6 +1352,7 @@ int ShInitialize() glslang::HlslScanContext::fillInKeywordMap(); #endif + glslang::ReleaseGlobalLock(); return 1; } @@ -1415,9 +1415,10 @@ int ShFinalize() --NumberOfClients; assert(NumberOfClients >= 0); bool finalize = NumberOfClients == 0; - glslang::ReleaseGlobalLock(); - if (! finalize) + if (! finalize) { + glslang::ReleaseGlobalLock(); return 1; + } for (int version = 0; version < VersionCount; ++version) { for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) { @@ -1455,6 +1456,7 @@ int ShFinalize() glslang::HlslScanContext::deleteKeywordMap(); #endif + glslang::ReleaseGlobalLock(); return 1; } From 13fd2d6470352b052ba1401b48f55d48c1e73a8e Mon Sep 17 00:00:00 2001 From: Kevin McCullough Date: Wed, 13 Oct 2021 15:28:45 -0700 Subject: [PATCH 44/64] Fix incorrect link time validation for unused gl_PerVertex members --- .../link.redeclareBuiltin.vert.out | 154 ++++++++++++++++++ Test/link.redeclareBuiltin.geom | 23 +++ Test/link.redeclareBuiltin.vert | 11 ++ glslang/Include/Types.h | 12 +- glslang/MachineIndependent/linkValidate.cpp | 18 +- gtests/Link.FromFile.cpp | 1 + 6 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 Test/baseResults/link.redeclareBuiltin.vert.out create mode 100644 Test/link.redeclareBuiltin.geom create mode 100644 Test/link.redeclareBuiltin.vert diff --git a/Test/baseResults/link.redeclareBuiltin.vert.out b/Test/baseResults/link.redeclareBuiltin.vert.out new file mode 100644 index 00000000..2cd42b9e --- /dev/null +++ b/Test/baseResults/link.redeclareBuiltin.vert.out @@ -0,0 +1,154 @@ +link.redeclareBuiltin.vert +Shader version: 410 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +link.redeclareBuiltin.geom +Shader version: 410 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:13 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:13 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:13 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:14 EmitVertex ( global void) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:16 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:16 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:16 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 EmitVertex ( global void) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:19 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 0 (const uint) +0:19 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:19 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:20 EmitVertex ( global void) +0:22 EndPrimitive ( global void) +0:? Linker Objects +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +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 1-element array of float ClipDistance gl_ClipDistance}) + + +Linked vertex stage: + + +Linked geometry stage: + + +Shader version: 410 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 410 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:11 Function Definition: main( ( global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:13 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:13 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:13 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:13 Constant: +0:13 0 (const int) +0:13 Constant: +0:13 0 (const int) +0:14 EmitVertex ( global void) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:16 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:16 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:16 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:16 Constant: +0:16 1 (const int) +0:16 Constant: +0:16 0 (const int) +0:17 EmitVertex ( global void) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:19 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:19 Constant: +0:19 0 (const uint) +0:19 gl_Position: direct index for structure ( in 4-component vector of float Position) +0:19 direct index ( temp block{ in 4-component vector of float Position gl_Position}) +0:19 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +0:19 Constant: +0:19 2 (const int) +0:19 Constant: +0:19 0 (const int) +0:20 EmitVertex ( global void) +0:22 EndPrimitive ( global void) +0:? Linker Objects +0:? 'gl_in' ( in 3-element array of block{ in 4-component vector of float Position gl_Position}) +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 1-element array of float ClipDistance gl_ClipDistance}) + diff --git a/Test/link.redeclareBuiltin.geom b/Test/link.redeclareBuiltin.geom new file mode 100644 index 00000000..a2ceff68 --- /dev/null +++ b/Test/link.redeclareBuiltin.geom @@ -0,0 +1,23 @@ +#version 410 + +layout(triangles) in; +layout(triangle_strip, max_vertices=3) out; + +in gl_PerVertex +{ + vec4 gl_Position; +} gl_in[]; + +void main() +{ + gl_Position = gl_in[0].gl_Position; + EmitVertex(); + + gl_Position = gl_in[1].gl_Position; + EmitVertex(); + + gl_Position = gl_in[2].gl_Position; + EmitVertex(); + + EndPrimitive(); +} \ No newline at end of file diff --git a/Test/link.redeclareBuiltin.vert b/Test/link.redeclareBuiltin.vert new file mode 100644 index 00000000..7cda45c4 --- /dev/null +++ b/Test/link.redeclareBuiltin.vert @@ -0,0 +1,11 @@ +#version 410 + +out gl_PerVertex +{ + vec4 gl_Position; +}; + +void main() +{ + gl_Position = vec4(1.0); +} \ No newline at end of file diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index f4f3f341..e87f2583 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -2469,6 +2469,14 @@ public: if (*(*structure)[li].type != *(*right.structure)[ri].type) return false; } else { + // Skip hidden members + if ((*structure)[li].type->hiddenMember()) { + ri--; + continue; + } else if ((*right.structure)[ri].type->hiddenMember()) { + li--; + continue; + } // If one of the members is something that's inconsistently declared, skip over it // for now. if (isGLPerVertex) { @@ -2485,10 +2493,10 @@ public: } // If we get here, then there should only be inconsistently declared members left } else if (li < structure->size()) { - if (!isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName())) + if (!(*structure)[li].type->hiddenMember() && !isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName())) return false; } else { - if (!isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName())) + if (!(*right.structure)[ri].type->hiddenMember() && !isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName())) return false; } } diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 4edd2a90..c4335212 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -858,9 +858,19 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock && symbol.getType().getStruct() && unitSymbol.getType().getStruct() && symbol.getType().sameStructType(unitSymbol.getType())) { - for (unsigned int i = 0; i < symbol.getType().getStruct()->size(); ++i) { - const TQualifier& qualifier = (*symbol.getType().getStruct())[i].type->getQualifier(); - const TQualifier& unitQualifier = (*unitSymbol.getType().getStruct())[i].type->getQualifier(); + unsigned int li = 0; + unsigned int ri = 0; + while (li < symbol.getType().getStruct()->size() && ri < unitSymbol.getType().getStruct()->size()) { + if ((*symbol.getType().getStruct())[li].type->hiddenMember()) { + ++li; + continue; + } + if ((*unitSymbol.getType().getStruct())[ri].type->hiddenMember()) { + ++ri; + continue; + } + const TQualifier& qualifier = (*symbol.getType().getStruct())[li].type->getQualifier(); + const TQualifier & unitQualifier = (*unitSymbol.getType().getStruct())[ri].type->getQualifier(); if (qualifier.layoutMatrix != unitQualifier.layoutMatrix || qualifier.layoutOffset != unitQualifier.layoutOffset || qualifier.layoutAlign != unitQualifier.layoutAlign || @@ -869,6 +879,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy error(infoSink, "Interface block member layout qualifiers must match:"); writeTypeComparison = true; } + ++li; + ++ri; } } diff --git a/gtests/Link.FromFile.cpp b/gtests/Link.FromFile.cpp index a83d49d9..9e029fc7 100644 --- a/gtests/Link.FromFile.cpp +++ b/gtests/Link.FromFile.cpp @@ -108,6 +108,7 @@ INSTANTIATE_TEST_SUITE_P( {"link.multiBlocksValid.1.0.vert", "link.multiBlocksValid.1.1.vert"}, {"link.tesselation.vert", "link.tesselation.frag"}, {"link.tesselation.tese", "link.tesselation.tesc"}, + {"link.redeclareBuiltin.vert", "link.redeclareBuiltin.geom"}, })) ); // clang-format on From d1ee644e1d8f25c6dba8c00e4839b2c0380e9949 Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Tue, 9 Nov 2021 16:31:22 +0100 Subject: [PATCH 45/64] Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding There were two implementations of isInf() and isNan(), in Constant.cpp and in intermOut.cpp. The former only works on little-endian systems, the latter is a wrapper for library functions and works regardless of endianness. Move the second version into Common.h and adopt it in both places. Thereby avoid the duplication and fix for big-endian systems. On s390x, this fixes the test case Glsl/CompileToAstTest.FromFile/constFold_frag. Fixes #2802 --- glslang/Include/Common.h | 29 +++++++++++++++++++++ glslang/MachineIndependent/Constant.cpp | 33 ++---------------------- glslang/MachineIndependent/intermOut.cpp | 31 ---------------------- 3 files changed, 31 insertions(+), 62 deletions(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index e7b5e072..a24977f8 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -302,6 +303,34 @@ template int IntLog2(T n) return result; } +inline bool IsInfinity(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_NINF: + case _FPCLASS_PINF: + return true; + default: + return false; + } +#else + return std::isinf(x); +#endif +} + +inline bool IsNan(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_SNAN: + case _FPCLASS_QNAN: + return true; + default: + return false; + } +#else + return std::isnan(x); +#endif +} + } // end namespace glslang #endif // _COMMON_INCLUDED_ diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index 7f5d4c4f..5fc61dbb 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -46,35 +46,6 @@ namespace { using namespace glslang; -typedef union { - double d; - int i[2]; -} DoubleIntUnion; - -// Some helper functions - -bool isNan(double x) -{ - DoubleIntUnion u; - // tough to find a platform independent library function, do it directly - u.d = x; - int bitPatternL = u.i[0]; - int bitPatternH = u.i[1]; - return (bitPatternH & 0x7ff80000) == 0x7ff80000 && - ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0); -} - -bool isInf(double x) -{ - DoubleIntUnion u; - // tough to find a platform independent library function, do it directly - u.d = x; - int bitPatternL = u.i[0]; - int bitPatternH = u.i[1]; - return (bitPatternH & 0x7ff00000) == 0x7ff00000 && - (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0; -} - const double pi = 3.1415926535897932384626433832795; } // end anonymous namespace @@ -663,12 +634,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpIsNan: { - newConstArray[i].setBConst(isNan(unionArray[i].getDConst())); + newConstArray[i].setBConst(IsNan(unionArray[i].getDConst())); break; } case EOpIsInf: { - newConstArray[i].setBConst(isInf(unionArray[i].getDConst())); + newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst())); break; } diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index a0fade16..d8a3aab5 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -48,37 +48,6 @@ #endif #include -namespace { - -bool IsInfinity(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_NINF: - case _FPCLASS_PINF: - return true; - default: - return false; - } -#else - return std::isinf(x); -#endif -} - -bool IsNan(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - return true; - default: - return false; - } -#else - return std::isnan(x); -#endif -} - -} namespace glslang { From 9600b97c6af4c90b0837be0c22bb3268fa0624c3 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Tue, 9 Nov 2021 15:46:08 -0700 Subject: [PATCH 46/64] Fix test spv.1.4.OpEntryPoint.frag Cannot apply binding qualifier to push_constant --- Test/baseResults/spv.1.4.OpEntryPoint.frag.out | 2 -- Test/spv.1.4.OpEntryPoint.frag | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out index 2c6e6dcc..e43e954e 100644 --- a/Test/baseResults/spv.1.4.OpEntryPoint.frag.out +++ b/Test/baseResults/spv.1.4.OpEntryPoint.frag.out @@ -1,5 +1,4 @@ spv.1.4.OpEntryPoint.frag -Validation failed // Module Version 10400 // Generated by (magic number): 8000a // Id's are bound by 64 @@ -32,7 +31,6 @@ Validation failed Decorate 25(uniformv) Binding 0 MemberDecorate 31(pushB) 0 Offset 0 Decorate 31(pushB) Block - Decorate 33(pushv) Binding 2 MemberDecorate 39(bbt) 0 Offset 0 Decorate 39(bbt) Block Decorate 41(bufferv) DescriptorSet 0 diff --git a/Test/spv.1.4.OpEntryPoint.frag b/Test/spv.1.4.OpEntryPoint.frag index ef1235a4..a12b1b37 100644 --- a/Test/spv.1.4.OpEntryPoint.frag +++ b/Test/spv.1.4.OpEntryPoint.frag @@ -13,7 +13,7 @@ layout(binding = 1) buffer bbt { float f; } bufferv; -layout(binding = 2, push_constant) uniform pushB { +layout(push_constant) uniform pushB { int a; } pushv; From 77b0d72c6838d5587f8defba61dfc98bcfdb5f1a Mon Sep 17 00:00:00 2001 From: ZhiqianXia Date: Mon, 2 Aug 2021 16:41:21 +0800 Subject: [PATCH 47/64] #extension GL_ARB_gpu_shader5 support the implicit conversion , So the best function matching algorithm should be actived. Signed-off-by: ZhiqianXia --- Test/BestMatchFunction.vert | 20 ++ Test/baseResults/BestMatchFunction.vert.out | 206 ++++++++++++++++++++ glslang/MachineIndependent/ParseHelper.cpp | 6 +- gtests/AST.FromFile.cpp | 1 + 4 files changed, 231 insertions(+), 2 deletions(-) create mode 100644 Test/BestMatchFunction.vert create mode 100644 Test/baseResults/BestMatchFunction.vert.out diff --git a/Test/BestMatchFunction.vert b/Test/BestMatchFunction.vert new file mode 100644 index 00000000..eb092339 --- /dev/null +++ b/Test/BestMatchFunction.vert @@ -0,0 +1,20 @@ +#version 150 +#extension GL_ARB_gpu_shader5 : require + +uniform ivec4 u1; +uniform uvec4 u2; +out vec4 result; +vec4 f(in vec4 a, in vec4 b){ return a * b;} // choice 1 +vec4 f(in uvec4 a, in uvec4 b){ return vec4(a - b);} // choice 2 + +void main() +{ + result = f(u1, u2); // should match choice 2. which have less implicit conversion. + switch (gl_VertexID) + { + case 0: gl_Position = vec4(-1.0, 1.0, 0.0, 1.0); break; + case 1: gl_Position = vec4( 1.0, 1.0, 0.0, 1.0); break; + case 2: gl_Position = vec4(-1.0,-1.0, 0.0, 1.0); break; + case 3: gl_Position = vec4( 1.0,-1.0, 0.0, 1.0); break; + } +} diff --git a/Test/baseResults/BestMatchFunction.vert.out b/Test/baseResults/BestMatchFunction.vert.out new file mode 100644 index 00000000..843ffd79 --- /dev/null +++ b/Test/baseResults/BestMatchFunction.vert.out @@ -0,0 +1,206 @@ +BestMatchFunction.vert +WARNING: 0:2: '#extension' : extension is only partially supported: GL_ARB_gpu_shader5 + +Shader version: 150 +Requested GL_ARB_gpu_shader5 +0:? Sequence +0:7 Function Definition: f(vf4;vf4; ( global 4-component vector of float) +0:7 Function Parameters: +0:7 'a' ( in 4-component vector of float) +0:7 'b' ( in 4-component vector of float) +0:7 Sequence +0:7 Branch: Return with expression +0:7 component-wise multiply ( temp 4-component vector of float) +0:7 'a' ( in 4-component vector of float) +0:7 'b' ( in 4-component vector of float) +0:8 Function Definition: f(vu4;vu4; ( global 4-component vector of float) +0:8 Function Parameters: +0:8 'a' ( in 4-component vector of uint) +0:8 'b' ( in 4-component vector of uint) +0:8 Sequence +0:8 Branch: Return with expression +0:8 Convert uint to float ( temp 4-component vector of float) +0:8 subtract ( temp 4-component vector of uint) +0:8 'a' ( in 4-component vector of uint) +0:8 'b' ( in 4-component vector of uint) +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'result' ( smooth out 4-component vector of float) +0:12 Function Call: f(vu4;vu4; ( global 4-component vector of float) +0:12 Convert int to uint ( temp 4-component vector of uint) +0:12 'u1' ( uniform 4-component vector of int) +0:12 'u2' ( uniform 4-component vector of uint) +0:13 switch +0:13 condition +0:13 'gl_VertexID' ( gl_VertexId int VertexId) +0:13 body +0:13 Sequence +0:15 case: with expression +0:15 Constant: +0:15 0 (const int) +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:15 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:15 Constant: +0:15 0 (const uint) +0:15 Constant: +0:15 -1.000000 +0:15 1.000000 +0:15 0.000000 +0:15 1.000000 +0:15 Branch: Break +0:16 case: with expression +0:16 Constant: +0:16 1 (const int) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:16 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 0.000000 +0:16 1.000000 +0:16 Branch: Break +0:17 case: with expression +0:17 Constant: +0:17 2 (const int) +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:17 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 0 (const uint) +0:17 Constant: +0:17 -1.000000 +0:17 -1.000000 +0:17 0.000000 +0:17 1.000000 +0:17 Branch: Break +0:18 case: with expression +0:18 Constant: +0:18 3 (const int) +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:18 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 0 (const uint) +0:18 Constant: +0:18 1.000000 +0:18 -1.000000 +0:18 0.000000 +0:18 1.000000 +0:18 Branch: Break +0:? Linker Objects +0:? 'u1' ( uniform 4-component vector of int) +0:? 'u2' ( uniform 4-component vector of uint) +0:? 'result' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 150 +Requested GL_ARB_gpu_shader5 +0:? Sequence +0:8 Function Definition: f(vu4;vu4; ( global 4-component vector of float) +0:8 Function Parameters: +0:8 'a' ( in 4-component vector of uint) +0:8 'b' ( in 4-component vector of uint) +0:8 Sequence +0:8 Branch: Return with expression +0:8 Convert uint to float ( temp 4-component vector of float) +0:8 subtract ( temp 4-component vector of uint) +0:8 'a' ( in 4-component vector of uint) +0:8 'b' ( in 4-component vector of uint) +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'result' ( smooth out 4-component vector of float) +0:12 Function Call: f(vu4;vu4; ( global 4-component vector of float) +0:12 Convert int to uint ( temp 4-component vector of uint) +0:12 'u1' ( uniform 4-component vector of int) +0:12 'u2' ( uniform 4-component vector of uint) +0:13 switch +0:13 condition +0:13 'gl_VertexID' ( gl_VertexId int VertexId) +0:13 body +0:13 Sequence +0:15 case: with expression +0:15 Constant: +0:15 0 (const int) +0:? Sequence +0:15 move second child to first child ( temp 4-component vector of float) +0:15 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:15 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:15 Constant: +0:15 0 (const uint) +0:15 Constant: +0:15 -1.000000 +0:15 1.000000 +0:15 0.000000 +0:15 1.000000 +0:15 Branch: Break +0:16 case: with expression +0:16 Constant: +0:16 1 (const int) +0:? Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:16 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 0.000000 +0:16 1.000000 +0:16 Branch: Break +0:17 case: with expression +0:17 Constant: +0:17 2 (const int) +0:? Sequence +0:17 move second child to first child ( temp 4-component vector of float) +0:17 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:17 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:17 Constant: +0:17 0 (const uint) +0:17 Constant: +0:17 -1.000000 +0:17 -1.000000 +0:17 0.000000 +0:17 1.000000 +0:17 Branch: Break +0:18 case: with expression +0:18 Constant: +0:18 3 (const int) +0:? Sequence +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:18 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 0 (const uint) +0:18 Constant: +0:18 1.000000 +0:18 -1.000000 +0:18 0.000000 +0:18 1.000000 +0:18 Branch: Break +0:? Linker Objects +0:? 'u1' ( uniform 4-component vector of int) +0:? 'u2' ( uniform 4-component vector of uint) +0:? 'result' ( smooth out 4-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 9ab1207f..e4d47917 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -6650,8 +6650,10 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct : findFunctionExact(loc, call, builtIn)); else if (version < 120) function = findFunctionExact(loc, call, builtIn); - else if (version < 400) - function = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn); + else if (version < 400) { + bool needfindFunction400 = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) || extensionTurnedOn(E_GL_ARB_gpu_shader5); + function = needfindFunction400 ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn); + } else if (explicitTypesEnabled) function = findFunctionExplicitTypes(loc, call, builtIn); else diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp index f9680dd6..6976d9e3 100644 --- a/gtests/AST.FromFile.cpp +++ b/gtests/AST.FromFile.cpp @@ -287,6 +287,7 @@ INSTANTIATE_TEST_SUITE_P( "atomicCounterARBOps.vert", "GL_EXT_shader_integer_mix.vert", "GL_ARB_draw_instanced.vert", + "BestMatchFunction.vert", })), FileNameAsCustomTestSuffix ); From 22a5e364460523413e1791e9280bda1397b9b515 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 10 Nov 2021 14:13:37 -0700 Subject: [PATCH 48/64] Revert "Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding" --- glslang/Include/Common.h | 29 --------------------- glslang/MachineIndependent/Constant.cpp | 33 ++++++++++++++++++++++-- glslang/MachineIndependent/intermOut.cpp | 31 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 31 deletions(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index a24977f8..e7b5e072 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -39,7 +39,6 @@ #include #include -#include #include #include #include @@ -303,34 +302,6 @@ template int IntLog2(T n) return result; } -inline bool IsInfinity(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_NINF: - case _FPCLASS_PINF: - return true; - default: - return false; - } -#else - return std::isinf(x); -#endif -} - -inline bool IsNan(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - return true; - default: - return false; - } -#else - return std::isnan(x); -#endif -} - } // end namespace glslang #endif // _COMMON_INCLUDED_ diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index 5fc61dbb..7f5d4c4f 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -46,6 +46,35 @@ namespace { using namespace glslang; +typedef union { + double d; + int i[2]; +} DoubleIntUnion; + +// Some helper functions + +bool isNan(double x) +{ + DoubleIntUnion u; + // tough to find a platform independent library function, do it directly + u.d = x; + int bitPatternL = u.i[0]; + int bitPatternH = u.i[1]; + return (bitPatternH & 0x7ff80000) == 0x7ff80000 && + ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0); +} + +bool isInf(double x) +{ + DoubleIntUnion u; + // tough to find a platform independent library function, do it directly + u.d = x; + int bitPatternL = u.i[0]; + int bitPatternH = u.i[1]; + return (bitPatternH & 0x7ff00000) == 0x7ff00000 && + (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0; +} + const double pi = 3.1415926535897932384626433832795; } // end anonymous namespace @@ -634,12 +663,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpIsNan: { - newConstArray[i].setBConst(IsNan(unionArray[i].getDConst())); + newConstArray[i].setBConst(isNan(unionArray[i].getDConst())); break; } case EOpIsInf: { - newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst())); + newConstArray[i].setBConst(isInf(unionArray[i].getDConst())); break; } diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index d8a3aab5..a0fade16 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -48,6 +48,37 @@ #endif #include +namespace { + +bool IsInfinity(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_NINF: + case _FPCLASS_PINF: + return true; + default: + return false; + } +#else + return std::isinf(x); +#endif +} + +bool IsNan(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_SNAN: + case _FPCLASS_QNAN: + return true; + default: + return false; + } +#else + return std::isnan(x); +#endif +} + +} namespace glslang { From 002b3f55c7852408100cc20b799aeb0f8646a77a Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Wed, 10 Nov 2021 15:03:07 -0700 Subject: [PATCH 49/64] Generate error for binding on push_constant --- Test/baseResults/vulkan.frag.out | 53 +++++++++++----------- Test/vulkan.frag | 3 ++ glslang/MachineIndependent/ParseHelper.cpp | 2 + 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out index e6208980..28134aed 100644 --- a/Test/baseResults/vulkan.frag.out +++ b/Test/baseResults/vulkan.frag.out @@ -24,37 +24,38 @@ ERROR: 0:39: 'push_constant' : can only be used with a uniform ERROR: 0:43: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan ERROR: 0:43: 'push_constant' : can only be used with a block ERROR: 0:45: 'push_constant' : cannot declare a default, can only be used on a block -ERROR: 0:51: 'binding' : sampler/texture/image requires layout(binding=X) -ERROR: 0:52: 'binding' : sampler/texture/image requires layout(binding=X) -ERROR: 0:52: 'input_attachment_index' : can only be used with a subpass -ERROR: 0:53: 'binding' : sampler/texture/image requires layout(binding=X) -ERROR: 0:53: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:46: 'binding' : cannot be used with push_constant ERROR: 0:54: 'binding' : sampler/texture/image requires layout(binding=X) -ERROR: 0:54: 'subpass' : requires an input_attachment_index layout qualifier ERROR: 0:55: 'binding' : sampler/texture/image requires layout(binding=X) -ERROR: 0:60: 'subpassLoadMS' : no matching overloaded function found -ERROR: 0:61: 'subpassLoad' : no matching overloaded function found +ERROR: 0:55: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:56: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:56: 'input_attachment_index' : can only be used with a subpass +ERROR: 0:57: 'binding' : sampler/texture/image requires layout(binding=X) +ERROR: 0:57: 'subpass' : requires an input_attachment_index layout qualifier +ERROR: 0:58: 'binding' : sampler/texture/image requires layout(binding=X) ERROR: 0:63: 'subpassLoadMS' : no matching overloaded function found -ERROR: 0:66: 'subroutine' : not allowed when generating SPIR-V -ERROR: 0:66: 'subroutine' : feature not yet implemented -ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V -ERROR: 0:67: 'subroutine' : feature not yet implemented -ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan -ERROR: 0:73: 'texture' : no matching overloaded function found -ERROR: 0:74: 'imageStore' : no matching overloaded function found -WARNING: 0:82: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: +ERROR: 0:64: 'subpassLoad' : no matching overloaded function found +ERROR: 0:66: 'subpassLoadMS' : no matching overloaded function found +ERROR: 0:69: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:69: 'subroutine' : feature not yet implemented +ERROR: 0:70: 'subroutine' : not allowed when generating SPIR-V +ERROR: 0:70: 'subroutine' : feature not yet implemented +ERROR: 0:72: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan +ERROR: 0:76: 'texture' : no matching overloaded function found +ERROR: 0:77: 'imageStore' : no matching overloaded function found +WARNING: 0:85: '' : all default precisions are highp; use precision statements to quiet warning, e.g.: "precision mediump int; precision highp float;" -ERROR: 0:91: 'call argument' : sampler constructor must appear at point of use -ERROR: 0:92: 'call argument' : sampler constructor must appear at point of use -ERROR: 0:93: ',' : sampler constructor must appear at point of use -ERROR: 0:94: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' temp sampler2D' and a right operand of type ' temp sampler2D' (or there is no acceptable conversion) ERROR: 0:94: 'call argument' : sampler constructor must appear at point of use -ERROR: 0:96: 'gl_NumSamples' : undeclared identifier -ERROR: 0:101: 'noise1' : no matching overloaded function found -ERROR: 0:102: 'noise2' : no matching overloaded function found -ERROR: 0:103: 'noise3' : no matching overloaded function found -ERROR: 0:104: 'noise4' : no matching overloaded function found -ERROR: 53 compilation errors. No code generated. +ERROR: 0:95: 'call argument' : sampler constructor must appear at point of use +ERROR: 0:96: ',' : sampler constructor must appear at point of use +ERROR: 0:97: ':' : wrong operand types: no operation ':' exists that takes a left-hand operand of type ' temp sampler2D' and a right operand of type ' temp sampler2D' (or there is no acceptable conversion) +ERROR: 0:97: 'call argument' : sampler constructor must appear at point of use +ERROR: 0:99: 'gl_NumSamples' : undeclared identifier +ERROR: 0:104: 'noise1' : no matching overloaded function found +ERROR: 0:105: 'noise2' : no matching overloaded function found +ERROR: 0:106: 'noise3' : no matching overloaded function found +ERROR: 0:107: 'noise4' : no matching overloaded function found +ERROR: 54 compilation errors. No code generated. ERROR: Linking fragment stage: Only one push_constant block is allowed per stage diff --git a/Test/vulkan.frag b/Test/vulkan.frag index 46c14f31..25bfefec 100644 --- a/Test/vulkan.frag +++ b/Test/vulkan.frag @@ -43,6 +43,9 @@ layout(push_constant) buffer pcb { // ERROR, not on a buffer layout(push_constant) uniform float pcfloat; // ERROR 2X: not on a non-block, and non-opaque outside block layout(push_constant) uniform; // ERROR, needs an object +layout(binding=2, push_constant) uniform pcbnd1 { // ERROR, can't have binding + int a; +} pcbnd1inst; layout(std430, push_constant) uniform pcb1 { int a; } pcb1inst; layout(push_constant) uniform pcb2 { int a; diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 9ab1207f..7f2f171b 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -6496,6 +6496,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier error(loc, "can only be used with a uniform", "push_constant", ""); if (qualifier.hasSet()) error(loc, "cannot be used with push_constant", "set", ""); + if (qualifier.hasBinding()) + error(loc, "cannot be used with push_constant", "binding", ""); } if (qualifier.hasBufferReference()) { if (qualifier.storage != EvqBuffer) From 77415296b2174ea6113107fbbb59c0db0a870197 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 11 Nov 2021 08:43:30 -0700 Subject: [PATCH 50/64] Update to latest spirv-headers --- SPIRV/spirv.hpp | 4 ++-- known_good.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index e0fe2498..f6b7be92 100644 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -1543,7 +1543,7 @@ enum Op { OpUSubSatINTEL = 5596, OpIMul32x16INTEL = 5597, OpUMul32x16INTEL = 5598, - OpConstFunctionPointerINTEL = 5600, + OpConstantFunctionPointerINTEL = 5600, OpFunctionPointerCallINTEL = 5601, OpAsmTargetINTEL = 5609, OpAsmINTEL = 5610, @@ -2131,7 +2131,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break; case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break; case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break; - case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; + case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break; case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break; case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break; case OpAsmINTEL: *hasResult = true; *hasResultType = true; break; diff --git a/known_good.json b/known_good.json index bed5dd80..96c27dea 100644 --- a/known_good.json +++ b/known_good.json @@ -5,14 +5,14 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "339d4475c1a806c187c57678af26733575d1cecd" + "commit" : "21e3f681e2004590c7865bc8c0195a4ab8e66c88" }, { "name" : "spirv-tools/external/spirv-headers", "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Headers", "subdir" : "External/spirv-tools/external/spirv-headers", - "commit" : "29817199b7069bac971e5365d180295d4b077ebe" + "commit" : "814e728b30ddd0f4509233099a3ad96fd4318c07" } ] } From 0eda343970e04e7c9447d264271b1c4cfdc923f4 Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Tue, 9 Nov 2021 16:31:22 +0100 Subject: [PATCH 51/64] Use intermOut.cpp's IsNan and IsInfinity for parse-time constant folding (updated) There were two implementations of isInf() and isNan(), in Constant.cpp and in intermOut.cpp. The former only works on little-endian systems, the latter is a wrapper for library functions and works regardless of endianness. Move the second version into Common.h and adopt it in both places. Thereby avoid the duplication and fix for big-endian systems. A previous commit with the same intent and purpose had missed a required header for builds on Windows. On s390x, this fixes the test case Glsl/CompileToAstTest.FromFile/constFold_frag. Fixes #2802 --- glslang/Include/Common.h | 33 ++++++++++++++++++++++++ glslang/MachineIndependent/Constant.cpp | 33 ++---------------------- glslang/MachineIndependent/intermOut.cpp | 31 ---------------------- 3 files changed, 35 insertions(+), 62 deletions(-) diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index e7b5e072..9042a1aa 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -39,6 +39,11 @@ #include #include +#ifdef _MSC_VER +#include +#else +#include +#endif #include #include #include @@ -302,6 +307,34 @@ template int IntLog2(T n) return result; } +inline bool IsInfinity(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_NINF: + case _FPCLASS_PINF: + return true; + default: + return false; + } +#else + return std::isinf(x); +#endif +} + +inline bool IsNan(double x) { +#ifdef _MSC_VER + switch (_fpclass(x)) { + case _FPCLASS_SNAN: + case _FPCLASS_QNAN: + return true; + default: + return false; + } +#else + return std::isnan(x); +#endif +} + } // end namespace glslang #endif // _COMMON_INCLUDED_ diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index 7f5d4c4f..5fc61dbb 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -46,35 +46,6 @@ namespace { using namespace glslang; -typedef union { - double d; - int i[2]; -} DoubleIntUnion; - -// Some helper functions - -bool isNan(double x) -{ - DoubleIntUnion u; - // tough to find a platform independent library function, do it directly - u.d = x; - int bitPatternL = u.i[0]; - int bitPatternH = u.i[1]; - return (bitPatternH & 0x7ff80000) == 0x7ff80000 && - ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0); -} - -bool isInf(double x) -{ - DoubleIntUnion u; - // tough to find a platform independent library function, do it directly - u.d = x; - int bitPatternL = u.i[0]; - int bitPatternH = u.i[1]; - return (bitPatternH & 0x7ff00000) == 0x7ff00000 && - (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0; -} - const double pi = 3.1415926535897932384626433832795; } // end anonymous namespace @@ -663,12 +634,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpIsNan: { - newConstArray[i].setBConst(isNan(unionArray[i].getDConst())); + newConstArray[i].setBConst(IsNan(unionArray[i].getDConst())); break; } case EOpIsInf: { - newConstArray[i].setBConst(isInf(unionArray[i].getDConst())); + newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst())); break; } diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index a0fade16..d8a3aab5 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -48,37 +48,6 @@ #endif #include -namespace { - -bool IsInfinity(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_NINF: - case _FPCLASS_PINF: - return true; - default: - return false; - } -#else - return std::isinf(x); -#endif -} - -bool IsNan(double x) { -#ifdef _MSC_VER - switch (_fpclass(x)) { - case _FPCLASS_SNAN: - case _FPCLASS_QNAN: - return true; - default: - return false; - } -#else - return std::isnan(x); -#endif -} - -} namespace glslang { From 0bc8932aba15a5707a6123e07ed2cab8573d3375 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 11 Nov 2021 09:08:05 -0700 Subject: [PATCH 52/64] Release 11.7.0 --- CHANGES.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ad4fa400..ebab4da0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/). +## 11.7.0 2021-11-11 + +### Other changes +* Add support for targeting Vulkan 1.2 in the C API + ## 11.6.0 2021-08-25 ### Other changes From 1f8c8b88c71072fa8b79e401042cd52063e5ff78 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Thu, 11 Nov 2021 18:48:05 -0700 Subject: [PATCH 53/64] Revert port of GL_EXT_shader_realtime_clock to GL_EXT_spirv_intrinsics Could not be found by glslang library interface. Blocking SDK build. --- .../GL_EXT_shader_realtime_clock.glsl | 16 ---------------- glslang/MachineIndependent/Initialize.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl b/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl index f74df6fc..7cf545d9 100644 --- a/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl +++ b/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl @@ -36,19 +36,3 @@ // POSSIBILITY OF SUCH DAMAGE. // -#extension GL_EXT_spirv_intrinsics : enable -#extension GL_ARB_gpu_shader_int64 : enable - -uvec2 clockRealtime2x32EXT(void) { - spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056) - uvec2 clockRealtime2x32EXT_internal(uint scope); - - return clockRealtime2x32EXT_internal(1 /*Device scope*/); -} - -uint64_t clockRealtimeEXT(void) { - spirv_instruction (extensions = ["SPV_KHR_shader_clock"], capabilities = [5055], id = 5056) - uint64_t clockRealtimeEXT_internal(uint scope); - - return clockRealtimeEXT_internal(1 /*Device scope*/); -} \ No newline at end of file diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 728cd4a6..b5f48fb4 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -4553,11 +4553,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - // GL_ARB_shader_clock + // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock if (profile != EEsProfile && version >= 450) { commonBuiltins.append( "uvec2 clock2x32ARB();" "uint64_t clockARB();" + "uvec2 clockRealtime2x32EXT();" + "uint64_t clockRealtimeEXT();" "\n"); } @@ -8324,6 +8326,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock); symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock); + symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock); + symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock); + if (profile == EEsProfile && version < 320) { symbolTable.setVariableExtensions("gl_PrimitiveID", Num_AEP_geometry_shader, AEP_geometry_shader); symbolTable.setVariableExtensions("gl_Layer", Num_AEP_geometry_shader, AEP_geometry_shader); From f1fa8afa25c99a550b3d80c516b7cfa3ac725de5 Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Wed, 10 Nov 2021 18:10:58 +0100 Subject: [PATCH 54/64] TIntermediate::promoteConstantUnion(): fix conversion to int8 The signedness of type char is implementation-defined in C++. The conversion to (signed) int8 currently uses a cast to char, which is undefined for negative values when the type char is implemented as unsigned. Thus, fix to cast to "signed char", which has the intended semantic on all implementations. Fixes #2807 --- glslang/MachineIndependent/Intermediate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 1283f449..6aea5b3d 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -3902,7 +3902,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtFloat16: PROMOTE(setDConst, double, Get); break; \ case EbtFloat: PROMOTE(setDConst, double, Get); break; \ case EbtDouble: PROMOTE(setDConst, double, Get); break; \ - case EbtInt8: PROMOTE(setI8Const, char, Get); break; \ + case EbtInt8: PROMOTE(setI8Const, signed char, Get); break; \ case EbtInt16: PROMOTE(setI16Const, short, Get); break; \ case EbtInt: PROMOTE(setIConst, int, Get); break; \ case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \ From 10be28ac9b9edd1d82e872c69333c563759fb912 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Fri, 12 Nov 2021 16:54:22 -0700 Subject: [PATCH 55/64] Fix struct type sharing Fixes #2812 --- .../hlsl.structbuffer.rwbyte2.comp.out | 140 ++++++++++++++++++ Test/hlsl.structbuffer.rwbyte2.comp | 10 ++ glslang/HLSL/hlslParseHelper.cpp | 3 + gtests/Hlsl.FromFile.cpp | 1 + 4 files changed, 154 insertions(+) create mode 100644 Test/baseResults/hlsl.structbuffer.rwbyte2.comp.out create mode 100644 Test/hlsl.structbuffer.rwbyte2.comp diff --git a/Test/baseResults/hlsl.structbuffer.rwbyte2.comp.out b/Test/baseResults/hlsl.structbuffer.rwbyte2.comp.out new file mode 100644 index 00000000..127d52cc --- /dev/null +++ b/Test/baseResults/hlsl.structbuffer.rwbyte2.comp.out @@ -0,0 +1,140 @@ +hlsl.structbuffer.rwbyte2.comp +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:6 Function Definition: @main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'f' ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'g_bbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 16 (const int) +0:7 Constant: +0:7 2 (const int) +0:8 move second child to first child ( temp uint) +0:8 direct index (layout( row_major std430) buffer uint) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'g_sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 Constant: +0:8 0 (const int) +0:8 'f' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'g_sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'g_bbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + + +Linked compute stage: + + +Shader version: 500 +local_size = (1, 1, 1) +0:? Sequence +0:6 Function Definition: @main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:7 Sequence +0:7 move second child to first child ( temp uint) +0:7 'f' ( temp uint) +0:7 indirect index (layout( row_major std430) buffer uint) +0:7 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:7 'g_bbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:7 Constant: +0:7 0 (const uint) +0:7 right-shift ( temp int) +0:7 Constant: +0:7 16 (const int) +0:7 Constant: +0:7 2 (const int) +0:8 move second child to first child ( temp uint) +0:8 direct index (layout( row_major std430) buffer uint) +0:8 @data: direct index for structure (layout( row_major std430) buffer unsized 1-element array of uint) +0:8 'g_sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:8 Constant: +0:8 0 (const uint) +0:8 Constant: +0:8 0 (const int) +0:8 'f' ( temp uint) +0:6 Function Definition: main( ( temp void) +0:6 Function Parameters: +0:? Sequence +0:6 Function Call: @main( ( temp void) +0:? Linker Objects +0:? 'g_sbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) +0:? 'g_bbuf' (layout( row_major std430) buffer block{layout( row_major std430) buffer unsized 1-element array of uint @data}) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 30 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 1 1 1 + Source HLSL 500 + Name 4 "main" + Name 6 "@main(" + Name 10 "f" + Name 12 "g_bbuf" + MemberName 12(g_bbuf) 0 "@data" + Name 14 "g_bbuf" + Name 24 "g_sbuf" + MemberName 24(g_sbuf) 0 "@data" + Name 26 "g_sbuf" + Decorate 11 ArrayStride 4 + MemberDecorate 12(g_bbuf) 0 Offset 0 + Decorate 12(g_bbuf) BufferBlock + Decorate 14(g_bbuf) DescriptorSet 0 + Decorate 14(g_bbuf) Binding 1 + Decorate 23 ArrayStride 4 + MemberDecorate 24(g_sbuf) 0 Offset 0 + Decorate 24(g_sbuf) BufferBlock + Decorate 26(g_sbuf) DescriptorSet 0 + Decorate 26(g_sbuf) Binding 0 + 2: TypeVoid + 3: TypeFunction 2 + 8: TypeInt 32 0 + 9: TypePointer Function 8(int) + 11: TypeRuntimeArray 8(int) + 12(g_bbuf): TypeStruct 11 + 13: TypePointer Uniform 12(g_bbuf) + 14(g_bbuf): 13(ptr) Variable Uniform + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: 15(int) Constant 16 + 18: 15(int) Constant 2 + 20: TypePointer Uniform 8(int) + 23: TypeRuntimeArray 8(int) + 24(g_sbuf): TypeStruct 23 + 25: TypePointer Uniform 24(g_sbuf) + 26(g_sbuf): 25(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + 29: 2 FunctionCall 6(@main() + Return + FunctionEnd + 6(@main(): 2 Function None 3 + 7: Label + 10(f): 9(ptr) Variable Function + 19: 15(int) ShiftRightArithmetic 17 18 + 21: 20(ptr) AccessChain 14(g_bbuf) 16 19 + 22: 8(int) Load 21 + Store 10(f) 22 + 27: 8(int) Load 10(f) + 28: 20(ptr) AccessChain 26(g_sbuf) 16 16 + Store 28 27 + Return + FunctionEnd diff --git a/Test/hlsl.structbuffer.rwbyte2.comp b/Test/hlsl.structbuffer.rwbyte2.comp new file mode 100644 index 00000000..42d61c00 --- /dev/null +++ b/Test/hlsl.structbuffer.rwbyte2.comp @@ -0,0 +1,10 @@ +RWStructuredBuffer g_sbuf; +RWByteAddressBuffer g_bbuf; + + +void main() +{ + uint f = g_bbuf.Load(16); + g_sbuf[0] = f; +} + diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index 39b3ecac..0936bd3a 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -6935,6 +6935,9 @@ void HlslParseContext::shareStructBufferType(TType& type) if (lhs.isStruct() != rhs.isStruct()) return false; + if (lhs.getQualifier().builtIn != rhs.getQualifier().builtIn) + return false; + if (lhs.isStruct() && rhs.isStruct()) { if (lhs.getStruct()->size() != rhs.getStruct()->size()) return false; diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp index 5e1cbdae..3e29896d 100644 --- a/gtests/Hlsl.FromFile.cpp +++ b/gtests/Hlsl.FromFile.cpp @@ -385,6 +385,7 @@ INSTANTIATE_TEST_SUITE_P( {"hlsl.structbuffer.fn2.comp", "main"}, {"hlsl.structbuffer.rw.frag", "main"}, {"hlsl.structbuffer.rwbyte.frag", "main"}, + {"hlsl.structbuffer.rwbyte2.comp", "main"}, {"hlsl.structin.vert", "main"}, {"hlsl.structIoFourWay.frag", "main"}, {"hlsl.structStructName.frag", "main"}, From 0d85595e3388237368bc312b64dd95b59d31c3d3 Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Mon, 15 Nov 2021 16:30:15 +0100 Subject: [PATCH 56/64] add negative float conversions to test constantUnaryConversion.comp Add conversions from negative float16_t and float32_t to bool, all signed integer types (i.e., including those in GL_EXT_shader_explicit_arithmetic_types), and all float types (from the same extension) to extend coverage. Note that converting negative float values to unsigned integers is undefined behavior. Thus, we exclude them. --- .../constantUnaryConversion.comp.out | 116 +++++++++++++++++- Test/constantUnaryConversion.comp | 21 ++++ 2 files changed, 133 insertions(+), 4 deletions(-) diff --git a/Test/baseResults/constantUnaryConversion.comp.out b/Test/baseResults/constantUnaryConversion.comp.out index fcaf6f22..752745a8 100644 --- a/Test/baseResults/constantUnaryConversion.comp.out +++ b/Test/baseResults/constantUnaryConversion.comp.out @@ -3,8 +3,8 @@ Shader version: 450 Requested GL_EXT_shader_explicit_arithmetic_types local_size = (1, 1, 1) 0:? Sequence -0:48 Function Definition: main( ( global void) -0:48 Function Parameters: +0:69 Function Definition: main( ( global void) +0:69 Function Parameters: 0:? Linker Objects 0:? 'bool_init' ( const bool) 0:? true (const bool) @@ -30,6 +30,12 @@ local_size = (1, 1, 1) 0:? 13.000000 0:? 'float64_t_init' ( const double) 0:? -4.000000 +0:? 'neg_float16_t_init' ( const float16_t) +0:? -42.000000 +0:? 'neg_float32_t_init' ( const float) +0:? -13.000000 +0:? 'neg_float64_t_init' ( const double) +0:? -4.000000 0:? 'bool_to_bool' ( const bool) 0:? true (const bool) 0:? 'int8_t_to_bool' ( const bool) @@ -318,6 +324,54 @@ local_size = (1, 1, 1) 0:? 13.000000 0:? 'float64_t_to_float64_t' ( const double) 0:? -4.000000 +0:? 'neg_float16_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float16_t_to_int8_t' ( const int8_t) +0:? -42 (const int8_t) +0:? 'neg_float32_t_to_int8_t' ( const int8_t) +0:? -13 (const int8_t) +0:? 'neg_float64_t_to_int8_t' ( const int8_t) +0:? -4 (const int8_t) +0:? 'neg_float16_t_to_int16_t' ( const int16_t) +0:? -42 (const int16_t) +0:? 'neg_float32_t_to_int16_t' ( const int16_t) +0:? -13 (const int16_t) +0:? 'neg_float64_t_to_int16_t' ( const int16_t) +0:? -4 (const int16_t) +0:? 'neg_float16_t_to_int32_t' ( const int) +0:? -42 (const int) +0:? 'neg_float32_t_to_int32_t' ( const int) +0:? -13 (const int) +0:? 'neg_float64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'neg_float16_t_to_int64_t' ( const int64_t) +0:? -42 (const int64_t) +0:? 'neg_float32_t_to_int64_t' ( const int64_t) +0:? -13 (const int64_t) +0:? 'neg_float64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'neg_float16_t_to_float16_t' ( const float16_t) +0:? -42.000000 +0:? 'neg_float32_t_to_float16_t' ( const float16_t) +0:? -13.000000 +0:? 'neg_float64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'neg_float16_t_to_float32_t' ( const float) +0:? -42.000000 +0:? 'neg_float32_t_to_float32_t' ( const float) +0:? -13.000000 +0:? 'neg_float64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'neg_float16_t_to_float64_t' ( const double) +0:? -42.000000 +0:? 'neg_float32_t_to_float64_t' ( const double) +0:? -13.000000 +0:? 'neg_float64_t_to_float64_t' ( const double) +0:? -4.000000 Linked compute stage: @@ -327,8 +381,8 @@ Shader version: 450 Requested GL_EXT_shader_explicit_arithmetic_types local_size = (1, 1, 1) 0:? Sequence -0:48 Function Definition: main( ( global void) -0:48 Function Parameters: +0:69 Function Definition: main( ( global void) +0:69 Function Parameters: 0:? Linker Objects 0:? 'bool_init' ( const bool) 0:? true (const bool) @@ -354,6 +408,12 @@ local_size = (1, 1, 1) 0:? 13.000000 0:? 'float64_t_init' ( const double) 0:? -4.000000 +0:? 'neg_float16_t_init' ( const float16_t) +0:? -42.000000 +0:? 'neg_float32_t_init' ( const float) +0:? -13.000000 +0:? 'neg_float64_t_init' ( const double) +0:? -4.000000 0:? 'bool_to_bool' ( const bool) 0:? true (const bool) 0:? 'int8_t_to_bool' ( const bool) @@ -642,4 +702,52 @@ local_size = (1, 1, 1) 0:? 13.000000 0:? 'float64_t_to_float64_t' ( const double) 0:? -4.000000 +0:? 'neg_float16_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float32_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float64_t_to_bool' ( const bool) +0:? true (const bool) +0:? 'neg_float16_t_to_int8_t' ( const int8_t) +0:? -42 (const int8_t) +0:? 'neg_float32_t_to_int8_t' ( const int8_t) +0:? -13 (const int8_t) +0:? 'neg_float64_t_to_int8_t' ( const int8_t) +0:? -4 (const int8_t) +0:? 'neg_float16_t_to_int16_t' ( const int16_t) +0:? -42 (const int16_t) +0:? 'neg_float32_t_to_int16_t' ( const int16_t) +0:? -13 (const int16_t) +0:? 'neg_float64_t_to_int16_t' ( const int16_t) +0:? -4 (const int16_t) +0:? 'neg_float16_t_to_int32_t' ( const int) +0:? -42 (const int) +0:? 'neg_float32_t_to_int32_t' ( const int) +0:? -13 (const int) +0:? 'neg_float64_t_to_int32_t' ( const int) +0:? -4 (const int) +0:? 'neg_float16_t_to_int64_t' ( const int64_t) +0:? -42 (const int64_t) +0:? 'neg_float32_t_to_int64_t' ( const int64_t) +0:? -13 (const int64_t) +0:? 'neg_float64_t_to_int64_t' ( const int64_t) +0:? -4 (const int64_t) +0:? 'neg_float16_t_to_float16_t' ( const float16_t) +0:? -42.000000 +0:? 'neg_float32_t_to_float16_t' ( const float16_t) +0:? -13.000000 +0:? 'neg_float64_t_to_float16_t' ( const float16_t) +0:? -4.000000 +0:? 'neg_float16_t_to_float32_t' ( const float) +0:? -42.000000 +0:? 'neg_float32_t_to_float32_t' ( const float) +0:? -13.000000 +0:? 'neg_float64_t_to_float32_t' ( const float) +0:? -4.000000 +0:? 'neg_float16_t_to_float64_t' ( const double) +0:? -42.000000 +0:? 'neg_float32_t_to_float64_t' ( const double) +0:? -13.000000 +0:? 'neg_float64_t_to_float64_t' ( const double) +0:? -4.000000 diff --git a/Test/constantUnaryConversion.comp b/Test/constantUnaryConversion.comp index 3c479ae6..7226a267 100644 --- a/Test/constantUnaryConversion.comp +++ b/Test/constantUnaryConversion.comp @@ -15,9 +15,16 @@ const float16_t float16_t_init = float16_t(42.0); const float32_t float32_t_init = float32_t(13.0); const float64_t float64_t_init = float64_t(-4.0); +const float16_t neg_float16_t_init = float16_t(-42.0); +const float32_t neg_float32_t_init = float32_t(-13.0); +const float64_t neg_float64_t_init = float64_t(-4.0); + #define TYPE_TO_TYPE(x, y) \ const x y##_to_##x = x(y##_init) +#define TYPE_TO_TYPE_PREFIX(prefix, x, y) \ + const x prefix##_##y##_to_##x = x(prefix##_##y##_init) + #define TYPE_TO(x) \ TYPE_TO_TYPE(x, bool); \ TYPE_TO_TYPE(x, int8_t); \ @@ -45,4 +52,18 @@ TYPE_TO(float16_t); TYPE_TO(float32_t); TYPE_TO(float64_t); +#define NEG_FLOAT_TO(x) \ + TYPE_TO_TYPE_PREFIX(neg, x, float16_t); \ + TYPE_TO_TYPE_PREFIX(neg, x, float32_t); \ + TYPE_TO_TYPE_PREFIX(neg, x, float64_t) + +NEG_FLOAT_TO(bool); +NEG_FLOAT_TO(int8_t); +NEG_FLOAT_TO(int16_t); +NEG_FLOAT_TO(int32_t); +NEG_FLOAT_TO(int64_t); +NEG_FLOAT_TO(float16_t); +NEG_FLOAT_TO(float32_t); +NEG_FLOAT_TO(float64_t); + void main() {} From d13f81510f73bc33f53ea6228debd9a1f0862770 Mon Sep 17 00:00:00 2001 From: Marius Hillenbrand Date: Mon, 15 Nov 2021 16:31:50 +0100 Subject: [PATCH 57/64] remove undefined conversions from test constantUnaryConversion.comp Remove remaining conversions from negative float64_t to unsigned integers, which are undefined behavior. As a result, this test will also succeed on platforms that implement those conversions differently than x86. That addresses one of the issues in #2815. --- .../constantUnaryConversion.comp.out | 48 +++++++++---------- Test/constantUnaryConversion.comp | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Test/baseResults/constantUnaryConversion.comp.out b/Test/baseResults/constantUnaryConversion.comp.out index 752745a8..78372f06 100644 --- a/Test/baseResults/constantUnaryConversion.comp.out +++ b/Test/baseResults/constantUnaryConversion.comp.out @@ -29,7 +29,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_init' ( const float) 0:? 13.000000 0:? 'float64_t_init' ( const double) -0:? -4.000000 +0:? 4.000000 0:? 'neg_float16_t_init' ( const float16_t) 0:? -42.000000 0:? 'neg_float32_t_init' ( const float) @@ -83,7 +83,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int8_t' ( const int8_t) 0:? 13 (const int8_t) 0:? 'float64_t_to_int8_t' ( const int8_t) -0:? -4 (const int8_t) +0:? 4 (const int8_t) 0:? 'bool_to_int16_t' ( const int16_t) 0:? 1 (const int16_t) 0:? 'int8_t_to_int16_t' ( const int16_t) @@ -107,7 +107,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int16_t' ( const int16_t) 0:? 13 (const int16_t) 0:? 'float64_t_to_int16_t' ( const int16_t) -0:? -4 (const int16_t) +0:? 4 (const int16_t) 0:? 'bool_to_int32_t' ( const int) 0:? 1 (const int) 0:? 'int8_t_to_int32_t' ( const int) @@ -131,7 +131,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int32_t' ( const int) 0:? 13 (const int) 0:? 'float64_t_to_int32_t' ( const int) -0:? -4 (const int) +0:? 4 (const int) 0:? 'bool_to_int64_t' ( const int64_t) 0:? 1 (const int64_t) 0:? 'int8_t_to_int64_t' ( const int64_t) @@ -155,7 +155,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int64_t' ( const int64_t) 0:? 13 (const int64_t) 0:? 'float64_t_to_int64_t' ( const int64_t) -0:? -4 (const int64_t) +0:? 4 (const int64_t) 0:? 'bool_to_uint8_t' ( const uint8_t) 0:? 1 (const uint8_t) 0:? 'int8_t_to_uint8_t' ( const uint8_t) @@ -179,7 +179,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint8_t' ( const uint8_t) 0:? 13 (const uint8_t) 0:? 'float64_t_to_uint8_t' ( const uint8_t) -0:? 252 (const uint8_t) +0:? 4 (const uint8_t) 0:? 'bool_to_uint16_t' ( const uint16_t) 0:? 1 (const uint16_t) 0:? 'int8_t_to_uint16_t' ( const uint16_t) @@ -203,7 +203,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint16_t' ( const uint16_t) 0:? 13 (const uint16_t) 0:? 'float64_t_to_uint16_t' ( const uint16_t) -0:? 65532 (const uint16_t) +0:? 4 (const uint16_t) 0:? 'bool_to_uint32_t' ( const uint) 0:? 1 (const uint) 0:? 'int8_t_to_uint32_t' ( const uint) @@ -227,7 +227,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint32_t' ( const uint) 0:? 13 (const uint) 0:? 'float64_t_to_uint32_t' ( const uint) -0:? 4294967292 (const uint) +0:? 4 (const uint) 0:? 'bool_to_uint64_t' ( const uint64_t) 0:? 1 (const uint64_t) 0:? 'int8_t_to_uint64_t' ( const uint64_t) @@ -251,7 +251,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint64_t' ( const uint64_t) 0:? 13 (const uint64_t) 0:? 'float64_t_to_uint64_t' ( const uint64_t) -0:? 18446744073709551612 (const uint64_t) +0:? 4 (const uint64_t) 0:? 'bool_to_float16_t' ( const float16_t) 0:? 1.000000 0:? 'int8_t_to_float16_t' ( const float16_t) @@ -275,7 +275,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float16_t' ( const float16_t) 0:? 13.000000 0:? 'float64_t_to_float16_t' ( const float16_t) -0:? -4.000000 +0:? 4.000000 0:? 'bool_to_float32_t' ( const float) 0:? 1.000000 0:? 'int8_t_to_float32_t' ( const float) @@ -299,7 +299,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float32_t' ( const float) 0:? 13.000000 0:? 'float64_t_to_float32_t' ( const float) -0:? -4.000000 +0:? 4.000000 0:? 'bool_to_float64_t' ( const double) 0:? 1.000000 0:? 'int8_t_to_float64_t' ( const double) @@ -323,7 +323,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float64_t' ( const double) 0:? 13.000000 0:? 'float64_t_to_float64_t' ( const double) -0:? -4.000000 +0:? 4.000000 0:? 'neg_float16_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'neg_float32_t_to_bool' ( const bool) @@ -407,7 +407,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_init' ( const float) 0:? 13.000000 0:? 'float64_t_init' ( const double) -0:? -4.000000 +0:? 4.000000 0:? 'neg_float16_t_init' ( const float16_t) 0:? -42.000000 0:? 'neg_float32_t_init' ( const float) @@ -461,7 +461,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int8_t' ( const int8_t) 0:? 13 (const int8_t) 0:? 'float64_t_to_int8_t' ( const int8_t) -0:? -4 (const int8_t) +0:? 4 (const int8_t) 0:? 'bool_to_int16_t' ( const int16_t) 0:? 1 (const int16_t) 0:? 'int8_t_to_int16_t' ( const int16_t) @@ -485,7 +485,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int16_t' ( const int16_t) 0:? 13 (const int16_t) 0:? 'float64_t_to_int16_t' ( const int16_t) -0:? -4 (const int16_t) +0:? 4 (const int16_t) 0:? 'bool_to_int32_t' ( const int) 0:? 1 (const int) 0:? 'int8_t_to_int32_t' ( const int) @@ -509,7 +509,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int32_t' ( const int) 0:? 13 (const int) 0:? 'float64_t_to_int32_t' ( const int) -0:? -4 (const int) +0:? 4 (const int) 0:? 'bool_to_int64_t' ( const int64_t) 0:? 1 (const int64_t) 0:? 'int8_t_to_int64_t' ( const int64_t) @@ -533,7 +533,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_int64_t' ( const int64_t) 0:? 13 (const int64_t) 0:? 'float64_t_to_int64_t' ( const int64_t) -0:? -4 (const int64_t) +0:? 4 (const int64_t) 0:? 'bool_to_uint8_t' ( const uint8_t) 0:? 1 (const uint8_t) 0:? 'int8_t_to_uint8_t' ( const uint8_t) @@ -557,7 +557,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint8_t' ( const uint8_t) 0:? 13 (const uint8_t) 0:? 'float64_t_to_uint8_t' ( const uint8_t) -0:? 252 (const uint8_t) +0:? 4 (const uint8_t) 0:? 'bool_to_uint16_t' ( const uint16_t) 0:? 1 (const uint16_t) 0:? 'int8_t_to_uint16_t' ( const uint16_t) @@ -581,7 +581,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint16_t' ( const uint16_t) 0:? 13 (const uint16_t) 0:? 'float64_t_to_uint16_t' ( const uint16_t) -0:? 65532 (const uint16_t) +0:? 4 (const uint16_t) 0:? 'bool_to_uint32_t' ( const uint) 0:? 1 (const uint) 0:? 'int8_t_to_uint32_t' ( const uint) @@ -605,7 +605,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint32_t' ( const uint) 0:? 13 (const uint) 0:? 'float64_t_to_uint32_t' ( const uint) -0:? 4294967292 (const uint) +0:? 4 (const uint) 0:? 'bool_to_uint64_t' ( const uint64_t) 0:? 1 (const uint64_t) 0:? 'int8_t_to_uint64_t' ( const uint64_t) @@ -629,7 +629,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_uint64_t' ( const uint64_t) 0:? 13 (const uint64_t) 0:? 'float64_t_to_uint64_t' ( const uint64_t) -0:? 18446744073709551612 (const uint64_t) +0:? 4 (const uint64_t) 0:? 'bool_to_float16_t' ( const float16_t) 0:? 1.000000 0:? 'int8_t_to_float16_t' ( const float16_t) @@ -653,7 +653,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float16_t' ( const float16_t) 0:? 13.000000 0:? 'float64_t_to_float16_t' ( const float16_t) -0:? -4.000000 +0:? 4.000000 0:? 'bool_to_float32_t' ( const float) 0:? 1.000000 0:? 'int8_t_to_float32_t' ( const float) @@ -677,7 +677,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float32_t' ( const float) 0:? 13.000000 0:? 'float64_t_to_float32_t' ( const float) -0:? -4.000000 +0:? 4.000000 0:? 'bool_to_float64_t' ( const double) 0:? 1.000000 0:? 'int8_t_to_float64_t' ( const double) @@ -701,7 +701,7 @@ local_size = (1, 1, 1) 0:? 'float32_t_to_float64_t' ( const double) 0:? 13.000000 0:? 'float64_t_to_float64_t' ( const double) -0:? -4.000000 +0:? 4.000000 0:? 'neg_float16_t_to_bool' ( const bool) 0:? true (const bool) 0:? 'neg_float32_t_to_bool' ( const bool) diff --git a/Test/constantUnaryConversion.comp b/Test/constantUnaryConversion.comp index 7226a267..f0710cd0 100644 --- a/Test/constantUnaryConversion.comp +++ b/Test/constantUnaryConversion.comp @@ -13,7 +13,7 @@ const uint32_t uint32_t_init = uint32_t(3); const uint64_t uint64_t_init = uint64_t(4); const float16_t float16_t_init = float16_t(42.0); const float32_t float32_t_init = float32_t(13.0); -const float64_t float64_t_init = float64_t(-4.0); +const float64_t float64_t_init = float64_t(4.0); const float16_t neg_float16_t_init = float16_t(-42.0); const float32_t neg_float32_t_init = float32_t(-13.0); From cd187e201a43d31e1e740edc99d184e806a46f6d Mon Sep 17 00:00:00 2001 From: Kevin Athey Date: Mon, 15 Nov 2021 16:33:08 -0800 Subject: [PATCH 58/64] Initialize member TSymbol::uniqueId. --- glslang/MachineIndependent/SymbolTable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glslang/MachineIndependent/SymbolTable.h b/glslang/MachineIndependent/SymbolTable.h index 720999a3..31312ecb 100644 --- a/glslang/MachineIndependent/SymbolTable.h +++ b/glslang/MachineIndependent/SymbolTable.h @@ -84,7 +84,7 @@ typedef TVector TExtensionList; class TSymbol { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) - explicit TSymbol(const TString *n) : name(n), extensions(0), writable(true) { } + explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(0), writable(true) { } virtual TSymbol* clone() const = 0; virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool From 1025f4736a78363acdad236c7550989f5160d9db Mon Sep 17 00:00:00 2001 From: Alan Baker Date: Tue, 16 Nov 2021 19:03:12 -0500 Subject: [PATCH 59/64] Update SPIRV-Tools * Fix test expectations --- Test/baseLegalResults/hlsl.flattenSubset.frag.out | 6 +----- Test/baseLegalResults/hlsl.flattenSubset2.frag.out | 6 +----- known_good.json | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Test/baseLegalResults/hlsl.flattenSubset.frag.out b/Test/baseLegalResults/hlsl.flattenSubset.frag.out index 0edf7120..46d3afba 100644 --- a/Test/baseLegalResults/hlsl.flattenSubset.frag.out +++ b/Test/baseLegalResults/hlsl.flattenSubset.frag.out @@ -6,19 +6,17 @@ hlsl.flattenSubset.frag Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 50 + EntryPoint Fragment 4 "main" 50 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" Name 21 "samp" Name 33 "tex" - Name 47 "vpos" Name 50 "@entryPointOutput" Decorate 21(samp) DescriptorSet 0 Decorate 21(samp) Binding 0 Decorate 33(tex) DescriptorSet 0 Decorate 33(tex) Binding 1 - Decorate 47(vpos) Location 0 Decorate 50(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 @@ -34,8 +32,6 @@ hlsl.flattenSubset.frag 39: TypeVector 6(float) 2 40: 6(float) Constant 1056964608 41: 39(fvec2) ConstantComposite 40 40 - 46: TypePointer Input 7(fvec4) - 47(vpos): 46(ptr) Variable Input 49: TypePointer Output 7(fvec4) 50(@entryPointOutput): 49(ptr) Variable Output 4(main): 2 Function None 3 diff --git a/Test/baseLegalResults/hlsl.flattenSubset2.frag.out b/Test/baseLegalResults/hlsl.flattenSubset2.frag.out index 00bd55be..408c0eac 100644 --- a/Test/baseLegalResults/hlsl.flattenSubset2.frag.out +++ b/Test/baseLegalResults/hlsl.flattenSubset2.frag.out @@ -6,13 +6,11 @@ hlsl.flattenSubset2.frag Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 49 52 + EntryPoint Fragment 4 "main" 52 ExecutionMode 4 OriginUpperLeft Source HLSL 500 Name 4 "main" - Name 49 "vpos" Name 52 "@entryPointOutput" - Decorate 49(vpos) Location 0 Decorate 52(@entryPointOutput) Location 0 2: TypeVoid 3: TypeFunction 2 @@ -20,8 +18,6 @@ hlsl.flattenSubset2.frag 7: TypeVector 6(float) 4 43: 6(float) Constant 0 44: 7(fvec4) ConstantComposite 43 43 43 43 - 48: TypePointer Input 7(fvec4) - 49(vpos): 48(ptr) Variable Input 51: TypePointer Output 7(fvec4) 52(@entryPointOutput): 51(ptr) Variable Output 4(main): 2 Function None 3 diff --git a/known_good.json b/known_good.json index 96c27dea..5da639d6 100644 --- a/known_good.json +++ b/known_good.json @@ -5,7 +5,7 @@ "site" : "github", "subrepo" : "KhronosGroup/SPIRV-Tools", "subdir" : "External/spirv-tools", - "commit" : "21e3f681e2004590c7865bc8c0195a4ab8e66c88" + "commit" : "4b092d2ab81854e61632bdd1e658907f0071c37e" }, { "name" : "spirv-tools/external/spirv-headers", From e9564feb55492127cc3c556502bfa46875fc3992 Mon Sep 17 00:00:00 2001 From: Greg Fischer Date: Tue, 16 Nov 2021 18:42:12 -0700 Subject: [PATCH 60/64] Add --hlsl-dx-position-w option This reciprocates the w component of SV_Position in HLSL fragment shaders to provide DirectX compatibility for HLSL shaders in Vulkan. Fixes #2244 --- StandAlone/StandAlone.cpp | 8 + Test/baseResults/hlsl.w-recip.frag.out | 268 ++++++++++++++++++ Test/hlsl.w-recip.frag | 12 + Test/runtests | 7 + glslang/HLSL/hlslParseHelper.cpp | 17 +- glslang/MachineIndependent/ShaderLang.cpp | 1 + glslang/MachineIndependent/linkValidate.cpp | 1 + .../MachineIndependent/localintermediate.h | 10 + glslang/Public/ShaderLang.h | 1 + 9 files changed, 323 insertions(+), 2 deletions(-) create mode 100644 Test/baseResults/hlsl.w-recip.frag.out create mode 100644 Test/hlsl.w-recip.frag diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 23e510c2..4deaf4d9 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -177,6 +177,7 @@ const char* shaderStageName = nullptr; const char* variableName = nullptr; bool HlslEnable16BitTypes = false; bool HlslDX9compatible = false; +bool HlslDxPositionW = false; bool DumpBuiltinSymbols = false; std::vector IncludeDirectoryList; @@ -662,6 +663,8 @@ void ProcessArguments(std::vector>& workItem HlslEnable16BitTypes = true; } else if (lowerword == "hlsl-dx9-compatible") { HlslDX9compatible = true; + } else if (lowerword == "hlsl-dx-position-w") { + HlslDxPositionW = true; } else if (lowerword == "auto-sampled-textures") { autoSampledTextures = true; } else if (lowerword == "invert-y" || // synonyms @@ -1284,6 +1287,9 @@ void CompileAndLinkShaderUnits(std::vector compUnits) if (Options & EOptionInvertY) shader->setInvertY(true); + if (HlslDxPositionW) + shader->setDxPositionW(true); + // Set up the environment, some subsettings take precedence over earlier // ways of setting things. if (Options & EOptionSpv) { @@ -1847,6 +1853,8 @@ void usage() " --hlsl-dx9-compatible interprets sampler declarations as a\n" " texture/sampler combo like DirectX9 would,\n" " and recognizes DirectX9-specific semantics\n" + " --hlsl-dx-position-w W component of SV_Position in HLSL fragment\n" + " shaders compatible with DirectX\n" " --invert-y | --iy invert position.Y output in vertex shader\n" " --keep-uncalled | --ku don't eliminate uncalled functions\n" " --nan-clamp favor non-NaN operand in min, max, and clamp\n" diff --git a/Test/baseResults/hlsl.w-recip.frag.out b/Test/baseResults/hlsl.w-recip.frag.out new file mode 100644 index 00000000..b72f361e --- /dev/null +++ b/Test/baseResults/hlsl.w-recip.frag.out @@ -0,0 +1,268 @@ +hlsl.w-recip.frag +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'vpos' ( in 4-component vector of float) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'vpos_t' ( temp 4-component vector of float) +0:6 Construct vec4 ( temp 4-component vector of float) +0:6 vector swizzle ( temp 3-component vector of float) +0:6 'vpos' ( in 4-component vector of float) +0:6 Sequence +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 1 (const int) +0:6 Constant: +0:6 2 (const int) +0:6 divide ( temp float) +0:6 Constant: +0:6 1.000000 +0:6 direct index ( temp float) +0:6 'vpos' ( in 4-component vector of float) +0:6 Constant: +0:6 3 (const int) +0:7 Test condition and select ( temp void) +0:7 Condition +0:7 Compare Less Than ( temp bool) +0:7 direct index ( temp float) +0:7 'vpos_t' ( temp 4-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 400.000000 +0:7 true case +0:8 Branch: Return with expression +0:8 AmbientColor: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:8 Constant: +0:8 0 (const uint) +0:7 false case +0:10 Branch: Return with expression +0:10 AmbientColor2: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:10 Constant: +0:10 1 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 vector swizzle ( temp 3-component vector of float) +0:? 'vpos' ( in 4-component vector of float FragCoord) +0:5 Sequence +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 divide ( temp float) +0:5 Constant: +0:5 1.000000 +0:5 direct index ( temp float) +0:? 'vpos' ( in 4-component vector of float FragCoord) +0:5 Constant: +0:5 3 (const int) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' ( in 4-component vector of float FragCoord) + + +Linked fragment stage: + + +Shader version: 500 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: @main(vf4; ( temp 4-component vector of float) +0:5 Function Parameters: +0:5 'vpos' ( in 4-component vector of float) +0:? Sequence +0:6 Sequence +0:6 move second child to first child ( temp 4-component vector of float) +0:6 'vpos_t' ( temp 4-component vector of float) +0:6 Construct vec4 ( temp 4-component vector of float) +0:6 vector swizzle ( temp 3-component vector of float) +0:6 'vpos' ( in 4-component vector of float) +0:6 Sequence +0:6 Constant: +0:6 0 (const int) +0:6 Constant: +0:6 1 (const int) +0:6 Constant: +0:6 2 (const int) +0:6 divide ( temp float) +0:6 Constant: +0:6 1.000000 +0:6 direct index ( temp float) +0:6 'vpos' ( in 4-component vector of float) +0:6 Constant: +0:6 3 (const int) +0:7 Test condition and select ( temp void) +0:7 Condition +0:7 Compare Less Than ( temp bool) +0:7 direct index ( temp float) +0:7 'vpos_t' ( temp 4-component vector of float) +0:7 Constant: +0:7 0 (const int) +0:7 Constant: +0:7 400.000000 +0:7 true case +0:8 Branch: Return with expression +0:8 AmbientColor: direct index for structure ( uniform 4-component vector of float) +0:8 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:8 Constant: +0:8 0 (const uint) +0:7 false case +0:10 Branch: Return with expression +0:10 AmbientColor2: direct index for structure ( uniform 4-component vector of float) +0:10 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:10 Constant: +0:10 1 (const uint) +0:5 Function Definition: main( ( temp void) +0:5 Function Parameters: +0:? Sequence +0:5 move second child to first child ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:5 Construct vec4 ( temp 4-component vector of float) +0:5 vector swizzle ( temp 3-component vector of float) +0:? 'vpos' ( in 4-component vector of float FragCoord) +0:5 Sequence +0:5 Constant: +0:5 0 (const int) +0:5 Constant: +0:5 1 (const int) +0:5 Constant: +0:5 2 (const int) +0:5 divide ( temp float) +0:5 Constant: +0:5 1.000000 +0:5 direct index ( temp float) +0:? 'vpos' ( in 4-component vector of float FragCoord) +0:5 Constant: +0:5 3 (const int) +0:5 move second child to first child ( temp 4-component vector of float) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:5 Function Call: @main(vf4; ( temp 4-component vector of float) +0:? 'vpos' ( temp 4-component vector of float) +0:? Linker Objects +0:? 'anon@0' (layout( row_major std140) uniform block{ uniform 4-component vector of float AmbientColor, uniform 4-component vector of float AmbientColor2}) +0:? '@entryPointOutput' (layout( location=0) out 4-component vector of float) +0:? 'vpos' ( in 4-component vector of float FragCoord) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 69 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 53 65 + ExecutionMode 4 OriginUpperLeft + Source HLSL 500 + Name 4 "main" + Name 11 "@main(vf4;" + Name 10 "vpos" + Name 13 "vpos_t" + Name 36 "$Global" + MemberName 36($Global) 0 "AmbientColor" + MemberName 36($Global) 1 "AmbientColor2" + Name 38 "" + Name 51 "vpos" + Name 53 "vpos" + Name 65 "@entryPointOutput" + Name 66 "param" + MemberDecorate 36($Global) 0 Offset 0 + MemberDecorate 36($Global) 1 Offset 16 + Decorate 36($Global) Block + Decorate 38 DescriptorSet 0 + Decorate 38 Binding 0 + Decorate 53(vpos) BuiltIn FragCoord + Decorate 65(@entryPointOutput) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) + 14: TypeVector 6(float) 3 + 17: 6(float) Constant 1065353216 + 18: TypeInt 32 0 + 19: 18(int) Constant 3 + 20: TypePointer Function 6(float) + 28: 18(int) Constant 0 + 31: 6(float) Constant 1137180672 + 32: TypeBool + 36($Global): TypeStruct 7(fvec4) 7(fvec4) + 37: TypePointer Uniform 36($Global) + 38: 37(ptr) Variable Uniform + 39: TypeInt 32 1 + 40: 39(int) Constant 0 + 41: TypePointer Uniform 7(fvec4) + 46: 39(int) Constant 1 + 52: TypePointer Input 7(fvec4) + 53(vpos): 52(ptr) Variable Input + 56: TypePointer Input 6(float) + 64: TypePointer Output 7(fvec4) +65(@entryPointOutput): 64(ptr) Variable Output + 4(main): 2 Function None 3 + 5: Label + 51(vpos): 8(ptr) Variable Function + 66(param): 8(ptr) Variable Function + 54: 7(fvec4) Load 53(vpos) + 55: 14(fvec3) VectorShuffle 54 54 0 1 2 + 57: 56(ptr) AccessChain 53(vpos) 19 + 58: 6(float) Load 57 + 59: 6(float) FDiv 17 58 + 60: 6(float) CompositeExtract 55 0 + 61: 6(float) CompositeExtract 55 1 + 62: 6(float) CompositeExtract 55 2 + 63: 7(fvec4) CompositeConstruct 60 61 62 59 + Store 51(vpos) 63 + 67: 7(fvec4) Load 51(vpos) + Store 66(param) 67 + 68: 7(fvec4) FunctionCall 11(@main(vf4;) 66(param) + Store 65(@entryPointOutput) 68 + Return + FunctionEnd + 11(@main(vf4;): 7(fvec4) Function None 9 + 10(vpos): 8(ptr) FunctionParameter + 12: Label + 13(vpos_t): 8(ptr) Variable Function + 15: 7(fvec4) Load 10(vpos) + 16: 14(fvec3) VectorShuffle 15 15 0 1 2 + 21: 20(ptr) AccessChain 10(vpos) 19 + 22: 6(float) Load 21 + 23: 6(float) FDiv 17 22 + 24: 6(float) CompositeExtract 16 0 + 25: 6(float) CompositeExtract 16 1 + 26: 6(float) CompositeExtract 16 2 + 27: 7(fvec4) CompositeConstruct 24 25 26 23 + Store 13(vpos_t) 27 + 29: 20(ptr) AccessChain 13(vpos_t) 28 + 30: 6(float) Load 29 + 33: 32(bool) FOrdLessThan 30 31 + SelectionMerge 35 None + BranchConditional 33 34 45 + 34: Label + 42: 41(ptr) AccessChain 38 40 + 43: 7(fvec4) Load 42 + ReturnValue 43 + 45: Label + 47: 41(ptr) AccessChain 38 46 + 48: 7(fvec4) Load 47 + ReturnValue 48 + 35: Label + Unreachable + FunctionEnd diff --git a/Test/hlsl.w-recip.frag b/Test/hlsl.w-recip.frag new file mode 100644 index 00000000..4812d269 --- /dev/null +++ b/Test/hlsl.w-recip.frag @@ -0,0 +1,12 @@ +float4 AmbientColor = float4(1, 0.5, 0, 1); +float4 AmbientColor2 = float4(0.5, 1, 0, 0); + +float4 main(float4 vpos : SV_POSITION) : SV_TARGET +{ + float4 vpos_t = float4(vpos.xyz, 1 / vpos.w); + if (vpos_t.x < 400) + return AmbientColor; + else + return AmbientColor2; +} + diff --git a/Test/runtests b/Test/runtests index a7bdda79..f27b6d83 100755 --- a/Test/runtests +++ b/Test/runtests @@ -254,6 +254,13 @@ diff -b $BASEDIR/hlsl.y-negate-2.vert.out $TARGETDIR/hlsl.y-negate-2.vert.out || run -H -e main -V -D -Od -H -i --invert-y hlsl.y-negate-3.vert > $TARGETDIR/hlsl.y-negate-3.vert.out diff -b $BASEDIR/hlsl.y-negate-3.vert.out $TARGETDIR/hlsl.y-negate-3.vert.out || HASERROR=1 +# +# Testing position W reciprocal +# +echo "Testing position W reciprocal" +run -H -e main -V -D -Od -H -i --hlsl-dx-position-w hlsl.w-recip.frag > $TARGETDIR/hlsl.w-recip.frag.out +diff -b $BASEDIR/hlsl.w-recip.frag.out $TARGETDIR/hlsl.w-recip.frag.out || HASERROR=1 + # # Testing hlsl_functionality1 # diff --git a/glslang/HLSL/hlslParseHelper.cpp b/glslang/HLSL/hlslParseHelper.cpp index 0936bd3a..9122973a 100644 --- a/glslang/HLSL/hlslParseHelper.cpp +++ b/glslang/HLSL/hlslParseHelper.cpp @@ -2167,8 +2167,21 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct TIntermSymbol* arg = intermediate.addSymbol(*argVars.back()); handleFunctionArgument(&callee, callingArgs, arg); if (param.type->getQualifier().isParamInput()) { - intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, - intermediate.addSymbol(**inputIt))); + TIntermTyped* input = intermediate.addSymbol(**inputIt); + if (input->getType().getQualifier().builtIn == EbvFragCoord && intermediate.getDxPositionW()) { + // Replace FragCoord W with reciprocal + auto pos_xyz = handleDotDereference(loc, input, "xyz"); + auto pos_w = handleDotDereference(loc, input, "w"); + auto one = intermediate.addConstantUnion(1.0, EbtFloat, loc); + auto recip_w = intermediate.addBinaryMath(EOpDiv, one, pos_w, loc); + TIntermAggregate* dst = new TIntermAggregate(EOpConstructVec4); + dst->getSequence().push_back(pos_xyz); + dst->getSequence().push_back(recip_w); + dst->setType(TType(EbtFloat, EvqTemporary, 4)); + dst->setLoc(loc); + input = dst; + } + intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, input)); inputIt++; } if (param.type->getQualifier().storage == EvqUniform) { diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index a2dd71cf..bcf2c33f 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1829,6 +1829,7 @@ void TShader::setUniqueId(unsigned long long id) } void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); } +void TShader::setDxPositionW(bool invert) { intermediate->setDxPositionW(invert); } void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); } #ifndef GLSLANG_WEB diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index b1adfc93..d2eb9026 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -312,6 +312,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(autoMapBindings); MERGE_TRUE(autoMapLocations); MERGE_TRUE(invertY); + MERGE_TRUE(dxPositionW); MERGE_TRUE(flattenUniformArrays); MERGE_TRUE(useUnknownFormat); MERGE_TRUE(hlslOffsets); diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 6aa9399d..940abf79 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -290,6 +290,7 @@ public: resources(TBuiltInResource{}), numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false), invertY(false), + dxPositionW(false), useStorageBuffer(false), invariantAll(false), nanMinMaxClamp(false), @@ -460,6 +461,14 @@ public: } bool getInvertY() const { return invertY; } + void setDxPositionW(bool dxPosW) + { + dxPositionW = dxPosW; + if (dxPositionW) + processes.addProcess("dx-position-w"); + } + bool getDxPositionW() const { return dxPositionW; } + #ifdef ENABLE_HLSL void setSource(EShSource s) { source = s; } EShSource getSource() const { return source; } @@ -1070,6 +1079,7 @@ protected: int numPushConstants; bool recursive; bool invertY; + bool dxPositionW; bool useStorageBuffer; bool invariantAll; bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index d2a4bf40..9d3e9be1 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -485,6 +485,7 @@ public: GLSLANG_EXPORT void addUniformLocationOverride(const char* name, int loc); GLSLANG_EXPORT void setUniformLocationBase(int base); GLSLANG_EXPORT void setInvertY(bool invert); + GLSLANG_EXPORT void setDxPositionW(bool dxPosW); #ifdef ENABLE_HLSL GLSLANG_EXPORT void setHlslIoMapping(bool hlslIoMap); GLSLANG_EXPORT void setFlattenUniformArrays(bool flatten); From cbab732905af5161693fa12c46e16938a16e5fd8 Mon Sep 17 00:00:00 2001 From: Kevin McCullough Date: Wed, 13 Oct 2021 15:32:38 -0700 Subject: [PATCH 61/64] Fix issue with separable shader validation in iomapper --- .../iomap.blockOutVariableIn.2.vert.out | 413 ++++++++++++++++++ .../iomap.blockOutVariableIn.vert.out | 234 ++++++++++ .../iomap.variableOutBlockIn.2.vert.out | 276 ++++++++++++ .../iomap.variableOutBlockIn.vert.out | 236 ++++++++++ Test/iomap.blockOutVariableIn.2.vert | 14 + Test/iomap.blockOutVariableIn.frag | 11 + Test/iomap.blockOutVariableIn.geom | 28 ++ Test/iomap.blockOutVariableIn.vert | 14 + Test/iomap.variableOutBlockIn.2.vert | 11 + Test/iomap.variableOutBlockIn.frag | 13 + Test/iomap.variableOutBlockIn.geom | 19 + Test/iomap.variableOutBlockIn.vert | 11 + glslang/MachineIndependent/iomapper.cpp | 18 + glslang/MachineIndependent/linkValidate.cpp | 5 +- gtests/GlslMapIO.FromFile.cpp | 49 ++- 15 files changed, 1350 insertions(+), 2 deletions(-) create mode 100644 Test/baseResults/iomap.blockOutVariableIn.2.vert.out create mode 100644 Test/baseResults/iomap.blockOutVariableIn.vert.out create mode 100644 Test/baseResults/iomap.variableOutBlockIn.2.vert.out create mode 100644 Test/baseResults/iomap.variableOutBlockIn.vert.out create mode 100644 Test/iomap.blockOutVariableIn.2.vert create mode 100644 Test/iomap.blockOutVariableIn.frag create mode 100644 Test/iomap.blockOutVariableIn.geom create mode 100644 Test/iomap.blockOutVariableIn.vert create mode 100644 Test/iomap.variableOutBlockIn.2.vert create mode 100644 Test/iomap.variableOutBlockIn.frag create mode 100644 Test/iomap.variableOutBlockIn.geom create mode 100644 Test/iomap.variableOutBlockIn.vert diff --git a/Test/baseResults/iomap.blockOutVariableIn.2.vert.out b/Test/baseResults/iomap.blockOutVariableIn.2.vert.out new file mode 100644 index 00000000..0b4c0ac9 --- /dev/null +++ b/Test/baseResults/iomap.blockOutVariableIn.2.vert.out @@ -0,0 +1,413 @@ +iomap.blockOutVariableIn.2.vert +Shader version: 440 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 a1: direct index for structure ( out 4-component vector of float) +0:11 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 move second child to first child ( temp 2-component vector of float) +0:12 a2: direct index for structure ( out 2-component vector of float) +0:12 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:12 Constant: +0:12 0.500000 +0:12 0.500000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +iomap.blockOutVariableIn.geom +Shader version: 440 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:14 direct index (layout( location=0) temp 4-component vector of float) +0:14 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:15 direct index (layout( location=1) temp 2-component vector of float) +0:15 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:16 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 EmitVertex ( global void) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:19 direct index (layout( location=0) temp 4-component vector of float) +0:19 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:20 direct index (layout( location=1) temp 2-component vector of float) +0:20 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:21 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:21 Constant: +0:21 0 (const uint) +0:21 Constant: +0:21 1.000000 +0:21 1.000000 +0:21 1.000000 +0:21 1.000000 +0:22 EmitVertex ( global void) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:24 direct index (layout( location=0) temp 4-component vector of float) +0:24 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp 2-component vector of float) +0:25 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:25 direct index (layout( location=1) temp 2-component vector of float) +0:25 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:25 Constant: +0:25 2 (const int) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:26 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:26 Constant: +0:26 0 (const uint) +0:26 Constant: +0:26 1.000000 +0:26 1.000000 +0:26 1.000000 +0:26 1.000000 +0:27 EmitVertex ( global void) +0:? Linker Objects +0:? 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:? 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:? 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:? 'a2' (layout( location=1 stream=0) out 2-component vector of float) +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 1-element array of float ClipDistance gl_ClipDistance}) + + +Linked vertex stage: + + +Linked geometry stage: + + +Shader version: 440 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 a1: direct index for structure ( out 4-component vector of float) +0:11 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 move second child to first child ( temp 2-component vector of float) +0:12 a2: direct index for structure ( out 2-component vector of float) +0:12 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:12 Constant: +0:12 0.500000 +0:12 0.500000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 440 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:12 Function Definition: main( ( global void) +0:12 Function Parameters: +0:14 Sequence +0:14 move second child to first child ( temp 4-component vector of float) +0:14 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:14 direct index (layout( location=0) temp 4-component vector of float) +0:14 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:14 Constant: +0:14 0 (const int) +0:15 move second child to first child ( temp 2-component vector of float) +0:15 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:15 direct index (layout( location=1) temp 2-component vector of float) +0:15 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:15 Constant: +0:15 0 (const int) +0:16 move second child to first child ( temp 4-component vector of float) +0:16 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:16 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:16 Constant: +0:16 0 (const uint) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 EmitVertex ( global void) +0:19 move second child to first child ( temp 4-component vector of float) +0:19 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:19 direct index (layout( location=0) temp 4-component vector of float) +0:19 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:19 Constant: +0:19 1 (const int) +0:20 move second child to first child ( temp 2-component vector of float) +0:20 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:20 direct index (layout( location=1) temp 2-component vector of float) +0:20 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:20 Constant: +0:20 1 (const int) +0:21 move second child to first child ( temp 4-component vector of float) +0:21 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:21 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:21 Constant: +0:21 0 (const uint) +0:21 Constant: +0:21 1.000000 +0:21 1.000000 +0:21 1.000000 +0:21 1.000000 +0:22 EmitVertex ( global void) +0:24 move second child to first child ( temp 4-component vector of float) +0:24 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:24 direct index (layout( location=0) temp 4-component vector of float) +0:24 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:24 Constant: +0:24 2 (const int) +0:25 move second child to first child ( temp 2-component vector of float) +0:25 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:25 direct index (layout( location=1) temp 2-component vector of float) +0:25 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:25 Constant: +0:25 2 (const int) +0:26 move second child to first child ( temp 4-component vector of float) +0:26 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:26 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:26 Constant: +0:26 0 (const uint) +0:26 Constant: +0:26 1.000000 +0:26 1.000000 +0:26 1.000000 +0:26 1.000000 +0:27 EmitVertex ( global void) +0:? Linker Objects +0:? 'in_a1' (layout( location=0) in 3-element array of 4-component vector of float) +0:? 'in_a2' (layout( location=1) in 3-element array of 2-component vector of float) +0:? 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:? 'a2' (layout( location=1 stream=0) out 2-component vector of float) +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 1-element array of float ClipDistance gl_ClipDistance}) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 33 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 11 28 31 32 + Source GLSL 440 + Name 4 "main" + Name 9 "Block" + MemberName 9(Block) 0 "a1" + MemberName 9(Block) 1 "a2" + Name 11 "" + Name 26 "gl_PerVertex" + MemberName 26(gl_PerVertex) 0 "gl_Position" + MemberName 26(gl_PerVertex) 1 "gl_PointSize" + MemberName 26(gl_PerVertex) 2 "gl_ClipDistance" + Name 28 "" + Name 31 "gl_VertexID" + Name 32 "gl_InstanceID" + Decorate 9(Block) Block + Decorate 11 Location 0 + MemberDecorate 26(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 26(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 26(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 26(gl_PerVertex) Block + Decorate 31(gl_VertexID) BuiltIn VertexId + Decorate 32(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(Block): TypeStruct 7(fvec4) 8(fvec2) + 10: TypePointer Output 9(Block) + 11: 10(ptr) Variable Output + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: 6(float) Constant 1065353216 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 16: TypePointer Output 7(fvec4) + 18: 12(int) Constant 1 + 19: 6(float) Constant 1056964608 + 20: 8(fvec2) ConstantComposite 19 19 + 21: TypePointer Output 8(fvec2) + 23: TypeInt 32 0 + 24: 23(int) Constant 1 + 25: TypeArray 6(float) 24 +26(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 25 + 27: TypePointer Output 26(gl_PerVertex) + 28: 27(ptr) Variable Output + 30: TypePointer Input 12(int) + 31(gl_VertexID): 30(ptr) Variable Input +32(gl_InstanceID): 30(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 11 13 + Store 17 15 + 22: 21(ptr) AccessChain 11 18 + Store 22 20 + 29: 16(ptr) AccessChain 28 13 + Store 29 15 + Return + FunctionEnd +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 49 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 9 14 22 25 33 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 440 + Name 4 "main" + Name 9 "a1" + Name 14 "in_a1" + Name 22 "a2" + Name 25 "in_a2" + Name 31 "gl_PerVertex" + MemberName 31(gl_PerVertex) 0 "gl_Position" + MemberName 31(gl_PerVertex) 1 "gl_PointSize" + MemberName 31(gl_PerVertex) 2 "gl_ClipDistance" + Name 33 "" + Decorate 9(a1) Location 0 + Decorate 14(in_a1) Location 0 + Decorate 22(a2) Location 1 + Decorate 25(in_a2) Location 1 + MemberDecorate 31(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 31(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 31(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 31(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(a1): 8(ptr) Variable Output + 10: TypeInt 32 0 + 11: 10(int) Constant 3 + 12: TypeArray 7(fvec4) 11 + 13: TypePointer Input 12 + 14(in_a1): 13(ptr) Variable Input + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Input 7(fvec4) + 20: TypeVector 6(float) 2 + 21: TypePointer Output 20(fvec2) + 22(a2): 21(ptr) Variable Output + 23: TypeArray 20(fvec2) 11 + 24: TypePointer Input 23 + 25(in_a2): 24(ptr) Variable Input + 26: TypePointer Input 20(fvec2) + 29: 10(int) Constant 1 + 30: TypeArray 6(float) 29 +31(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 30 + 32: TypePointer Output 31(gl_PerVertex) + 33: 32(ptr) Variable Output + 34: 6(float) Constant 1065353216 + 35: 7(fvec4) ConstantComposite 34 34 34 34 + 37: 15(int) Constant 1 + 43: 15(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 18: 17(ptr) AccessChain 14(in_a1) 16 + 19: 7(fvec4) Load 18 + Store 9(a1) 19 + 27: 26(ptr) AccessChain 25(in_a2) 16 + 28: 20(fvec2) Load 27 + Store 22(a2) 28 + 36: 8(ptr) AccessChain 33 16 + Store 36 35 + EmitVertex + 38: 17(ptr) AccessChain 14(in_a1) 37 + 39: 7(fvec4) Load 38 + Store 9(a1) 39 + 40: 26(ptr) AccessChain 25(in_a2) 37 + 41: 20(fvec2) Load 40 + Store 22(a2) 41 + 42: 8(ptr) AccessChain 33 16 + Store 42 35 + EmitVertex + 44: 17(ptr) AccessChain 14(in_a1) 43 + 45: 7(fvec4) Load 44 + Store 9(a1) 45 + 46: 26(ptr) AccessChain 25(in_a2) 43 + 47: 20(fvec2) Load 46 + Store 22(a2) 47 + 48: 8(ptr) AccessChain 33 16 + Store 48 35 + EmitVertex + Return + FunctionEnd diff --git a/Test/baseResults/iomap.blockOutVariableIn.vert.out b/Test/baseResults/iomap.blockOutVariableIn.vert.out new file mode 100644 index 00000000..dd12cbc2 --- /dev/null +++ b/Test/baseResults/iomap.blockOutVariableIn.vert.out @@ -0,0 +1,234 @@ +iomap.blockOutVariableIn.vert +Shader version: 440 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 a1: direct index for structure ( out 4-component vector of float) +0:11 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 move second child to first child ( temp 2-component vector of float) +0:12 a2: direct index for structure ( out 2-component vector of float) +0:12 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:12 Constant: +0:12 0.500000 +0:12 0.500000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +iomap.blockOutVariableIn.frag +Shader version: 440 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'color' (layout( location=0) out 4-component vector of float) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 'a1' (layout( location=0) smooth in 4-component vector of float) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 'a2' (layout( location=1) smooth in 2-component vector of float) +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth in 4-component vector of float) +0:? 'a2' (layout( location=1) smooth in 2-component vector of float) +0:? 'color' (layout( location=0) out 4-component vector of float) + + +Linked vertex stage: + + +Linked fragment stage: + + +Shader version: 440 +0:? Sequence +0:9 Function Definition: main( ( global void) +0:9 Function Parameters: +0:11 Sequence +0:11 move second child to first child ( temp 4-component vector of float) +0:11 a1: direct index for structure ( out 4-component vector of float) +0:11 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:11 Constant: +0:11 0 (const uint) +0:11 Constant: +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:11 1.000000 +0:12 move second child to first child ( temp 2-component vector of float) +0:12 a2: direct index for structure ( out 2-component vector of float) +0:12 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:12 Constant: +0:12 0.500000 +0:12 0.500000 +0:13 move second child to first child ( temp 4-component vector of float) +0:13 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:13 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:13 Constant: +0:13 0 (const uint) +0:13 Constant: +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:13 1.000000 +0:? Linker Objects +0:? 'anon@0' (layout( location=0) out block{ out 4-component vector of float a1, out 2-component vector of float a2}) +0:? 'anon@1' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 440 +0:? Sequence +0:8 Function Definition: main( ( global void) +0:8 Function Parameters: +0:10 Sequence +0:10 move second child to first child ( temp 4-component vector of float) +0:10 'color' (layout( location=0) out 4-component vector of float) +0:10 Construct vec4 ( temp 4-component vector of float) +0:10 vector swizzle ( temp 2-component vector of float) +0:10 'a1' (layout( location=0) smooth in 4-component vector of float) +0:10 Sequence +0:10 Constant: +0:10 0 (const int) +0:10 Constant: +0:10 1 (const int) +0:10 'a2' (layout( location=1) smooth in 2-component vector of float) +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth in 4-component vector of float) +0:? 'a2' (layout( location=1) smooth in 2-component vector of float) +0:? 'color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 33 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 11 28 31 32 + Source GLSL 440 + Name 4 "main" + Name 9 "Block" + MemberName 9(Block) 0 "a1" + MemberName 9(Block) 1 "a2" + Name 11 "" + Name 26 "gl_PerVertex" + MemberName 26(gl_PerVertex) 0 "gl_Position" + MemberName 26(gl_PerVertex) 1 "gl_PointSize" + MemberName 26(gl_PerVertex) 2 "gl_ClipDistance" + Name 28 "" + Name 31 "gl_VertexID" + Name 32 "gl_InstanceID" + Decorate 9(Block) Block + Decorate 11 Location 0 + MemberDecorate 26(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 26(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 26(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 26(gl_PerVertex) Block + Decorate 31(gl_VertexID) BuiltIn VertexId + Decorate 32(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypeVector 6(float) 2 + 9(Block): TypeStruct 7(fvec4) 8(fvec2) + 10: TypePointer Output 9(Block) + 11: 10(ptr) Variable Output + 12: TypeInt 32 1 + 13: 12(int) Constant 0 + 14: 6(float) Constant 1065353216 + 15: 7(fvec4) ConstantComposite 14 14 14 14 + 16: TypePointer Output 7(fvec4) + 18: 12(int) Constant 1 + 19: 6(float) Constant 1056964608 + 20: 8(fvec2) ConstantComposite 19 19 + 21: TypePointer Output 8(fvec2) + 23: TypeInt 32 0 + 24: 23(int) Constant 1 + 25: TypeArray 6(float) 24 +26(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 25 + 27: TypePointer Output 26(gl_PerVertex) + 28: 27(ptr) Variable Output + 30: TypePointer Input 12(int) + 31(gl_VertexID): 30(ptr) Variable Input +32(gl_InstanceID): 30(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 11 13 + Store 17 15 + 22: 21(ptr) AccessChain 11 18 + Store 22 20 + 29: 16(ptr) AccessChain 28 13 + Store 29 15 + Return + FunctionEnd +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 23 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 11 16 + ExecutionMode 4 OriginLowerLeft + Source GLSL 440 + Name 4 "main" + Name 9 "color" + Name 11 "a1" + Name 16 "a2" + Decorate 9(color) Location 0 + Decorate 11(a1) Location 0 + Decorate 16(a2) Location 1 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypePointer Input 7(fvec4) + 11(a1): 10(ptr) Variable Input + 12: TypeVector 6(float) 2 + 15: TypePointer Input 12(fvec2) + 16(a2): 15(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + 13: 7(fvec4) Load 11(a1) + 14: 12(fvec2) VectorShuffle 13 13 0 1 + 17: 12(fvec2) Load 16(a2) + 18: 6(float) CompositeExtract 14 0 + 19: 6(float) CompositeExtract 14 1 + 20: 6(float) CompositeExtract 17 0 + 21: 6(float) CompositeExtract 17 1 + 22: 7(fvec4) CompositeConstruct 18 19 20 21 + Store 9(color) 22 + Return + FunctionEnd diff --git a/Test/baseResults/iomap.variableOutBlockIn.2.vert.out b/Test/baseResults/iomap.variableOutBlockIn.2.vert.out new file mode 100644 index 00000000..6ef7d4e3 --- /dev/null +++ b/Test/baseResults/iomap.variableOutBlockIn.2.vert.out @@ -0,0 +1,276 @@ +iomap.variableOutBlockIn.2.vert +Shader version: 440 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a1' (layout( location=0) smooth out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 2-component vector of float) +0:9 'a2' (layout( location=1) smooth out 2-component vector of float) +0:9 Constant: +0:9 0.500000 +0:9 0.500000 +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth out 4-component vector of float) +0:? 'a2' (layout( location=1) smooth out 2-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +iomap.variableOutBlockIn.geom +Shader version: 440 +invocations = -1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:14 Function Definition: main( ( global void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:17 Constant: +0:17 0.500000 +0:17 0.500000 +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:18 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 0 (const uint) +0:18 Constant: +0:18 1.000000 +0:18 1.000000 +0:18 1.000000 +0:18 1.000000 +0:? Linker Objects +0:? 'gin' (layout( location=0) in 3-element array of block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:? 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:? 'a2' (layout( location=1 stream=0) out 2-component vector of float) +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 1-element array of float ClipDistance gl_ClipDistance}) + + +Linked vertex stage: + + +Linked geometry stage: + + +Shader version: 440 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a1' (layout( location=0) smooth out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 2-component vector of float) +0:9 'a2' (layout( location=1) smooth out 2-component vector of float) +0:9 Constant: +0:9 0.500000 +0:9 0.500000 +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth out 4-component vector of float) +0:? 'a2' (layout( location=1) smooth out 2-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 440 +invocations = 1 +max_vertices = 3 +input primitive = triangles +output primitive = triangle_strip +0:? Sequence +0:14 Function Definition: main( ( global void) +0:14 Function Parameters: +0:16 Sequence +0:16 move second child to first child ( temp 4-component vector of float) +0:16 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:16 Constant: +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:16 1.000000 +0:17 move second child to first child ( temp 2-component vector of float) +0:17 'a2' (layout( location=1 stream=0) out 2-component vector of float) +0:17 Constant: +0:17 0.500000 +0:17 0.500000 +0:18 move second child to first child ( temp 4-component vector of float) +0:18 gl_Position: direct index for structure (layout( stream=0) gl_Position 4-component vector of float Position) +0:18 '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 1-element array of float ClipDistance gl_ClipDistance}) +0:18 Constant: +0:18 0 (const uint) +0:18 Constant: +0:18 1.000000 +0:18 1.000000 +0:18 1.000000 +0:18 1.000000 +0:? Linker Objects +0:? 'gin' (layout( location=0) in 3-element array of block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:? 'a1' (layout( location=0 stream=0) out 4-component vector of float) +0:? 'a2' (layout( location=1 stream=0) out 2-component vector of float) +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 1-element array of float ClipDistance gl_ClipDistance}) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 29 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 14 22 27 28 + Source GLSL 440 + Name 4 "main" + Name 9 "a1" + Name 14 "a2" + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + MemberName 20(gl_PerVertex) 2 "gl_ClipDistance" + Name 22 "" + Name 27 "gl_VertexID" + Name 28 "gl_InstanceID" + Decorate 9(a1) Location 0 + Decorate 14(a2) Location 1 + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 20(gl_PerVertex) Block + Decorate 27(gl_VertexID) BuiltIn VertexId + Decorate 28(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(a1): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeVector 6(float) 2 + 13: TypePointer Output 12(fvec2) + 14(a2): 13(ptr) Variable Output + 15: 6(float) Constant 1056964608 + 16: 12(fvec2) ConstantComposite 15 15 + 17: TypeInt 32 0 + 18: 17(int) Constant 1 + 19: TypeArray 6(float) 18 +20(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 19 + 21: TypePointer Output 20(gl_PerVertex) + 22: 21(ptr) Variable Output + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 26: TypePointer Input 23(int) + 27(gl_VertexID): 26(ptr) Variable Input +28(gl_InstanceID): 26(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Store 9(a1) 11 + Store 14(a2) 16 + 25: 8(ptr) AccessChain 22 24 + Store 25 11 + Return + FunctionEnd +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 31 + + Capability Geometry + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Geometry 4 "main" 9 14 22 30 + ExecutionMode 4 Triangles + ExecutionMode 4 Invocations 1 + ExecutionMode 4 OutputTriangleStrip + ExecutionMode 4 OutputVertices 3 + Source GLSL 440 + Name 4 "main" + Name 9 "a1" + Name 14 "a2" + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + MemberName 20(gl_PerVertex) 2 "gl_ClipDistance" + Name 22 "" + Name 26 "Inputs" + MemberName 26(Inputs) 0 "a1" + MemberName 26(Inputs) 1 "a2" + Name 30 "gin" + Decorate 9(a1) Location 0 + Decorate 14(a2) Location 1 + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 20(gl_PerVertex) Block + Decorate 26(Inputs) Block + Decorate 30(gin) Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(a1): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeVector 6(float) 2 + 13: TypePointer Output 12(fvec2) + 14(a2): 13(ptr) Variable Output + 15: 6(float) Constant 1056964608 + 16: 12(fvec2) ConstantComposite 15 15 + 17: TypeInt 32 0 + 18: 17(int) Constant 1 + 19: TypeArray 6(float) 18 +20(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 19 + 21: TypePointer Output 20(gl_PerVertex) + 22: 21(ptr) Variable Output + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 26(Inputs): TypeStruct 7(fvec4) 12(fvec2) + 27: 17(int) Constant 3 + 28: TypeArray 26(Inputs) 27 + 29: TypePointer Input 28 + 30(gin): 29(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Store 9(a1) 11 + Store 14(a2) 16 + 25: 8(ptr) AccessChain 22 24 + Store 25 11 + Return + FunctionEnd diff --git a/Test/baseResults/iomap.variableOutBlockIn.vert.out b/Test/baseResults/iomap.variableOutBlockIn.vert.out new file mode 100644 index 00000000..8fef640d --- /dev/null +++ b/Test/baseResults/iomap.variableOutBlockIn.vert.out @@ -0,0 +1,236 @@ +iomap.variableOutBlockIn.vert +Shader version: 440 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a1' (layout( location=0) smooth out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 2-component vector of float) +0:9 'a2' (layout( location=1) smooth out 2-component vector of float) +0:9 Constant: +0:9 0.500000 +0:9 0.500000 +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth out 4-component vector of float) +0:? 'a2' (layout( location=1) smooth out 2-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out unsized 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) + +iomap.variableOutBlockIn.frag +Shader version: 440 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' (layout( location=0) out 4-component vector of float) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 vector swizzle ( temp 2-component vector of float) +0:12 a1: direct index for structure ( in 4-component vector of float) +0:12 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:12 Constant: +0:12 0 (const uint) +0:12 Sequence +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 a2: direct index for structure ( in 2-component vector of float) +0:12 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:? 'color' (layout( location=0) out 4-component vector of float) + + +Linked vertex stage: + + +Linked fragment stage: + + +Shader version: 440 +0:? Sequence +0:6 Function Definition: main( ( global void) +0:6 Function Parameters: +0:8 Sequence +0:8 move second child to first child ( temp 4-component vector of float) +0:8 'a1' (layout( location=0) smooth out 4-component vector of float) +0:8 Constant: +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:8 1.000000 +0:9 move second child to first child ( temp 2-component vector of float) +0:9 'a2' (layout( location=1) smooth out 2-component vector of float) +0:9 Constant: +0:9 0.500000 +0:9 0.500000 +0:10 move second child to first child ( temp 4-component vector of float) +0:10 gl_Position: direct index for structure ( gl_Position 4-component vector of float Position) +0:10 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:10 Constant: +0:10 0 (const uint) +0:10 Constant: +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:10 1.000000 +0:? Linker Objects +0:? 'a1' (layout( location=0) smooth out 4-component vector of float) +0:? 'a2' (layout( location=1) smooth out 2-component vector of float) +0:? 'anon@0' ( out block{ gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_VertexID' ( gl_VertexId int VertexId) +0:? 'gl_InstanceID' ( gl_InstanceId int InstanceId) +Shader version: 440 +0:? Sequence +0:10 Function Definition: main( ( global void) +0:10 Function Parameters: +0:12 Sequence +0:12 move second child to first child ( temp 4-component vector of float) +0:12 'color' (layout( location=0) out 4-component vector of float) +0:12 Construct vec4 ( temp 4-component vector of float) +0:12 vector swizzle ( temp 2-component vector of float) +0:12 a1: direct index for structure ( in 4-component vector of float) +0:12 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:12 Constant: +0:12 0 (const uint) +0:12 Sequence +0:12 Constant: +0:12 0 (const int) +0:12 Constant: +0:12 1 (const int) +0:12 a2: direct index for structure ( in 2-component vector of float) +0:12 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:12 Constant: +0:12 1 (const uint) +0:? Linker Objects +0:? 'anon@0' (layout( location=0) in block{ in 4-component vector of float a1, in 2-component vector of float a2}) +0:? 'color' (layout( location=0) out 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 29 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" 9 14 22 27 28 + Source GLSL 440 + Name 4 "main" + Name 9 "a1" + Name 14 "a2" + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + MemberName 20(gl_PerVertex) 2 "gl_ClipDistance" + Name 22 "" + Name 27 "gl_VertexID" + Name 28 "gl_InstanceID" + Decorate 9(a1) Location 0 + Decorate 14(a2) Location 1 + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 20(gl_PerVertex) Block + Decorate 27(gl_VertexID) BuiltIn VertexId + Decorate 28(gl_InstanceID) BuiltIn InstanceId + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(a1): 8(ptr) Variable Output + 10: 6(float) Constant 1065353216 + 11: 7(fvec4) ConstantComposite 10 10 10 10 + 12: TypeVector 6(float) 2 + 13: TypePointer Output 12(fvec2) + 14(a2): 13(ptr) Variable Output + 15: 6(float) Constant 1056964608 + 16: 12(fvec2) ConstantComposite 15 15 + 17: TypeInt 32 0 + 18: 17(int) Constant 1 + 19: TypeArray 6(float) 18 +20(gl_PerVertex): TypeStruct 7(fvec4) 6(float) 19 + 21: TypePointer Output 20(gl_PerVertex) + 22: 21(ptr) Variable Output + 23: TypeInt 32 1 + 24: 23(int) Constant 0 + 26: TypePointer Input 23(int) + 27(gl_VertexID): 26(ptr) Variable Input +28(gl_InstanceID): 26(ptr) Variable Input + 4(main): 2 Function None 3 + 5: Label + Store 9(a1) 11 + Store 14(a2) 16 + 25: 8(ptr) AccessChain 22 24 + Store 25 11 + Return + FunctionEnd +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 29 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" 9 13 + ExecutionMode 4 OriginLowerLeft + Source GLSL 440 + Name 4 "main" + Name 9 "color" + Name 11 "Inputs" + MemberName 11(Inputs) 0 "a1" + MemberName 11(Inputs) 1 "a2" + Name 13 "" + Decorate 9(color) Location 0 + Decorate 11(Inputs) Block + Decorate 13 Location 0 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Output 7(fvec4) + 9(color): 8(ptr) Variable Output + 10: TypeVector 6(float) 2 + 11(Inputs): TypeStruct 7(fvec4) 10(fvec2) + 12: TypePointer Input 11(Inputs) + 13: 12(ptr) Variable Input + 14: TypeInt 32 1 + 15: 14(int) Constant 0 + 16: TypePointer Input 7(fvec4) + 20: 14(int) Constant 1 + 21: TypePointer Input 10(fvec2) + 4(main): 2 Function None 3 + 5: Label + 17: 16(ptr) AccessChain 13 15 + 18: 7(fvec4) Load 17 + 19: 10(fvec2) VectorShuffle 18 18 0 1 + 22: 21(ptr) AccessChain 13 20 + 23: 10(fvec2) Load 22 + 24: 6(float) CompositeExtract 19 0 + 25: 6(float) CompositeExtract 19 1 + 26: 6(float) CompositeExtract 23 0 + 27: 6(float) CompositeExtract 23 1 + 28: 7(fvec4) CompositeConstruct 24 25 26 27 + Store 9(color) 28 + Return + FunctionEnd diff --git a/Test/iomap.blockOutVariableIn.2.vert b/Test/iomap.blockOutVariableIn.2.vert new file mode 100644 index 00000000..67f45c97 --- /dev/null +++ b/Test/iomap.blockOutVariableIn.2.vert @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) out Block +{ + vec4 a1; + vec2 a2; +}; + +void main() +{ + a1 = vec4(1.0); + a2 = vec2(0.5); + gl_Position = vec4(1.0); +} diff --git a/Test/iomap.blockOutVariableIn.frag b/Test/iomap.blockOutVariableIn.frag new file mode 100644 index 00000000..f2cb26e7 --- /dev/null +++ b/Test/iomap.blockOutVariableIn.frag @@ -0,0 +1,11 @@ +#version 440 + +layout(location = 0) in vec4 a1; +layout(location = 1) in vec2 a2; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(a1.xy, a2); +} diff --git a/Test/iomap.blockOutVariableIn.geom b/Test/iomap.blockOutVariableIn.geom new file mode 100644 index 00000000..feefdd13 --- /dev/null +++ b/Test/iomap.blockOutVariableIn.geom @@ -0,0 +1,28 @@ +#version 440 + +layout(triangles) in; +layout(triangle_strip, max_vertices=3) out; + +layout(location = 0) in vec4 in_a1[3]; +layout(location = 1) in vec2 in_a2[3]; + +layout(location = 0) out vec4 a1; +layout(location = 1) out vec2 a2; + +void main() +{ + a1 = in_a1[0]; + a2 = in_a2[0]; + gl_Position = vec4(1.0); + EmitVertex(); + + a1 = in_a1[1]; + a2 = in_a2[1]; + gl_Position = vec4(1.0); + EmitVertex(); + + a1 = in_a1[2]; + a2 = in_a2[2]; + gl_Position = vec4(1.0); + EmitVertex(); +} diff --git a/Test/iomap.blockOutVariableIn.vert b/Test/iomap.blockOutVariableIn.vert new file mode 100644 index 00000000..67f45c97 --- /dev/null +++ b/Test/iomap.blockOutVariableIn.vert @@ -0,0 +1,14 @@ +#version 440 + +layout(location = 0) out Block +{ + vec4 a1; + vec2 a2; +}; + +void main() +{ + a1 = vec4(1.0); + a2 = vec2(0.5); + gl_Position = vec4(1.0); +} diff --git a/Test/iomap.variableOutBlockIn.2.vert b/Test/iomap.variableOutBlockIn.2.vert new file mode 100644 index 00000000..f9b80b46 --- /dev/null +++ b/Test/iomap.variableOutBlockIn.2.vert @@ -0,0 +1,11 @@ +#version 440 + +layout(location = 0) out vec4 a1; +layout(location = 1) out vec2 a2; + +void main() +{ + a1 = vec4(1.0); + a2 = vec2(0.5); + gl_Position = vec4(1.0); +} diff --git a/Test/iomap.variableOutBlockIn.frag b/Test/iomap.variableOutBlockIn.frag new file mode 100644 index 00000000..967d7698 --- /dev/null +++ b/Test/iomap.variableOutBlockIn.frag @@ -0,0 +1,13 @@ +#version 440 + +layout(location = 0) in Inputs { + vec4 a1; + vec2 a2; +}; + +layout(location = 0) out vec4 color; + +void main() +{ + color = vec4(a1.xy, a2); +} diff --git a/Test/iomap.variableOutBlockIn.geom b/Test/iomap.variableOutBlockIn.geom new file mode 100644 index 00000000..637ddabb --- /dev/null +++ b/Test/iomap.variableOutBlockIn.geom @@ -0,0 +1,19 @@ +#version 440 + +layout(triangles) in; +layout(triangle_strip, max_vertices=3) out; + +layout(location = 0) in Inputs { + vec4 a1; + vec2 a2; +} gin[3]; + +layout(location = 0) out vec4 a1; +layout(location = 1) out vec2 a2; + +void main() +{ + a1 = vec4(1.0); + a2 = vec2(0.5); + gl_Position = vec4(1.0); +} diff --git a/Test/iomap.variableOutBlockIn.vert b/Test/iomap.variableOutBlockIn.vert new file mode 100644 index 00000000..f9b80b46 --- /dev/null +++ b/Test/iomap.variableOutBlockIn.vert @@ -0,0 +1,11 @@ +#version 440 + +layout(location = 0) out vec4 a1; +layout(location = 1) out vec2 a2; + +void main() +{ + a1 = vec4(1.0); + a2 = vec2(0.5); + gl_Position = vec4(1.0); +} diff --git a/glslang/MachineIndependent/iomapper.cpp b/glslang/MachineIndependent/iomapper.cpp index a1db5c13..288a6c97 100644 --- a/glslang/MachineIndependent/iomapper.cpp +++ b/glslang/MachineIndependent/iomapper.cpp @@ -514,6 +514,24 @@ struct TSymbolValidater return; } else { + // Deal with input/output pairs where one is a block member but the other is loose, + // e.g. with ARB_separate_shader_objects + if (type1.getBasicType() == EbtBlock && + type1.isStruct() && !type2.isStruct()) { + // Iterate through block members tracking layout + glslang::TString name; + type1.getStruct()->begin()->type->appendMangledName(name); + if (name == mangleName2 + && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return; + } + if (type2.getBasicType() == EbtBlock && + type2.isStruct() && !type1.isStruct()) { + // Iterate through block members tracking layout + glslang::TString name; + type2.getStruct()->begin()->type->appendMangledName(name); + if (name == mangleName1 + && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return; + } TString err = "Invalid In/Out variable type : " + entKey.first; infoSink.info.message(EPrefixInternalError, err.c_str()); hadError = true; diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 4edd2a90..9d7db887 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -759,7 +759,10 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin auto checkName = [this, unitSymbol, &infoSink](const TString& name) { for (unsigned int i = 0; i < unitSymbol->getType().getStruct()->size(); ++i) { - if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName()) { + if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName() + && !((*unitSymbol->getType().getStruct())[i].type->getQualifier().hasLocation() + || unitSymbol->getType().getQualifier().hasLocation()) + ) { error(infoSink, "Anonymous member name used for global variable or other anonymous member: "); infoSink.info << (*unitSymbol->getType().getStruct())[i].type->getCompleteString() << "\n"; } diff --git a/gtests/GlslMapIO.FromFile.cpp b/gtests/GlslMapIO.FromFile.cpp index 574e905f..73fdec4e 100644 --- a/gtests/GlslMapIO.FromFile.cpp +++ b/gtests/GlslMapIO.FromFile.cpp @@ -109,7 +109,50 @@ bool verifyIOMapping(std::string& linkingError, glslang::TProgram& program) { success &= outQualifier.layoutLocation == inQualifier.layoutLocation; } else { - success &= false; + if (!in.getType()->isStruct()) { + bool found = false; + for (auto outIt : pipeOut) { + if (outIt.second->getType()->isStruct()) { + unsigned int baseLoc = outIt.second->getType()->getQualifier().hasLocation() ? outIt.second->getType()->getQualifier().layoutLocation : -1; + for (int j = 0; j < outIt.second->getType()->getStruct()->size(); j++) { + baseLoc = (*outIt.second->getType()->getStruct())[j].type->getQualifier().hasLocation() ? + (*outIt.second->getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc; + if (baseLoc != -1) { + if (baseLoc == in.getType()->getQualifier().layoutLocation) { + found = true; + break; + } + baseLoc += glslang::TIntermediate::computeTypeLocationSize(*(*outIt.second->getType()->getStruct())[j].type, EShLangVertex); + } + } + if (found) { + break; + } + } + } + success &= found; + } + else { + unsigned int baseLoc = in.getType()->getQualifier().hasLocation() ? in.getType()->getQualifier().layoutLocation : -1; + for (int j = 0; j < in.getType()->getStruct()->size(); j++) { + baseLoc = (*in.getType()->getStruct())[j].type->getQualifier().hasLocation() ? + (*in.getType()->getStruct())[j].type->getQualifier().layoutLocation : baseLoc; + if (baseLoc != -1) { + bool isMemberFound = false; + for (auto outIt : pipeOut) { + if (baseLoc == outIt.second->getType()->getQualifier().layoutLocation) { + isMemberFound = true; + break; + } + } + if (!isMemberFound) { + success &= false; + break; + } + baseLoc += glslang::TIntermediate::computeTypeLocationSize(*(*in.getType()->getStruct())[j].type, EShLangVertex); + } + } + } } } } @@ -295,6 +338,10 @@ INSTANTIATE_TEST_SUITE_P( ::testing::ValuesIn(std::vector({ {{"iomap.crossStage.vert", "iomap.crossStage.frag" }, Semantics::OpenGL}, {{"iomap.crossStage.2.vert", "iomap.crossStage.2.geom", "iomap.crossStage.2.frag" }, Semantics::OpenGL}, + {{"iomap.blockOutVariableIn.vert", "iomap.blockOutVariableIn.frag"}, Semantics::OpenGL}, + {{"iomap.variableOutBlockIn.vert", "iomap.variableOutBlockIn.frag"}, Semantics::OpenGL}, + {{"iomap.blockOutVariableIn.2.vert", "iomap.blockOutVariableIn.geom"}, Semantics::OpenGL}, + {{"iomap.variableOutBlockIn.2.vert", "iomap.variableOutBlockIn.geom"}, Semantics::OpenGL}, // vulkan semantics {{"iomap.crossStage.vk.vert", "iomap.crossStage.vk.geom", "iomap.crossStage.vk.frag" }, Semantics::Vulkan}, })) From eebb48f5fc8631830e04e6ac1de623413008a526 Mon Sep 17 00:00:00 2001 From: Malcolm Bechard Date: Mon, 15 Nov 2021 10:44:08 -0500 Subject: [PATCH 62/64] remove unneeded extra constructions now that pool allocation is fixed --- glslang/MachineIndependent/SymbolTable.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 5b7e27fa..a3ffa0c4 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -426,12 +426,7 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const symTableLevel->thisLevel = thisLevel; symTableLevel->retargetedSymbols.clear(); for (auto &s : retargetedSymbols) { - // Extra constructions to make sure they use the correct allocator pool - TString newFrom; - newFrom = s.first; - TString newTo; - newTo = s.second; - symTableLevel->retargetedSymbols.push_back({std::move(newFrom), std::move(newTo)}); + symTableLevel->retargetedSymbols.push_back({s.first, s.second}); } std::vector containerCopied(anonId, false); tLevel::const_iterator iter; @@ -462,11 +457,7 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const TSymbol* sym = symTableLevel->find(s.second); if (!sym) continue; - - // Need to declare and assign so newS is using the correct pool allocator - TString newS; - newS = s.first; - symTableLevel->insert(newS, sym); + symTableLevel->insert(s.first, sym); } return symTableLevel; From bee91eb479ee38ce4f268c363154e5175c7a9bd0 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Wed, 17 Nov 2021 23:32:27 +0800 Subject: [PATCH 63/64] Fix an issue of spirv_type used in local variable definitions We previously use createOp() in SPV builder to create type declaration. However, all type declarations should be placed in const-type-variable declaration section. And duplicated type defintions ought to be avoided. We now make a method in SPV builder to perform this operation with a more general solution: makeGenericType(). --- SPIRV/GlslangToSpv.cpp | 25 +++++------ SPIRV/SpvBuilder.cpp | 31 +++++++++++++ SPIRV/SpvBuilder.h | 1 + .../spv.intrinsicsSpirvType.rgen.out | 4 +- .../spv.intrinsicsSpirvTypeLocalVar.vert.out | 43 +++++++++++++++++++ Test/spv.intrinsicsSpirvTypeLocalVar.vert | 14 ++++++ gtests/Spv.FromFile.cpp | 1 + 7 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 Test/baseResults/spv.intrinsicsSpirvTypeLocalVar.vert.out create mode 100644 Test/spv.intrinsicsSpirvTypeLocalVar.vert diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index 43aba9cb..3a906189 100644 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -4148,23 +4148,23 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty const auto& spirvType = type.getSpirvType(); const auto& spirvInst = spirvType.spirvInst; - std::vector operands; + std::vector operands; for (const auto& typeParam : spirvType.typeParams) { // Constant expression if (typeParam.constant->isLiteral()) { if (typeParam.constant->getBasicType() == glslang::EbtFloat) { float floatValue = static_cast(typeParam.constant->getConstArray()[0].getDConst()); unsigned literal = *reinterpret_cast(&floatValue); - operands.push_back(literal); + operands.push_back({false, literal}); } else if (typeParam.constant->getBasicType() == glslang::EbtInt) { unsigned literal = typeParam.constant->getConstArray()[0].getIConst(); - operands.push_back(literal); + operands.push_back({false, literal}); } else if (typeParam.constant->getBasicType() == glslang::EbtUint) { unsigned literal = typeParam.constant->getConstArray()[0].getUConst(); - operands.push_back(literal); + operands.push_back({false, literal}); } else if (typeParam.constant->getBasicType() == glslang::EbtBool) { unsigned literal = typeParam.constant->getConstArray()[0].getBConst(); - operands.push_back(literal); + operands.push_back({false, literal}); } else if (typeParam.constant->getBasicType() == glslang::EbtString) { auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str(); unsigned literal = 0; @@ -4176,7 +4176,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty *(literalPtr++) = ch; ++charCount; if (charCount == 4) { - operands.push_back(literal); + operands.push_back({false, literal}); literalPtr = reinterpret_cast(&literal); charCount = 0; } @@ -4186,20 +4186,17 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty if (charCount > 0) { for (; charCount < 4; ++charCount) *(literalPtr++) = 0; - operands.push_back(literal); + operands.push_back({false, literal}); } } else assert(0); // Unexpected type } else - operands.push_back(createSpvConstant(*typeParam.constant)); + operands.push_back({true, createSpvConstant(*typeParam.constant)}); } - if (spirvInst.set == "") - spvType = builder.createOp(static_cast(spirvInst.id), spv::NoType, operands); - else { - spvType = builder.createBuiltinCall( - spv::NoType, getExtBuiltins(spirvInst.set.c_str()), spirvInst.id, operands); - } + assert(spirvInst.set == ""); // Currently, couldn't be extended instructions. + spvType = builder.makeGenericType(static_cast(spirvInst.id), operands); + break; } #endif diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index e83306eb..838f916a 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -427,6 +427,37 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols) return type->getResultId(); } +Id Builder::makeGenericType(spv::Op opcode, std::vector& operands) +{ + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) { + type = groupedTypes[opcode][t]; + if (type->getNumOperands() != operands.size()) + continue; // Number mismatch, find next + + bool match = true; + for (int op = 0; match && op < operands.size(); ++op) { + match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word; + } + if (match) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, opcode); + for (int op = 0; op < operands.size(); ++op) { + if (operands[op].isId) + type->addIdOperand(operands[op].word); + else + type->addImmediateOperand(operands[op].word); + } + groupedTypes[opcode].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} // TODO: performance: track arrays per stride // If a stride is supplied (non-zero) make an array. diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index 251b9ee8..c72d9b28 100644 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -181,6 +181,7 @@ public: Id makeSamplerType(); Id makeSampledImageType(Id imageType); Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols); + Id makeGenericType(spv::Op opcode, std::vector& operands); // accelerationStructureNV type Id makeAccelerationStructureType(); diff --git a/Test/baseResults/spv.intrinsicsSpirvType.rgen.out b/Test/baseResults/spv.intrinsicsSpirvType.rgen.out index ac0c9464..021e7a6d 100644 --- a/Test/baseResults/spv.intrinsicsSpirvType.rgen.out +++ b/Test/baseResults/spv.intrinsicsSpirvType.rgen.out @@ -22,7 +22,9 @@ Validation failed Decorate 11(as) Binding 0 2: TypeVoid 3: TypeFunction 2 + 6: TypeRayQueryKHR 7: TypePointer Function 6 + 9: TypeAccelerationStructureKHR 10: TypePointer UniformConstant 9 11(as): 10(ptr) Variable UniformConstant 13: TypeInt 32 0 @@ -36,8 +38,6 @@ Validation failed 4(main): 2 Function None 3 5: Label 8(rq): 7(ptr) Variable Function - 6: TypeRayQueryKHR - 9: TypeAccelerationStructureKHR 12: 9 Load 11(as) RayQueryInitializeKHR 8(rq) 12 14 14 18 17 20 19 RayQueryTerminateKHR 8(rq) diff --git a/Test/baseResults/spv.intrinsicsSpirvTypeLocalVar.vert.out b/Test/baseResults/spv.intrinsicsSpirvTypeLocalVar.vert.out new file mode 100644 index 00000000..75515be0 --- /dev/null +++ b/Test/baseResults/spv.intrinsicsSpirvTypeLocalVar.vert.out @@ -0,0 +1,43 @@ +spv.intrinsicsSpirvTypeLocalVar.vert +// Module Version 10000 +// Generated by (magic number): 8000a +// Id's are bound by 22 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 460 + SourceExtension "GL_EXT_spirv_intrinsics" + Name 4 "main" + Name 10 "func(spv-t1;" + Name 9 "emptyStruct" + Name 13 "size" + Name 16 "dummy" + Name 18 "param" + Decorate 13(size) SpecId 9 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeStruct + 7: TypePointer Function 6(struct) + 8: TypeFunction 2 7(ptr) + 12: TypeInt 32 1 + 13(size): 12(int) SpecConstant 9 + 14: TypeArray 6(struct) 13(size) + 15: TypePointer Function 14 + 17: 12(int) Constant 1 + 4(main): 2 Function None 3 + 5: Label + 16(dummy): 15(ptr) Variable Function + 18(param): 7(ptr) Variable Function + 19: 7(ptr) AccessChain 16(dummy) 17 + 20: 6(struct) Load 19 + Store 18(param) 20 + 21: 2 FunctionCall 10(func(spv-t1;) 18(param) + Return + FunctionEnd +10(func(spv-t1;): 2 Function None 8 + 9(emptyStruct): 7(ptr) FunctionParameter + 11: Label + Return + FunctionEnd diff --git a/Test/spv.intrinsicsSpirvTypeLocalVar.vert b/Test/spv.intrinsicsSpirvTypeLocalVar.vert new file mode 100644 index 00000000..203d9007 --- /dev/null +++ b/Test/spv.intrinsicsSpirvTypeLocalVar.vert @@ -0,0 +1,14 @@ +#version 460 core + +#extension GL_EXT_spirv_intrinsics: enable + +layout(constant_id = 9) const int size = 9; + +#define EmptyStruct spirv_type(id = 30) +void func(EmptyStruct emptyStruct) {} + +void main() +{ + EmptyStruct dummy[size]; + func(dummy[1]); +} diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index ef117640..460c1d22 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -373,6 +373,7 @@ INSTANTIATE_TEST_SUITE_P( "spv.intrinsicsSpirvLiteral.vert", "spv.intrinsicsSpirvStorageClass.rchit", "spv.intrinsicsSpirvType.rgen", + "spv.intrinsicsSpirvTypeLocalVar.vert", "spv.invariantAll.vert", "spv.layer.tese", "spv.layoutNested.vert", From 3e9e60af8636cd5a4740bc8244c72605cb1df3a0 Mon Sep 17 00:00:00 2001 From: Rex Xu Date: Mon, 22 Nov 2021 20:05:06 +0800 Subject: [PATCH 64/64] Remove the test spv.intrinsicsSpecConst According to current SPIR-V spec, we couldn't write a valid case that references OpExecutionModeId and OpDecorateId. --- SPIRV/doc.cpp | 6 ++++ .../spv.intrinsicsSpecConst.vert.out | 35 ------------------- Test/spv.intrinsicsSpecConst.vert | 14 -------- gtests/Spv.FromFile.cpp | 1 - 4 files changed, 6 insertions(+), 50 deletions(-) delete mode 100644 Test/baseResults/spv.intrinsicsSpecConst.vert.out delete mode 100644 Test/spv.intrinsicsSpecConst.vert diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index dbdf7077..9a569e0d 100644 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -900,6 +900,12 @@ const char* CapabilityString(int info) case CapabilityDeviceGroup: return "DeviceGroup"; case CapabilityMultiView: return "MultiView"; + case CapabilityDenormPreserve: return "DenormPreserve"; + case CapabilityDenormFlushToZero: return "DenormFlushToZero"; + case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve"; + case CapabilityRoundingModeRTE: return "RoundingModeRTE"; + case CapabilityRoundingModeRTZ: return "RoundingModeRTZ"; + case CapabilityStencilExportEXT: return "StencilExportEXT"; case CapabilityFloat16ImageAMD: return "Float16ImageAMD"; diff --git a/Test/baseResults/spv.intrinsicsSpecConst.vert.out b/Test/baseResults/spv.intrinsicsSpecConst.vert.out deleted file mode 100644 index 11751d64..00000000 --- a/Test/baseResults/spv.intrinsicsSpecConst.vert.out +++ /dev/null @@ -1,35 +0,0 @@ -spv.intrinsicsSpecConst.vert -Validation failed -// Module Version 10000 -// Generated by (magic number): 8000a -// Id's are bound by 13 - - Capability Shader - 1: ExtInstImport "GLSL.std.450" - MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 10 - ExecutionModeId 4 DenormFlushToZero 7 - Source GLSL 450 - SourceExtension "GL_EXT_spirv_intrinsics" - Name 4 "main" - Name 7 "targetWidth" - Name 10 "pointSize" - Name 11 "builtIn" - Decorate 7(targetWidth) SpecId 5 - Decorate 10(pointSize) Location 0 - Decorate 11(builtIn) SpecId 6 - DecorateId 10(pointSize) BuiltIn 11(builtIn) - 2: TypeVoid - 3: TypeFunction 2 - 6: TypeInt 32 0 - 7(targetWidth): 6(int) SpecConstant 32 - 8: TypeFloat 32 - 9: TypePointer Output 8(float) - 10(pointSize): 9(ptr) Variable Output - 11(builtIn): 6(int) SpecConstant 1 - 12: 8(float) Constant 1082130432 - 4(main): 2 Function None 3 - 5: Label - Store 10(pointSize) 12 - Return - FunctionEnd diff --git a/Test/spv.intrinsicsSpecConst.vert b/Test/spv.intrinsicsSpecConst.vert deleted file mode 100644 index 19cc5ef4..00000000 --- a/Test/spv.intrinsicsSpecConst.vert +++ /dev/null @@ -1,14 +0,0 @@ -#version 450 core - -#extension GL_EXT_spirv_intrinsics: enable - -layout(constant_id = 5) const uint targetWidth = 32; -spirv_execution_mode_id(4460/*=DenormFlushToZero*/, targetWidth); - -layout(constant_id = 6) const uint builtIn = 1; -spirv_decorate_id(11/*=BuiltIn*/, builtIn) out float pointSize; - -void main() -{ - pointSize = 4.0; -} diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp index 460c1d22..885707c2 100644 --- a/gtests/Spv.FromFile.cpp +++ b/gtests/Spv.FromFile.cpp @@ -365,7 +365,6 @@ INSTANTIATE_TEST_SUITE_P( "spv.int64.frag", "spv.intcoopmat.comp", "spv.intOps.vert", - "spv.intrinsicsSpecConst.vert", "spv.intrinsicsSpirvByReference.vert", "spv.intrinsicsSpirvDecorate.frag", "spv.intrinsicsSpirvExecutionMode.frag",