From b392d21536e95342753f0a8ca82b820afffc5e25 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Fri, 24 Jul 2026 16:50:17 -0300 Subject: [PATCH] update glslang to slime73/glslang@72d1590 (16.3.0 plus fixes for love) --- CMakeLists.txt | 4 +- .../xcode/liblove.xcodeproj/project.pbxproj | 18 +- src/libraries/glslang/SPIRV/GLSL.ext.ARM.h | 8 +- src/libraries/glslang/SPIRV/GLSL.ext.EXT.h | 4 +- src/libraries/glslang/SPIRV/GLSL.ext.KHR.h | 6 +- src/libraries/glslang/SPIRV/GLSL.ext.NV.h | 4 + src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h | 2 + src/libraries/glslang/SPIRV/GlslangToSpv.cpp | 1257 +- .../SPIRV/NonSemanticShaderDebugInfo.h | 173 + .../SPIRV/NonSemanticShaderDebugInfo100.h | 171 - src/libraries/glslang/SPIRV/SPVRemapper.cpp | 1563 --- src/libraries/glslang/SPIRV/SPVRemapper.h | 300 - src/libraries/glslang/SPIRV/SpvBuilder.cpp | 1085 +- src/libraries/glslang/SPIRV/SpvBuilder.h | 205 +- .../glslang/SPIRV/SpvPostProcess.cpp | 95 +- src/libraries/glslang/SPIRV/SpvTools.cpp | 1 + src/libraries/glslang/SPIRV/disassemble.cpp | 110 +- src/libraries/glslang/SPIRV/doc.cpp | 382 +- src/libraries/glslang/SPIRV/hex_float.h | 23 +- src/libraries/glslang/SPIRV/spirv.hpp11 | 226 +- src/libraries/glslang/SPIRV/spvIR.h | 10 +- .../glslang/glslang/Include/BaseTypes.h | 30 +- .../glslang/glslang/Include/ConstantUnion.h | 11 + .../glslang/glslang/Include/PoolAlloc.h | 33 +- src/libraries/glslang/glslang/Include/Types.h | 259 +- .../glslang/glslang/Include/arrays.h | 11 + src/libraries/glslang/glslang/Include/defer.h | 63 + .../glslang/glslang/Include/intermediate.h | 129 +- .../glslang/glslang/Include/visibility.h | 6 +- .../glslang/MachineIndependent/Constant.cpp | 2 +- .../glslang/MachineIndependent/Initialize.cpp | 1148 +- .../glslang/MachineIndependent/Initialize.h | 3 + .../MachineIndependent/IntermTraverse.cpp | 31 + .../MachineIndependent/Intermediate.cpp | 61 +- .../MachineIndependent/LiveTraverser.h | 4 +- .../MachineIndependent/ParseContextBase.cpp | 25 +- .../MachineIndependent/ParseHelper.cpp | 1449 +- .../glslang/MachineIndependent/ParseHelper.h | 46 +- .../glslang/MachineIndependent/PoolAlloc.cpp | 4 +- .../glslang/MachineIndependent/RemoveTree.cpp | 8 +- .../glslang/MachineIndependent/Scan.cpp | 201 +- .../glslang/MachineIndependent/ScanContext.h | 7 +- .../glslang/MachineIndependent/ShaderLang.cpp | 1 + .../MachineIndependent/SpirvIntrinsics.cpp | 30 +- .../MachineIndependent/SymbolTable.cpp | 24 +- .../glslang/MachineIndependent/SymbolTable.h | 47 +- .../glslang/MachineIndependent/Versions.cpp | 72 +- .../glslang/MachineIndependent/Versions.h | 19 + .../MachineIndependent/glslang_tab.cpp | 11695 ++++++++-------- .../MachineIndependent/glslang_tab.cpp.h | 612 +- .../glslang/MachineIndependent/intermOut.cpp | 21 + .../glslang/MachineIndependent/iomapper.cpp | 107 +- .../glslang/MachineIndependent/iomapper.h | 37 +- .../MachineIndependent/linkValidate.cpp | 75 +- .../MachineIndependent/localintermediate.h | 51 +- .../MachineIndependent/parseVersions.h | 3 + .../MachineIndependent/preprocessor/Pp.cpp | 65 +- .../preprocessor/PpContext.h | 49 +- .../preprocessor/PpScanner.cpp | 57 +- .../preprocessor/PpTokens.cpp | 39 +- .../glslang/glslang/Public/ShaderLang.h | 187 +- .../glslang/ResourceLimits/ResourceLimits.cpp | 4 +- src/libraries/glslang/glslang/build_info.h | 2 +- 63 files changed, 13103 insertions(+), 9272 deletions(-) create mode 100644 src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo.h delete mode 100644 src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h delete mode 100644 src/libraries/glslang/SPIRV/SPVRemapper.cpp delete mode 100644 src/libraries/glslang/SPIRV/SPVRemapper.h create mode 100644 src/libraries/glslang/glslang/Include/defer.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d6b824a0f..bfcbb69c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1486,15 +1486,13 @@ add_library(love_3p_glslang src/libraries/glslang/SPIRV/Logger.cpp src/libraries/glslang/SPIRV/Logger.h src/libraries/glslang/SPIRV/NonSemanticDebugPrintf.h - src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h + src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo.h src/libraries/glslang/SPIRV/spirv.hpp11 src/libraries/glslang/SPIRV/SpvBuilder.cpp src/libraries/glslang/SPIRV/SpvBuilder.h src/libraries/glslang/SPIRV/spvIR.h src/libraries/glslang/SPIRV/spvUtil.h src/libraries/glslang/SPIRV/SpvPostProcess.cpp - src/libraries/glslang/SPIRV/SPVRemapper.cpp - src/libraries/glslang/SPIRV/SPVRemapper.h src/libraries/glslang/SPIRV/SpvTools.cpp src/libraries/glslang/SPIRV/SpvTools.h ) diff --git a/platform/xcode/liblove.xcodeproj/project.pbxproj b/platform/xcode/liblove.xcodeproj/project.pbxproj index d9eb82daf..2dcb2fd2c 100644 --- a/platform/xcode/liblove.xcodeproj/project.pbxproj +++ b/platform/xcode/liblove.xcodeproj/project.pbxproj @@ -79,7 +79,6 @@ D9DB6E362B4B41100037A1F6 /* ResourceLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9DB6E332B4B41100037A1F6 /* ResourceLimits.cpp */; }; D9DB6E372B4B41100037A1F6 /* ResourceLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9DB6E332B4B41100037A1F6 /* ResourceLimits.cpp */; }; D9DB6E3E2B4B41580037A1F6 /* NonSemanticDebugPrintf.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DB6E382B4B41570037A1F6 /* NonSemanticDebugPrintf.h */; }; - D9DB6E3F2B4B41580037A1F6 /* NonSemanticShaderDebugInfo100.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DB6E392B4B41570037A1F6 /* NonSemanticShaderDebugInfo100.h */; }; D9DB6E402B4B41580037A1F6 /* GLSL.ext.ARM.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DB6E3A2B4B41570037A1F6 /* GLSL.ext.ARM.h */; }; D9DB6E412B4B41580037A1F6 /* GLSL.ext.QCOM.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DB6E3B2B4B41580037A1F6 /* GLSL.ext.QCOM.h */; }; D9DB6E452B4B80E80037A1F6 /* build_info.h in Headers */ = {isa = PBXBuildFile; fileRef = D9DB6E442B4B80E80037A1F6 /* build_info.h */; }; @@ -94,6 +93,7 @@ D9F0C2DB2C680A5500BB2D25 /* OpenSSLConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = D9F0C2D12C680A5500BB2D25 /* OpenSSLConnection.h */; }; D9F0C2DC2C680A5500BB2D25 /* UnixLibraryLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9F0C2D22C680A5500BB2D25 /* UnixLibraryLoader.cpp */; }; D9F0C2DD2C680A5500BB2D25 /* UnixLibraryLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9F0C2D22C680A5500BB2D25 /* UnixLibraryLoader.cpp */; }; + D9F318AE3013F85300CFB9D0 /* NonSemanticShaderDebugInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = D9F318AD3013F85300CFB9D0 /* NonSemanticShaderDebugInfo.h */; }; FA0A3A5F23366CE9001C269E /* floattypes.h in Headers */ = {isa = PBXBuildFile; fileRef = FA0A3A5D23366CE9001C269E /* floattypes.h */; }; FA0A3A6023366CE9001C269E /* floattypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0A3A5E23366CE9001C269E /* floattypes.cpp */; }; FA0A3A6123366CE9001C269E /* floattypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA0A3A5E23366CE9001C269E /* floattypes.cpp */; }; @@ -1312,7 +1312,6 @@ FAF140BB1E20934C00F898D2 /* ossource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF140211E20934C00F898D2 /* ossource.cpp */; }; FAF140BC1E20934C00F898D2 /* ossource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF140211E20934C00F898D2 /* ossource.cpp */; }; FAF140C41E20934C00F898D2 /* ShaderLang.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF140291E20934C00F898D2 /* ShaderLang.h */; }; - FAF6C9DA23C2DE2900D7B5BC /* SPVRemapper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9C123C2DE2900D7B5BC /* SPVRemapper.h */; }; FAF6C9DB23C2DE2900D7B5BC /* SpvBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9C223C2DE2900D7B5BC /* SpvBuilder.h */; }; FAF6C9DC23C2DE2900D7B5BC /* SpvPostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9C323C2DE2900D7B5BC /* SpvPostProcess.cpp */; }; FAF6C9DD23C2DE2900D7B5BC /* SpvPostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9C323C2DE2900D7B5BC /* SpvPostProcess.cpp */; }; @@ -1335,8 +1334,6 @@ FAF6C9EF23C2DE2900D7B5BC /* disassemble.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9D123C2DE2900D7B5BC /* disassemble.h */; }; FAF6C9F023C2DE2900D7B5BC /* GlslangToSpv.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9D223C2DE2900D7B5BC /* GlslangToSpv.h */; }; FAF6C9F123C2DE2900D7B5BC /* GLSL.std.450.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9D323C2DE2900D7B5BC /* GLSL.std.450.h */; }; - FAF6C9F223C2DE2900D7B5BC /* SPVRemapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9D423C2DE2900D7B5BC /* SPVRemapper.cpp */; }; - FAF6C9F323C2DE2900D7B5BC /* SPVRemapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9D423C2DE2900D7B5BC /* SPVRemapper.cpp */; }; FAF6C9F423C2DE2900D7B5BC /* Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9D523C2DE2900D7B5BC /* Logger.cpp */; }; FAF6C9F523C2DE2900D7B5BC /* Logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF6C9D523C2DE2900D7B5BC /* Logger.cpp */; }; FAF6C9F623C2DE2900D7B5BC /* hex_float.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF6C9D623C2DE2900D7B5BC /* hex_float.h */; }; @@ -1441,7 +1438,6 @@ D9DB6E282B4B40970037A1F6 /* span.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = span.h; sourceTree = ""; }; D9DB6E332B4B41100037A1F6 /* ResourceLimits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLimits.cpp; sourceTree = ""; }; D9DB6E382B4B41570037A1F6 /* NonSemanticDebugPrintf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NonSemanticDebugPrintf.h; sourceTree = ""; }; - D9DB6E392B4B41570037A1F6 /* NonSemanticShaderDebugInfo100.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NonSemanticShaderDebugInfo100.h; sourceTree = ""; }; D9DB6E3A2B4B41570037A1F6 /* GLSL.ext.ARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLSL.ext.ARM.h; sourceTree = ""; }; D9DB6E3B2B4B41580037A1F6 /* GLSL.ext.QCOM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLSL.ext.QCOM.h; sourceTree = ""; }; D9DB6E442B4B80E80037A1F6 /* build_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = build_info.h; sourceTree = ""; }; @@ -1452,6 +1448,7 @@ D9F0C2D02C680A5500BB2D25 /* OpenSSLConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpenSSLConnection.cpp; sourceTree = ""; }; D9F0C2D12C680A5500BB2D25 /* OpenSSLConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenSSLConnection.h; sourceTree = ""; }; D9F0C2D22C680A5500BB2D25 /* UnixLibraryLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnixLibraryLoader.cpp; sourceTree = ""; }; + D9F318AD3013F85300CFB9D0 /* NonSemanticShaderDebugInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NonSemanticShaderDebugInfo.h; sourceTree = ""; }; FA08F5AE16C7525600F007B5 /* liblove-macosx.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "liblove-macosx.plist"; path = "macosx/liblove-macosx.plist"; sourceTree = ""; }; FA0A3A5D23366CE9001C269E /* floattypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = floattypes.h; sourceTree = ""; }; FA0A3A5E23366CE9001C269E /* floattypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = floattypes.cpp; sourceTree = ""; }; @@ -2299,7 +2296,6 @@ FAF140211E20934C00F898D2 /* ossource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ossource.cpp; sourceTree = ""; }; FAF140291E20934C00F898D2 /* ShaderLang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderLang.h; sourceTree = ""; }; FAF1889C1E9DA834008C1479 /* Optional.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Optional.h; sourceTree = ""; }; - FAF6C9C123C2DE2900D7B5BC /* SPVRemapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPVRemapper.h; sourceTree = ""; }; FAF6C9C223C2DE2900D7B5BC /* SpvBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpvBuilder.h; sourceTree = ""; }; FAF6C9C323C2DE2900D7B5BC /* SpvPostProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpvPostProcess.cpp; sourceTree = ""; }; FAF6C9C423C2DE2900D7B5BC /* SpvTools.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpvTools.h; sourceTree = ""; }; @@ -2317,7 +2313,6 @@ FAF6C9D123C2DE2900D7B5BC /* disassemble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = disassemble.h; sourceTree = ""; }; FAF6C9D223C2DE2900D7B5BC /* GlslangToSpv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlslangToSpv.h; sourceTree = ""; }; FAF6C9D323C2DE2900D7B5BC /* GLSL.std.450.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GLSL.std.450.h; sourceTree = ""; }; - FAF6C9D423C2DE2900D7B5BC /* SPVRemapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SPVRemapper.cpp; sourceTree = ""; }; FAF6C9D523C2DE2900D7B5BC /* Logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Logger.cpp; sourceTree = ""; }; FAF6C9D623C2DE2900D7B5BC /* hex_float.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hex_float.h; sourceTree = ""; }; FAF6C9D723C2DE2900D7B5BC /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = ""; }; @@ -4096,14 +4091,12 @@ FAF6C9D723C2DE2900D7B5BC /* Logger.h */, FAF6C9D523C2DE2900D7B5BC /* Logger.cpp */, D9DB6E382B4B41570037A1F6 /* NonSemanticDebugPrintf.h */, - D9DB6E392B4B41570037A1F6 /* NonSemanticShaderDebugInfo100.h */, + D9F318AD3013F85300CFB9D0 /* NonSemanticShaderDebugInfo.h */, D91C76102DE3D088001FC408 /* spirv.hpp11 */, FAF6C9C223C2DE2900D7B5BC /* SpvBuilder.h */, FAF6C9CA23C2DE2900D7B5BC /* SpvBuilder.cpp */, FAF6C9CF23C2DE2900D7B5BC /* spvIR.h */, FAF6C9C323C2DE2900D7B5BC /* SpvPostProcess.cpp */, - FAF6C9C123C2DE2900D7B5BC /* SPVRemapper.h */, - FAF6C9D423C2DE2900D7B5BC /* SPVRemapper.cpp */, FAF6C9C423C2DE2900D7B5BC /* SpvTools.h */, FAF6C9C523C2DE2900D7B5BC /* SpvTools.cpp */, D91C76112DE3D088001FC408 /* spvUtil.h */, @@ -4155,7 +4148,6 @@ FAF6C9EF23C2DE2900D7B5BC /* disassemble.h in Headers */, FA18CF4123DCF67900263725 /* spirv_common.hpp in Headers */, FAC7CD901FE35E95006A60C7 /* physfs_miniz.h in Headers */, - D9DB6E3F2B4B41580037A1F6 /* NonSemanticShaderDebugInfo100.h in Headers */, FA0B791D1A958E3B000E1D17 /* b64.h in Headers */, FA0B7DC61A95902C000E1D17 /* wrap_JoystickModule.h in Headers */, FA0B7D201A95902C000E1D17 /* ImageRasterizer.h in Headers */, @@ -4265,7 +4257,6 @@ FA0B7B391A958EA3000E1D17 /* wuff_internal.h in Headers */, FAC7CD771FE35E95006A60C7 /* physfs_internal.h in Headers */, FA0B7D881A95902C000E1D17 /* ImageData.h in Headers */, - FAF6C9DA23C2DE2900D7B5BC /* SPVRemapper.h in Headers */, FA0B7EE11A95902D000E1D17 /* wrap_Touch.h in Headers */, FA9D8DDB1DEF8411002CD881 /* Stream.h in Headers */, FAF6C9E823C2DE2900D7B5BC /* GLSL.ext.EXT.h in Headers */, @@ -4509,6 +4500,7 @@ FA0B79261A958E3B000E1D17 /* Exception.h in Headers */, D9DB6E402B4B41580037A1F6 /* GLSL.ext.ARM.h in Headers */, FA0B7D4D1A95902C000E1D17 /* Shader.h in Headers */, + D9F318AE3013F85300CFB9D0 /* NonSemanticShaderDebugInfo.h in Headers */, FA0B793D1A958E3B000E1D17 /* runtime.h in Headers */, FAF6C9E323C2DE2900D7B5BC /* GLSL.ext.AMD.h in Headers */, FA57FB9A1AE1993600F2AD6D /* noise1234.h in Headers */, @@ -5043,7 +5035,6 @@ FAF6C9FB23C2DE2900D7B5BC /* disassemble.cpp in Sources */, FA18CEDD23DBC6E000263725 /* Metal.mm in Sources */, FAE64A822071363100BC7981 /* physfs_archiver_grp.c in Sources */, - FAF6C9F323C2DE2900D7B5BC /* SPVRemapper.cpp in Sources */, FA0B79331A958E3B000E1D17 /* Object.cpp in Sources */, FAE64A8D2071363500BC7981 /* physfs_platform_apple.m in Sources */, FA0B7E5B1A95902C000E1D17 /* wrap_MotorJoint.cpp in Sources */, @@ -5519,7 +5510,6 @@ FA0B7D281A95902C000E1D17 /* wrap_GlyphData.cpp in Sources */, FABDA9F92552448300B5C523 /* b2_polygon_shape.cpp in Sources */, FA0B7DE21A95902C000E1D17 /* wrap_RandomGenerator.cpp in Sources */, - FAF6C9F223C2DE2900D7B5BC /* SPVRemapper.cpp in Sources */, FA18CEEF23DC9B3E00263725 /* Texture.mm in Sources */, FABDAA012552448300B5C523 /* b2_distance.cpp in Sources */, FACA02F61F5E396B0084B28F /* wrap_DataModule.cpp in Sources */, diff --git a/src/libraries/glslang/SPIRV/GLSL.ext.ARM.h b/src/libraries/glslang/SPIRV/GLSL.ext.ARM.h index 14425be1e..eef5b03e1 100644 --- a/src/libraries/glslang/SPIRV/GLSL.ext.ARM.h +++ b/src/libraries/glslang/SPIRV/GLSL.ext.ARM.h @@ -1,5 +1,5 @@ /* -** Copyright (c) 2022 ARM Limited +** Copyright (c) 2022, 2025 ARM Limited ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and/or associated documentation files (the "Materials"), @@ -28,8 +28,10 @@ #define GLSLextARM_H static const int GLSLextARMVersion = 100; -static const int GLSLextARMRevision = 1; +static const int GLSLextARMRevision = 2; -static const char * const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins"; +static const char* const E_SPV_ARM_core_builtins = "SPV_ARM_core_builtins"; +static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts"; +static const char* const E_SPV_ARM_tensors = "SPV_ARM_tensors"; #endif // #ifndef GLSLextARM_H diff --git a/src/libraries/glslang/SPIRV/GLSL.ext.EXT.h b/src/libraries/glslang/SPIRV/GLSL.ext.EXT.h index 307185e51..bed1f0704 100644 --- a/src/libraries/glslang/SPIRV/GLSL.ext.EXT.h +++ b/src/libraries/glslang/SPIRV/GLSL.ext.EXT.h @@ -41,7 +41,9 @@ static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64"; static const char* const E_SPV_EXT_shader_tile_image = "SPV_EXT_shader_tile_image"; static const char* const E_SPV_EXT_mesh_shader = "SPV_EXT_mesh_shader"; -static const char* const E_SPV_ARM_cooperative_matrix_layouts = "SPV_ARM_cooperative_matrix_layouts"; static const char* const E_SPV_EXT_float8 = "SPV_EXT_float8"; +static const char* const E_SPV_EXT_shader_64bit_indexing = "SPV_EXT_shader_64bit_indexing"; +static const char* const E_SPV_EXT_shader_invocation_reorder = "SPV_EXT_shader_invocation_reorder"; +static const char* const E_SPV_EXT_long_vector = "SPV_EXT_long_vector"; #endif // #ifndef GLSLextEXT_H diff --git a/src/libraries/glslang/SPIRV/GLSL.ext.KHR.h b/src/libraries/glslang/SPIRV/GLSL.ext.KHR.h index 25dd88ff2..91412c25d 100644 --- a/src/libraries/glslang/SPIRV/GLSL.ext.KHR.h +++ b/src/libraries/glslang/SPIRV/GLSL.ext.KHR.h @@ -55,6 +55,7 @@ static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_w static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow"; static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric"; static const char* const E_SPV_KHR_quad_control = "SPV_KHR_quad_control"; +static const char* const E_SPV_KHR_compute_shader_derivatives = "SPV_KHR_compute_shader_derivatives"; static const char* const E_SPV_AMD_shader_early_and_late_fragment_tests = "SPV_AMD_shader_early_and_late_fragment_tests"; static const char* const E_SPV_KHR_ray_tracing_position_fetch = "SPV_KHR_ray_tracing_position_fetch"; static const char* const E_SPV_KHR_cooperative_matrix = "SPV_KHR_cooperative_matrix"; @@ -66,5 +67,8 @@ static const char* const E_SPV_KHR_relaxed_extended_instruction = "SPV_KHR_relax static const char* const E_SPV_KHR_integer_dot_product = "SPV_KHR_integer_dot_product"; static const char* const E_SPV_NV_cooperative_vector = "SPV_NV_cooperative_vector"; static const char* const E_SPV_KHR_bfloat16 = "SPV_KHR_bfloat16"; - +static const char* const E_SPV_EXT_descriptor_heap = "SPV_EXT_descriptor_heap"; +static const char* const E_SPV_KHR_untyped_pointers = "SPV_KHR_untyped_pointers"; +static const char* const E_SPV_KHR_abort = "SPV_KHR_abort"; +static const char* const E_SPV_KHR_constant_data = "SPV_KHR_constant_data"; #endif // #ifndef GLSLextKHR_H diff --git a/src/libraries/glslang/SPIRV/GLSL.ext.NV.h b/src/libraries/glslang/SPIRV/GLSL.ext.NV.h index 4516d2d54..3666cd88a 100644 --- a/src/libraries/glslang/SPIRV/GLSL.ext.NV.h +++ b/src/libraries/glslang/SPIRV/GLSL.ext.NV.h @@ -101,4 +101,8 @@ const char* const E_SPV_NV_cluster_acceleration_structure = "SPV_NV_cluster_acce //SPV_NV_linear_swept_spheres const char* const E_SPV_NV_linear_swept_spheres = "SPV_NV_linear_swept_spheres"; + +//SPV_NV_push_constant_bank +const char* const E_SPV_NV_push_constant_bank = "SPV_NV_push_constant_bank"; + #endif // #ifndef GLSLextNV_H diff --git a/src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h b/src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h index a671d79a8..7633d4079 100644 --- a/src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h +++ b/src/libraries/glslang/SPIRV/GLSL.ext.QCOM.h @@ -39,6 +39,8 @@ static const int GLSLextQCOMRevision = 1; const char* const E_SPV_QCOM_image_processing = "SPV_QCOM_image_processing"; //SPV_QCOM_image_processing2 const char* const E_SPV_QCOM_image_processing2 = "SPV_QCOM_image_processing2"; +//SPV_QCOM_cooperative_matrix_conversion +const char* const E_SPV_QCOM_cooperative_matrix_conversion = "SPV_QCOM_cooperative_matrix_conversion"; //SPV_QCOM_tile_shading const char* const E_SPV_QCOM_tile_shading = "SPV_QCOM_tile_shading"; diff --git a/src/libraries/glslang/SPIRV/GlslangToSpv.cpp b/src/libraries/glslang/SPIRV/GlslangToSpv.cpp index 984fda877..6778c6286 100644 --- a/src/libraries/glslang/SPIRV/GlslangToSpv.cpp +++ b/src/libraries/glslang/SPIRV/GlslangToSpv.cpp @@ -110,10 +110,36 @@ struct OpDecorations { void addNoContraction(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, noContraction); } void addNonUniform(spv::Builder& builder, spv::Id t) { builder.addDecoration(t, nonUniform); } protected: - spv::Decoration noContraction; - spv::Decoration nonUniform; + spv::Decoration noContraction; + spv::Decoration nonUniform; }; +void addDerivativeGroupExecutionMode(spv::Builder& builder, const glslang::TIntermediate& intermediate, + spv::Function* shaderEntry) +{ + if (intermediate.getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { + if (intermediate.getLayoutDerivativeExtension() == glslang::EdgKHR) { + builder.addCapability(spv::Capability::ComputeDerivativeGroupQuadsKHR); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupQuadsKHR); + builder.addExtension(spv::E_SPV_KHR_compute_shader_derivatives); + } else { + builder.addCapability(spv::Capability::ComputeDerivativeGroupQuadsNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupQuadsNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } + } else if (intermediate.getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupLinear) { + if (intermediate.getLayoutDerivativeExtension() == glslang::EdgKHR) { + builder.addCapability(spv::Capability::ComputeDerivativeGroupLinearKHR); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupLinearKHR); + builder.addExtension(spv::E_SPV_KHR_compute_shader_derivatives); + } else { + builder.addCapability(spv::Capability::ComputeDerivativeGroupLinearNV); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupLinearNV); + builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); + } + } +} + } // namespace // @@ -127,15 +153,16 @@ public: glslang::SpvOptions& options); virtual ~TGlslangToSpvTraverser() { } - bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*); - bool visitBinary(glslang::TVisit, glslang::TIntermBinary*); - void visitConstantUnion(glslang::TIntermConstantUnion*); - bool visitSelection(glslang::TVisit, glslang::TIntermSelection*); - bool visitSwitch(glslang::TVisit, glslang::TIntermSwitch*); - void visitSymbol(glslang::TIntermSymbol* symbol); - bool visitUnary(glslang::TVisit, glslang::TIntermUnary*); - bool visitLoop(glslang::TVisit, glslang::TIntermLoop*); - bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*); + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*) override; + bool visitBinary(glslang::TVisit, glslang::TIntermBinary*) override; + void visitConstantUnion(glslang::TIntermConstantUnion*) override; + bool visitSelection(glslang::TVisit, glslang::TIntermSelection*) override; + bool visitSwitch(glslang::TVisit, glslang::TIntermSwitch*) override; + void visitSymbol(glslang::TIntermSymbol* symbol) override; + bool visitUnary(glslang::TVisit, glslang::TIntermUnary*) override; + bool visitLoop(glslang::TVisit, glslang::TIntermLoop*) override; + bool visitBranch(glslang::TVisit visit, glslang::TIntermBranch*) override; + bool visitVariableDecl(glslang::TVisit, glslang::TIntermVariableDecl*) override; void finishSpv(bool compileOnly); void dumpSpv(std::vector& out); @@ -173,6 +200,8 @@ protected: spv::Id convertGlslangStructToSpvType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&); spv::LinkageType convertGlslangLinkageToSpv(glslang::TLinkType glslangLinkType); + spv::Id decorateDescHeapType(const glslang::TType& type, spv::Id& memberBaseOffset, spv::Id& alignment, + int& maxPlainDataAlignment); void decorateStructType(const glslang::TType&, const glslang::TTypeList* glslangStruct, glslang::TLayoutPacking, const glslang::TQualifier&, spv::Id, const std::vector& spvMembers); spv::Id makeArraySizeId(const glslang::TArraySizes&, int dim, bool allowZero = false, bool boolType = false); @@ -194,7 +223,6 @@ protected: void makeGlobalInitializers(const glslang::TIntermSequence&); void collectRayTracingLinkerObjects(); void visitFunctions(const glslang::TIntermSequence&); - void handleFunctionEntry(const glslang::TIntermAggregate* node); void translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags); void translateArguments(glslang::TIntermUnary& node, std::vector& arguments); @@ -243,6 +271,8 @@ protected: std::pair getForcedType(glslang::TBuiltInVariable builtIn, const glslang::TType&); spv::Id translateForcedType(spv::Id object); spv::Id createCompositeConstruct(spv::Id typeId, std::vector constituents); + void recordDescHeapAccessChainInfo(glslang::TIntermBinary* node); + void createAbortEXT(const glslang::TIntermSequence &glslangOperands); glslang::SpvOptions& options; spv::Function* shaderEntry; @@ -288,6 +318,15 @@ protected: // Used later for generating OpTraceKHR/OpExecuteCallableKHR/OpHitObjectRecordHit*/OpHitObjectGetShaderBindingTableData std::unordered_map locationToSymbol[4]; std::unordered_map > idToQCOMDecorations; + // For nested or inner resource heap structure's alignment and offset records. + typedef struct heapMetaData { + spv::Id typeStride; + spv::Id maxRsrcTypeAlignment; + int maxPlainDataAlignment; + } HeapMetaData; + std::unordered_map heapStructureTypeMetaData; + std::unordered_map heapStructureTypeSize; + std::vector heapStructureMemberOffsets; }; // @@ -390,6 +429,9 @@ spv::Decoration TranslateBlockDecoration(const glslang::TStorageQualifier storag case glslang::EvqCallableData: return spv::Decoration::Block; case glslang::EvqCallableDataIn: return spv::Decoration::Block; case glslang::EvqHitObjectAttrNV: return spv::Decoration::Block; + case glslang::EvqHitObjectAttrEXT: return spv::Decoration::Block; + case glslang::EvqResourceHeap: return spv::Decoration::Block; + case glslang::EvqSamplerHeap: return spv::Decoration::Block; default: assert(0); break; @@ -465,6 +507,9 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T case glslang::EvqCallableData: case glslang::EvqCallableDataIn: case glslang::EvqHitObjectAttrNV: + case glslang::EvqHitObjectAttrEXT: + case glslang::EvqResourceHeap: + case glslang::EvqSamplerHeap: return spv::Decoration::Max; default: assert(0); @@ -1158,6 +1203,38 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI builder.addExtension(spv::E_SPV_QCOM_tile_shading); return spv::BuiltIn::TileApronSizeQCOM; + // SPV_EXT_descriptor_heap + case glslang::EbvSamplerHeapEXT: + builder.addExtension(spv::E_SPV_EXT_descriptor_heap); + builder.addExtension(spv::E_SPV_KHR_untyped_pointers); + builder.addCapability(spv::Capability::DescriptorHeapEXT); + builder.addCapability(spv::Capability::UntypedPointersKHR); + // Add SamplerHeapEXT Symbol for spv level. + if (builtInVariableIds.find(uint32_t(spv::BuiltIn::SamplerHeapEXT)) == builtInVariableIds.end()) { + spv::Id samplerHeapEXT = + builder.createUntypedVariable(spv::NoPrecision, spv::StorageClass::UniformConstant, "sampler_heap"); + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) + entryPoint->addIdOperand(samplerHeapEXT); + builder.addDecoration(samplerHeapEXT, spv::Decoration::BuiltIn, (int)spv::BuiltIn::SamplerHeapEXT); + builtInVariableIds.insert({uint32_t(spv::BuiltIn::SamplerHeapEXT), samplerHeapEXT}); + } + return spv::BuiltIn::SamplerHeapEXT; + case glslang::EbvResourceHeapEXT: + builder.addExtension(spv::E_SPV_EXT_descriptor_heap); + builder.addExtension(spv::E_SPV_KHR_untyped_pointers); + builder.addCapability(spv::Capability::DescriptorHeapEXT); + builder.addCapability(spv::Capability::UntypedPointersKHR); + // Add ResourceHeapEXT Symbol for spv level. + if (builtInVariableIds.find(uint32_t(spv::BuiltIn::ResourceHeapEXT)) == builtInVariableIds.end()) { + spv::Id resourceHeapEXT = + builder.createUntypedVariable(spv::NoPrecision, spv::StorageClass::UniformConstant, "resource_heap"); + if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4) + entryPoint->addIdOperand(resourceHeapEXT); + builder.addDecoration(resourceHeapEXT, spv::Decoration::BuiltIn, (int)spv::BuiltIn::ResourceHeapEXT); + builtInVariableIds.insert({uint32_t(spv::BuiltIn::ResourceHeapEXT), resourceHeapEXT}); + } + return spv::BuiltIn::ResourceHeapEXT; + default: return spv::BuiltIn::Max; } @@ -1323,7 +1400,8 @@ spv::LoopControlMask TGlslangToSpvTraverser::TranslateLoopControl(const glslang: // Translate glslang type to SPIR-V storage class. spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::TType& type) { - if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV) + if (type.getBasicType() == glslang::EbtRayQuery || type.getBasicType() == glslang::EbtHitObjectNV + || type.getBasicType() == glslang::EbtHitObjectEXT) return spv::StorageClass::Private; if (type.getQualifier().isSpirvByReference()) { if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput()) @@ -1349,8 +1427,13 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T type.getQualifier().storage == glslang::EvqUniform) { if (type.isAtomic()) return spv::StorageClass::AtomicCounter; - if (type.containsOpaque() && !glslangIntermediate->getBindlessMode()) - return spv::StorageClass::UniformConstant; + if (type.containsOpaque() && !glslangIntermediate->getBindlessMode()) { + if (type.getQualifier().storage == glslang::EvqResourceHeap || + type.getQualifier().storage == glslang::EvqSamplerHeap) + return spv::StorageClass::Uniform; + else + return spv::StorageClass::UniformConstant; + } } if (type.getQualifier().isUniformOrBuffer() && @@ -1366,7 +1449,8 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T if (type.getQualifier().isUniformOrBuffer()) { if (type.getQualifier().isPushConstant()) return spv::StorageClass::PushConstant; - if (type.getBasicType() == glslang::EbtBlock) + if (type.getBasicType() == glslang::EbtBlock || + type.getQualifier().layoutDescriptorHeap) return spv::StorageClass::Uniform; return spv::StorageClass::UniformConstant; } @@ -1389,6 +1473,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T case glslang::EvqCallableDataIn: return spv::StorageClass::IncomingCallableDataKHR; case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClass::TaskPayloadWorkgroupEXT; case glslang::EvqHitObjectAttrNV: return spv::StorageClass::HitObjectAttributeNV; + case glslang::EvqHitObjectAttrEXT: return spv::StorageClass::HitObjectAttributeEXT; case glslang::EvqSpirvStorageClass: return static_cast(type.getQualifier().spirvStorageClass); default: assert(0); @@ -1505,6 +1590,10 @@ bool IsDescriptorResource(const glslang::TType& type) type.getBasicType() == glslang::EbtAccStruct) return type.getQualifier().isUniformOrBuffer(); + // Tensors are tied to a descriptor. + if (type.isTensorARM()) + return true; + // None of the above. return false; } @@ -1617,20 +1706,32 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, } builder.setDebugMainSourceFile(glslangIntermediate->getSourceFile()); - // Set the source shader's text. If for SPV version 1.0, include + // Set the source shader's text + std::string text; + + // If for SPV version 1.0, include // a preamble in comments stating the OpModuleProcessed instructions. // Otherwise, emit those as actual instructions. - std::string text; + // + // ...Except when using ShaderDebugInfo we DON'T want these as it will mess up the line + // number, instead the user has opt'ed in for ShaderDebugInfo instead, so they will want + // to parse those instead + // https://github.com/KhronosGroup/glslang/issues/3863 + const bool add_comments = + glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && !options.emitNonSemanticShaderDebugSource; + const std::vector& processes = glslangIntermediate->getProcesses(); for (int p = 0; p < (int)processes.size(); ++p) { - if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1) { + if (add_comments) { text.append("// OpModuleProcessed "); text.append(processes[p]); text.append("\n"); - } else + } else if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_1) { + // OpModuleProcessed added in SPIR-V 1.1 builder.addModuleProcessed(processes[p]); + } } - if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_1 && (int)processes.size() > 0) + if (add_comments && (int)processes.size() > 0) text.append("#line 1\n"); text.append(glslangIntermediate->getSourceText()); builder.setSourceText(text); @@ -1709,6 +1810,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, builder.addExecutionMode(shaderEntry, spv::ExecutionMode::RequireFullQuadsKHR); } + if (glslangIntermediate->usingShader64BitIndexing()) + { + builder.addCapability(spv::Capability::Shader64BitIndexingEXT); + builder.addExtension(spv::E_SPV_EXT_shader_64bit_indexing); + builder.addExecutionMode(shaderEntry, spv::ExecutionMode::Shader64BitIndexingEXT); + } + spv::ExecutionMode mode; switch (glslangIntermediate->getStage()) { case EShLangVertex: @@ -1859,15 +1967,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, glslangIntermediate->getLocalSize(2)); } } - if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) { - builder.addCapability(spv::Capability::ComputeDerivativeGroupQuadsNV); - builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupQuadsNV); - builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); - } else if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupLinear) { - builder.addCapability(spv::Capability::ComputeDerivativeGroupLinearNV); - builder.addExecutionMode(shaderEntry, spv::ExecutionMode::DerivativeGroupLinearNV); - builder.addExtension(spv::E_SPV_NV_compute_shader_derivatives); - } + addDerivativeGroupExecutionMode(builder, *glslangIntermediate, shaderEntry); if (glslangIntermediate->getNonCoherentTileAttachmentReadQCOM()) { builder.addCapability(spv::Capability::TileShadingQCOM); @@ -2004,6 +2104,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion, glslangIntermediate->getLocalSize(1), glslangIntermediate->getLocalSize(2)); } + addDerivativeGroupExecutionMode(builder, *glslangIntermediate, shaderEntry); if (glslangIntermediate->getStage() == EShLangMesh) { builder.addExecutionMode(shaderEntry, spv::ExecutionMode::OutputVertices, glslangIntermediate->getVertices()); @@ -2192,7 +2293,7 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) // C) R-Values from type translation, see above call to translateForcedType() glslang::TQualifier qualifier = symbol->getQualifier(); if (qualifier.isSpecConstant() || rValueParameters.find(symbol->getId()) != rValueParameters.end() || - !builder.isPointerType(builder.getTypeId(id))) + (!builder.isPointerType(builder.getTypeId(id)) && !builder.isUntypedPointer(id))) builder.setAccessChainRValue(id); else builder.setAccessChainLValue(id); @@ -2233,6 +2334,28 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) #endif } +// Create new untyped access chain instruction to descriptor heap, based on EXT_descriptor_heap extension. +void TGlslangToSpvTraverser::recordDescHeapAccessChainInfo(glslang::TIntermBinary* node) +{ + // EXT_descriptor_heap + glslang::TType* nodeTy = node->getWritableType().clone(); + // For buffer/structure type, using its basic structure type: + // data ptr will be first loaded into a BufferPointerType before finally gets chained accessed. + if (node->getLeft()->getQualifier().isUniformOrBuffer()) + nodeTy = node->getLeft()->getType().clone(); + if (nodeTy->isArray()) + nodeTy->clearArraySizes(); + spv::BuiltIn bt = spv::BuiltIn::Max; + unsigned int firstArrIndex = 0; + auto rsrcOffsetIdx = builder.isStructureHeapMember(builder.getTypeId(builder.getAccessChain().base), + builder.getAccessChain().indexChain, 0, &bt, &firstArrIndex); + spv::Id remappedBuiltin = bt == spv::BuiltIn::Max ? 0 : builtInVariableIds[unsigned(bt)]; + nodeTy->getQualifier().layoutDescriptorInnerBlock = false; + // Extra dimension is not needed when translate storage and type. Real loading type is based on orignal AST nodes. + builder.setAccessChainDescHeapInfo(TranslateStorageClass(*nodeTy), convertGlslangToSpvType(*nodeTy), + nodeTy->getQualifier().layoutDescriptorStride, rsrcOffsetIdx, remappedBuiltin, firstArrIndex); +} + bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) { builder.setDebugSourceLocation(node->getLoc().line, node->getLoc().getFilename()); @@ -2369,14 +2492,32 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T coherentFlags.nonUniform = 0; // normal case for indexing array or structure or block - builder.accessChainPush(builder.makeIntConstant(spvIndex), - coherentFlags, - node->getLeft()->getType().getBufferReferenceAlignment()); + if ((node->getRight()->getType().getBasicType() == glslang::EbtUint && glslangIntermediate->usingPromoteUint32Indices()) || + node->getRight()->getType().contains64BitInt()) { + int64_t idx = node->getRight()->getType().contains64BitInt() ? + node->getRight()->getAsConstantUnion()->getConstArray()[0].getI64Const() : + node->getRight()->getAsConstantUnion()->getConstArray()[0].getUConst(); + builder.accessChainPush(builder.makeInt64Constant(idx), + coherentFlags, + node->getLeft()->getType().getBufferReferenceAlignment()); + } else { + builder.accessChainPush(builder.makeIntConstant(spvIndex), + coherentFlags, + node->getLeft()->getType().getBufferReferenceAlignment()); + } // Add capabilities here for accessing PointSize and clip/cull distance. // We have deferred generation of associated capabilities until now. if (node->getLeft()->getType().isStruct() && ! node->getLeft()->getType().isArray()) declareUseOfStructMember(*(node->getLeft()->getType().getStruct()), glslangIndex); + + // EXT_descriptor_heap + // Record untyped descriptor heap access info. + if (node->getLeft()->getType().isBuiltIn() && + (node->getLeft()->getQualifier().builtIn == glslang::EbvResourceHeapEXT || + node->getLeft()->getQualifier().builtIn == glslang::EbvSamplerHeapEXT)) { + recordDescHeapAccessChainInfo(node); + } } } return false; @@ -2399,6 +2540,16 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T node->getRight()->traverse(this); spv::Id index = accessChainLoad(node->getRight()->getType()); + // Zero-extend smaller unsigned integer types for array indexing. + // SPIR-V OpAccessChain treats indices as signed, so we need to zero-extend + // unsigned types to preserve their values (signed types are fine as-is). + spv::Id indexType = builder.getTypeId(index); + if (builder.isUintType(indexType) && builder.getScalarTypeWidth(indexType) < 32) { + // Zero-extend unsigned types to preserve their values + spv::Id uintType = builder.makeUintType(32); + index = builder.createUnaryOp(spv::Op::OpUConvert, uintType, index); + } + addIndirectionIndexCapabilities(node->getLeft()->getType(), node->getRight()->getType()); // restore the saved access chain @@ -2415,9 +2566,23 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T index, convertGlslangToSpvType(node->getLeft()->getType()), coherent_flags, glslangIntermediate->getBaseAlignmentScalar(node->getLeft()->getType(), dummySize)); - } else + } else { + if (glslangIntermediate->usingPromoteUint32Indices() && + node->getRight()->getType().getBasicType() == glslang::EbtUint) { + index = createIntWidthConversion(index, 0, builder.makeIntegerType(64, true), glslang::EbtInt64, node->getRight()->getType().getBasicType()); + } + builder.accessChainPush(index, coherent_flags, node->getLeft()->getType().getBufferReferenceAlignment()); + } + + // EXT_descriptor_heap + // Record untyped descriptor heap access info. + if (node->getLeft()->getType().isBuiltIn() && + (node->getLeft()->getQualifier().builtIn == glslang::EbvResourceHeapEXT || + node->getLeft()->getQualifier().builtIn == glslang::EbvSamplerHeapEXT)) { + recordDescHeapAccessChainInfo(node); + } } return false; case glslang::EOpVectorSwizzle: @@ -2644,6 +2809,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // So, this has to be block.lastMember.length(). // SPV wants "block" and member number as the operands, go get them. + uint32_t bits = node->getType().contains64BitInt() ? 64 : 32; + spv::Id length; if (node->getOperand()->getType().isCoopMat()) { spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType()); @@ -2655,15 +2822,19 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); length = builder.createCooperativeMatrixLengthNV(typeId); } - } else if (node->getOperand()->getType().isCoopVecNV()) { + } else if (node->getOperand()->getType().isCoopVecOrLongVector()) { spv::Id typeId = convertGlslangToSpvType(node->getOperand()->getType()); - length = builder.getCooperativeVectorNumComponents(typeId); + if (builder.isCooperativeVectorType(typeId)) { + length = builder.getCooperativeVectorNumComponents(typeId); + } else { + length = builder.makeIntConstant(builder.getNumTypeConstituents(typeId)); + } } else { glslang::TIntermTyped* block = node->getOperand()->getAsBinaryNode()->getLeft(); block->traverse(this); unsigned int member = node->getOperand()->getAsBinaryNode()->getRight()->getAsConstantUnion() ->getConstArray()[0].getUConst(); - length = builder.createArrayLength(builder.accessChainGetLValue(), member); + length = builder.createArrayLength(builder.accessChainGetLValue(), member, bits); } // GLSL semantics say the result of .length() is an int, while SPIR-V says @@ -2671,9 +2842,9 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI // AST expectation of a signed result. if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { if (builder.isInSpecConstCodeGenMode()) { - length = builder.createBinOp(spv::Op::OpIAdd, builder.makeIntType(32), length, builder.makeIntConstant(0)); + length = builder.createBinOp(spv::Op::OpIAdd, builder.makeIntType(bits), length, builder.makeIntConstant(0)); } else { - length = builder.createUnaryOp(spv::Op::OpBitcast, builder.makeIntType(32), length); + length = builder.createUnaryOp(spv::Op::OpBitcast, builder.makeIntType(bits), length); } } @@ -2742,6 +2913,28 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI case glslang::EOpHitObjectGetSphereRadiusNV: case glslang::EOpHitObjectIsSphereHitNV: case glslang::EOpHitObjectIsLSSHitNV: + case glslang::EOpReorderThreadEXT: + case glslang::EOpHitObjectGetCurrentTimeEXT: + case glslang::EOpHitObjectGetHitKindEXT: + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + case glslang::EOpHitObjectGetGeometryIndexEXT: + case glslang::EOpHitObjectGetInstanceIdEXT: + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + case glslang::EOpHitObjectGetObjectRayOriginEXT: + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + case glslang::EOpHitObjectGetWorldRayOriginEXT: + case glslang::EOpHitObjectGetWorldToObjectEXT: + case glslang::EOpHitObjectGetObjectToWorldEXT: + case glslang::EOpHitObjectGetRayTMaxEXT: + case glslang::EOpHitObjectGetRayTMinEXT: + case glslang::EOpHitObjectGetRayFlagsEXT: + case glslang::EOpHitObjectIsEmptyEXT: + case glslang::EOpHitObjectIsHitEXT: + case glslang::EOpHitObjectIsMissEXT: + case glslang::EOpHitObjectRecordEmptyEXT: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: return true; default: return false; @@ -2913,9 +3106,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI case glslang::EOpReorderThreadNV: builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operand); return false; + case glslang::EOpReorderThreadEXT: + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operand); + return false; case glslang::EOpHitObjectRecordEmptyNV: builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyNV, operand); return false; + case glslang::EOpHitObjectRecordEmptyEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordEmptyEXT, operand); + return false; case glslang::EOpCreateTensorLayoutNV: result = builder.createOp(spv::Op::OpCreateTensorLayoutNV, resultType(), std::vector{}); @@ -2969,6 +3168,106 @@ spv::Id TGlslangToSpvTraverser::createCompositeConstruct(spv::Id resultTypeId, s return builder.createCompositeConstruct(resultTypeId, constituents); } +void TGlslangToSpvTraverser::createAbortEXT(const glslang::TIntermSequence &glslangOperands) +{ + bool isEmptyMsg = + glslangOperands.empty() || + strcmp(glslangOperands[0]->getAsConstantUnion()->getConstArray()[0].getSConst()->c_str(), "") == 0; + // Add Capability and extensions. + builder.addCapability(spv::Capability::AbortKHR); + builder.addCapability(spv::Capability::ConstantDataKHR); + builder.addExtension(spv::E_SPV_KHR_constant_data); + builder.addExtension(spv::E_SPV_KHR_abort); + + struct strInfo { + glslang::TString string; + int specifierIndex; // -1 if not a specifier. + strInfo(glslang::TString str, int spec) : string(str), specifierIndex(spec) {}; + }; + + std::vector splitStr, tempSplitStr; + const uint32_t formatSpecifiersSize = 4; + const char* formatSpecifiers[formatSpecifiersSize] = {"%d", "%i", "%f", "%u"}; + // 1. Split original message string with format specifiers. + const auto emptyMsg = glslang::TString("\0"); + const glslang::TString* msg = + isEmptyMsg ? &emptyMsg : glslangOperands[0]->getAsConstantUnion()->getConstArray()[0].getSConst(); + splitStr.push_back(strInfo(*msg, -1)); + for (uint32_t i = 0; i < formatSpecifiersSize; i++) { + for (uint32_t j = 0; j < splitStr.size(); j++) { + auto str = splitStr[j].string; + int specifierIndex = splitStr[j].specifierIndex; + auto pos = str.find(formatSpecifiers[i]); + while (pos != std::string::npos) { + tempSplitStr.push_back(strInfo(str.substr(0, pos), specifierIndex)); + tempSplitStr.push_back(strInfo(glslang::TString(formatSpecifiers[i]), i)); + str = str.substr(pos + strlen(formatSpecifiers[i])); + pos = str.find(formatSpecifiers[i]); + } + if (!str.empty() || isEmptyMsg) + tempSplitStr.push_back(strInfo(str, specifierIndex)); + } + splitStr.clear(); + splitStr = tempSplitStr; + tempSplitStr.clear(); + } + // 2. Prepare to construct message struct variable, record members' types, data and offsets. + std::vector structMemberOffsets; + std::vector structMemberType; + std::vector structLoadMemberType; + std::vector structMemberData; + structMemberOffsets.push_back(0); + auto charType = builder.makeIntType(8); + for (auto elem : splitStr) { + // 2.1 get sub string's length (if specifier, be spec const). + // If not an empty string, \0 is the final character. + unsigned int strElemLen = isEmptyMsg ? 1 : elem.string.size() + 1; + unsigned int paddingSize = (4 - strElemLen % 4) % 4; + strElemLen = strElemLen + paddingSize; + spv::Id constLen = builder.makeUintConstant(strElemLen); + spv::Op constDataOp = spv::Op::OpConstantDataKHR; + if (elem.specifierIndex >= 0) { + constLen = builder.makeUintConstant(strElemLen, true); + constDataOp = spv::Op::OpSpecConstantDataKHR; + } + // 2.2 get sub string's array type (if specifier, be spec const). + auto strElemArrType = builder.makeArrayType(charType, constLen, 1); + auto strElemLoadArrType = builder.makeArrayType(charType, constLen, 1); + // 2.3 add sub string constant data + auto strElemConstData = builder.createConstData(constDataOp, strElemArrType, {elem.string.c_str()}); + // 2.4 add decoration for those sub string. + builder.addDecoration(strElemArrType, spv::Decoration::UTFEncodedKHR); + builder.addDecoration(strElemLoadArrType, spv::Decoration::UTFEncodedKHR); + // 2.5 Collect data and type for construct an internal message structure member. + structMemberType.push_back(strElemArrType); + structLoadMemberType.push_back(strElemLoadArrType); + structMemberOffsets.push_back(structMemberOffsets.back() + strElemLen); + structMemberData.push_back(strElemConstData); + } + structMemberOffsets.pop_back(); + // 3. Add extra following arguments/variables' types in member structure. + for (unsigned int i = 1; i < glslangOperands.size(); i++) { + spv::Builder::AccessChain save = builder.getAccessChain(); + builder.clearAccessChain(); + auto width = GetNumBits(glslangOperands[i]->getAsTyped()->getBasicType()); + structMemberOffsets.push_back(structMemberOffsets.back() + width / 8); + glslangOperands[i]->traverse(this); + structMemberData.push_back(accessChainLoad(glslangOperands[i]->getAsTyped()->getType())); + spv::Id reservedOpType = builder.getTypeId(structMemberData.back()); + structMemberType.push_back(reservedOpType); + structLoadMemberType.push_back(reservedOpType); + + builder.setAccessChain(save); + } + // 4. Construct struct message variable, add abortExt instruction. + auto structLoadType = builder.makeStructType(structLoadMemberType, {}, "abortMessageLoadType"); + for (unsigned int i = 0; i < structMemberOffsets.size(); i++) + builder.addMemberDecoration(structLoadType, i, spv::Decoration::Offset, structMemberOffsets[i]); + auto structType = builder.makeStructType(structMemberType, {}, "abortMessage"); + auto messageVar = builder.createCompositeConstruct(structType, structMemberData); + builder.makeStatementTerminator(spv::Op::OpAbortKHR, {structLoadType, messageVar}, "post-abort"); +} + bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TIntermAggregate* node) { SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); @@ -2980,6 +3279,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt std::vector complexLvalues; // for holding swizzling l-values too complex for // SPIR-V, for an out parameter std::vector temporaryLvalues; // temporaries to pass, as proxies for complexLValues + spv::Builder::AccessChain tensorReadResultLValue = {}; + tensorReadResultLValue.base = spv::NoResult; // deferred tensorReadARM out-arg store target auto resultType = [&invertedType, &node, this](){ if (invertedType != spv::NoType) { @@ -3090,7 +3391,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.enterFunction(shaderEntry); currentFunction = shaderEntry; } else { - handleFunctionEntry(node); + // SPIR-V functions should already be in the functionMap from the prepass + // that called makeFunctions(). + currentFunction = functionMap[node->getName().c_str()]; + spv::Block* functionBlock = currentFunction->getEntryBlock(); + builder.setBuildPoint(functionBlock); + builder.enterFunction(currentFunction); } if (options.generateDebugInfo && !options.emitNonSemanticShaderDebugInfo) { const auto& loc = node->getLoc(); @@ -3099,6 +3405,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column); } } else { + // Here we have finished visiting the function (post-visit). Finalize it. if (options.generateDebugInfo) { if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && node->getSequence().size() > 1) { auto endLoc = node->getSequence()[1]->getAsAggregate()->getEndLoc(); @@ -3109,6 +3416,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt entryPointTerminated = true; builder.leaveFunction(); inEntryPoint = false; + currentFunction = nullptr; } return true; @@ -3273,7 +3581,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addCapability(spv::Capability::CooperativeMatrixConversionsNV); builder.addExtension(spv::E_SPV_NV_cooperative_matrix2); constructed = builder.createCooperativeMatrixConversion(resultType(), arguments[0]); - } else if (node->getOp() == glslang::EOpConstructCooperativeVectorNV && + } else if (node->getType().isCoopVecOrLongVector() && arguments.size() == 1 && builder.getTypeId(arguments[0]) == resultType()) { constructed = arguments[0]; @@ -3283,7 +3591,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt node->getType().isArray() || // Handle constructing coopvec from one component here, to avoid the component // getting smeared - (node->getOp() == glslang::EOpConstructCooperativeVectorNV && arguments.size() == 1 && builder.isScalar(arguments[0]))) { + (node->getType().hasSpecConstantVectorComponents() && arguments.size() == 1 && builder.isScalar(arguments[0]))) { std::vector constituents; for (int c = 0; c < (int)arguments.size(); ++c) constituents.push_back(arguments[c]); @@ -3345,7 +3653,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt { // for scalar dot product, use multiply glslang::TIntermSequence& glslangOperands = node->getSequence(); - if (glslangOperands[0]->getAsTyped()->getVectorSize() == 1) + if (!glslangOperands[0]->getAsTyped()->getType().isLongVector() && + glslangOperands[0]->getAsTyped()->getVectorSize() == 1) binOp = glslang::EOpMul; break; } @@ -3562,6 +3871,46 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); break; + case glslang::EOpHitObjectTraceRayEXT: + case glslang::EOpHitObjectTraceRayMotionEXT: + case glslang::EOpHitObjectGetAttributesEXT: + case glslang::EOpHitObjectExecuteShaderEXT: + case glslang::EOpHitObjectRecordEmptyEXT: + case glslang::EOpHitObjectRecordMissEXT: + case glslang::EOpHitObjectRecordMissMotionEXT: + case glslang::EOpReorderThreadEXT: + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectReorderExecuteEXT: + case glslang::EOpHitObjectTraceReorderExecuteEXT: + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: + case glslang::EOpHitObjectRecordFromQueryEXT: + case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT: + noReturnValue = true; + [[fallthrough]]; + case glslang::EOpHitObjectIsEmptyEXT: + case glslang::EOpHitObjectIsMissEXT: + case glslang::EOpHitObjectIsHitEXT: + case glslang::EOpHitObjectGetRayTMinEXT: + case glslang::EOpHitObjectGetRayTMaxEXT: + case glslang::EOpHitObjectGetRayFlagsEXT: + case glslang::EOpHitObjectGetObjectRayOriginEXT: + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + case glslang::EOpHitObjectGetWorldRayOriginEXT: + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + case glslang::EOpHitObjectGetObjectToWorldEXT: + case glslang::EOpHitObjectGetWorldToObjectEXT: + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + case glslang::EOpHitObjectGetInstanceIdEXT: + case glslang::EOpHitObjectGetGeometryIndexEXT: + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + case glslang::EOpHitObjectGetHitKindEXT: + case glslang::EOpHitObjectGetCurrentTimeEXT: + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderEXT); + break; + case glslang::EOpRayQueryGetIntersectionTriangleVertexPositionsEXT: builder.addExtension(spv::E_SPV_KHR_ray_tracing_position_fetch); builder.addCapability(spv::Capability::RayQueryPositionFetchKHR); @@ -3580,6 +3929,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.addCapability(spv::Capability::TextureBlockMatchQCOM); builder.addExtension(spv::E_SPV_QCOM_image_processing); break; + case glslang::EOpTensorWriteARM: + noReturnValue = true; + break; case glslang::EOpImageBlockMatchWindowSSDQCOM: case glslang::EOpImageBlockMatchWindowSADQCOM: @@ -3655,6 +4007,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt glslang::TIntermSequence& glslangOperands = node->getSequence(); std::vector operands; std::vector memoryAccessOperands; + if (node->getOp() == glslang::EOpAbortEXT) { + createAbortEXT(glslangOperands); + return false; + } for (int arg = 0; arg < (int)glslangOperands.size(); ++arg) { // special case l-value operands; there are just a few bool lvalue = false; @@ -3666,6 +4022,12 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt + case glslang::EOpHitObjectRecordFromQueryEXT: + case glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT: + if (arg == 0 || arg == 1) + lvalue = true; + break; + case glslang::EOpHitObjectRecordHitNV: case glslang::EOpHitObjectRecordHitMotionNV: case glslang::EOpHitObjectRecordHitWithIndexNV: @@ -3677,6 +4039,16 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpHitObjectRecordMissMotionNV: case glslang::EOpHitObjectGetAttributesNV: case glslang::EOpHitObjectGetClusterIdNV: + case glslang::EOpHitObjectTraceRayEXT: + case glslang::EOpHitObjectTraceRayMotionEXT: + case glslang::EOpHitObjectExecuteShaderEXT: + case glslang::EOpHitObjectRecordMissEXT: + case glslang::EOpHitObjectRecordMissMotionEXT: + case glslang::EOpHitObjectGetAttributesEXT: + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + case glslang::EOpHitObjectReorderExecuteEXT: + case glslang::EOpHitObjectTraceReorderExecuteEXT: + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: if (arg == 0) lvalue = true; break; @@ -3820,6 +4192,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt lvalue = true; break; case glslang::EOpReorderThreadNV: + case glslang::EOpReorderThreadEXT: //Three variants of reorderThreadNV, two of them use hitObjectNV if (arg == 0 && glslangOperands.size() != 2) lvalue = true; @@ -3830,6 +4203,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt if (arg == 0 || arg == 2) lvalue = true; break; + case glslang::EOpTensorReadARM: + if (arg == 2) + lvalue = true; + break; default: break; } @@ -3919,7 +4296,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.accessChainGetInferredType(), "swizzleTemp")); operands.push_back(temporaryLvalues.back()); } else { - operands.push_back(builder.accessChainGetLValue()); + if (node->getOp() == glslang::EOpTensorReadARM && arg == 2) { + // tensorReadARM stores the result after emitting the op, so keep the + // original l-value access chain and avoid materializing a transient + // pointer that may not preserve descriptor-heap indexing. + tensorReadResultLValue = builder.getAccessChain(); + // Keep the operand slot so optional tensor operands keep their + // existing indices in the later lowering logic. + operands.push_back(spv::NoResult); + } else { + operands.push_back(builder.accessChainGetLValue()); + } } lvalueCoherentFlags = builder.getAccessChain().coherentFlags; lvalueCoherentFlags |= TranslateCoherent(glslangOperands[arg]->getAsTyped()->getType()); @@ -3952,22 +4339,33 @@ 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) || - (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) || - (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) || - (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV)) { - const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0; - const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); - auto itNode = locationToSymbol[set].find(location); - visitSymbol(itNode->second); - spv::Id symId = getSymbolId(itNode->second); - operands.push_back(symId); + } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) || + (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) || + (arg == 1 && glslangOp == glslang::EOpExecuteCallableKHR) || + (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderNV) || + (arg == 1 && glslangOp == glslang::EOpHitObjectExecuteShaderEXT) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayNV) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceRayEXT) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionNV) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceRayMotionEXT) || + (arg == 12 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 13) || + (arg == 14 && glslangOp == glslang::EOpHitObjectTraceMotionReorderExecuteEXT && glslangOperands.size() == 15) || + (arg == 11 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 12) || + (arg == 13 && glslangOp == glslang::EOpHitObjectTraceReorderExecuteEXT && glslangOperands.size() == 14) || + (arg == 1 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 2) || + (arg == 3 && glslangOp == glslang::EOpHitObjectReorderExecuteEXT && glslangOperands.size() == 4)) { + const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0; + const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); + auto itNode = locationToSymbol[set].find(location); + visitSymbol(itNode->second); + spv::Id symId = getSymbolId(itNode->second); + operands.push_back(symId); } else if ((arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitNV) || (arg == 13 && glslangOp == glslang::EOpHitObjectRecordHitMotionNV) || (arg == 11 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexNV) || (arg == 12 && glslangOp == glslang::EOpHitObjectRecordHitWithIndexMotionNV) || + (arg == 3 && glslangOp == glslang::EOpHitObjectRecordFromQueryEXT) || + (arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesEXT) || (arg == 1 && glslangOp == glslang::EOpHitObjectGetAttributesNV)) { const int location = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getUConst(); const int set = 2; @@ -4177,7 +4575,19 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // store the result to the pointer (out param 'm') builder.createStore(result, operands[1]); result = 0; + } else if (node->getOp() == glslang::EOpHitObjectGetIntersectionTriangleVertexPositionsEXT) { + std::vector idImmOps; + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // hitObject + + spv::Op spvOp = spv::Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT; + spv::Id typeId = builder.makeArrayType(builder.makeVectorType(builder.makeFloatType(32), 3), + builder.makeUintConstant(3), 0); + + spv::Id result = builder.createOp(spvOp, typeId, idImmOps); + // store the result to the pointer (out param 'm') + builder.createStore(result, operands[1]); + result = 0; } else if (node->getOp() == glslang::EOpCooperativeMatrixMulAdd) { auto matrixOperands = spv::CooperativeMatrixOperandsMask::MaskNone; @@ -4241,6 +4651,24 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt // store the result to the pointer builder.createStore(result, operands[0]); result = 0; + } else if (node->getOp() == glslang::EOpBitCastArrayQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpBitCastArrayQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpCompositeConstructCoopMatQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpCompositeConstructCoopMatQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpCompositeExtractCoopMatQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + result = builder.createUnaryOp(spv::Op::OpCompositeExtractCoopMatQCOM, resultType(), operands[0]); + } else if (node->getOp() == glslang::EOpExtractSubArrayQCOM) { + builder.addCapability(spv::Capability::CooperativeMatrixConversionQCOM); + builder.addExtension(spv::E_SPV_QCOM_cooperative_matrix_conversion); + + std::vector arguments { operands[0], operands[1] };; + result = builder.createOp(spv::Op::OpExtractSubArrayQCOM, resultType(), arguments); } else if (node->getOp() == glslang::EOpCooperativeVectorMatMulNV || node->getOp() == glslang::EOpCooperativeVectorMatMulAddNV) { auto matrixOperands = spv::CooperativeMatrixOperandsMask::MaskNone; @@ -4331,6 +4759,68 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt idImmOps.push_back(spv::IdImmediate(true, operands[0])); // A builder.createNoResultOp(spv::Op::OpCooperativeVectorReduceSumAccumulateNV, idImmOps); result = 0; + } else if (node->getOp() == glslang::EOpTensorReadARM || + node->getOp() == glslang::EOpTensorWriteARM) { + const bool isWrite = node->getOp() == glslang::EOpTensorWriteARM; + const unsigned int tensorMinOperandCount = 3; + assert(operands.size() >= tensorMinOperandCount); + std::vector idImmOps; + + idImmOps.push_back(spv::IdImmediate(true, operands[0])); // tensor + idImmOps.push_back(spv::IdImmediate(true, operands[1])); // coords + if (isWrite) { + idImmOps.push_back(spv::IdImmediate(true, operands[2])); // value + } + + // Analyze the tensor operands + spv::IdImmediate tensorOperands = { false, uint32_t(spv::TensorOperandsMask::MaskNone) }; + bool pushExtraArg = false; + if (operands.size() > tensorMinOperandCount) { + auto enumVal = builder.getConstantScalar(operands[tensorMinOperandCount]); + + if (enumVal & uint32_t(spv::TensorOperandsMask::NontemporalARM)) { + tensorOperands.word |= uint32_t(spv::TensorOperandsMask::NontemporalARM); + } + if (enumVal & uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM)) { + tensorOperands.word |= uint32_t(spv::TensorOperandsMask::OutOfBoundsValueARM); + assert(operands.size() >= tensorMinOperandCount + 2 && + "TensorOperandsOutOfBoundsValueMask requires an additional value"); + pushExtraArg = true; + } + } + + // Append optional tensor operands if the mask was non-zero. + if (tensorOperands.word) { + idImmOps.push_back(tensorOperands); + if (pushExtraArg) + idImmOps.push_back(spv::IdImmediate(true, operands[tensorMinOperandCount + 1])); + } + + if (isWrite) { + builder.createNoResultOp(spv::Op::OpTensorWriteARM, idImmOps); + result = 0; + } else { + // Use the result argument type as the OpTensorReadARM result type. + const glslang::TType &resArgType = glslangOperands[2]->getAsTyped()->getType(); + spv::Id retType = convertGlslangToSpvType(resArgType); + result = builder.createOp(spv::Op::OpTensorReadARM, retType, idImmOps); + // Store the result to the result argument. + assert(tensorReadResultLValue.base != spv::NoResult); + builder.setAccessChain(tensorReadResultLValue); + accessChainStore(resArgType, result); + } + } else if (node->getOp() == glslang::EOpTensorSizeARM) { + // Expected operands are (tensor, dimension) + assert(operands.size() == 2); + + spv::Id tensorOp = operands[0]; + spv::Id dimOp = operands[1]; + assert(builder.isTensorTypeARM(builder.getTypeId(tensorOp)) && "operand #0 must be a tensor"); + + std::vector idImmOps; + idImmOps.push_back(spv::IdImmediate(true, tensorOp)); + idImmOps.push_back(spv::IdImmediate(true, dimOp)); + result = builder.createOp(spv::Op::OpTensorQuerySizeARM, resultType(), idImmOps); } else if (atomic) { // Handle all atomics glslang::TBasicType typeProxy = (node->getOp() == glslang::EOpAtomicStore) @@ -4701,7 +5191,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn builder.setBuildPoint(&test); node->getTest()->traverse(this); - spv::Id condition = accessChainLoad(node->getTest()->getType()); + spv::Id condition = accessChainLoad(node->getTestExpr()->getType()); builder.createConditionalBranch(condition, &blocks.body, &blocks.merge); builder.setBuildPoint(&blocks.body); @@ -4732,7 +5222,7 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn if (node->getTest()) { node->getTest()->traverse(this); spv::Id condition = - accessChainLoad(node->getTest()->getType()); + accessChainLoad(node->getTestExpr()->getType()); builder.createConditionalBranch(condition, &blocks.head, &blocks.merge); } else { // TODO: unless there was a break/return/discard instruction @@ -4815,6 +5305,18 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T return false; } +bool TGlslangToSpvTraverser::visitVariableDecl(glslang::TVisit visit, glslang::TIntermVariableDecl* node) +{ + if (visit == glslang::EvPreVisit) { + builder.setDebugSourceLocation(node->getDeclSymbol()->getLoc().line, node->getDeclSymbol()->getLoc().getFilename()); + // We touch the symbol once here to create the debug info. + getSymbolId(node->getDeclSymbol()); + } + + return true; +} + + spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node, spv::Id forcedType) { // First, steer off constants, which are not SPIR-V variables, but @@ -4822,8 +5324,12 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* // This includes specialization constants. if (node->getQualifier().isConstant()) { spv::Id result = createSpvConstant(*node); - if (result != spv::NoResult) + if (result != spv::NoResult) { + auto name = node->getAsSymbolNode()->getAccessName().c_str(); + auto typeId = convertGlslangToSpvType(node->getType()); + builder.createConstVariable(typeId, name, result, currentFunction == nullptr); return result; + } } // Now, handle actual variables @@ -4908,6 +5414,16 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* } spv::Id var = builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false); + + if (options.emitNonSemanticShaderDebugInfo && storageClass != spv::StorageClass::Function) { + // Create variable alias for retargeted symbols if any. + // Notably, this is only applicable to built-in variables so that it is okay to only use name as the key. + auto [itBegin, itEnd] = glslangIntermediate->getBuiltinAliasLookup().equal_range(name); + for (auto it = itBegin; it != itEnd; ++it) { + builder.createDebugGlobalVariable(builder.getDebugType(spvType), it->second.c_str(), var); + } + } + std::vector topLevelDecorations; glslang::TQualifier typeQualifier = node->getType().getQualifier(); TranslateMemoryDecoration(typeQualifier, topLevelDecorations, glslangIntermediate->usingVulkanMemoryModel()); @@ -5110,18 +5626,50 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtSampler: { const glslang::TSampler& sampler = type.getSampler(); + std::string debugName; + if (sampler.isPureSampler()) { - spvType = builder.makeSamplerType(); + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.getString(); + } + else { + debugName = "type.sampler"; + } + } + spvType = builder.makeSamplerType(debugName.c_str()); } else { // an image is present, make its type + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.removeCombined().getString(); + } + else { + switch (sampler.dim) { + case glslang::Esd1D: debugName = "type.1d.image"; break; + case glslang::Esd2D: debugName = "type.2d.image"; break; + case glslang::Esd3D: debugName = "type.3d.image"; break; + case glslang::EsdCube: debugName = "type.cube.image"; break; + default: debugName = "type.image"; break; + } + } + } spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler), sampler.isShadow(), sampler.isArrayed(), sampler.isMultiSample(), - sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type)); + sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type), debugName.c_str()); if (sampler.isCombined() && (!sampler.isBuffer() || glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6)) { // Already has both image and sampler, make the combined type. Only combine sampler to // buffer if before SPIR-V 1.6. - spvType = builder.makeSampledImageType(spvType); + if (options.emitNonSemanticShaderDebugInfo) { + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl) { + debugName = sampler.getString(); + } + else { + debugName = "type.sampled.image"; + } + } + spvType = builder.makeSampledImageType(spvType, debugName.c_str()); } } } @@ -5129,6 +5677,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtStruct: case glslang::EbtBlock: { + // If it's an inner declared heap buffer or uniform block, using OpTypeBufferEXT + // to convert it to an untyped type. + if (type.getQualifier().isUniformOrBuffer() && + type.getQualifier().layoutDescriptorHeap && type.getQualifier().layoutDescriptorInnerBlock) { + spvType = builder.makeUntypedPointer(TranslateStorageClass(type), true); + break; + } + // If we've seen this struct type, return it const glslang::TTypeList* glslangMembers = type.getStruct(); @@ -5155,6 +5711,13 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeHitObjectNVType(); } break; + + case glslang::EbtHitObjectEXT: { + builder.addExtension(spv::E_SPV_EXT_shader_invocation_reorder); + builder.addCapability(spv::Capability::ShaderInvocationReorderEXT); + spvType = builder.makeHitObjectEXTType(); + } + break; case glslang::EbtSpirvType: { // GL_EXT_spirv_intrinsics const auto& spirvType = type.getSpirvType(); @@ -5300,10 +5863,29 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spv::Id scope = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); spv::Id rows = makeArraySizeId(*type.getTypeParameters()->arraySizes, 1); spv::Id cols = makeArraySizeId(*type.getTypeParameters()->arraySizes, 2); - spv::Id use = builder.makeUintConstant(type.getCoopMatKHRuse()); + spv::Id use = makeArraySizeId(*type.getTypeParameters()->arraySizes, 3, true); spvType = builder.makeCooperativeMatrixTypeKHR(spvType, scope, rows, cols, use); } + else if (type.isTensorARM()) { + builder.addCapability(spv::Capability::TensorsARM); + builder.addExtension(spv::E_SPV_ARM_tensors); + if (type.getBasicType() == glslang::EbtInt8 || type.getBasicType() == glslang::EbtUint8) { + builder.addCapability(spv::Capability::Int8); + } else if (type.getBasicType() == glslang::EbtInt16 || + type.getBasicType() == glslang::EbtUint16) { + builder.addCapability(spv::Capability::Int16); + } else if (type.getBasicType() == glslang::EbtInt64 || + type.getBasicType() == glslang::EbtUint64) { + builder.addCapability(spv::Capability::Int64); + } else if (type.getBasicType() == glslang::EbtFloat16) { + builder.addCapability(spv::Capability::Float16); + } + + spv::Id rank = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); + + spvType = builder.makeTensorTypeARM(spvType, rank); + } if (type.isCoopVecNV()) { builder.addCapability(spv::Capability::CooperativeVectorNV); @@ -5320,6 +5902,30 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty spvType = builder.makeCooperativeVectorTypeNV(spvType, components); } + if (type.isLongVector()) { + // SPIR-V LongVectorEXT not needed when component count is literal 2–4. + const bool needLongVectorCap = type.hasSpecConstantVectorComponents() || + (type.getTypeParameters()->arraySizes->getDimSize(0) < 2 || + type.getTypeParameters()->arraySizes->getDimSize(0) > 4); + if (needLongVectorCap) { + builder.addCapability(spv::Capability::LongVectorEXT); + builder.addExtension(spv::E_SPV_EXT_long_vector); + } + + if (type.getBasicType() == glslang::EbtFloat16) + builder.addCapability(spv::Capability::Float16); + if (type.getBasicType() == glslang::EbtUint8 || type.getBasicType() == glslang::EbtInt8) { + builder.addCapability(spv::Capability::Int8); + } + + if (type.hasSpecConstantVectorComponents()) { + spv::Id components = makeArraySizeId(*type.getTypeParameters()->arraySizes, 0); + spvType = builder.makeCooperativeVectorTypeNV(spvType, components); + } else { + spvType = builder.makeVectorType(spvType, type.getTypeParameters()->arraySizes->getDimSize(0)); + } + } + if (type.isArray()) { int stride = 0; // keep this 0 unless doing an explicit layout; 0 will mean no decoration, no stride @@ -5353,12 +5959,19 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty stride = getArrayStride(type, explicitLayout, qualifier.layoutMatrix); } + if (type.getQualifier().storage == glslang::EvqResourceHeap || + type.getQualifier().storage == glslang::EvqSamplerHeap) { + auto structSize = heapStructureTypeSize[spvType]; + spvType = builder.makeRuntimeArray(spvType); + builder.addDecorationId(spvType, spv::Decoration::ArrayStrideIdEXT, structSize); + } // Do the outer dimension, which might not be known for a runtime-sized array. // (Unsized arrays that survive through linking will be runtime-sized arrays) - if (type.isSizedArray()) + else if (type.isSizedArray()) spvType = builder.makeArrayType(spvType, makeArraySizeId(*type.getArraySizes(), 0), stride); else { - if (!lastBufferBlockMember) { + // If we see an runtime array in a buffer_reference, it is not a descriptor + if (!lastBufferBlockMember && type.getBasicType() != glslang::EbtReference) { builder.addIncorporatedExtension("SPV_EXT_descriptor_indexing", spv::Spv_1_5); builder.addCapability(spv::Capability::RuntimeDescriptorArrayEXT); } @@ -5478,6 +6091,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy int memberDelta = 0; // how much the member's index changes from glslang to SPIR-V, normally 0, // except sometimes for blocks std::vector > deferredForwardPointers; + std::vector memberDebugInfo; for (int i = 0; i < (int)glslangMembers->size(); i++) { auto& glslangMember = (*glslangMembers)[i]; if (glslangMember.type->hiddenMember()) { @@ -5528,18 +6142,85 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy // + Not as clean as desired. Traverser queries/sets persistent state. This is fragile. // + Table lookup during creation of composite debug types. This really shouldn't be necessary. if(options.emitNonSemanticShaderDebugInfo) { - builder.debugTypeLocs[spvMember].name = glslangMember.type->getFieldName().c_str(); - builder.debugTypeLocs[spvMember].line = glslangMember.loc.line; - builder.debugTypeLocs[spvMember].column = glslangMember.loc.column; + spv::StructMemberDebugInfo debugInfo{}; + debugInfo.name = glslangMember.type->getFieldName(); + debugInfo.line = glslangMember.loc.line; + debugInfo.column = glslangMember.loc.column; + + // Per the GLSL spec, bool variables inside of a uniform or buffer block are generated as uint. + // But for debug info, we want to represent them as bool because that is the original type in + // the source code. The bool type can be nested within a vector or a multidimensional array, + // so we must construct the chain of types up from the scalar bool. + if (glslangIntermediate->getSource() == glslang::EShSourceGlsl && explicitLayout != glslang::ElpNone && + glslangMember.type->getBasicType() == glslang::EbtBool) { + auto typeId = builder.makeBoolType(); + if (glslangMember.type->isVector()) { + typeId = builder.makeVectorType(typeId, glslangMember.type->getVectorSize()); + } + if (glslangMember.type->isArray()) { + const auto* arraySizes = glslangMember.type->getArraySizes(); + int dims = arraySizes->getNumDims(); + for (int i = dims - 1; i >= 0; --i) { + spv::Id size = builder.makeIntConstant(arraySizes->getDimSize(i)); + typeId = builder.makeArrayType(typeId, size, 0); + } + } + debugInfo.debugTypeOverride = builder.getDebugType(typeId); + } else if (glslangMember.type->getQualifier().builtIn != glslang::EbvNone) { + // TODO - The built-in currently are not provide the correct line/column and spirv-val will validate these when using shaderDebugInfo + // + // There is a larger issue because even defining the builtIn such as + // + // out gl_PerVertex { + // vec4 gl_Position; + // }; + // + // in the shader also doesn't produce the correct line/column + // So for now, provide zero, as that is a valid value here + debugInfo.line = 0; + debugInfo.column = 0; + } + + memberDebugInfo.push_back(debugInfo); } } } + // For those whose storage is ResourceHeap or SamplerHeap, we needs to recursively add + // member decorator for inner structure member declaration with spec Constant. + spv::Id heapStructSize = 0; + if (qualifier.storage == glslang::EvqResourceHeap || qualifier.storage == glslang::EvqSamplerHeap || + qualifier.layoutDescriptorInnerBlock) { + auto memberBaseOffset = builder.makeUintConstant(0); + int maxPlainDataTypeAlignment = 0; + spv::Id descTypeMaxAlignment = 0; + auto structLastMemberSize = + decorateDescHeapType(type, memberBaseOffset, descTypeMaxAlignment, maxPlainDataTypeAlignment); + auto structureUnaligned = builder.createSpecConstantOp( + spv::Op::OpIAdd, builder.makeUintType(32), {memberBaseOffset, structLastMemberSize}, {}); + auto structurePadding = builder.createSpecConstantOp( + spv::Op::OpUMod, builder.makeUintType(32), {descTypeMaxAlignment, structureUnaligned}, {}); + heapStructSize = builder.createSpecConstantOp( + spv::Op::OpIAdd, builder.makeUintType(32), {structureUnaligned, structurePadding}, {}); + HeapMetaData meta = {heapStructSize, descTypeMaxAlignment, maxPlainDataTypeAlignment}; + heapStructureTypeMetaData[&type] = meta; + } + // Make the SPIR-V type - spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str(), false); + spv::Id spvType = builder.makeStructType(spvMembers, memberDebugInfo, type.getTypeName().c_str(), false); if (! HasNonLayoutQualifiers(type, qualifier)) structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType; + // Keep decoration data order after spv structure type. + if (qualifier.storage == glslang::EvqResourceHeap || qualifier.storage == glslang::EvqSamplerHeap || + qualifier.layoutDescriptorInnerBlock) { + heapStructureTypeSize[spvType] = heapStructSize; + for (unsigned int i = 0; i < spvMembers.size(); i++) { + builder.addMemberDecorationIdEXT(spvType, i, spv::Decoration::OffsetIdEXT, {heapStructureMemberOffsets[i]}); + } + heapStructureMemberOffsets.clear(); + } + // Decorate it decorateStructType(type, glslangMembers, explicitLayout, qualifier, spvType, spvMembers); @@ -5551,6 +6232,126 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy return spvType; } +// Return not aligned size of current type. +spv::Id TGlslangToSpvTraverser::decorateDescHeapType( + const glslang::TType& type, + spv::Id &memberBaseOffset, + spv::Id &descTypeAlignment, + int& maxPlainDataAlignment) +{ + glslang::TLayoutPacking explicitLayout = glslang::ElpScalar; + auto selectMaxRsrcTyAlign = [&](spv::Id typeSize) { + if (descTypeAlignment != 0) { + auto compareInst = builder.createSpecConstantOp(spv::Op::OpUGreaterThan, builder.makeBoolType(), + {descTypeAlignment, typeSize}, {}); + auto selectMaxAlign = builder.createSpecConstantOp(spv::Op::OpSelect, builder.makeUintType(32), + {compareInst, descTypeAlignment, typeSize}, {}); + descTypeAlignment = selectMaxAlign; + } else + descTypeAlignment = typeSize; + }; + + // Get or calculate following info ordered. + // Member Type | Type size | Type alignment within current structure | Type offset. + // PS. resource blocks declared within a structure will not be processed as a normal declaration before, + // and its' size is dependent on constantSizeOfEXT op, so we won't trigger it as a normal structure here. + bool isArray = type.isArray(); + if (type.isStruct() && !type.getQualifier().layoutDescriptorInnerBlock) { + // 1. Structure type is processed from inner to higher level. + // If member is a sturcture, it will be processed earlier, + // parent structure could just load early results. + if (heapStructureTypeMetaData.find(&type) != heapStructureTypeMetaData.end()) { + auto metadata = heapStructureTypeMetaData[&type]; + selectMaxRsrcTyAlign(metadata.maxRsrcTypeAlignment); + maxPlainDataAlignment = std::max(metadata.maxPlainDataAlignment, maxPlainDataAlignment); + return metadata.typeStride; + } + // For other nested structure, it would be declared before its parent, + // so it should be directly returned a result in above check. + const glslang::TTypeList* structTyList = type.getStruct(); + spv::Id previousTypeSize = 0; + auto currentOffset = memberBaseOffset; + for (int i = 0; i < (int)structTyList->size(); i++) { + // Get offset : + // OffsetsBase = default ? 0 : OffsetInLayout; + // OffsetsBase = OffsetsBase + previousOffset + previousPadding. + const glslang::TType& memberTy = *(*structTyList)[i].type; + spv::Id typeSize = decorateDescHeapType(memberTy, currentOffset, descTypeAlignment, maxPlainDataAlignment); + // 2. Get each member's unaligned offset, padding and aligned offset. + // As this function is processed recursively, from bottom to upper, so in here, + // non-structure member's alignment should have been known. + if (i != 0) { + auto offsetNotAligned = builder.createSpecConstantOp(spv::Op::OpIAdd, builder.makeUintType(32), + {currentOffset, previousTypeSize}, {}); + auto offsetPadding = builder.createSpecConstantOp(spv::Op::OpUMod, builder.makeUintType(32), + {typeSize, offsetNotAligned}, {}); + currentOffset = builder.createSpecConstantOp(spv::Op::OpIAdd, builder.makeUintType(32), + {offsetNotAligned, offsetPadding}, {}); + } + heapStructureMemberOffsets.push_back(currentOffset); + previousTypeSize = typeSize; + } + // 3. Structure level, get max resource type's alignment, max plain data alignment and final + // structure inner alignment. + // Get compared result for alignment within whole structure. + spv::Id maxPlainAlignmentSize = builder.makeIntConstant(maxPlainDataAlignment); + + // Select biggest alignemnt size between desc types and plain old types. + selectMaxRsrcTyAlign(maxPlainAlignmentSize); + memberBaseOffset = currentOffset; + + // Now, return generates size of the MaterialData type + // Get structure level unaligned offset, padding and final offset outside. + return previousTypeSize; + } + + // Following are normal types, structures/blocks have been processed in above part. + // Normal type or member type within a structure. + bool useConstantSizeOf = + ((type.getQualifier().isUniformOrBuffer() && type.getQualifier().layoutDescriptorHeap) || + type.isImage() || type.isTexture() || type.isTensorARM() || type.getBasicType() == glslang::EbtAccStruct); + + // Get single type and layout info. + int elemCurrentOffset, elemAlignedSize; + int memberSize, dummyStride, typeAlignment; + spv::Id spvType = 0; + if (isArray) { + glslang::TType elemTy(type, 0); + elemTy.clearArraySizes(); + if (!useConstantSizeOf) { + typeAlignment = glslangIntermediate->getMemberAlignment( + elemTy, memberSize, dummyStride, glslang::ElpScalar, elemTy.getQualifier().layoutMatrix == glslang::ElmRowMajor); + updateMemberOffset(elemTy, elemTy, elemCurrentOffset, elemAlignedSize, explicitLayout, elemTy.getQualifier().layoutMatrix); + elemAlignedSize *= type.getCumulativeArraySize(); + } + spvType = convertGlslangToSpvType(elemTy); + } else { + if (!useConstantSizeOf) { + typeAlignment = glslangIntermediate->getMemberAlignment( + type, memberSize, dummyStride, glslang::ElpScalar, type.getQualifier().layoutMatrix == glslang::ElmRowMajor); + updateMemberOffset(type, type, elemCurrentOffset, elemAlignedSize, explicitLayout, type.getQualifier().layoutMatrix); + } + spvType = convertGlslangToSpvType(type); + } + + // Get alignment and type size. + spv::Id typeSize = 0; + if (useConstantSizeOf) { + typeSize = builder.createConstantSizeOfEXT(spvType); + // For resource type, needs to check current's largest alignment to select. + // New parent structure's alignment is equal to: + // maxInnerAlignment = currentAlignment > maxInnerAlignment + // ? currentAlignment + // : maxInnerAlignment; + selectMaxRsrcTyAlign(typeSize); + } else { + typeSize = builder.makeIntConstant(elemAlignedSize); + maxPlainDataAlignment = std::max(typeAlignment, maxPlainDataAlignment); + } + + return typeSize; +} + void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, const glslang::TTypeList* glslangMembers, glslang::TLayoutPacking explicitLayout, @@ -5619,7 +6420,12 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, if (glslangMember.getQualifier().hasXfbOffset()) builder.addMemberDecoration(spvType, member, spv::Decoration::Offset, glslangMember.getQualifier().layoutXfbOffset); - else if (explicitLayout != glslang::ElpNone) { + else if (glslangMember.getQualifier().hasMemberOffset()) { + builder.addExtension(spv::E_SPV_NV_push_constant_bank); + builder.addCapability(spv::Capability::PushConstantBanksNV); + builder.addMemberDecoration(spvType, member, spv::Decoration::MemberOffsetNV, + glslangMember.getQualifier().layoutMemberOffset); + } else if (explicitLayout != glslang::ElpNone) { // figure out what to do with offset, which is accumulating int nextOffset; updateMemberOffset(type, glslangMember, offset, nextOffset, explicitLayout, memberQualifier.layoutMatrix); @@ -5634,7 +6440,9 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, // built-in variable decorations spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangMember.getQualifier().builtIn, true); - if (builtIn != spv::BuiltIn::Max) + // built-in decoration is used to detect AST nodes, but won't be decorated on member variables. + if (builtIn != spv::BuiltIn::Max && + builtIn != spv::BuiltIn::ResourceHeapEXT && builtIn != spv::BuiltIn::SamplerHeapEXT) builder.addMemberDecoration(spvType, member, spv::Decoration::BuiltIn, (int)builtIn); // nonuniform @@ -5687,6 +6495,15 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type, if (qualifier.hasHitObjectShaderRecordNV()) builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferNV); + + if (qualifier.hasBank()) { + builder.addExtension(spv::E_SPV_NV_push_constant_bank); + builder.addCapability(spv::Capability::PushConstantBanksNV); + builder.addDecoration(spvType, spv::Decoration::BankNV, qualifier.layoutBank); + } + + if (qualifier.hasHitObjectShaderRecordEXT()) + builder.addDecoration(spvType, spv::Decoration::HitObjectShaderRecordBufferEXT); } // Turn the expression forming the array size into an id. @@ -5756,6 +6573,12 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type) loadedId = convertLoadedBoolInUniformToUint(type, nominalTypeId, loadedId); } + if (!builder.getAccessChain().descHeapInfo.descHeapInstId.empty()) { + for (auto heapInst : builder.getAccessChain().descHeapInfo.descHeapInstId) + heapInst->setTypeId(convertGlslangToSpvType(type)); + builder.clearAccessChain(); + } + return loadedId; } @@ -6253,6 +7076,7 @@ void TGlslangToSpvTraverser::collectRayTracingLinkerObjects() break; case glslang::EvqHitObjectAttrNV: + case glslang::EvqHitObjectAttrEXT: set = 2; break; @@ -6275,16 +7099,6 @@ void TGlslangToSpvTraverser::visitFunctions(const glslang::TIntermSequence& glsl } } -void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate* node) -{ - // SPIR-V functions should already be in the functionMap from the prepass - // that called makeFunctions(). - currentFunction = functionMap[node->getName().c_str()]; - spv::Block* functionBlock = currentFunction->getEntryBlock(); - builder.setBuildPoint(functionBlock); - builder.enterFunction(currentFunction); -} - void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector& arguments, spv::Builder::AccessChain::CoherentFlags &lvalueCoherentFlags) { @@ -6736,7 +7550,18 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO } else { resultTypeId = builder.makePointer(spv::StorageClass::Image, resultType()); } - spv::Id pointer = builder.createOp(spv::Op::OpImageTexelPointer, resultTypeId, operands); + + // EXT_descriptor_heap + // For image atomic parameter, using untyped image texel pointer to carry on type metadata. + spv::Op imgTexelOp = spv::Op::OpImageTexelPointer; + if (node->getQualifier().isUsedByAtomic() && + imageType.getQualifier().builtIn == glslang::EbvResourceHeapEXT) { + operands.insert(operands.begin(), {true, convertGlslangToSpvType(imageType)}); + imgTexelOp = spv::Op::OpUntypedImageTexelPointerEXT; + resultTypeId = builder.makeUntypedPointer(spv::StorageClass::Image); + } + + spv::Id pointer = builder.createOp(imgTexelOp, resultTypeId, operands); if (imageType.getQualifier().nonUniform) { builder.addDecoration(pointer, spv::Decoration::NonUniformEXT); } @@ -6955,7 +7780,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO for (int i = 0; i < 5; i++) { members.push_back(builder.getContainedTypeId(resultStructType, i)); } - spv::Id resType = builder.makeStructType(members, "ResType"); + spv::Id resType = builder.makeStructType(members, {}, "ResType"); //call ImageFootprintNV spv::Id res = builder.createTextureCall(precision, resType, sparse, cracked.fetch, cracked.proj, @@ -7932,74 +8757,150 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe unaryOp = spv::Op::OpHitObjectIsEmptyNV; break; + case glslang::EOpHitObjectIsEmptyEXT: + unaryOp = spv::Op::OpHitObjectIsEmptyEXT; + break; + case glslang::EOpHitObjectIsMissNV: unaryOp = spv::Op::OpHitObjectIsMissNV; break; + case glslang::EOpHitObjectIsMissEXT: + unaryOp = spv::Op::OpHitObjectIsMissEXT; + break; + case glslang::EOpHitObjectIsHitNV: unaryOp = spv::Op::OpHitObjectIsHitNV; break; + case glslang::EOpHitObjectIsHitEXT: + unaryOp = spv::Op::OpHitObjectIsHitEXT; + break; + case glslang::EOpHitObjectGetObjectRayOriginNV: unaryOp = spv::Op::OpHitObjectGetObjectRayOriginNV; break; + case glslang::EOpHitObjectGetObjectRayOriginEXT: + unaryOp = spv::Op::OpHitObjectGetObjectRayOriginEXT; + break; + case glslang::EOpHitObjectGetObjectRayDirectionNV: unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionNV; break; + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + unaryOp = spv::Op::OpHitObjectGetObjectRayDirectionEXT; + break; + case glslang::EOpHitObjectGetWorldRayOriginNV: unaryOp = spv::Op::OpHitObjectGetWorldRayOriginNV; break; + case glslang::EOpHitObjectGetWorldRayOriginEXT: + unaryOp = spv::Op::OpHitObjectGetWorldRayOriginEXT; + break; + case glslang::EOpHitObjectGetWorldRayDirectionNV: unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionNV; break; + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + unaryOp = spv::Op::OpHitObjectGetWorldRayDirectionEXT; + break; + case glslang::EOpHitObjectGetObjectToWorldNV: unaryOp = spv::Op::OpHitObjectGetObjectToWorldNV; break; + case glslang::EOpHitObjectGetObjectToWorldEXT: + unaryOp = spv::Op::OpHitObjectGetObjectToWorldEXT; + break; + case glslang::EOpHitObjectGetWorldToObjectNV: unaryOp = spv::Op::OpHitObjectGetWorldToObjectNV; break; + case glslang::EOpHitObjectGetWorldToObjectEXT: + unaryOp = spv::Op::OpHitObjectGetWorldToObjectEXT; + break; + case glslang::EOpHitObjectGetRayTMinNV: unaryOp = spv::Op::OpHitObjectGetRayTMinNV; break; + case glslang::EOpHitObjectGetRayTMinEXT: + unaryOp = spv::Op::OpHitObjectGetRayTMinEXT; + break; + case glslang::EOpHitObjectGetRayTMaxNV: unaryOp = spv::Op::OpHitObjectGetRayTMaxNV; break; + case glslang::EOpHitObjectGetRayTMaxEXT: + unaryOp = spv::Op::OpHitObjectGetRayTMaxEXT; + break; + + case glslang::EOpHitObjectGetRayFlagsEXT: + unaryOp = spv::Op::OpHitObjectGetRayFlagsEXT; + break; + case glslang::EOpHitObjectGetPrimitiveIndexNV: unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexNV; break; + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + unaryOp = spv::Op::OpHitObjectGetPrimitiveIndexEXT; + break; + case glslang::EOpHitObjectGetInstanceIdNV: unaryOp = spv::Op::OpHitObjectGetInstanceIdNV; break; + case glslang::EOpHitObjectGetInstanceIdEXT: + unaryOp = spv::Op::OpHitObjectGetInstanceIdEXT; + break; + case glslang::EOpHitObjectGetInstanceCustomIndexNV: unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexNV; break; + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + unaryOp = spv::Op::OpHitObjectGetInstanceCustomIndexEXT; + break; + case glslang::EOpHitObjectGetGeometryIndexNV: unaryOp = spv::Op::OpHitObjectGetGeometryIndexNV; break; + case glslang::EOpHitObjectGetGeometryIndexEXT: + unaryOp = spv::Op::OpHitObjectGetGeometryIndexEXT; + break; + case glslang::EOpHitObjectGetHitKindNV: unaryOp = spv::Op::OpHitObjectGetHitKindNV; break; + case glslang::EOpHitObjectGetHitKindEXT: + unaryOp = spv::Op::OpHitObjectGetHitKindEXT; + break; + case glslang::EOpHitObjectGetCurrentTimeNV: unaryOp = spv::Op::OpHitObjectGetCurrentTimeNV; break; + case glslang::EOpHitObjectGetCurrentTimeEXT: + unaryOp = spv::Op::OpHitObjectGetCurrentTimeEXT; + break; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV; break; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + unaryOp = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT; + break; + case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV; break; @@ -8039,6 +8940,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, OpDe builder.addCapability(spv::Capability::RayTracingLinearSweptSpheresGeometryNV); break; + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + unaryOp = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT; + break; + case glslang::EOpFetchMicroTriangleVertexPositionNV: unaryOp = spv::Op::OpFetchMicroTriangleVertexPositionNV; break; @@ -9417,9 +10322,12 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: builder.addExtension(spv::E_SPV_AMD_gpu_shader_int16); if (builder.getNumComponents(operands[0]) == 1) frexpIntType = builder.makeIntegerType(width, true); + else if (builder.isCooperativeVector(operands[0])) + frexpIntType = builder.makeCooperativeVectorTypeNV(builder.makeIntegerType(width, true), + builder.getCooperativeVectorNumComponents(builder.getTypeId(operands[0]))); else frexpIntType = builder.makeVectorType(builder.makeIntegerType(width, true), - builder.getNumComponents(operands[0])); + builder.getNumComponents(operands[0])); typeId = builder.makeStructResultType(typeId0, frexpIntType); consumedOperands = 1; } @@ -9676,9 +10584,15 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpHitObjectTraceRayNV: builder.createNoResultOp(spv::Op::OpHitObjectTraceRayNV, operands); return 0; + case glslang::EOpHitObjectTraceRayEXT: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayEXT, operands); + return 0; case glslang::EOpHitObjectTraceRayMotionNV: builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionNV, operands); return 0; + case glslang::EOpHitObjectTraceRayMotionEXT: + builder.createNoResultOp(spv::Op::OpHitObjectTraceRayMotionEXT, operands); + return 0; case glslang::EOpHitObjectRecordHitNV: builder.createNoResultOp(spv::Op::OpHitObjectRecordHitNV, operands); return 0; @@ -9694,20 +10608,37 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: case glslang::EOpHitObjectRecordMissNV: builder.createNoResultOp(spv::Op::OpHitObjectRecordMissNV, operands); return 0; + case glslang::EOpHitObjectRecordMissEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissEXT, operands); + return 0; case glslang::EOpHitObjectRecordMissMotionNV: builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionNV, operands); return 0; + case glslang::EOpHitObjectRecordMissMotionEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordMissMotionEXT, operands); + return 0; case glslang::EOpHitObjectExecuteShaderNV: builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderNV, operands); return 0; + case glslang::EOpHitObjectExecuteShaderEXT: + builder.createNoResultOp(spv::Op::OpHitObjectExecuteShaderEXT, operands); + return 0; case glslang::EOpHitObjectIsEmptyNV: typeId = builder.makeBoolType(); opCode = spv::Op::OpHitObjectIsEmptyNV; break; + case glslang::EOpHitObjectIsEmptyEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsEmptyEXT; + break; case glslang::EOpHitObjectIsMissNV: typeId = builder.makeBoolType(); opCode = spv::Op::OpHitObjectIsMissNV; break; + case glslang::EOpHitObjectIsMissEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsMissEXT; + break; case glslang::EOpHitObjectIsHitNV: typeId = builder.makeBoolType(); opCode = spv::Op::OpHitObjectIsHitNV; @@ -9720,69 +10651,143 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: typeId = builder.makeBoolType(); opCode = spv::Op::OpHitObjectIsLSSHitNV; break; + case glslang::EOpHitObjectIsHitEXT: + typeId = builder.makeBoolType(); + opCode = spv::Op::OpHitObjectIsHitEXT; + break; case glslang::EOpHitObjectGetRayTMinNV: typeId = builder.makeFloatType(32); opCode = spv::Op::OpHitObjectGetRayTMinNV; break; + case glslang::EOpHitObjectGetRayTMinEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMinEXT; + break; case glslang::EOpHitObjectGetRayTMaxNV: typeId = builder.makeFloatType(32); opCode = spv::Op::OpHitObjectGetRayTMaxNV; break; + case glslang::EOpHitObjectGetRayTMaxEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetRayTMaxEXT; + break; + case glslang::EOpHitObjectGetRayFlagsEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetRayFlagsEXT; + break; case glslang::EOpHitObjectGetObjectRayOriginNV: typeId = builder.makeVectorType(builder.makeFloatType(32), 3); opCode = spv::Op::OpHitObjectGetObjectRayOriginNV; break; + case glslang::EOpHitObjectGetObjectRayOriginEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayOriginEXT; + break; case glslang::EOpHitObjectGetObjectRayDirectionNV: typeId = builder.makeVectorType(builder.makeFloatType(32), 3); opCode = spv::Op::OpHitObjectGetObjectRayDirectionNV; break; + case glslang::EOpHitObjectGetObjectRayDirectionEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetObjectRayDirectionEXT; + break; case glslang::EOpHitObjectGetWorldRayOriginNV: typeId = builder.makeVectorType(builder.makeFloatType(32), 3); opCode = spv::Op::OpHitObjectGetWorldRayOriginNV; break; + case glslang::EOpHitObjectGetWorldRayOriginEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayOriginEXT; + break; case glslang::EOpHitObjectGetWorldRayDirectionNV: typeId = builder.makeVectorType(builder.makeFloatType(32), 3); opCode = spv::Op::OpHitObjectGetWorldRayDirectionNV; break; + case glslang::EOpHitObjectGetWorldRayDirectionEXT: + typeId = builder.makeVectorType(builder.makeFloatType(32), 3); + opCode = spv::Op::OpHitObjectGetWorldRayDirectionEXT; + break; case glslang::EOpHitObjectGetWorldToObjectNV: typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); opCode = spv::Op::OpHitObjectGetWorldToObjectNV; break; + case glslang::EOpHitObjectGetWorldToObjectEXT: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetWorldToObjectEXT; + break; case glslang::EOpHitObjectGetObjectToWorldNV: typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); opCode = spv::Op::OpHitObjectGetObjectToWorldNV; break; + case glslang::EOpHitObjectGetObjectToWorldEXT: + typeId = builder.makeMatrixType(builder.makeFloatType(32), 4, 3); + opCode = spv::Op::OpHitObjectGetObjectToWorldEXT; + break; case glslang::EOpHitObjectGetInstanceCustomIndexNV: typeId = builder.makeIntegerType(32, 1); opCode = spv::Op::OpHitObjectGetInstanceCustomIndexNV; break; + case glslang::EOpHitObjectGetInstanceCustomIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceCustomIndexEXT; + break; case glslang::EOpHitObjectGetInstanceIdNV: typeId = builder.makeIntegerType(32, 1); opCode = spv::Op::OpHitObjectGetInstanceIdNV; break; + case glslang::EOpHitObjectGetInstanceIdEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetInstanceIdEXT; + break; case glslang::EOpHitObjectGetGeometryIndexNV: typeId = builder.makeIntegerType(32, 1); opCode = spv::Op::OpHitObjectGetGeometryIndexNV; break; + case glslang::EOpHitObjectGetGeometryIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetGeometryIndexEXT; + break; case glslang::EOpHitObjectGetPrimitiveIndexNV: typeId = builder.makeIntegerType(32, 1); opCode = spv::Op::OpHitObjectGetPrimitiveIndexNV; break; + case glslang::EOpHitObjectGetPrimitiveIndexEXT: + typeId = builder.makeIntegerType(32, 1); + opCode = spv::Op::OpHitObjectGetPrimitiveIndexEXT; + break; case glslang::EOpHitObjectGetHitKindNV: typeId = builder.makeIntegerType(32, 0); opCode = spv::Op::OpHitObjectGetHitKindNV; break; + case glslang::EOpHitObjectGetHitKindEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetHitKindEXT; + break; case glslang::EOpHitObjectGetCurrentTimeNV: typeId = builder.makeFloatType(32); opCode = spv::Op::OpHitObjectGetCurrentTimeNV; break; + case glslang::EOpHitObjectGetCurrentTimeEXT: + typeId = builder.makeFloatType(32); + opCode = spv::Op::OpHitObjectGetCurrentTimeEXT; + break; case glslang::EOpHitObjectGetShaderBindingTableRecordIndexNV: typeId = builder.makeIntegerType(32, 0); opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexNV; return 0; + case glslang::EOpHitObjectGetShaderBindingTableRecordIndexEXT: + typeId = builder.makeIntegerType(32, 0); + opCode = spv::Op::OpHitObjectGetShaderBindingTableRecordIndexEXT; + return 0; case glslang::EOpHitObjectGetAttributesNV: builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesNV, operands); return 0; + case glslang::EOpHitObjectGetAttributesEXT: + builder.createNoResultOp(spv::Op::OpHitObjectGetAttributesEXT, operands); + return 0; + case glslang::EOpHitObjectRecordFromQueryEXT: + builder.createNoResultOp(spv::Op::OpHitObjectRecordFromQueryEXT, operands); + return 0; case glslang::EOpHitObjectGetShaderRecordBufferHandleNV: typeId = builder.makeVectorType(builder.makeUintType(32), 2); opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleNV; @@ -9791,6 +10796,13 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: typeId = builder.makeIntegerType(32, 1); opCode = spv::Op::OpHitObjectGetClusterIdNV; break; + case glslang::EOpHitObjectGetShaderRecordBufferHandleEXT: + typeId = builder.makeVectorType(builder.makeUintType(32), 2); + opCode = spv::Op::OpHitObjectGetShaderRecordBufferHandleEXT; + break; + case glslang::EOpHitObjectSetShaderBindingTableRecordIndexEXT: + builder.createNoResultOp(spv::Op::OpHitObjectSetShaderBindingTableRecordIndexEXT, operands); + return 0; case glslang::EOpReorderThreadNV: { if (operands.size() == 2) { builder.createNoResultOp(spv::Op::OpReorderThreadWithHintNV, operands); @@ -9798,9 +10810,54 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectNV, operands); } return 0; - + } + case glslang::EOpReorderThreadEXT: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHintEXT, operands); + } else { + builder.createNoResultOp(spv::Op::OpReorderThreadWithHitObjectEXT, operands); + } + return 0; } + case glslang::EOpHitObjectReorderExecuteEXT: { + if (operands.size() == 2) { + builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, operands); + } else { + // GLSL intrinsic is + // hitObjectReorderExecuteEXT(hitObjectEXT hitObject, uint hint, uint bits,int payload) while + // SPIRV is hitObject id , payload id, optional hint id, optional bits id hence reorder operands + builder.createNoResultOp(spv::Op::OpHitObjectReorderExecuteShaderEXT, {operands[0], operands[3], operands[1], operands[2]}); + } + return 0; + } + + case glslang::EOpHitObjectTraceReorderExecuteEXT: { + if (operands.size() == 12) { + builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, operands); + } else { + std::vector argOperands; + std::copy(operands.begin(), operands.begin() + 11, std::back_inserter(argOperands)); + argOperands.push_back(operands[13]); + argOperands.push_back(operands[11]); + argOperands.push_back(operands[12]); + builder.createNoResultOp(spv::Op::OpHitObjectTraceReorderExecuteEXT, argOperands); + } + return 0; + } + case glslang::EOpHitObjectTraceMotionReorderExecuteEXT: { + if (operands.size() == 13) { + builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, operands); + } else { + std::vector argOperands; + std::copy(operands.begin(), operands.begin() + 12, std::back_inserter(argOperands)); + argOperands.push_back(operands[14]); + argOperands.push_back(operands[12]); + argOperands.push_back(operands[13]); + builder.createNoResultOp(spv::Op::OpHitObjectTraceMotionReorderExecuteEXT, argOperands); + } + return 0; + } case glslang::EOpImageSampleWeightedQCOM: typeId = builder.makeVectorType(builder.makeFloatType(32), 4); opCode = spv::Op::OpImageSampleWeightedQCOM; @@ -10180,7 +11237,11 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol builtIn == spv::BuiltIn::ObjectToWorldKHR || builtIn == spv::BuiltIn::WorldToObjectKHR; - if (mayNeedToReuseBuiltIn) { + // EXT_descriptor_heap + const bool needToRemapDescHeap = + builtIn == spv::BuiltIn::ResourceHeapEXT || builtIn == spv::BuiltIn::SamplerHeapEXT; + + if (mayNeedToReuseBuiltIn || needToRemapDescHeap) { auto iter = builtInVariableIds.find(uint32_t(builtIn)); if (builtInVariableIds.end() != iter) { id = iter->second; @@ -10224,11 +11285,13 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (symbol->getQualifier().hasLocation()) { if (!(glslangIntermediate->isRayTracingStage() && (glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing) || - glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder)) + glslangIntermediate->IsRequestedExtension(glslang::E_GL_NV_shader_invocation_reorder) || + glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_shader_invocation_reorder)) && (builder.getStorageClass(id) == spv::StorageClass::RayPayloadKHR || builder.getStorageClass(id) == spv::StorageClass::IncomingRayPayloadKHR || builder.getStorageClass(id) == spv::StorageClass::CallableDataKHR || builder.getStorageClass(id) == spv::StorageClass::IncomingCallableDataKHR || + builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeEXT || builder.getStorageClass(id) == spv::StorageClass::HitObjectAttributeNV))) { // Location values are used to link TraceRayKHR/ExecuteCallableKHR/HitObjectGetAttributesNV // to corresponding variables but are not valid in SPIRV since they are supported only @@ -10352,6 +11415,18 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (symbol->getType().getQualifier().hasSpirvDecorate()) applySpirvDecorate(symbol->getType(), id, {}); + if (symbol->getQualifier().hasBank()) { + builder.addExtension(spv::E_SPV_NV_push_constant_bank); + builder.addCapability(spv::Capability::PushConstantBanksNV); + builder.addDecoration(id, spv::Decoration::BankNV, symbol->getQualifier().layoutBank); + } + + if (symbol->getQualifier().hasMemberOffset()) { + builder.addExtension(spv::E_SPV_NV_push_constant_bank); + builder.addCapability(spv::Capability::PushConstantBanksNV); + builder.addDecoration(id, spv::Decoration::MemberOffsetNV, symbol->getQualifier().layoutMemberOffset); + } + return id; } @@ -10529,7 +11604,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n int nextConst = 0; result = createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true); } else { - logger->missingFunctionality("Invalid initializer for spec onstant."); + logger->missingFunctionality("Invalid initializer for spec constant."); return spv::NoResult; } builder.addName(result, sn->getName().c_str()); @@ -10572,8 +11647,8 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla glslang::TVector::const_iterator iter; for (iter = glslangType.getStruct()->begin(); iter != glslangType.getStruct()->end(); ++iter) spvConsts.push_back(createSpvConstantFromConstUnionArray(*iter->type, consts, nextConst, false)); - } else if (glslangType.getVectorSize() > 1 || glslangType.isCoopVecNV()) { - unsigned int numComponents = glslangType.isCoopVecNV() ? glslangType.getTypeParameters()->arraySizes->getDimSize(0) : glslangType.getVectorSize(); + } else if (glslangType.getVectorSize() > 1 || glslangType.isCoopVecOrLongVector()) { + unsigned int numComponents = glslangType.isCoopVecOrLongVector() ? glslangType.getTypeParameters()->arraySizes->getDimSize(0) : glslangType.getVectorSize(); for (unsigned int i = 0; i < numComponents; ++i) { bool zero = nextConst >= consts.size(); switch (glslangType.getBasicType()) { diff --git a/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo.h b/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo.h new file mode 100644 index 000000000..7e4c618cd --- /dev/null +++ b/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo.h @@ -0,0 +1,173 @@ +// Copyright (c) 2018 The Khronos Group Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and/or associated documentation files (the "Materials"), +// to deal in the Materials without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Materials, and to permit persons to whom the +// Materials are furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Materials. +// +// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS +// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND +// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ +// +// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS +// IN THE MATERIALS. + +#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo_H_ +#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +enum { + NonSemanticShaderDebugInfoVersion = 101, + NonSemanticShaderDebugInfoVersion_BitWidthPadding = 0x7fffffff +}; +enum { + NonSemanticShaderDebugInfoRevision = 6, + NonSemanticShaderDebugInfoRevision_BitWidthPadding = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoInstructions { + NonSemanticShaderDebugInfoDebugInfoNone = 0, + NonSemanticShaderDebugInfoDebugCompilationUnit = 1, + NonSemanticShaderDebugInfoDebugTypeBasic = 2, + NonSemanticShaderDebugInfoDebugTypePointer = 3, + NonSemanticShaderDebugInfoDebugTypeQualifier = 4, + NonSemanticShaderDebugInfoDebugTypeArray = 5, + NonSemanticShaderDebugInfoDebugTypeVector = 6, + NonSemanticShaderDebugInfoDebugTypedef = 7, + NonSemanticShaderDebugInfoDebugTypeFunction = 8, + NonSemanticShaderDebugInfoDebugTypeEnum = 9, + NonSemanticShaderDebugInfoDebugTypeComposite = 10, + NonSemanticShaderDebugInfoDebugTypeMember = 11, + NonSemanticShaderDebugInfoDebugTypeInheritance = 12, + NonSemanticShaderDebugInfoDebugTypePtrToMember = 13, + NonSemanticShaderDebugInfoDebugTypeTemplate = 14, + NonSemanticShaderDebugInfoDebugTypeTemplateParameter = 15, + NonSemanticShaderDebugInfoDebugTypeTemplateTemplateParameter = 16, + NonSemanticShaderDebugInfoDebugTypeTemplateParameterPack = 17, + NonSemanticShaderDebugInfoDebugGlobalVariable = 18, + NonSemanticShaderDebugInfoDebugFunctionDeclaration = 19, + NonSemanticShaderDebugInfoDebugFunction = 20, + NonSemanticShaderDebugInfoDebugLexicalBlock = 21, + NonSemanticShaderDebugInfoDebugLexicalBlockDiscriminator = 22, + NonSemanticShaderDebugInfoDebugScope = 23, + NonSemanticShaderDebugInfoDebugNoScope = 24, + NonSemanticShaderDebugInfoDebugInlinedAt = 25, + NonSemanticShaderDebugInfoDebugLocalVariable = 26, + NonSemanticShaderDebugInfoDebugInlinedVariable = 27, + NonSemanticShaderDebugInfoDebugDeclare = 28, + NonSemanticShaderDebugInfoDebugValue = 29, + NonSemanticShaderDebugInfoDebugOperation = 30, + NonSemanticShaderDebugInfoDebugExpression = 31, + NonSemanticShaderDebugInfoDebugMacroDef = 32, + NonSemanticShaderDebugInfoDebugMacroUndef = 33, + NonSemanticShaderDebugInfoDebugImportedEntity = 34, + NonSemanticShaderDebugInfoDebugSource = 35, + NonSemanticShaderDebugInfoDebugFunctionDefinition = 101, + NonSemanticShaderDebugInfoDebugSourceContinued = 102, + NonSemanticShaderDebugInfoDebugLine = 103, + NonSemanticShaderDebugInfoDebugNoLine = 104, + NonSemanticShaderDebugInfoDebugBuildIdentifier = 105, + NonSemanticShaderDebugInfoDebugStoragePath = 106, + NonSemanticShaderDebugInfoDebugEntryPoint = 107, + NonSemanticShaderDebugInfoDebugTypeMatrix = 108, + NonSemanticShaderDebugInfoDebugTypeVectorIdEXT = 109, + NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR = 110, + NonSemanticShaderDebugInfoInstructionsMax = 0x7fffffff +}; + + +enum NonSemanticShaderDebugInfoDebugInfoFlags { + NonSemanticShaderDebugInfoNone = 0x0000, + NonSemanticShaderDebugInfoFlagIsProtected = 0x01, + NonSemanticShaderDebugInfoFlagIsPrivate = 0x02, + NonSemanticShaderDebugInfoFlagIsPublic = 0x03, + NonSemanticShaderDebugInfoFlagIsLocal = 0x04, + NonSemanticShaderDebugInfoFlagIsDefinition = 0x08, + NonSemanticShaderDebugInfoFlagFwdDecl = 0x10, + NonSemanticShaderDebugInfoFlagArtificial = 0x20, + NonSemanticShaderDebugInfoFlagExplicit = 0x40, + NonSemanticShaderDebugInfoFlagPrototyped = 0x80, + NonSemanticShaderDebugInfoFlagObjectPointer = 0x100, + NonSemanticShaderDebugInfoFlagStaticMember = 0x200, + NonSemanticShaderDebugInfoFlagIndirectVariable = 0x400, + NonSemanticShaderDebugInfoFlagLValueReference = 0x800, + NonSemanticShaderDebugInfoFlagRValueReference = 0x1000, + NonSemanticShaderDebugInfoFlagIsOptimized = 0x2000, + NonSemanticShaderDebugInfoFlagIsEnumClass = 0x4000, + NonSemanticShaderDebugInfoFlagTypePassByValue = 0x8000, + NonSemanticShaderDebugInfoFlagTypePassByReference = 0x10000, + NonSemanticShaderDebugInfoFlagUnknownPhysicalLayout = 0x20000, + NonSemanticShaderDebugInfoDebugInfoFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoBuildIdentifierFlags { + NonSemanticShaderDebugInfoIdentifierPossibleDuplicates = 0x01, + NonSemanticShaderDebugInfoBuildIdentifierFlagsMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoDebugBaseTypeAttributeEncoding { + NonSemanticShaderDebugInfoUnspecified = 0, + NonSemanticShaderDebugInfoAddress = 1, + NonSemanticShaderDebugInfoBoolean = 2, + NonSemanticShaderDebugInfoFloat = 3, + NonSemanticShaderDebugInfoSigned = 4, + NonSemanticShaderDebugInfoSignedChar = 5, + NonSemanticShaderDebugInfoUnsigned = 6, + NonSemanticShaderDebugInfoUnsignedChar = 7, + NonSemanticShaderDebugInfoDebugBaseTypeAttributeEncodingMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoDebugCompositeType { + NonSemanticShaderDebugInfoClass = 0, + NonSemanticShaderDebugInfoStructure = 1, + NonSemanticShaderDebugInfoUnion = 2, + NonSemanticShaderDebugInfoDebugCompositeTypeMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoDebugTypeQualifier { + NonSemanticShaderDebugInfoConstType = 0, + NonSemanticShaderDebugInfoVolatileType = 1, + NonSemanticShaderDebugInfoRestrictType = 2, + NonSemanticShaderDebugInfoAtomicType = 3, + NonSemanticShaderDebugInfoDebugTypeQualifierMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoDebugOperation { + NonSemanticShaderDebugInfoDeref = 0, + NonSemanticShaderDebugInfoPlus = 1, + NonSemanticShaderDebugInfoMinus = 2, + NonSemanticShaderDebugInfoPlusUconst = 3, + NonSemanticShaderDebugInfoBitPiece = 4, + NonSemanticShaderDebugInfoSwap = 5, + NonSemanticShaderDebugInfoXderef = 6, + NonSemanticShaderDebugInfoStackValue = 7, + NonSemanticShaderDebugInfoConstu = 8, + NonSemanticShaderDebugInfoFragment = 9, + NonSemanticShaderDebugInfoDebugOperationMax = 0x7fffffff +}; + +enum NonSemanticShaderDebugInfoDebugImportedEntity { + NonSemanticShaderDebugInfoImportedModule = 0, + NonSemanticShaderDebugInfoImportedDeclaration = 1, + NonSemanticShaderDebugInfoDebugImportedEntityMax = 0x7fffffff +}; + + +#ifdef __cplusplus +} +#endif + +#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo_H_ diff --git a/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h b/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h deleted file mode 100644 index f74abcb64..000000000 --- a/src/libraries/glslang/SPIRV/NonSemanticShaderDebugInfo100.h +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) 2018 The Khronos Group Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and/or associated documentation files (the "Materials"), -// to deal in the Materials without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Materials, and to permit persons to whom the -// Materials are furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Materials. -// -// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS -// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND -// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ -// -// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS -// IN THE MATERIALS. - -#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ -#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -enum { - NonSemanticShaderDebugInfo100Version = 100, - NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff -}; -enum { - NonSemanticShaderDebugInfo100Revision = 6, - NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100Instructions { - NonSemanticShaderDebugInfo100DebugInfoNone = 0, - NonSemanticShaderDebugInfo100DebugCompilationUnit = 1, - NonSemanticShaderDebugInfo100DebugTypeBasic = 2, - NonSemanticShaderDebugInfo100DebugTypePointer = 3, - NonSemanticShaderDebugInfo100DebugTypeQualifier = 4, - NonSemanticShaderDebugInfo100DebugTypeArray = 5, - NonSemanticShaderDebugInfo100DebugTypeVector = 6, - NonSemanticShaderDebugInfo100DebugTypedef = 7, - NonSemanticShaderDebugInfo100DebugTypeFunction = 8, - NonSemanticShaderDebugInfo100DebugTypeEnum = 9, - NonSemanticShaderDebugInfo100DebugTypeComposite = 10, - NonSemanticShaderDebugInfo100DebugTypeMember = 11, - NonSemanticShaderDebugInfo100DebugTypeInheritance = 12, - NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13, - NonSemanticShaderDebugInfo100DebugTypeTemplate = 14, - NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15, - NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16, - NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17, - NonSemanticShaderDebugInfo100DebugGlobalVariable = 18, - NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19, - NonSemanticShaderDebugInfo100DebugFunction = 20, - NonSemanticShaderDebugInfo100DebugLexicalBlock = 21, - NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22, - NonSemanticShaderDebugInfo100DebugScope = 23, - NonSemanticShaderDebugInfo100DebugNoScope = 24, - NonSemanticShaderDebugInfo100DebugInlinedAt = 25, - NonSemanticShaderDebugInfo100DebugLocalVariable = 26, - NonSemanticShaderDebugInfo100DebugInlinedVariable = 27, - NonSemanticShaderDebugInfo100DebugDeclare = 28, - NonSemanticShaderDebugInfo100DebugValue = 29, - NonSemanticShaderDebugInfo100DebugOperation = 30, - NonSemanticShaderDebugInfo100DebugExpression = 31, - NonSemanticShaderDebugInfo100DebugMacroDef = 32, - NonSemanticShaderDebugInfo100DebugMacroUndef = 33, - NonSemanticShaderDebugInfo100DebugImportedEntity = 34, - NonSemanticShaderDebugInfo100DebugSource = 35, - NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101, - NonSemanticShaderDebugInfo100DebugSourceContinued = 102, - NonSemanticShaderDebugInfo100DebugLine = 103, - NonSemanticShaderDebugInfo100DebugNoLine = 104, - NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105, - NonSemanticShaderDebugInfo100DebugStoragePath = 106, - NonSemanticShaderDebugInfo100DebugEntryPoint = 107, - NonSemanticShaderDebugInfo100DebugTypeMatrix = 108, - NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff -}; - - -enum NonSemanticShaderDebugInfo100DebugInfoFlags { - NonSemanticShaderDebugInfo100None = 0x0000, - NonSemanticShaderDebugInfo100FlagIsProtected = 0x01, - NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02, - NonSemanticShaderDebugInfo100FlagIsPublic = 0x03, - NonSemanticShaderDebugInfo100FlagIsLocal = 0x04, - NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08, - NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10, - NonSemanticShaderDebugInfo100FlagArtificial = 0x20, - NonSemanticShaderDebugInfo100FlagExplicit = 0x40, - NonSemanticShaderDebugInfo100FlagPrototyped = 0x80, - NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100, - NonSemanticShaderDebugInfo100FlagStaticMember = 0x200, - NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400, - NonSemanticShaderDebugInfo100FlagLValueReference = 0x800, - NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000, - NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000, - NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000, - NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000, - NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000, - NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000, - NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100BuildIdentifierFlags { - NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01, - NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding { - NonSemanticShaderDebugInfo100Unspecified = 0, - NonSemanticShaderDebugInfo100Address = 1, - NonSemanticShaderDebugInfo100Boolean = 2, - NonSemanticShaderDebugInfo100Float = 3, - NonSemanticShaderDebugInfo100Signed = 4, - NonSemanticShaderDebugInfo100SignedChar = 5, - NonSemanticShaderDebugInfo100Unsigned = 6, - NonSemanticShaderDebugInfo100UnsignedChar = 7, - NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugCompositeType { - NonSemanticShaderDebugInfo100Class = 0, - NonSemanticShaderDebugInfo100Structure = 1, - NonSemanticShaderDebugInfo100Union = 2, - NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugTypeQualifier { - NonSemanticShaderDebugInfo100ConstType = 0, - NonSemanticShaderDebugInfo100VolatileType = 1, - NonSemanticShaderDebugInfo100RestrictType = 2, - NonSemanticShaderDebugInfo100AtomicType = 3, - NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugOperation { - NonSemanticShaderDebugInfo100Deref = 0, - NonSemanticShaderDebugInfo100Plus = 1, - NonSemanticShaderDebugInfo100Minus = 2, - NonSemanticShaderDebugInfo100PlusUconst = 3, - NonSemanticShaderDebugInfo100BitPiece = 4, - NonSemanticShaderDebugInfo100Swap = 5, - NonSemanticShaderDebugInfo100Xderef = 6, - NonSemanticShaderDebugInfo100StackValue = 7, - NonSemanticShaderDebugInfo100Constu = 8, - NonSemanticShaderDebugInfo100Fragment = 9, - NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff -}; - -enum NonSemanticShaderDebugInfo100DebugImportedEntity { - NonSemanticShaderDebugInfo100ImportedModule = 0, - NonSemanticShaderDebugInfo100ImportedDeclaration = 1, - NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff -}; - - -#ifdef __cplusplus -} -#endif - -#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_ diff --git a/src/libraries/glslang/SPIRV/SPVRemapper.cpp b/src/libraries/glslang/SPIRV/SPVRemapper.cpp deleted file mode 100644 index 02ecb3c53..000000000 --- a/src/libraries/glslang/SPIRV/SPVRemapper.cpp +++ /dev/null @@ -1,1563 +0,0 @@ -// -// Copyright (C) 2015 LunarG, Inc. -// -// 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. -// - -#include "SPVRemapper.h" -#include "doc.h" -#include "spvUtil.h" - -#include -#include - -namespace spv { - - // By default, just abort on error. Can be overridden via RegisterErrorHandler - spirvbin_t::errorfn_t spirvbin_t::errorHandler = [](const std::string&) { exit(5); }; - // By default, eat log messages. Can be overridden via RegisterLogHandler - spirvbin_t::logfn_t spirvbin_t::logHandler = [](const std::string&) { }; - - // This can be overridden to provide other message behavior if needed - void spirvbin_t::msg(int minVerbosity, int indent, const std::string& txt) const - { - if (verbose >= minVerbosity) - logHandler(std::string(indent, ' ') + txt); - } - - // hash opcode, with special handling for OpExtInst - std::uint32_t spirvbin_t::asOpCodeHash(unsigned word) - { - const spv::Op opCode = asOpCode(word); - - std::uint32_t offset = 0; - - switch (opCode) { - case spv::Op::OpExtInst: - offset += asId(word + 4); break; - default: - break; - } - - return ((unsigned)opCode) * 19 + offset; // 19 = small prime - } - - spirvbin_t::range_t spirvbin_t::literalRange(spv::Op opCode) const - { - static const int maxCount = 1<<30; - - switch (opCode) { - case spv::Op::OpTypeFloat: // fall through... - case spv::Op::OpTypePointer: return range_t(2, 3); - case spv::Op::OpTypeInt: return range_t(2, 4); - // TODO: case spv::OpTypeImage: - // TODO: case spv::OpTypeSampledImage: - case spv::Op::OpTypeSampler: return range_t(3, 8); - case spv::Op::OpTypeVector: // fall through - case spv::Op::OpTypeMatrix: // ... - case spv::Op::OpTypePipe: return range_t(3, 4); - case spv::Op::OpConstant: return range_t(3, maxCount); - default: return range_t(0, 0); - } - } - - spirvbin_t::range_t spirvbin_t::typeRange(spv::Op opCode) const - { - static const int maxCount = 1<<30; - - if (isConstOp(opCode)) - return range_t(1, 2); - - switch (opCode) { - case spv::Op::OpTypeVector: // fall through - case spv::Op::OpTypeMatrix: // ... - case spv::Op::OpTypeSampler: // ... - case spv::Op::OpTypeArray: // ... - case spv::Op::OpTypeRuntimeArray: // ... - case spv::Op::OpTypePipe: return range_t(2, 3); - case spv::Op::OpTypeStruct: // fall through - case spv::Op::OpTypeFunction: return range_t(2, maxCount); - case spv::Op::OpTypePointer: return range_t(3, 4); - default: return range_t(0, 0); - } - } - - spirvbin_t::range_t spirvbin_t::constRange(spv::Op opCode) const - { - static const int maxCount = 1<<30; - - switch (opCode) { - case spv::Op::OpTypeArray: // fall through... - case spv::Op::OpTypeRuntimeArray: return range_t(3, 4); - case spv::Op::OpConstantComposite: return range_t(3, maxCount); - default: return range_t(0, 0); - } - } - - // Return the size of a type in 32-bit words. This currently only - // handles ints and floats, and is only invoked by queries which must be - // integer types. If ever needed, it can be generalized. - unsigned spirvbin_t::typeSizeInWords(spv::Id id) const - { - const unsigned typeStart = idPos(id); - const spv::Op opCode = asOpCode(typeStart); - - if (errorLatch) - return 0; - - switch (opCode) { - case spv::Op::OpTypeInt: // fall through... - case spv::Op::OpTypeFloat: return (spv[typeStart + 2] + 31) / 32; - default: - return 0; - } - } - - // Looks up the type of a given const or variable ID, and - // returns its size in 32-bit words. - unsigned spirvbin_t::idTypeSizeInWords(spv::Id id) const - { - const auto tid_it = idTypeSizeMap.find(id); - if (tid_it == idTypeSizeMap.end()) { - error("type size for ID not found"); - return 0; - } - - return tid_it->second; - } - - // Is this an opcode we should remove when using --strip? - bool spirvbin_t::isStripOp(spv::Op opCode, unsigned start) const - { - switch (opCode) { - case spv::Op::OpSource: - case spv::Op::OpSourceExtension: - case spv::Op::OpName: - case spv::Op::OpMemberName: - case spv::Op::OpLine: - { - const std::string name = literalString(start + 2); - - std::vector::const_iterator it; - for (it = stripWhiteList.begin(); it < stripWhiteList.end(); it++) - { - if (name.find(*it) != std::string::npos) { - return false; - } - } - - return true; - } - default : - return false; - } - } - - // Return true if this opcode is flow control - bool spirvbin_t::isFlowCtrl(spv::Op opCode) const - { - switch (opCode) { - case spv::Op::OpBranchConditional: - case spv::Op::OpBranch: - case spv::Op::OpSwitch: - case spv::Op::OpLoopMerge: - case spv::Op::OpSelectionMerge: - case spv::Op::OpLabel: - case spv::Op::OpFunction: - case spv::Op::OpFunctionEnd: return true; - default: return false; - } - } - - // Return true if this opcode defines a type - bool spirvbin_t::isTypeOp(spv::Op opCode) const - { - switch (opCode) { - case spv::Op::OpTypeVoid: - case spv::Op::OpTypeBool: - case spv::Op::OpTypeInt: - case spv::Op::OpTypeFloat: - case spv::Op::OpTypeVector: - case spv::Op::OpTypeMatrix: - case spv::Op::OpTypeImage: - case spv::Op::OpTypeSampler: - case spv::Op::OpTypeArray: - case spv::Op::OpTypeRuntimeArray: - case spv::Op::OpTypeStruct: - case spv::Op::OpTypeOpaque: - case spv::Op::OpTypePointer: - case spv::Op::OpTypeFunction: - case spv::Op::OpTypeEvent: - case spv::Op::OpTypeDeviceEvent: - case spv::Op::OpTypeReserveId: - case spv::Op::OpTypeQueue: - case spv::Op::OpTypeSampledImage: - case spv::Op::OpTypePipe: return true; - default: return false; - } - } - - // Return true if this opcode defines a constant - bool spirvbin_t::isConstOp(spv::Op opCode) const - { - switch (opCode) { - case spv::Op::OpConstantSampler: - error("unimplemented constant type"); - return true; - - case spv::Op::OpConstantNull: - case spv::Op::OpConstantTrue: - case spv::Op::OpConstantFalse: - case spv::Op::OpConstantComposite: - case spv::Op::OpConstant: - return true; - - default: - return false; - } - } - - const auto inst_fn_nop = [](spv::Op, unsigned) { return false; }; - const auto op_fn_nop = [](spv::Id&) { }; - - // g++ doesn't like these defined in the class proper in an anonymous namespace. - // Dunno why. Also MSVC doesn't like the constexpr keyword. Also dunno why. - // Defining them externally seems to please both compilers, so, here they are. - const spv::Id spirvbin_t::unmapped = spv::Id(-10000); - const spv::Id spirvbin_t::unused = spv::Id(-10001); - const int spirvbin_t::header_size = 5; - - spv::Id spirvbin_t::nextUnusedId(spv::Id id) - { - while (isNewIdMapped(id)) // search for an unused ID - ++id; - - return id; - } - - spv::Id spirvbin_t::localId(spv::Id id, spv::Id newId) - { - //assert(id != spv::NoResult && newId != spv::NoResult); - - if (id > bound()) { - error(std::string("ID out of range: ") + std::to_string(id)); - return spirvbin_t::unused; - } - - if (id >= idMapL.size()) - idMapL.resize(id+1, unused); - - if (newId != unmapped && newId != unused) { - if (isOldIdUnused(id)) { - error(std::string("ID unused in module: ") + std::to_string(id)); - return spirvbin_t::unused; - } - - if (!isOldIdUnmapped(id)) { - error(std::string("ID already mapped: ") + std::to_string(id) + " -> " - + std::to_string(localId(id))); - - return spirvbin_t::unused; - } - - if (isNewIdMapped(newId)) { - error(std::string("ID already used in module: ") + std::to_string(newId)); - return spirvbin_t::unused; - } - - msg(4, 4, std::string("map: ") + std::to_string(id) + " -> " + std::to_string(newId)); - setMapped(newId); - largestNewId = std::max(largestNewId, newId); - } - - return idMapL[id] = newId; - } - - // Parse a literal string from the SPIR binary and return it as an std::string - // Due to C++11 RValue references, this doesn't copy the result string. - std::string spirvbin_t::literalString(unsigned word) const - { - std::string literal; - const spirword_t * pos = spv.data() + word; - - literal.reserve(16); - - do { - spirword_t word = *pos; - for (int i = 0; i < 4; i++) { - char c = word & 0xff; - if (c == '\0') - return literal; - literal += c; - word >>= 8; - } - pos++; - } while (true); - } - - void spirvbin_t::applyMap() - { - msg(3, 2, std::string("Applying map: ")); - - // Map local IDs through the ID map - process(inst_fn_nop, // ignore instructions - [this](spv::Id& id) { - id = localId(id); - - if (errorLatch) - return; - - assert(id != unused && id != unmapped); - } - ); - } - - // Find free IDs for anything we haven't mapped - void spirvbin_t::mapRemainder() - { - msg(3, 2, std::string("Remapping remainder: ")); - - spv::Id unusedId = 1; // can't use 0: that's NoResult - spirword_t maxBound = 0; - - for (spv::Id id = 0; id < idMapL.size(); ++id) { - if (isOldIdUnused(id)) - continue; - - // Find a new mapping for any used but unmapped IDs - if (isOldIdUnmapped(id)) { - localId(id, unusedId = nextUnusedId(unusedId)); - if (errorLatch) - return; - } - - if (isOldIdUnmapped(id)) { - error(std::string("old ID not mapped: ") + std::to_string(id)); - return; - } - - // Track max bound - maxBound = std::max(maxBound, localId(id) + 1); - - if (errorLatch) - return; - } - - bound(maxBound); // reset header ID bound to as big as it now needs to be - } - - // Mark debug instructions for stripping - void spirvbin_t::stripDebug() - { - // Strip instructions in the stripOp set: debug info. - process( - [&](spv::Op opCode, unsigned start) { - // remember opcodes we want to strip later - if (isStripOp(opCode, start)) - stripInst(start); - return true; - }, - op_fn_nop); - } - - // Mark instructions that refer to now-removed IDs for stripping - void spirvbin_t::stripDeadRefs() - { - process( - [&](spv::Op opCode, unsigned start) { - // strip opcodes pointing to removed data - switch (opCode) { - case spv::Op::OpName: - case spv::Op::OpMemberName: - case spv::Op::OpDecorate: - case spv::Op::OpMemberDecorate: - if (idPosR.find(asId(start+1)) == idPosR.end()) - stripInst(start); - break; - default: - break; // leave it alone - } - - return true; - }, - op_fn_nop); - - strip(); - } - - // Update local maps of ID, type, etc positions - void spirvbin_t::buildLocalMaps() - { - msg(2, 2, std::string("build local maps: ")); - - mapped.clear(); - idMapL.clear(); -// preserve nameMap, so we don't clear that. - fnPos.clear(); - fnCalls.clear(); - typeConstPos.clear(); - idPosR.clear(); - entryPoint = spv::NoResult; - largestNewId = 0; - - idMapL.resize(bound(), unused); - - int fnStart = 0; - spv::Id fnRes = spv::NoResult; - - // build local Id and name maps - process( - [&](spv::Op opCode, unsigned start) { - unsigned word = start+1; - spv::Id typeId = spv::NoResult; - - if (spv::InstructionDesc[enumCast(opCode)].hasType()) - typeId = asId(word++); - - // If there's a result ID, remember the size of its type - if (spv::InstructionDesc[enumCast(opCode)].hasResult()) { - const spv::Id resultId = asId(word++); - idPosR[resultId] = start; - - if (typeId != spv::NoResult) { - const unsigned idTypeSize = typeSizeInWords(typeId); - - if (errorLatch) - return false; - - if (idTypeSize != 0) - idTypeSizeMap[resultId] = idTypeSize; - } - } - - if (opCode == spv::Op::OpName) { - const spv::Id target = asId(start+1); - const std::string name = literalString(start+2); - nameMap[name] = target; - - } else if (opCode == spv::Op::OpFunctionCall) { - ++fnCalls[asId(start + 3)]; - } else if (opCode == spv::Op::OpEntryPoint) { - entryPoint = asId(start + 2); - } else if (opCode == spv::Op::OpFunction) { - if (fnStart != 0) { - error("nested function found"); - return false; - } - - fnStart = start; - fnRes = asId(start + 2); - } else if (opCode == spv::Op::OpFunctionEnd) { - assert(fnRes != spv::NoResult); - if (fnStart == 0) { - error("function end without function start"); - return false; - } - - fnPos[fnRes] = range_t(fnStart, start + asWordCount(start)); - fnStart = 0; - } else if (isConstOp(opCode)) { - if (errorLatch) - return false; - - assert(asId(start + 2) != spv::NoResult); - typeConstPos.insert(start); - } else if (isTypeOp(opCode)) { - assert(asId(start + 1) != spv::NoResult); - typeConstPos.insert(start); - } - - return false; - }, - - [this](spv::Id& id) { localId(id, unmapped); } - ); - } - - // Validate the SPIR header - void spirvbin_t::validate() const - { - msg(2, 2, std::string("validating: ")); - - if (spv.size() < header_size) { - error("file too short: "); - return; - } - - if (magic() != spv::MagicNumber) { - error("bad magic number"); - return; - } - - // field 1 = version - // field 2 = generator magic - // field 3 = result bound - - if (schemaNum() != 0) { - error("bad schema, must be 0"); - return; - } - } - - int spirvbin_t::processInstruction(unsigned word, instfn_t instFn, idfn_t idFn) - { - const auto instructionStart = word; - const unsigned wordCount = asWordCount(instructionStart); - const int nextInst = word++ + wordCount; - spv::Op opCode = asOpCode(instructionStart); - - if (nextInst > int(spv.size())) { - error("spir instruction terminated too early"); - return -1; - } - - // Base for computing number of operands; will be updated as more is learned - unsigned numOperands = wordCount - 1; - - if (instFn(opCode, instructionStart)) - return nextInst; - - // Read type and result ID from instruction desc table - if (spv::InstructionDesc[enumCast(opCode)].hasType()) { - idFn(asId(word++)); - --numOperands; - } - - if (spv::InstructionDesc[enumCast(opCode)].hasResult()) { - idFn(asId(word++)); - --numOperands; - } - - // Extended instructions: currently, assume everything is an ID. - // TODO: add whatever data we need for exceptions to that - if (opCode == spv::Op::OpExtInst) { - - idFn(asId(word)); // Instruction set is an ID that also needs to be mapped - - word += 2; // instruction set, and instruction from set - numOperands -= 2; - - for (unsigned op=0; op < numOperands; ++op) - idFn(asId(word++)); // ID - - return nextInst; - } - - // Circular buffer so we can look back at previous unmapped values during the mapping pass. - static const unsigned idBufferSize = 4; - spv::Id idBuffer[idBufferSize]; - unsigned idBufferPos = 0; - - // Store IDs from instruction in our map - for (int op = 0; numOperands > 0; ++op, --numOperands) { - // SpecConstantOp is special: it includes the operands of another opcode which is - // given as a literal in the 3rd word. We will switch over to pretending that the - // opcode being processed is the literal opcode value of the SpecConstantOp. See the - // SPIRV spec for details. This way we will handle IDs and literals as appropriate for - // the embedded op. - if (opCode == spv::Op::OpSpecConstantOp) { - if (op == 0) { - opCode = asOpCode(word++); // this is the opcode embedded in the SpecConstantOp. - --numOperands; - } - } - - switch (spv::InstructionDesc[enumCast(opCode)].operands.getClass(op)) { - case spv::OperandId: - case spv::OperandScope: - case spv::OperandMemorySemantics: - idBuffer[idBufferPos] = asId(word); - idBufferPos = (idBufferPos + 1) % idBufferSize; - idFn(asId(word++)); - break; - - case spv::OperandVariableIds: - for (unsigned i = 0; i < numOperands; ++i) - idFn(asId(word++)); - return nextInst; - - case spv::OperandVariableLiterals: - // for clarity - // if (opCode == spv::OpDecorate && asDecoration(word - 1) == spv::DecorationBuiltIn) { - // ++word; - // --numOperands; - // } - // word += numOperands; - return nextInst; - - case spv::OperandVariableLiteralId: { - if (opCode == Op::OpSwitch) { - // word-2 is the position of the selector ID. OpSwitch Literals match its type. - // In case the IDs are currently being remapped, we get the word[-2] ID from - // the circular idBuffer. - const unsigned literalSizePos = (idBufferPos+idBufferSize-2) % idBufferSize; - const unsigned literalSize = idTypeSizeInWords(idBuffer[literalSizePos]); - const unsigned numLiteralIdPairs = (nextInst-word) / (1+literalSize); - - if (errorLatch) - return -1; - - for (unsigned arg=0; arg instPos; - instPos.reserve(unsigned(spv.size()) / 16); // initial estimate; can grow if needed. - - // Build local table of instruction start positions - process( - [&](spv::Op, unsigned start) { instPos.push_back(start); return true; }, - op_fn_nop); - - if (errorLatch) - return; - - // Window size for context-sensitive canonicalization values - // Empirical best size from a single data set. TODO: Would be a good tunable. - // We essentially perform a little convolution around each instruction, - // to capture the flavor of nearby code, to hopefully match to similar - // code in other modules. - static const unsigned windowSize = 2; - - for (unsigned entry = 0; entry < unsigned(instPos.size()); ++entry) { - const unsigned start = instPos[entry]; - const spv::Op opCode = asOpCode(start); - - if (opCode == spv::Op::OpFunction) - fnId = asId(start + 2); - - if (opCode == spv::Op::OpFunctionEnd) - fnId = spv::NoResult; - - if (fnId != spv::NoResult) { // if inside a function - if (spv::InstructionDesc[enumCast(opCode)].hasResult()) { - const unsigned word = start + (spv::InstructionDesc[enumCast(opCode)].hasType() ? 2 : 1); - const spv::Id resId = asId(word); - std::uint32_t hashval = fnId * 17; // small prime - - for (unsigned i = entry-1; i >= entry-windowSize; --i) { - if (asOpCode(instPos[i]) == spv::Op::OpFunction) - break; - hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime - } - - for (unsigned i = entry; i <= entry + windowSize; ++i) { - if (asOpCode(instPos[i]) == spv::Op::OpFunctionEnd) - break; - hashval = hashval * 30103 + asOpCodeHash(instPos[i]); // 30103 = semiarbitrary prime - } - - if (isOldIdUnmapped(resId)) { - localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); - if (errorLatch) - return; - } - - } - } - } - - spv::Op thisOpCode(spv::Op::OpNop); - std::unordered_map opCounter; - int idCounter(0); - fnId = spv::NoResult; - - process( - [&](spv::Op opCode, unsigned start) { - switch (opCode) { - case spv::Op::OpFunction: - // Reset counters at each function - idCounter = 0; - opCounter.clear(); - fnId = asId(start + 2); - break; - - case spv::Op::OpImageSampleImplicitLod: - case spv::Op::OpImageSampleExplicitLod: - case spv::Op::OpImageSampleDrefImplicitLod: - case spv::Op::OpImageSampleDrefExplicitLod: - case spv::Op::OpImageSampleProjImplicitLod: - case spv::Op::OpImageSampleProjExplicitLod: - case spv::Op::OpImageSampleProjDrefImplicitLod: - case spv::Op::OpImageSampleProjDrefExplicitLod: - case spv::Op::OpDot: - case spv::Op::OpCompositeExtract: - case spv::Op::OpCompositeInsert: - case spv::Op::OpVectorShuffle: - case spv::Op::OpLabel: - case spv::Op::OpVariable: - - case spv::Op::OpAccessChain: - case spv::Op::OpLoad: - case spv::Op::OpStore: - case spv::Op::OpCompositeConstruct: - case spv::Op::OpFunctionCall: - ++opCounter[enumCast(opCode)]; - idCounter = 0; - thisOpCode = opCode; - break; - default: - thisOpCode = spv::Op::OpNop; - } - - return false; - }, - - [&](spv::Id& id) { - if (thisOpCode != spv::Op::OpNop) { - ++idCounter; - const std::uint32_t hashval = - // Explicitly cast operands to unsigned int to avoid integer - // promotion to signed int followed by integer overflow, - // which would result in undefined behavior. - static_cast(opCounter[enumCast(thisOpCode)]) - * enumCast(thisOpCode) - * 50047 - + idCounter - + static_cast(fnId) * 117; - - if (isOldIdUnmapped(id)) - localId(id, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); - } - }); - } - - // EXPERIMENTAL: forward IO and uniform load/stores into operands - // This produces invalid Schema-0 SPIRV - void spirvbin_t::forwardLoadStores() - { - idset_t fnLocalVars; // set of function local vars - idmap_t idMap; // Map of load result IDs to what they load - - // EXPERIMENTAL: Forward input and access chain loads into consumptions - process( - [&](spv::Op opCode, unsigned start) { - // Add inputs and uniforms to the map - if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && - (spv[start+3] == (unsigned)spv::StorageClass::Uniform || - spv[start+3] == (unsigned)spv::StorageClass::UniformConstant || - spv[start+3] == (unsigned)spv::StorageClass::Input)) - fnLocalVars.insert(asId(start+2)); - - if (opCode == spv::Op::OpAccessChain && fnLocalVars.count(asId(start+3)) > 0) - fnLocalVars.insert(asId(start+2)); - - if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) { - idMap[asId(start+2)] = asId(start+3); - stripInst(start); - } - - return false; - }, - - [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } - ); - - if (errorLatch) - return; - - // EXPERIMENTAL: Implicit output stores - fnLocalVars.clear(); - idMap.clear(); - - process( - [&](spv::Op opCode, unsigned start) { - // Add inputs and uniforms to the map - if ((opCode == spv::Op::OpVariable && asWordCount(start) == 4) && - (spv[start+3] == (int)spv::StorageClass::Output)) - fnLocalVars.insert(asId(start+2)); - - if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { - idMap[asId(start+2)] = asId(start+1); - stripInst(start); - } - - return false; - }, - op_fn_nop); - - if (errorLatch) - return; - - process( - inst_fn_nop, - [&](spv::Id& id) { if (idMap.find(id) != idMap.end()) id = idMap[id]; } - ); - - if (errorLatch) - return; - - strip(); // strip out data we decided to eliminate - } - - // optimize loads and stores - void spirvbin_t::optLoadStore() - { - idset_t fnLocalVars; // candidates for removal (only locals) - idmap_t idMap; // Map of load result IDs to what they load - blockmap_t blockMap; // Map of IDs to blocks they first appear in - int blockNum = 0; // block count, to avoid crossing flow control - - // Find all the function local pointers stored at most once, and not via access chains - process( - [&](spv::Op opCode, unsigned start) { - const int wordCount = asWordCount(start); - - // Count blocks, so we can avoid crossing flow control - if (isFlowCtrl(opCode)) - ++blockNum; - - // Add local variables to the map - if ((opCode == spv::Op::OpVariable && spv[start+3] == (unsigned)spv::StorageClass::Function && asWordCount(start) == 4)) { - fnLocalVars.insert(asId(start+2)); - return true; - } - - // Ignore process vars referenced via access chain - if ((opCode == spv::Op::OpAccessChain || opCode == spv::Op::OpInBoundsAccessChain) && fnLocalVars.count(asId(start+3)) > 0) { - fnLocalVars.erase(asId(start+3)); - idMap.erase(asId(start+3)); - return true; - } - - if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start + 3)) > 0) { - const spv::Id varId = asId(start+3); - - // Avoid loads before stores - if (idMap.find(varId) == idMap.end()) { - fnLocalVars.erase(varId); - idMap.erase(varId); - } - - // don't do for volatile references - if (wordCount > 4 && (spv[start+4] & spv::MemoryAccessMask::Volatile)) { - fnLocalVars.erase(varId); - idMap.erase(varId); - } - - // Handle flow control - if (blockMap.find(varId) == blockMap.end()) { - blockMap[varId] = blockNum; // track block we found it in. - } else if (blockMap[varId] != blockNum) { - fnLocalVars.erase(varId); // Ignore if crosses flow control - idMap.erase(varId); - } - - return true; - } - - if (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) { - const spv::Id varId = asId(start+1); - - if (idMap.find(varId) == idMap.end()) { - idMap[varId] = asId(start+2); - } else { - // Remove if it has more than one store to the same pointer - fnLocalVars.erase(varId); - idMap.erase(varId); - } - - // don't do for volatile references - if (wordCount > 3 && (spv[start+3] & spv::MemoryAccessMask::Volatile)) { - fnLocalVars.erase(asId(start+3)); - idMap.erase(asId(start+3)); - } - - // Handle flow control - if (blockMap.find(varId) == blockMap.end()) { - blockMap[varId] = blockNum; // track block we found it in. - } else if (blockMap[varId] != blockNum) { - fnLocalVars.erase(varId); // Ignore if crosses flow control - idMap.erase(varId); - } - - return true; - } - - return false; - }, - - // If local var id used anywhere else, don't eliminate - [&](spv::Id& id) { - if (fnLocalVars.count(id) > 0) { - fnLocalVars.erase(id); - idMap.erase(id); - } - } - ); - - if (errorLatch) - return; - - process( - [&](spv::Op opCode, unsigned start) { - if (opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) - idMap[asId(start+2)] = idMap[asId(start+3)]; - return false; - }, - op_fn_nop); - - if (errorLatch) - return; - - // Chase replacements to their origins, in case there is a chain such as: - // 2 = store 1 - // 3 = load 2 - // 4 = store 3 - // 5 = load 4 - // We want to replace uses of 5 with 1. - for (const auto& idPair : idMap) { - spv::Id id = idPair.first; - while (idMap.find(id) != idMap.end()) // Chase to end of chain - id = idMap[id]; - - idMap[idPair.first] = id; // replace with final result - } - - // Remove the load/store/variables for the ones we've discovered - process( - [&](spv::Op opCode, unsigned start) { - if ((opCode == spv::Op::OpLoad && fnLocalVars.count(asId(start+3)) > 0) || - (opCode == spv::Op::OpStore && fnLocalVars.count(asId(start+1)) > 0) || - (opCode == spv::Op::OpVariable && fnLocalVars.count(asId(start+2)) > 0)) { - - stripInst(start); - return true; - } - - return false; - }, - - [&](spv::Id& id) { - if (idMap.find(id) != idMap.end()) id = idMap[id]; - } - ); - - if (errorLatch) - return; - - strip(); // strip out data we decided to eliminate - } - - // remove bodies of uncalled functions - void spirvbin_t::dceFuncs() - { - msg(3, 2, std::string("Removing Dead Functions: ")); - - // TODO: There are more efficient ways to do this. - bool changed = true; - - while (changed) { - changed = false; - - for (auto fn = fnPos.begin(); fn != fnPos.end(); ) { - if (fn->first == entryPoint) { // don't DCE away the entry point! - ++fn; - continue; - } - - const auto call_it = fnCalls.find(fn->first); - - if (call_it == fnCalls.end() || call_it->second == 0) { - changed = true; - stripRange.push_back(fn->second); - - // decrease counts of called functions - process( - [&](spv::Op opCode, unsigned start) { - if (opCode == spv::Op::OpFunctionCall) { - const auto call_it = fnCalls.find(asId(start + 3)); - if (call_it != fnCalls.end()) { - if (--call_it->second <= 0) - fnCalls.erase(call_it); - } - } - - return true; - }, - op_fn_nop, - fn->second.first, - fn->second.second); - - if (errorLatch) - return; - - fn = fnPos.erase(fn); - } else ++fn; - } - } - } - - // remove unused function variables + decorations - void spirvbin_t::dceVars() - { - msg(3, 2, std::string("DCE Vars: ")); - - std::unordered_map varUseCount; - - // Count function variable use - process( - [&](spv::Op opCode, unsigned start) { - if (opCode == spv::Op::OpVariable) { - ++varUseCount[asId(start+2)]; - return true; - } else if (opCode == spv::Op::OpEntryPoint) { - const int wordCount = asWordCount(start); - for (int i = 4; i < wordCount; i++) { - ++varUseCount[asId(start+i)]; - } - return true; - } else - return false; - }, - - [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } - ); - - if (errorLatch) - return; - - // Remove single-use function variables + associated decorations and names - process( - [&](spv::Op opCode, unsigned start) { - spv::Id id = spv::NoResult; - if (opCode == spv::Op::OpVariable) - id = asId(start+2); - if (opCode == spv::Op::OpDecorate || opCode == spv::Op::OpName) - id = asId(start+1); - - if (id != spv::NoResult && varUseCount[id] == 1) - stripInst(start); - - return true; - }, - op_fn_nop); - } - - // remove unused types - void spirvbin_t::dceTypes() - { - std::vector isType(bound(), false); - - // for speed, make O(1) way to get to type query (map is log(n)) - for (const auto typeStart : typeConstPos) - isType[asTypeConstId(typeStart)] = true; - - std::unordered_map typeUseCount; - - // This is not the most efficient algorithm, but this is an offline tool, and - // it's easy to write this way. Can be improved opportunistically if needed. - bool changed = true; - while (changed) { - changed = false; - strip(); - typeUseCount.clear(); - - // Count total type usage - process(inst_fn_nop, - [&](spv::Id& id) { if (isType[id]) ++typeUseCount[id]; } - ); - - if (errorLatch) - return; - - // Remove single reference types - for (const auto typeStart : typeConstPos) { - const spv::Id typeId = asTypeConstId(typeStart); - if (typeUseCount[typeId] == 1) { - changed = true; - --typeUseCount[typeId]; - stripInst(typeStart); - } - } - - if (errorLatch) - return; - } - } - -#ifdef NOTDEF - bool spirvbin_t::matchType(const spirvbin_t::globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const - { - // Find the local type id "lt" and global type id "gt" - const auto lt_it = typeConstPosR.find(lt); - if (lt_it == typeConstPosR.end()) - return false; - - const auto typeStart = lt_it->second; - - // Search for entry in global table - const auto gtype = globalTypes.find(gt); - if (gtype == globalTypes.end()) - return false; - - const auto& gdata = gtype->second; - - // local wordcount and opcode - const int wordCount = asWordCount(typeStart); - const spv::Op opCode = asOpCode(typeStart); - - // no type match if opcodes don't match, or operand count doesn't match - if (opCode != opOpCode(gdata[0]) || wordCount != opWordCount(gdata[0])) - return false; - - const unsigned numOperands = wordCount - 2; // all types have a result - - const auto cmpIdRange = [&](range_t range) { - for (int x=range.first; xsecond; - } - - // Hash types to canonical values. This can return ID collisions (it's a bit - // inevitable): it's up to the caller to handle that gracefully. - std::uint32_t spirvbin_t::hashType(unsigned typeStart) const - { - const unsigned wordCount = asWordCount(typeStart); - const spv::Op opCode = asOpCode(typeStart); - - switch (opCode) { - case spv::Op::OpTypeVoid: return 0; - case spv::Op::OpTypeBool: return 1; - case spv::Op::OpTypeInt: return 3 + (spv[typeStart+3]); - case spv::Op::OpTypeFloat: return 5; - case spv::Op::OpTypeVector: - return 6 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); - case spv::Op::OpTypeMatrix: - return 30 + hashType(idPos(spv[typeStart+2])) * (spv[typeStart+3] - 1); - case spv::Op::OpTypeImage: - return 120 + hashType(idPos(spv[typeStart+2])) + - spv[typeStart+3] + // dimensionality - spv[typeStart+4] * 8 * 16 + // depth - spv[typeStart+5] * 4 * 16 + // arrayed - spv[typeStart+6] * 2 * 16 + // multisampled - spv[typeStart+7] * 1 * 16; // format - case spv::Op::OpTypeSampler: - return 500; - case spv::Op::OpTypeSampledImage: - return 502; - case spv::Op::OpTypeArray: - return 501 + hashType(idPos(spv[typeStart+2])) * spv[typeStart+3]; - case spv::Op::OpTypeRuntimeArray: - return 5000 + hashType(idPos(spv[typeStart+2])); - case spv::Op::OpTypeStruct: - { - std::uint32_t hash = 10000; - for (unsigned w=2; w < wordCount; ++w) - hash += w * hashType(idPos(spv[typeStart+w])); - return hash; - } - - case spv::Op::OpTypeOpaque: return 6000 + spv[typeStart+2]; - case spv::Op::OpTypePointer: return 100000 + hashType(idPos(spv[typeStart+3])); - case spv::Op::OpTypeFunction: - { - std::uint32_t hash = 200000; - for (unsigned w=2; w < wordCount; ++w) - hash += w * hashType(idPos(spv[typeStart+w])); - return hash; - } - - case spv::Op::OpTypeEvent: return 300000; - case spv::Op::OpTypeDeviceEvent: return 300001; - case spv::Op::OpTypeReserveId: return 300002; - case spv::Op::OpTypeQueue: return 300003; - case spv::Op::OpTypePipe: return 300004; - case spv::Op::OpConstantTrue: return 300007; - case spv::Op::OpConstantFalse: return 300008; - case spv::Op::OpTypeRayQueryKHR: return 300009; - case spv::Op::OpTypeAccelerationStructureKHR: return 300010; - case spv::Op::OpConstantComposite: - { - std::uint32_t hash = 300011 + hashType(idPos(spv[typeStart+1])); - for (unsigned w=3; w < wordCount; ++w) - hash += w * hashType(idPos(spv[typeStart+w])); - return hash; - } - case spv::Op::OpConstant: - { - std::uint32_t hash = 400011 + hashType(idPos(spv[typeStart+1])); - for (unsigned w=3; w < wordCount; ++w) - hash += w * spv[typeStart+w]; - return hash; - } - case spv::Op::OpConstantNull: - { - std::uint32_t hash = 500009 + hashType(idPos(spv[typeStart+1])); - return hash; - } - case spv::Op::OpConstantSampler: - { - std::uint32_t hash = 600011 + hashType(idPos(spv[typeStart+1])); - for (unsigned w=3; w < wordCount; ++w) - hash += w * spv[typeStart+w]; - return hash; - } - - default: - error("unknown type opcode"); - return 0; - } - } - - void spirvbin_t::mapTypeConst() - { - globaltypes_t globalTypeMap; - - msg(3, 2, std::string("Remapping Consts & Types: ")); - - static const std::uint32_t softTypeIdLimit = 3011; // small prime. TODO: get from options - static const std::uint32_t firstMappedID = 8; // offset into ID space - - for (auto& typeStart : typeConstPos) { - const spv::Id resId = asTypeConstId(typeStart); - const std::uint32_t hashval = hashType(typeStart); - - if (errorLatch) - return; - - if (isOldIdUnmapped(resId)) { - localId(resId, nextUnusedId(hashval % softTypeIdLimit + firstMappedID)); - if (errorLatch) - return; - } - } - } - - // Strip a single binary by removing ranges given in stripRange - void spirvbin_t::strip() - { - if (stripRange.empty()) // nothing to do - return; - - // Sort strip ranges in order of traversal - std::sort(stripRange.begin(), stripRange.end()); - - // Allocate a new binary big enough to hold old binary - // We'll step this iterator through the strip ranges as we go through the binary - auto strip_it = stripRange.begin(); - - int strippedPos = 0; - for (unsigned word = 0; word < unsigned(spv.size()); ++word) { - while (strip_it != stripRange.end() && word >= strip_it->second) - ++strip_it; - - if (strip_it == stripRange.end() || word < strip_it->first || word >= strip_it->second) - spv[strippedPos++] = spv[word]; - } - - spv.resize(strippedPos); - stripRange.clear(); - - buildLocalMaps(); - } - - // Strip a single binary by removing ranges given in stripRange - void spirvbin_t::remap(std::uint32_t opts) - { - options = opts; - - // Set up opcode tables from SpvDoc - spv::Parameterize(); - - validate(); // validate header - buildLocalMaps(); // build ID maps - - msg(3, 4, std::string("ID bound: ") + std::to_string(bound())); - - if (options & STRIP) stripDebug(); - if (errorLatch) return; - - strip(); // strip out data we decided to eliminate - if (errorLatch) return; - - if (options & OPT_LOADSTORE) optLoadStore(); - if (errorLatch) return; - - if (options & OPT_FWD_LS) forwardLoadStores(); - if (errorLatch) return; - - if (options & DCE_FUNCS) dceFuncs(); - if (errorLatch) return; - - if (options & DCE_VARS) dceVars(); - if (errorLatch) return; - - if (options & DCE_TYPES) dceTypes(); - if (errorLatch) return; - - strip(); // strip out data we decided to eliminate - if (errorLatch) return; - - stripDeadRefs(); // remove references to things we DCEed - if (errorLatch) return; - - // after the last strip, we must clean any debug info referring to now-deleted data - - if (options & MAP_TYPES) mapTypeConst(); - if (errorLatch) return; - - if (options & MAP_NAMES) mapNames(); - if (errorLatch) return; - - if (options & MAP_FUNCS) mapFnBodies(); - if (errorLatch) return; - - if (options & MAP_ALL) { - mapRemainder(); // map any unmapped IDs - if (errorLatch) return; - - applyMap(); // Now remap each shader to the new IDs we've come up with - if (errorLatch) return; - } - } - - // remap from a memory image - void spirvbin_t::remap(std::vector& in_spv, const std::vector& whiteListStrings, - std::uint32_t opts) - { - stripWhiteList = whiteListStrings; - spv.swap(in_spv); - remap(opts); - spv.swap(in_spv); - } - - // remap from a memory image - legacy interface without white list - void spirvbin_t::remap(std::vector& in_spv, std::uint32_t opts) - { - stripWhiteList.clear(); - spv.swap(in_spv); - remap(opts); - spv.swap(in_spv); - } - -} // namespace SPV - diff --git a/src/libraries/glslang/SPIRV/SPVRemapper.h b/src/libraries/glslang/SPIRV/SPVRemapper.h deleted file mode 100644 index d4c2295c9..000000000 --- a/src/libraries/glslang/SPIRV/SPVRemapper.h +++ /dev/null @@ -1,300 +0,0 @@ -// -// Copyright (C) 2015 LunarG, Inc. -// -// 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. -// - -#ifndef SPIRVREMAPPER_H -#define SPIRVREMAPPER_H - -#include -#include -#include -#include - -#ifdef GLSLANG_IS_SHARED_LIBRARY - #ifdef _WIN32 - #ifdef GLSLANG_EXPORTING - #define GLSLANG_EXPORT __declspec(dllexport) - #else - #define GLSLANG_EXPORT __declspec(dllimport) - #endif - #elif __GNUC__ >= 4 - #define GLSLANG_EXPORT __attribute__((visibility("default"))) - #endif -#endif // GLSLANG_IS_SHARED_LIBRARY -#ifndef GLSLANG_EXPORT -#define GLSLANG_EXPORT -#endif - -namespace spv { - -class spirvbin_base_t -{ -public: - enum Options { - NONE = 0, - STRIP = (1<<0), - MAP_TYPES = (1<<1), - MAP_NAMES = (1<<2), - MAP_FUNCS = (1<<3), - DCE_FUNCS = (1<<4), - DCE_VARS = (1<<5), - DCE_TYPES = (1<<6), - OPT_LOADSTORE = (1<<7), - OPT_FWD_LS = (1<<8), // EXPERIMENTAL: PRODUCES INVALID SCHEMA-0 SPIRV - MAP_ALL = (MAP_TYPES | MAP_NAMES | MAP_FUNCS), - DCE_ALL = (DCE_FUNCS | DCE_VARS | DCE_TYPES), - OPT_ALL = (OPT_LOADSTORE), - - ALL_BUT_STRIP = (MAP_ALL | DCE_ALL | OPT_ALL), - DO_EVERYTHING = (STRIP | ALL_BUT_STRIP) - }; -}; - -} // namespace SPV - -#include -#include -#include -#include -#include -#include -#include - -#include "spirv.hpp11" - -namespace spv { - -static inline constexpr Id NoResult = 0; - -// class to hold SPIR-V binary data for remapping, DCE, and debug stripping -class GLSLANG_EXPORT spirvbin_t : public spirvbin_base_t -{ -public: - spirvbin_t(int verbose = 0) : entryPoint(spv::NoResult), largestNewId(0), verbose(verbose), errorLatch(false) - { } - - virtual ~spirvbin_t() { } - - // remap on an existing binary in memory - void remap(std::vector& spv, const std::vector& whiteListStrings, - std::uint32_t opts = DO_EVERYTHING); - - // remap on an existing binary in memory - legacy interface without white list - void remap(std::vector& spv, std::uint32_t opts = DO_EVERYTHING); - - // Type for error/log handler functions - typedef std::function errorfn_t; - typedef std::function logfn_t; - - // Register error/log handling functions (can be lambda fn / functor / etc) - static void registerErrorHandler(errorfn_t handler) { errorHandler = handler; } - static void registerLogHandler(logfn_t handler) { logHandler = handler; } - -protected: - // This can be overridden to provide other message behavior if needed - virtual void msg(int minVerbosity, int indent, const std::string& txt) const; - -private: - // Local to global, or global to local ID map - typedef std::unordered_map idmap_t; - typedef std::unordered_set idset_t; - typedef std::unordered_map blockmap_t; - - void remap(std::uint32_t opts = DO_EVERYTHING); - - // Map of names to IDs - typedef std::unordered_map namemap_t; - - typedef std::uint32_t spirword_t; - - typedef std::pair range_t; - typedef std::function idfn_t; - typedef std::function instfn_t; - - // Special Values for ID map: - static const spv::Id unmapped; // unchanged from default value - static const spv::Id unused; // unused ID - static const int header_size; // SPIR header = 5 words - - class id_iterator_t; - - // For mapping type entries between different shaders - typedef std::vector typeentry_t; - typedef std::map globaltypes_t; - - // A set that preserves position order, and a reverse map - typedef std::set posmap_t; - typedef std::unordered_map posmap_rev_t; - - // Maps and ID to the size of its base type, if known. - typedef std::unordered_map typesize_map_t; - - // handle error - void error(const std::string& txt) const { errorLatch = true; errorHandler(txt); } - - bool isConstOp(spv::Op opCode) const; - bool isTypeOp(spv::Op opCode) const; - bool isStripOp(spv::Op opCode) const; - bool isFlowCtrl(spv::Op opCode) const; - range_t literalRange(spv::Op opCode) const; - range_t typeRange(spv::Op opCode) const; - range_t constRange(spv::Op opCode) const; - unsigned typeSizeInWords(spv::Id id) const; - unsigned idTypeSizeInWords(spv::Id id) const; - - bool isStripOp(spv::Op opCode, unsigned start) const; - - spv::Id& asId(unsigned word) { return spv[word]; } - const spv::Id& asId(unsigned word) const { return spv[word]; } - spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); } - std::uint32_t asOpCodeHash(unsigned word); - spv::Decoration asDecoration(unsigned word) const { return spv::Decoration(spv[word]); } - unsigned asWordCount(unsigned word) const { return opWordCount(spv[word]); } - spv::Id asTypeConstId(unsigned word) const { return asId(word + (isTypeOp(asOpCode(word)) ? 1 : 2)); } - unsigned idPos(spv::Id id) const; - - static unsigned opWordCount(spirword_t data) { return data >> spv::WordCountShift; } - static spv::Op opOpCode(spirword_t data) { return spv::Op(data & spv::OpCodeMask); } - - // Header access & set methods - spirword_t magic() const { return spv[0]; } // return magic number - spirword_t bound() const { return spv[3]; } // return Id bound from header - spirword_t bound(spirword_t b) { return spv[3] = b; } - spirword_t genmagic() const { return spv[2]; } // generator magic - spirword_t genmagic(spirword_t m) { return spv[2] = m; } - spirword_t schemaNum() const { return spv[4]; } // schema number from header - - // Mapping fns: get - spv::Id localId(spv::Id id) const { return idMapL[id]; } - - // Mapping fns: set - inline spv::Id localId(spv::Id id, spv::Id newId); - void countIds(spv::Id id); - - // Return next unused new local ID. - // NOTE: boost::dynamic_bitset would be more efficient due to find_next(), - // which std::vector doens't have. - inline spv::Id nextUnusedId(spv::Id id); - - void buildLocalMaps(); - std::string literalString(unsigned word) const; // Return literal as a std::string - int literalStringWords(const std::string& str) const { return (int(str.size())+4)/4; } - - bool isNewIdMapped(spv::Id newId) const { return isMapped(newId); } - bool isOldIdUnmapped(spv::Id oldId) const { return localId(oldId) == unmapped; } - bool isOldIdUnused(spv::Id oldId) const { return localId(oldId) == unused; } - bool isOldIdMapped(spv::Id oldId) const { return !isOldIdUnused(oldId) && !isOldIdUnmapped(oldId); } - bool isFunction(spv::Id oldId) const { return fnPos.find(oldId) != fnPos.end(); } - - // bool matchType(const globaltypes_t& globalTypes, spv::Id lt, spv::Id gt) const; - // spv::Id findType(const globaltypes_t& globalTypes, spv::Id lt) const; - std::uint32_t hashType(unsigned typeStart) const; - - spirvbin_t& process(instfn_t, idfn_t, unsigned begin = 0, unsigned end = 0); - int processInstruction(unsigned word, instfn_t, idfn_t); - - void validate() const; - void mapTypeConst(); - void mapFnBodies(); - void optLoadStore(); - void dceFuncs(); - void dceVars(); - void dceTypes(); - void mapNames(); - void foldIds(); // fold IDs to smallest space - void forwardLoadStores(); // load store forwarding (EXPERIMENTAL) - void offsetIds(); // create relative offset IDs - - void applyMap(); // remap per local name map - void mapRemainder(); // map any IDs we haven't touched yet - void stripDebug(); // strip all debug info - void stripDeadRefs(); // strips debug info for now-dead references after DCE - void strip(); // remove debug symbols - - std::vector spv; // SPIR words - - std::vector stripWhiteList; - - namemap_t nameMap; // ID names from OpName - - // Since we want to also do binary ops, we can't use std::vector. we could use - // boost::dynamic_bitset, but we're trying to avoid a boost dependency. - typedef std::uint64_t bits_t; - std::vector mapped; // which new IDs have been mapped - static const int mBits = sizeof(bits_t) * 4; - - bool isMapped(spv::Id id) const { return id < maxMappedId() && ((mapped[id/mBits] & (1LL<<(id%mBits))) != 0); } - void setMapped(spv::Id id) { resizeMapped(id); mapped[id/mBits] |= (1LL<<(id%mBits)); } - void resizeMapped(spv::Id id) { if (id >= maxMappedId()) mapped.resize(id/mBits+1, 0); } - size_t maxMappedId() const { return mapped.size() * mBits; } - - // Add a strip range for a given instruction starting at 'start' - // Note: avoiding brace initializers to please older versions os MSVC. - void stripInst(unsigned start) { stripRange.push_back(range_t(start, start + asWordCount(start))); } - - // Function start and end. use unordered_map because we'll have - // many fewer functions than IDs. - std::unordered_map fnPos; - - // Which functions are called, anywhere in the module, with a call count - std::unordered_map fnCalls; - - posmap_t typeConstPos; // word positions that define types & consts (ordered) - posmap_rev_t idPosR; // reverse map from IDs to positions - typesize_map_t idTypeSizeMap; // maps each ID to its type size, if known. - - std::vector idMapL; // ID {M}ap from {L}ocal to {G}lobal IDs - - spv::Id entryPoint; // module entry point - spv::Id largestNewId; // biggest new ID we have mapped anything to - - // Sections of the binary to strip, given as [begin,end) - std::vector stripRange; - - // processing options: - std::uint32_t options; - int verbose; // verbosity level - - // Error latch: this is set if the error handler is ever executed. It would be better to - // use a try/catch block and throw, but that's not desired for certain environments, so - // this is the alternative. - mutable bool errorLatch; - - static errorfn_t errorHandler; - static logfn_t logHandler; -}; - -} // namespace SPV - -#endif // SPIRVREMAPPER_H diff --git a/src/libraries/glslang/SPIRV/SpvBuilder.cpp b/src/libraries/glslang/SPIRV/SpvBuilder.cpp index 7c7612748..254b58055 100644 --- a/src/libraries/glslang/SPIRV/SpvBuilder.cpp +++ b/src/libraries/glslang/SPIRV/SpvBuilder.cpp @@ -97,7 +97,7 @@ Id Builder::makeVoidType() module.mapInstruction(type); // Core OpTypeVoid used for debug void type if (emitNonSemanticShaderDebugInfo) - debugId[typeId] = typeId; + debugTypeIdLookup[typeId] = typeId; } else type = groupedTypes[enumCast(Op::OpTypeVoid)].back(); @@ -115,7 +115,7 @@ Id Builder::makeBoolType() if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeBoolDebugType(32); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } } else @@ -125,7 +125,7 @@ Id Builder::makeBoolType() return type->getResultId(); } -Id Builder::makeSamplerType() +Id Builder::makeSamplerType(const char* debugName) { Instruction* type; if (groupedTypes[enumCast(Op::OpTypeSampler)].size() == 0) { @@ -138,8 +138,8 @@ Id Builder::makeSamplerType() if (emitNonSemanticShaderDebugInfo) { - auto const debugResultId = makeCompositeDebugType({}, "type.sampler", NonSemanticShaderDebugInfo100Structure, true); - debugId[type->getResultId()] = debugResultId; + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -167,7 +167,7 @@ Id Builder::makePointer(StorageClass storageClass, Id pointee) if (emitNonSemanticShaderDebugInfo) { const Id debugResultId = makePointerDebugType(storageClass, pointee); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -185,11 +185,32 @@ Id Builder::makeForwardPointer(StorageClass storageClass) if (emitNonSemanticShaderDebugInfo) { const Id debugResultId = makeForwardPointerDebugType(storageClass); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); } +Id Builder::makeUntypedPointer(StorageClass storageClass, bool setBufferPointer) +{ + // try to find it + Instruction* type; + // both typeBufferEXT and UntypedPointer only contains storage class info. + spv::Op typeOp = setBufferPointer ? Op::OpTypeBufferEXT : Op::OpTypeUntypedPointerKHR; + for (int t = 0; t < (int)groupedTypes[enumCast(typeOp)].size(); ++t) { + type = groupedTypes[enumCast(typeOp)][t]; + if (type->getImmediateOperand(0) == (unsigned)storageClass) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), NoType, typeOp); + type->addImmediateOperand(storageClass); + groupedTypes[enumCast(typeOp)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + return type->getResultId(); +} + Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardPointerType, Id pointee) { // try to find it @@ -213,9 +234,9 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP // that was emitted alongside the forward pointer, now that we have a pointee debug // type for it to point to. if (emitNonSemanticShaderDebugInfo) { - Instruction *debugForwardPointer = module.getInstruction(debugId[forwardPointerType]); - assert(debugId[pointee]); - debugForwardPointer->setIdOperand(2, debugId[pointee]); + Instruction *debugForwardPointer = module.getInstruction(getDebugType(forwardPointerType)); + assert(getDebugType(pointee)); + debugForwardPointer->setIdOperand(2, getDebugType(pointee)); } return type->getResultId(); @@ -257,7 +278,7 @@ Id Builder::makeIntegerType(int width, bool hasSign) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeIntegerDebugType(width, hasSign); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -298,7 +319,7 @@ Id Builder::makeFloatType(int width) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeFloatDebugType(width); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -329,14 +350,10 @@ Id Builder::makeBFloat16Type() addExtension(spv::E_SPV_KHR_bfloat16); addCapability(Capability::BFloat16TypeKHR); -#if 0 - // XXX not supported - if (emitNonSemanticShaderDebugInfo) - { - auto const debugResultId = makeFloatDebugType(width); - debugId[type->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeFloatDebugType(16, makeUintConstant((unsigned)FPEncoding::BFloat16KHR)); + debugTypeIdLookup[type->getResultId()] = debugResultId; } -#endif return type->getResultId(); } @@ -366,14 +383,10 @@ Id Builder::makeFloatE5M2Type() addExtension(spv::E_SPV_EXT_float8); addCapability(Capability::Float8EXT); -#if 0 - // XXX not supported - if (emitNonSemanticShaderDebugInfo) - { - auto const debugResultId = makeFloatDebugType(width); - debugId[type->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeFloatDebugType(8, makeUintConstant((unsigned)FPEncoding::Float8E5M2EXT)); + debugTypeIdLookup[type->getResultId()] = debugResultId; } -#endif return type->getResultId(); } @@ -403,14 +416,10 @@ Id Builder::makeFloatE4M3Type() addExtension(spv::E_SPV_EXT_float8); addCapability(Capability::Float8EXT); -#if 0 - // XXX not supported - if (emitNonSemanticShaderDebugInfo) - { - auto const debugResultId = makeFloatDebugType(width); - debugId[type->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeFloatDebugType(8, makeUintConstant((unsigned)FPEncoding::Float8E4M3EXT)); + debugTypeIdLookup[type->getResultId()] = debugResultId; } -#endif return type->getResultId(); } @@ -419,7 +428,9 @@ Id Builder::makeFloatE4M3Type() // See makeStructResultType() for non-decorated structs // needed as the result of some instructions, which does // check for duplicates. -Id Builder::makeStructType(const std::vector& members, const char* name, bool const compilerGenerated) +// For compiler-generated structs, debug info is ignored. +Id Builder::makeStructType(const std::vector& members, const std::vector& memberDebugInfo, + const char* name, bool const compilerGenerated) { // Don't look for previous one, because in the general case, // structs can be duplicated except for decorations. @@ -433,10 +444,11 @@ Id Builder::makeStructType(const std::vector& members, const char* name, boo module.mapInstruction(type); addName(type->getResultId(), name); - if (emitNonSemanticShaderDebugInfo && !compilerGenerated) - { - auto const debugResultId = makeCompositeDebugType(members, name, NonSemanticShaderDebugInfo100Structure); - debugId[type->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) { + assert(members.size() == memberDebugInfo.size()); + auto const debugResultId = + makeCompositeDebugType(members, memberDebugInfo, name, NonSemanticShaderDebugInfoStructure); + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -463,7 +475,7 @@ Id Builder::makeStructResultType(Id type0, Id type1) members.push_back(type0); members.push_back(type1); - return makeStructType(members, "ResType"); + return makeStructType(members, {}, "ResType"); } Id Builder::makeVectorType(Id component, int size) @@ -489,7 +501,7 @@ Id Builder::makeVectorType(Id component, int size) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeVectorDebugType(component, size); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -522,7 +534,7 @@ Id Builder::makeMatrixType(Id component, int cols, int rows) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeMatrixDebugType(column, cols); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -554,41 +566,9 @@ Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id col constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); - if (emitNonSemanticShaderDebugInfo) - { - // Find a name for one of the parameters. It can either come from debuginfo for another - // type, or an OpName from a constant. - auto const findName = [&](Id id) { - Id id2 = debugId[id]; - for (auto &t : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic]) { - if (t->getResultId() == id2) { - for (auto &s : strings) { - if (s->getResultId() == t->getIdOperand(2)) { - return s->getNameString(); - } - } - } - } - for (auto &t : names) { - if (t->getIdOperand(0) == id) { - return t->getNameString(); - } - } - return "unknown"; - }; - std::string debugName = "coopmat<"; - debugName += std::string(findName(component)) + ", "; - if (isConstantScalar(scope)) { - debugName += std::string("gl_Scope") + std::string(spv::ScopeToString((spv::Scope)getConstantScalar(scope))) + ", "; - } else { - debugName += std::string(findName(scope)) + ", "; - } - debugName += std::string(findName(rows)) + ", "; - debugName += std::string(findName(cols)) + ">"; - // There's no nonsemantic debug info instruction for cooperative matrix types, - // use opaque composite instead. - auto const debugResultId = makeCompositeDebugType({}, debugName.c_str(), NonSemanticShaderDebugInfo100Structure, true); - debugId[type->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeCooperativeMatrixDebugTypeKHR(component, scope, rows, cols, use); + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -649,9 +629,34 @@ Id Builder::makeCooperativeVectorTypeNV(Id componentType, Id components) constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + auto const debugResultId = makeVectorIdDebugType(componentType, components); + debugTypeIdLookup[type->getResultId()] = debugResultId; + } + return type->getResultId(); } +Id Builder::makeTensorTypeARM(Id elementType, Id rank) +{ + // See if an OpTypeTensorARM with same element type and rank already exists. + for (int t = 0; t < (int)groupedTypes[enumCast(Op::OpTypeTensorARM)].size(); ++t) { + const Instruction *type = groupedTypes[enumCast(Op::OpTypeTensorARM)][t]; + if (type->getIdOperand(0) == elementType && type->getIdOperand(1) == rank) + return type->getResultId(); + } + + // Not found, make it. + std::unique_ptr type(new Instruction(getUniqueId(), NoType, Op::OpTypeTensorARM)); + type->addIdOperand(elementType); + type->addIdOperand(rank); + groupedTypes[enumCast(Op::OpTypeTensorARM)].push_back(type.get()); + module.mapInstruction(type.get()); + Id resultID = type->getResultId(); + constantsTypesGlobals.push_back(std::move(type)); + return resultID; +} + Id Builder::makeGenericType(spv::Op opcode, std::vector& operands) { // try to find it @@ -719,7 +724,7 @@ Id Builder::makeArrayType(Id element, Id sizeId, int stride) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeArrayDebugType(element, sizeId); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -735,7 +740,7 @@ Id Builder::makeRuntimeArray(Id element) if (emitNonSemanticShaderDebugInfo) { auto const debugResultId = makeArrayDebugType(element, makeUintConstant(0)); - debugId[type->getResultId()] = debugResultId; + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -762,12 +767,12 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) // function type is created for the wrapper function. However, nonsemantic shader debug information is disabled // while creating the HLSL wrapper. Consequently, if we encounter another void(void) function, we need to create // the associated debug function type if it hasn't been created yet. - if(emitNonSemanticShaderDebugInfo && debugId[type->getResultId()] == 0) { + if(emitNonSemanticShaderDebugInfo && getDebugType(type->getResultId()) == NoType) { assert(sourceLang == spv::SourceLanguage::HLSL); assert(getTypeClass(returnType) == Op::OpTypeVoid && paramTypes.size() == 0); - Id debugTypeId = makeDebugFunctionType(returnType, {}); - debugId[type->getResultId()] = debugTypeId; + Id id = makeDebugFunctionType(returnType, {}); + debugTypeIdLookup[type->getResultId()] = id; } return type->getResultId(); } @@ -787,7 +792,7 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) // make debug type and map it if (emitNonSemanticShaderDebugInfo) { Id debugTypeId = makeDebugFunctionType(returnType, paramTypes); - debugId[typeId] = debugTypeId; + debugTypeIdLookup[typeId] = debugTypeId; } return type->getResultId(); @@ -795,21 +800,21 @@ Id Builder::makeFunctionType(Id returnType, const std::vector& paramTypes) Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTypes) { - assert(debugId[returnType] != 0); + assert(getDebugType(returnType) != NoType); Id typeId = getUniqueId(); auto type = new Instruction(typeId, makeVoidType(), Op::OpExtInst); type->reserveOperands(paramTypes.size() + 4); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeFunction); - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); - type->addIdOperand(debugId[returnType]); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeFunction); + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsPublic)); + type->addIdOperand(getDebugType(returnType)); for (auto const paramType : paramTypes) { if (isPointerType(paramType) || isArrayType(paramType)) { - type->addIdOperand(debugId[getContainedTypeId(paramType)]); + type->addIdOperand(getDebugType(getContainedTypeId(paramType))); } else { - type->addIdOperand(debugId[paramType]); + type->addIdOperand(getDebugType(paramType)); } } constantsTypesGlobals.push_back(std::unique_ptr(type)); @@ -818,7 +823,7 @@ Id Builder::makeDebugFunctionType(Id returnType, const std::vector& paramTyp } Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled, - ImageFormat format) + ImageFormat format, const char* debugName) { assert(sampled == 1 || sampled == 2); @@ -899,24 +904,14 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo if (emitNonSemanticShaderDebugInfo) { - auto TypeName = [&dim]() -> char const* { - switch (dim) { - case Dim::Dim1D: return "type.1d.image"; - case Dim::Dim2D: return "type.2d.image"; - case Dim::Dim3D: return "type.3d.image"; - case Dim::Cube: return "type.cube.image"; - default: return "type.image"; - } - }; - - auto const debugResultId = makeCompositeDebugType({}, TypeName(), NonSemanticShaderDebugInfo100Class, true); - debugId[type->getResultId()] = debugResultId; + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); } -Id Builder::makeSampledImageType(Id imageType) +Id Builder::makeSampledImageType(Id imageType, const char* debugName) { // try to find it Instruction* type; @@ -936,8 +931,8 @@ Id Builder::makeSampledImageType(Id imageType) if (emitNonSemanticShaderDebugInfo) { - auto const debugResultId = makeCompositeDebugType({}, "type.sampled.image", NonSemanticShaderDebugInfo100Class, true); - debugId[type->getResultId()] = debugResultId; + auto const debugResultId = makeOpaqueDebugType(debugName); + debugTypeIdLookup[type->getResultId()] = debugResultId; } return type->getResultId(); @@ -951,7 +946,7 @@ Id Builder::makeDebugInfoNone() Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(2); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugInfoNone); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugInfoNone); constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); @@ -965,25 +960,25 @@ Id Builder::makeBoolDebugType(int const size) { // try to find it Instruction* type; - for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { - type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic][t]; if (type->getIdOperand(0) == getStringId("bool") && type->getIdOperand(1) == static_cast(size) && - type->getIdOperand(2) == NonSemanticShaderDebugInfo100Boolean) + type->getIdOperand(2) == NonSemanticShaderDebugInfoBoolean) return type->getResultId(); } type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(6); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeBasic); type->addIdOperand(getStringId("bool")); // name id type->addIdOperand(makeUintConstant(size)); // size id - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Boolean)); // encoding id - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoBoolean)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoNone)); // flags id - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); @@ -1002,11 +997,11 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) auto nameId = getStringId(typeName); // try to find it Instruction* type; - for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { - type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic][t]; if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast(width) && - type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned)) + type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfoSigned : NonSemanticShaderDebugInfoUnsigned)) return type->getResultId(); } @@ -1014,63 +1009,88 @@ Id Builder::makeIntegerDebugType(int const width, bool const hasSign) type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(6); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeBasic); type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id if(hasSign == true) { - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoSigned)); // encoding id } else { - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Unsigned)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoUnsigned)); // encoding id } - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoNone)); // flags id - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); } -Id Builder::makeFloatDebugType(int const width) +Id Builder::makeFloatDebugType(int const width, Id const fpEncoding) { + if (fpEncoding != NoType) + requireNonSemanticShaderDebugInfoVersion(101); + // Determine the debug type name. FP-encoded variants have distinct names. + // Id comparison works here because makeUintConstant deduplicates: two calls + // with the same value return the same Id. const char* typeName = nullptr; - switch (width) { - case 16: typeName = "float16_t"; break; - case 64: typeName = "double"; break; - default: typeName = "float"; break; + if (fpEncoding != NoType) { + if (fpEncoding == makeUintConstant((unsigned)FPEncoding::BFloat16KHR)) + typeName = "bfloat16_t"; + else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float8E4M3EXT)) + typeName = "floate4m3_t"; + else if (fpEncoding == makeUintConstant((unsigned)FPEncoding::Float8E5M2EXT)) + typeName = "floate5m2_t"; + else + typeName = "float"; + } else { + switch (width) { + case 16: typeName = "float16_t"; break; + case 64: typeName = "double"; break; + default: typeName = "float"; break; + } } auto nameId = getStringId(typeName); // try to find it Instruction* type; - for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) { - type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t]; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic][t]; if (type->getIdOperand(0) == nameId && type->getIdOperand(1) == static_cast(width) && - type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float) - return type->getResultId(); + type->getIdOperand(2) == NonSemanticShaderDebugInfoFloat) { + if (fpEncoding == NoType) { + if (type->getNumOperands() == 6) + return type->getResultId(); + } else { + if (type->getNumOperands() == 7 && type->getIdOperand(6) == fpEncoding) + return type->getResultId(); + } + } } // not found, make it type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); - type->reserveOperands(6); + type->reserveOperands(fpEncoding == NoType ? 6 : 7); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeBasic); type->addIdOperand(nameId); // name id type->addIdOperand(makeUintConstant(width)); // size id - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFloat)); // encoding id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoNone)); // flags id + if (fpEncoding != NoType) + type->addIdOperand(fpEncoding); // optional FPEncoding id (NSDI.101) - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeBasic].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); } -Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType) +Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfoInstructions const sequenceType) { - assert(sequenceType == NonSemanticShaderDebugInfo100DebugTypeArray || - sequenceType == NonSemanticShaderDebugInfo100DebugTypeVector); + assert(sequenceType == NonSemanticShaderDebugInfoDebugTypeArray || + sequenceType == NonSemanticShaderDebugInfoDebugTypeVector); // try to find it Instruction* type; @@ -1086,7 +1106,7 @@ Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, type->reserveOperands(4); type->addIdOperand(nonSemanticShaderDebugInfo); type->addImmediateOperand(sequenceType); - type->addIdOperand(debugId[baseType]); // base type + type->addIdOperand(getDebugType(baseType)); // base type type->addIdOperand(componentCount); // component count groupedDebugTypes[sequenceType].push_back(type); @@ -1098,20 +1118,20 @@ Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount) { - return makeSequentialDebugType(baseType, componentCount, NonSemanticShaderDebugInfo100DebugTypeArray); + return makeSequentialDebugType(baseType, componentCount, NonSemanticShaderDebugInfoDebugTypeArray); } Id Builder::makeVectorDebugType(Id const baseType, int const componentCount) { - return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector); + return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfoDebugTypeVector); } Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor) { // try to find it Instruction* type; - for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].size(); ++t) { - type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix][t]; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeMatrix].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeMatrix][t]; if (type->getIdOperand(0) == vectorType && type->getIdOperand(1) == makeUintConstant(vectorCount)) return type->getResultId(); @@ -1121,87 +1141,168 @@ Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(5); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMatrix); - type->addIdOperand(debugId[vectorType]); // vector type id + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeMatrix); + type->addIdOperand(getDebugType(vectorType)); // vector type id type->addIdOperand(makeUintConstant(vectorCount)); // component count id type->addIdOperand(makeBoolConstant(columnMajor)); // column-major id - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeMatrix].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); } -Id Builder::makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc) +// DebugTypeVectorIdEXT (NSDI.101 opcode 109): describes OpTypeVectorIdEXT and +// OpTypeCooperativeVectorNV types whose component count is a SPIR-V Id (not a +// literal), including specialization-constant component counts. +Id Builder::makeVectorIdDebugType(Id const componentType, Id const componentCount) { - assert(debugId[memberType] != 0); + requireNonSemanticShaderDebugInfoVersion(101); + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeVectorIdEXT].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeVectorIdEXT][t]; + if (type->getIdOperand(2) == getDebugType(componentType) && + type->getIdOperand(3) == componentCount) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(4); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeVectorIdEXT); + type->addIdOperand(getDebugType(componentType)); // component debug type + type->addIdOperand(componentCount); // component count (constant instruction Id) + + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeVectorIdEXT].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// DebugTypeCooperativeMatrixKHR (NSDI.101 opcode 110): describes +// OpTypeCooperativeMatrixKHR types. +Id Builder::makeCooperativeMatrixDebugTypeKHR(Id const componentType, Id const scope, + Id const rows, Id const cols, Id const use) +{ + requireNonSemanticShaderDebugInfoVersion(101); + // try to find it + Instruction* type; + for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR].size(); ++t) { + type = groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR][t]; + if (type->getIdOperand(2) == getDebugType(componentType) && + type->getIdOperand(3) == scope && + type->getIdOperand(4) == rows && + type->getIdOperand(5) == cols && + type->getIdOperand(6) == use) + return type->getResultId(); + } + + // not found, make it + type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(7); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR); + type->addIdOperand(getDebugType(componentType)); // component debug type + type->addIdOperand(scope); // scope + type->addIdOperand(rows); // rows + type->addIdOperand(cols); // columns + type->addIdOperand(use); // use (MatrixA, MatrixB, Accumulator) + + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +Id Builder::makeMemberDebugType(Id const memberType, StructMemberDebugInfo const& debugTypeLoc) +{ + assert(getDebugType(memberType) != NoType); Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(10); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMember); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeMember); type->addIdOperand(getStringId(debugTypeLoc.name)); // name id - type->addIdOperand(debugId[memberType]); // type id - type->addIdOperand(makeDebugSource(currentFileId)); // source id - type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero + type->addIdOperand(debugTypeLoc.debugTypeOverride != 0 ? debugTypeLoc.debugTypeOverride + : getDebugType(memberType)); // type id + type->addIdOperand(makeDebugSource(currentFileId)); // source id + type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero type->addIdOperand(makeUintConstant(debugTypeLoc.column)); // TODO: column id - type->addIdOperand(makeUintConstant(0)); // TODO: offset id - type->addIdOperand(makeUintConstant(0)); // TODO: size id - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id + type->addIdOperand(makeUintConstant(0)); // TODO: offset id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsPublic)); // flags id - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMember].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeMember].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return type->getResultId(); } -// Note: To represent a source language opaque type, this instruction must have no Members operands, Size operand must be -// DebugInfoNone, and Name must start with @ to avoid clashes with user defined names. -Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char const*const name, - NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType) +Id Builder::makeCompositeDebugType(std::vector const& memberTypes, std::vector const& memberDebugInfo, + char const* const name, NonSemanticShaderDebugInfoDebugCompositeType const tag) { // Create the debug member types. std::vector memberDebugTypes; - for(auto const memberType : memberTypes) { - assert(debugTypeLocs.find(memberType) != debugTypeLocs.end()); - - // There _should_ be debug types for all the member types but currently buffer references - // do not have member debug info generated. - if (debugId[memberType]) - memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType])); - - // TODO: Need to rethink this method of passing location information. - // debugTypeLocs.erase(memberType); + assert(memberTypes.size() == memberDebugInfo.size()); + for (size_t i = 0; i < memberTypes.size(); i++) { + if (getDebugType(memberTypes[i]) != NoType) { + memberDebugTypes.emplace_back(makeMemberDebugType(memberTypes[i], memberDebugInfo[i])); + } } // Create The structure debug type. Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(memberDebugTypes.size() + 11); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeComposite); type->addIdOperand(getStringId(name)); // name id type->addIdOperand(makeUintConstant(tag)); // tag id type->addIdOperand(makeDebugSource(currentFileId)); // source id type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? type->addIdOperand(makeUintConstant(0)); // TODO: column id type->addIdOperand(makeDebugCompilationUnit()); // scope id - if(isOpaqueType == true) { - // Prepend '@' to opaque types. - type->addIdOperand(getStringId('@' + std::string(name))); // linkage name id - type->addIdOperand(makeDebugInfoNone()); // size id - } else { - type->addIdOperand(getStringId(name)); // linkage name id - type->addIdOperand(makeUintConstant(0)); // TODO: size id - } - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id - assert(isOpaqueType == false || (isOpaqueType == true && memberDebugTypes.empty())); + type->addIdOperand(getStringId(name)); // linkage name id + type->addIdOperand(makeUintConstant(0)); // TODO: size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsPublic)); // flags id for(auto const memberDebugType : memberDebugTypes) { type->addIdOperand(memberDebugType); } - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeComposite].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeComposite].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + + return type->getResultId(); +} + +// The NonSemantic Shader Debug Info doesn't really have a dedicated opcode for opaque types. Instead, we use DebugTypeComposite. +// To represent a source language opaque type, this instruction must have no Members operands, Size operand must be +// DebugInfoNone, and Name must start with @ to avoid clashes with user defined names. +Id Builder::makeOpaqueDebugType(char const* const name) +{ + // Create The structure debug type. + Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); + type->reserveOperands(11); + type->addIdOperand(nonSemanticShaderDebugInfo); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypeComposite); + type->addIdOperand(getStringId(name)); // name id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoStructure)); // tag id + type->addIdOperand(makeDebugSource(currentFileId)); // source id + type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero? + type->addIdOperand(makeUintConstant(0)); // TODO: column id + type->addIdOperand(makeDebugCompilationUnit()); // scope id + // Prepend '@' to opaque types. + type->addIdOperand(getStringId('@' + std::string(name))); // linkage name id + type->addIdOperand(makeDebugInfoNone()); // size id + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsPublic)); // flags id + + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypeComposite].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); @@ -1210,12 +1311,12 @@ Id Builder::makeCompositeDebugType(std::vector const& memberTypes, char cons Id Builder::makePointerDebugType(StorageClass storageClass, Id const baseType) { - const Id debugBaseType = debugId[baseType]; + const Id debugBaseType = getDebugType(baseType); if (!debugBaseType) { return makeDebugInfoNone(); } const Id scID = makeUintConstant(storageClass); - for (Instruction* otherType : groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer]) { + for (Instruction* otherType : groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypePointer]) { if (otherType->getIdOperand(2) == debugBaseType && otherType->getIdOperand(3) == scID) { return otherType->getResultId(); @@ -1225,12 +1326,12 @@ Id Builder::makePointerDebugType(StorageClass storageClass, Id const baseType) Instruction* type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); type->reserveOperands(5); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypePointer); type->addIdOperand(debugBaseType); type->addIdOperand(scID); type->addIdOperand(makeUintConstant(0)); - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypePointer].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); @@ -1248,12 +1349,12 @@ Id Builder::makeForwardPointerDebugType(StorageClass storageClass) Instruction *type = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInstWithForwardRefsKHR); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypePointer); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugTypePointer); type->addIdOperand(type->getResultId()); type->addIdOperand(scID); type->addIdOperand(makeUintConstant(0)); - groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypePointer].push_back(type); + groupedDebugTypes[NonSemanticShaderDebugInfoDebugTypePointer].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); @@ -1267,7 +1368,7 @@ Id Builder::makeDebugSource(const Id fileName) { Instruction* sourceInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); sourceInst->reserveOperands(3); sourceInst->addIdOperand(nonSemanticShaderDebugInfo); - sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSource); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugSource); sourceInst->addIdOperand(fileName); constantsTypesGlobals.push_back(std::unique_ptr(sourceInst)); module.mapInstruction(sourceInst); @@ -1289,7 +1390,7 @@ Id Builder::makeDebugSource(const Id fileName) { Instruction* sourceContinuedInst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); sourceContinuedInst->reserveOperands(2); sourceContinuedInst->addIdOperand(nonSemanticShaderDebugInfo); - sourceContinuedInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSourceContinued); + sourceContinuedInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugSourceContinued); sourceContinuedInst->addIdOperand(sourceId); constantsTypesGlobals.push_back(std::unique_ptr(sourceContinuedInst)); module.mapInstruction(sourceContinuedInst); @@ -1323,7 +1424,7 @@ Id Builder::makeDebugCompilationUnit() { Instruction* sourceInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); sourceInst->reserveOperands(6); sourceInst->addIdOperand(nonSemanticShaderDebugInfo); - sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugCompilationUnit); + sourceInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugCompilationUnit); sourceInst->addIdOperand(makeUintConstant(1)); // TODO(greg-lunarg): Get rid of magic number sourceInst->addIdOperand(makeUintConstant(4)); // TODO(greg-lunarg): Get rid of magic number sourceInst->addIdOperand(makeDebugSource(mainFileId)); @@ -1332,6 +1433,14 @@ Id Builder::makeDebugCompilationUnit() { module.mapInstruction(sourceInst); nonSemanticShaderCompilationUnitId = resultId; + // In the case of non-semantic shader debug info, preserve source text for every include + // even if no debug scope or line record ends up referencing that file. + if (emitNonSemanticShaderDebugSource) { + for (const auto& includeFile : includeFiles) { + makeDebugSource(includeFile.first); + } + } + // We can reasonably assume that makeDebugCompilationUnit will be called before any of // debug-scope stack. Function scopes and lexical scopes will occur afterward. assert(currentDebugScopeId.empty()); @@ -1347,7 +1456,7 @@ Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id c Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(11); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugGlobalVariable); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugGlobalVariable); inst->addIdOperand(getStringId(name)); // name id inst->addIdOperand(type); // type id inst->addIdOperand(makeDebugSource(currentFileId)); // source id @@ -1356,7 +1465,7 @@ Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id c inst->addIdOperand(makeDebugCompilationUnit()); // scope id inst->addIdOperand(getStringId(name)); // linkage name id inst->addIdOperand(variable); // variable id - inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsDefinition)); // flags id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsDefinition)); // flags id constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); @@ -1372,16 +1481,16 @@ Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t cons Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(9); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugLocalVariable); inst->addIdOperand(getStringId(name)); // name id inst->addIdOperand(type); // type id inst->addIdOperand(makeDebugSource(currentFileId)); // source id inst->addIdOperand(makeUintConstant(currentLine)); // line id inst->addIdOperand(makeUintConstant(0)); // TODO: column id inst->addIdOperand(currentDebugScopeId.top()); // scope id - inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsLocal)); // flags id + inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsLocal)); // flags id if(argNumber != 0) { - inst->addIdOperand(makeUintConstant(argNumber)); + inst->addIdOperand(makeUintConstant(static_cast(argNumber))); } constantsTypesGlobals.push_back(std::unique_ptr(inst)); @@ -1398,7 +1507,7 @@ Id Builder::makeDebugExpression() Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(2); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugExpression); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugExpression); constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); @@ -1413,7 +1522,7 @@ Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const pointer) Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(5); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugDeclare); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugDeclare); inst->addIdOperand(debugLocalVariable); // debug local variable id inst->addIdOperand(pointer); // pointer to local variable id inst->addIdOperand(makeDebugExpression()); // expression id @@ -1427,7 +1536,7 @@ Id Builder::makeDebugValue(Id const debugLocalVariable, Id const value) Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), Op::OpExtInst); inst->reserveOperands(5); inst->addIdOperand(nonSemanticShaderDebugInfo); - inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugValue); + inst->addImmediateOperand(NonSemanticShaderDebugInfoDebugValue); inst->addIdOperand(debugLocalVariable); // debug local variable id inst->addIdOperand(value); // value of local variable id inst->addIdOperand(makeDebugExpression()); // expression id @@ -1445,8 +1554,8 @@ Id Builder::makeAccelerationStructureType() constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); if (emitNonSemanticShaderDebugInfo) { - spv::Id debugType = makeCompositeDebugType({}, "accelerationStructure", NonSemanticShaderDebugInfo100Structure, true); - debugId[type->getResultId()] = debugType; + spv::Id debugType = makeOpaqueDebugType("accelerationStructure"); + debugTypeIdLookup[type->getResultId()] = debugType; } } else { type = groupedTypes[enumCast(Op::OpTypeAccelerationStructureKHR)].back(); @@ -1464,8 +1573,8 @@ Id Builder::makeRayQueryType() constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); if (emitNonSemanticShaderDebugInfo) { - spv::Id debugType = makeCompositeDebugType({}, "rayQuery", NonSemanticShaderDebugInfo100Structure, true); - debugId[type->getResultId()] = debugType; + spv::Id debugType = makeOpaqueDebugType("rayQuery"); + debugTypeIdLookup[type->getResultId()] = debugType; } } else { type = groupedTypes[enumCast(Op::OpTypeRayQueryKHR)].back(); @@ -1474,6 +1583,20 @@ Id Builder::makeRayQueryType() return type->getResultId(); } +Id Builder::makeHitObjectEXTType() +{ + Instruction *type; + if (groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].size() == 0) { + type = new Instruction(getUniqueId(), NoType, Op::OpTypeHitObjectEXT); + groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].push_back(type); + constantsTypesGlobals.push_back(std::unique_ptr(type)); + module.mapInstruction(type); + } else { + type = groupedTypes[enumCast(Op::OpTypeHitObjectEXT)].back(); + } + + return type->getResultId(); +} Id Builder::makeHitObjectNVType() { Instruction *type; @@ -1482,6 +1605,10 @@ Id Builder::makeHitObjectNVType() groupedTypes[enumCast(Op::OpTypeHitObjectNV)].push_back(type); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); + if (emitNonSemanticShaderDebugInfo) { + spv::Id debugType = makeOpaqueDebugType("hitObjectNV"); + debugTypeIdLookup[type->getResultId()] = debugType; + } } else { type = groupedTypes[enumCast(Op::OpTypeHitObjectNV)].back(); } @@ -1688,32 +1815,17 @@ bool Builder::containsPhysicalStorageBufferOrArray(Id typeId) const // can be reused rather than duplicated. (Required by the specification). Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) { - Instruction* constant; - for (int i = 0; i < (int)groupedConstants[enumCast(typeClass)].size(); ++i) { - constant = groupedConstants[enumCast(typeClass)][i]; - if (constant->getOpCode() == opcode && - constant->getTypeId() == typeId && - constant->getImmediateOperand(0) == value) - return constant->getResultId(); - } - - return 0; + ScalarConstantKey key{ enumCast(typeClass), enumCast(opcode), typeId, value, 0 }; + auto it = groupedScalarConstantResultIDs.find(key); + return (it != groupedScalarConstantResultIDs.end()) ? it->second : 0; } // Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64'). Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) { - Instruction* constant; - for (int i = 0; i < (int)groupedConstants[enumCast(typeClass)].size(); ++i) { - constant = groupedConstants[enumCast(typeClass)][i]; - if (constant->getOpCode() == opcode && - constant->getTypeId() == typeId && - constant->getImmediateOperand(0) == v1 && - constant->getImmediateOperand(1) == v2) - return constant->getResultId(); - } - - return 0; + ScalarConstantKey key{ enumCast(typeClass), enumCast(opcode), typeId, v1, v2 }; + auto it = groupedScalarConstantResultIDs.find(key); + return (it != groupedScalarConstantResultIDs.end()) ? it->second : 0; } // Return true if consuming 'opcode' means consuming a constant. @@ -1726,6 +1838,7 @@ bool Builder::isConstantOpCode(Op opcode) const case Op::OpConstantTrue: case Op::OpConstantFalse: case Op::OpConstant: + case Op::OpConstantDataKHR: case Op::OpConstantComposite: case Op::OpConstantCompositeReplicateEXT: case Op::OpConstantSampler: @@ -1735,7 +1848,9 @@ bool Builder::isConstantOpCode(Op opcode) const case Op::OpSpecConstant: case Op::OpSpecConstantComposite: case Op::OpSpecConstantCompositeReplicateEXT: + case Op::OpSpecConstantDataKHR: case Op::OpSpecConstantOp: + case Op::OpConstantSizeOfEXT: return true; default: return false; @@ -1750,6 +1865,7 @@ bool Builder::isSpecConstantOpCode(Op opcode) const case Op::OpSpecConstantFalse: case Op::OpSpecConstant: case Op::OpSpecConstantComposite: + case Op::OpSpecConstantDataKHR: case Op::OpSpecConstantOp: case Op::OpSpecConstantCompositeReplicateEXT: return true; @@ -1785,19 +1901,12 @@ Id Builder::makeNullConstant(Id typeId) Id Builder::makeBoolConstant(bool b, bool specConstant) { Id typeId = makeBoolType(); - Instruction* constant; Op opcode = specConstant ? (b ? Op::OpSpecConstantTrue : Op::OpSpecConstantFalse) : (b ? Op::OpConstantTrue : Op::OpConstantFalse); // See if we already made it. Applies only to regular constants, because specialization constants // must remain distinct for the purpose of applying a SpecId decoration. - if (! specConstant) { - Id existing = 0; - for (int i = 0; i < (int)groupedConstants[enumCast(Op::OpTypeBool)].size(); ++i) { - constant = groupedConstants[enumCast(Op::OpTypeBool)][i]; - if (constant->getTypeId() == typeId && constant->getOpCode() == opcode) - existing = constant->getResultId(); - } - + if (!specConstant) { + Id existing = findScalarConstant(Op::OpTypeBool, opcode, typeId, 0); if (existing) return existing; } @@ -1805,10 +1914,14 @@ Id Builder::makeBoolConstant(bool b, bool specConstant) // Make it Instruction* c = new Instruction(getUniqueId(), typeId, opcode); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeBool)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeBool), enumCast(opcode), typeId, 0, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) @@ -1826,10 +1939,14 @@ Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeInt)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeInt), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specConstant) @@ -1852,10 +1969,14 @@ Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specCons c->addImmediateOperand(op1); c->addImmediateOperand(op2); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeInt)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeInt), enumCast(opcode), typeId, op1, op2 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeFloatConstant(float f, bool specConstant) @@ -1877,10 +1998,14 @@ Id Builder::makeFloatConstant(float f, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeDoubleConstant(double d, bool specConstant) @@ -1906,10 +2031,14 @@ Id Builder::makeDoubleConstant(double d, bool specConstant) c->addImmediateOperand(op1); c->addImmediateOperand(op2); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, op1, op2 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeFloat16Constant(float f16, bool specConstant) @@ -1934,10 +2063,14 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeBFloat16Constant(float bf16, bool specConstant) @@ -1965,10 +2098,14 @@ Id Builder::makeBFloat16Constant(float bf16, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{ enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0 }; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant) @@ -1993,10 +2130,14 @@ Id Builder::makeFloatE5M2Constant(float fe5m2, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeFloatE4M3Constant(float fe4m3, bool specConstant) @@ -2021,10 +2162,14 @@ Id Builder::makeFloatE4M3Constant(float fe4m3, bool specConstant) Instruction* c = new Instruction(getUniqueId(), typeId, opcode); c->addImmediateOperand(value); constantsTypesGlobals.push_back(std::unique_ptr(c)); - groupedConstants[enumCast(Op::OpTypeFloat)].push_back(c); module.mapInstruction(c); - return c->getResultId(); + Id resultId = c->getResultId(); + if (!specConstant) { + ScalarConstantKey key{enumCast(Op::OpTypeFloat), enumCast(opcode), typeId, value, 0}; + groupedScalarConstantResultIDs[key] = resultId; + } + return resultId; } Id Builder::makeFpConstant(Id type, double d, bool specConstant) @@ -2055,18 +2200,41 @@ Id Builder::importNonSemanticShaderDebugInfoInstructions() if(nonSemanticShaderDebugInfo == 0) { this->addExtension(spv::E_SPV_KHR_non_semantic_info); - nonSemanticShaderDebugInfo = this->import("NonSemantic.Shader.DebugInfo.100"); + // Create the import instruction directly so we can save a pointer for later + // patching by requireNonSemanticShaderDebugInfoVersion(). + std::string importName = "NonSemantic.Shader.DebugInfo." + std::to_string(nonSemanticShaderDebugInfoVersion); + auto* importInst = new Instruction(getUniqueId(), NoType, Op::OpExtInstImport); + importInst->addStringOperand(importName.c_str()); + module.mapInstruction(importInst); + imports.push_back(std::unique_ptr(importInst)); + nonSemanticShaderDebugInfo = importInst->getResultId(); + nonSemanticShaderDebugInfoImportInst = importInst; } return nonSemanticShaderDebugInfo; } +void Builder::requireNonSemanticShaderDebugInfoVersion(unsigned version) +{ + if (nonSemanticShaderDebugInfoVersion >= version) + return; + nonSemanticShaderDebugInfoVersion = version; + if (nonSemanticShaderDebugInfoImportInst != nullptr) { + // The import instruction was already emitted with an older version string. + // Rebuild the string operands in place so all referencing OpExtInst instructions + // automatically pick up the new name without needing new IDs. + std::string importName = "NonSemantic.Shader.DebugInfo." + std::to_string(version); + nonSemanticShaderDebugInfoImportInst->clearOperands(); + nonSemanticShaderDebugInfoImportInst->addStringOperand(importName.c_str()); + } +} + Id Builder::findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector& comps, size_t numMembers) { Instruction* constant = nullptr; bool found = false; - for (int i = 0; i < (int)groupedConstants[enumCast(typeClass)].size(); ++i) { - constant = groupedConstants[enumCast(typeClass)][i]; + for (int i = 0; i < (int)groupedCompositeConstants[enumCast(typeClass)].size(); ++i) { + constant = groupedCompositeConstants[enumCast(typeClass)][i]; if (constant->getTypeId() != typeId) continue; @@ -2176,7 +2344,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector& members, boo if (typeClass == Op::OpTypeStruct) groupedStructConstants[typeId].push_back(c); else - groupedConstants[enumCast(typeClass)].push_back(c); + groupedCompositeConstants[enumCast(typeClass)].push_back(c); module.mapInstruction(c); return c->getResultId(); @@ -2369,6 +2537,23 @@ void Builder::addDecorationId(Id id, Decoration decoration, const std::vector(dec)); } +void Builder::addMemberDecorationIdEXT(Id id, unsigned int member, Decoration decoration, + const std::vector& operands) +{ + if (decoration == spv::Decoration::Max) + return; + + Instruction* dec = new Instruction(Op::OpMemberDecorateIdEXT); + dec->reserveOperands(operands.size() + 3); + dec->addIdOperand(id); + dec->addImmediateOperand(member); + dec->addImmediateOperand(decoration); + for (auto operand : operands) + dec->addIdOperand(operand); + + decorations.insert(std::unique_ptr(dec)); +} + void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decoration, int num) { if (decoration == spv::Decoration::Max) @@ -2445,7 +2630,7 @@ void Builder::addInstruction(std::unique_ptr inst) { auto scopeInst = std::make_unique(getUniqueId(), makeVoidType(), Op::OpExtInst); scopeInst->reserveOperands(3); scopeInst->addIdOperand(nonSemanticShaderDebugInfo); - scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope); + scopeInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugScope); scopeInst->addIdOperand(currentDebugScopeId.top()); buildPoint->addInstruction(std::move(scopeInst)); } @@ -2468,7 +2653,7 @@ void Builder::addInstruction(std::unique_ptr inst) { auto lineInst = std::make_unique(getUniqueId(), makeVoidType(), Op::OpExtInst); lineInst->reserveOperands(7); lineInst->addIdOperand(nonSemanticShaderDebugInfo); - lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine); + lineInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugLine); lineInst->addIdOperand(makeDebugSource(currentFileId)); lineInst->addIdOperand(makeUintConstant(currentLine)); lineInst->addIdOperand(makeUintConstant(currentLine)); @@ -2557,14 +2742,14 @@ void Builder::setupFunctionDebugInfo(Function* function, const char* name, const Id nameId = getStringId(unmangleFunctionName(name)); Id funcTypeId = function->getFuncTypeId(); - assert(debugId[funcTypeId] != 0); + assert(getDebugType(funcTypeId) != NoType); Id funcId = function->getId(); assert(funcId != 0); // Make the debug function instruction Id debugFuncId = makeDebugFunction(function, nameId, funcTypeId); - debugId[funcId] = debugFuncId; + debugFuncIdLookup[funcId] = debugFuncId; currentDebugScopeId.push(debugFuncId); // DebugScope and DebugLine for parameter DebugDeclares @@ -2583,9 +2768,8 @@ void Builder::setupFunctionDebugInfo(Function* function, const char* name, const } auto const& paramName = paramNames[p]; - auto const debugLocalVariableId = createDebugLocalVariable(debugId[paramTypeId], paramName, p + 1); + auto const debugLocalVariableId = createDebugLocalVariable(getDebugType(paramTypeId), paramName, p + 1); auto const paramId = static_cast(firstParamId + p); - debugId[paramId] = debugLocalVariableId; if (passByRef) { makeDebugDeclare(debugLocalVariableId, paramId); @@ -2605,22 +2789,22 @@ Id Builder::makeDebugFunction([[maybe_unused]] Function* function, Id nameId, Id assert(function != nullptr); assert(nameId != 0); assert(funcTypeId != 0); - assert(debugId[funcTypeId] != 0); + assert(getDebugType(funcTypeId) != NoType); Id funcId = getUniqueId(); auto type = new Instruction(funcId, makeVoidType(), Op::OpExtInst); type->reserveOperands(11); type->addIdOperand(nonSemanticShaderDebugInfo); - type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunction); + type->addImmediateOperand(NonSemanticShaderDebugInfoDebugFunction); type->addIdOperand(nameId); - type->addIdOperand(debugId[funcTypeId]); + type->addIdOperand(getDebugType(funcTypeId)); type->addIdOperand(makeDebugSource(currentFileId)); // TODO: This points to file of definition instead of declaration type->addIdOperand(makeUintConstant(currentLine)); // TODO: This points to line of definition instead of declaration type->addIdOperand(makeUintConstant(0)); // column type->addIdOperand(makeDebugCompilationUnit()); // scope type->addIdOperand(nameId); // linkage name - type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); - type->addIdOperand(makeUintConstant(currentLine)); + type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfoFlagIsPublic)); + type->addIdOperand(makeUintConstant(currentLine)); constantsTypesGlobals.push_back(std::unique_ptr(type)); module.mapInstruction(type); return funcId; @@ -2633,7 +2817,7 @@ Id Builder::makeDebugLexicalBlock(uint32_t line, uint32_t column) { auto lex = new Instruction(lexId, makeVoidType(), Op::OpExtInst); lex->reserveOperands(6); lex->addIdOperand(nonSemanticShaderDebugInfo); - lex->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLexicalBlock); + lex->addImmediateOperand(NonSemanticShaderDebugInfoDebugLexicalBlock); lex->addIdOperand(makeDebugSource(currentFileId)); lex->addIdOperand(makeUintConstant(line)); lex->addIdOperand(makeUintConstant(column)); // column @@ -2696,6 +2880,8 @@ void Builder::leaveLexicalBlock() // Comments in header void Builder::enterFunction(Function const* function) { + currentFunction = function; + // Save and disable debugInfo for HLSL entry point function. It is a wrapper // function with no user code in it. restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo; @@ -2706,14 +2892,15 @@ void Builder::enterFunction(Function const* function) if (emitNonSemanticShaderDebugInfo) { // Initialize scope state Id funcId = function->getFuncId(); - currentDebugScopeId.push(debugId[funcId]); + Id debugFuncId = getDebugFunction(funcId); + currentDebugScopeId.push(debugFuncId); // Create DebugFunctionDefinition spv::Id resultId = getUniqueId(); Instruction* defInst = new Instruction(resultId, makeVoidType(), Op::OpExtInst); defInst->reserveOperands(4); defInst->addIdOperand(nonSemanticShaderDebugInfo); - defInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunctionDefinition); - defInst->addIdOperand(debugId[funcId]); + defInst->addImmediateOperand(NonSemanticShaderDebugInfoDebugFunctionDefinition); + defInst->addIdOperand(debugFuncId); defInst->addIdOperand(funcId); addInstruction(std::unique_ptr(defInst)); } @@ -2746,6 +2933,9 @@ void Builder::leaveFunction() currentDebugScopeId.pop(); emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo; + + // Clear current function record + currentFunction = nullptr; } // Comments in header @@ -2765,6 +2955,52 @@ void Builder::makeStatementTerminator(spv::Op opcode, const std::vector& ope createAndSetNoPredecessorBlock(name); } +void Builder::createConstVariable(Id type, const char* name, Id constant, bool isGlobal) +{ + if (emitNonSemanticShaderDebugInfo) { + Id debugType = getDebugType(type); + if (isGlobal) { + createDebugGlobalVariable(debugType, name, constant); + } + else { + auto debugLocal = createDebugLocalVariable(debugType, name); + makeDebugValue(debugLocal, constant); + } + } +} + +// Comments in header +Id Builder::createUntypedVariable(Decoration precision, StorageClass storageClass, const char* name, Id dataType, + Id initializer) +{ + Id resultUntypedPointerType = makeUntypedPointer(storageClass); + Instruction* inst = new Instruction(getUniqueId(), resultUntypedPointerType, Op::OpUntypedVariableKHR); + inst->addImmediateOperand(storageClass); + if (dataType != NoResult) { + Id dataPointerType = makePointer(storageClass, dataType); + inst->addIdOperand(dataPointerType); + } + if (initializer != NoResult) + inst->addIdOperand(initializer); + + switch (storageClass) { + case StorageClass::Function: + // Validation rules require the declaration in the entry block + buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); + break; + default: + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + break; + } + + if (name) + addName(inst->getResultId(), name); + setPrecision(inst->getResultId(), precision); + + return inst->getResultId(); +} + // Comments in header Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer, bool const compilerGenerated) @@ -2775,31 +3011,27 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t if (initializer != NoResult) inst->addIdOperand(initializer); - switch (storageClass) { - case StorageClass::Function: + if (storageClass == StorageClass::Function) { // Validation rules require the declaration in the entry block buildPoint->getParent().addLocalVariable(std::unique_ptr(inst)); - - if (emitNonSemanticShaderDebugInfo && !compilerGenerated) - { - auto const debugLocalVariableId = createDebugLocalVariable(debugId[type], name); - debugId[inst->getResultId()] = debugLocalVariableId; - - makeDebugDeclare(debugLocalVariableId, inst->getResultId()); - } - - break; - - default: + } + else { constantsTypesGlobals.push_back(std::unique_ptr(inst)); module.mapInstruction(inst); + } - if (emitNonSemanticShaderDebugInfo) - { - auto const debugResultId = createDebugGlobalVariable(debugId[type], name, inst->getResultId()); - debugId[inst->getResultId()] = debugResultId; + if (emitNonSemanticShaderDebugInfo && !compilerGenerated) + { + // For debug info, we prefer respecting how the variable is declared in source code. + // We may emulate some local variables as global variable with private storage in SPIR-V, but we still want to + // treat them as local variables in debug info. + if (storageClass == StorageClass::Function || (currentFunction && storageClass == StorageClass::Private)) { + auto const debugLocalVariableId = createDebugLocalVariable(getDebugType(type), name); + makeDebugDeclare(debugLocalVariableId, inst->getResultId()); + } + else { + createDebugGlobalVariable(getDebugType(type), name, inst->getResultId()); } - break; } if (name) @@ -2841,9 +3073,14 @@ spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAc void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { - Instruction* store = new Instruction(Op::OpStore); - store->reserveOperands(2); - store->addIdOperand(lValue); + Instruction* store = nullptr; + if (isUntypedPointer(lValue)) + store = createDescHeapLoadStoreBaseRemap(lValue, Op::OpStore); + else { + store = new Instruction(Op::OpStore); + store->reserveOperands(2); + store->addIdOperand(lValue); + } store->addIdOperand(rValue); memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); @@ -2865,8 +3102,13 @@ void Builder::createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAcce Id Builder::createLoad(Id lValue, spv::Decoration precision, spv::MemoryAccessMask memoryAccess, spv::Scope scope, unsigned int alignment) { - Instruction* load = new Instruction(getUniqueId(), getDerefTypeId(lValue), Op::OpLoad); - load->addIdOperand(lValue); + Instruction* load = nullptr; + if (isUntypedPointer(lValue)) + load = createDescHeapLoadStoreBaseRemap(lValue, Op::OpLoad); + else { + load = new Instruction(getUniqueId(), getDerefTypeId(lValue), Op::OpLoad); + load->addIdOperand(lValue); + } memoryAccess = sanitizeMemoryAccessForStorageClass(memoryAccess, getStorageClass(lValue)); @@ -2886,6 +3128,172 @@ Id Builder::createLoad(Id lValue, spv::Decoration precision, spv::MemoryAccessMa return load->getResultId(); } +Instruction* Builder::createDescHeapLoadStoreBaseRemap(Id baseId, Op op) +{ + // could only be untypedAccessChain or BufferPointerEXT op. + spv::Op instOp = module.getInstruction(baseId)->getOpCode(); + spv::Id baseVal = baseId; + // base type (from run time array) + spv::Id resultTy = getIdOperand(baseId, 0); + // Descriptor heap using run time array. + if (accessChain.descHeapInfo.descHeapStorageClass != StorageClass::Max) + resultTy = getIdOperand(resultTy, 0); + if (instOp == Op::OpBufferPointerEXT) { + // get base structure type from run time array of buffer structure type. + // create an extra untyped access chain for buffer pointer. + resultTy = accessChain.descHeapInfo.descHeapBaseTy; + Instruction* chain = new Instruction(getUniqueId(), getTypeId(baseId), Op::OpUntypedAccessChainKHR); + // base type. + chain->addIdOperand(resultTy); + // base + chain->addIdOperand(baseId); + // index + for (int i = 0; i < (int)accessChain.indexChain.size(); ++i) { + chain->addIdOperand(accessChain.indexChain[i]); + } + addInstruction(std::unique_ptr(chain)); + baseVal = chain->getResultId(); + clearAccessChain(); + } else if (instOp != Op::OpUntypedAccessChainKHR) { + assert(false && "Not a untyped load type"); + } + + Instruction* inst = nullptr; + if (op == Op::OpStore) + inst = new Instruction(Op::OpStore); + else { + inst = new Instruction(getUniqueId(), resultTy, Op::OpLoad); + accessChain.descHeapInfo.descHeapInstId.push_back(inst); + } + inst->addIdOperand(baseVal); + return inst; +} + +uint32_t Builder::isStructureHeapMember(Id id, std::vector indexChain, + unsigned int idx, spv::BuiltIn* bt, uint32_t* firstArrIndex) +{ + unsigned currentIdx = idx; + // Process types, only array types could contain no constant id operands. + Id baseId = id; + if (baseId == NoType) + return 0; + if (isPointerType(baseId)) + baseId = getContainedTypeId(baseId); + auto baseInst = module.getInstruction(baseId); + if (baseInst->getOpCode() == spv::Op::OpTypeArray || + baseInst->getOpCode() == spv::Op::OpTypeRuntimeArray) { + if (firstArrIndex) + *firstArrIndex = currentIdx; + baseId = getContainedTypeId(baseId); + baseInst = module.getInstruction(baseId); + currentIdx++; + } + if (currentIdx >= indexChain.size()) + return 0; + // Process index op. + auto indexInst = module.getInstruction(indexChain[currentIdx]); + if (indexInst->getOpCode() != spv::Op::OpConstant) + return 0; + auto index = indexInst->getImmediateOperand(0); + for (auto dec = decorations.begin(); dec != decorations.end(); dec++) { + if (dec->get()->getOpCode() == spv::Op::OpMemberDecorate && dec->get()->getIdOperand(0) == baseId && + dec->get()->getImmediateOperand(1) == index && + dec->get()->getImmediateOperand(2) == spv::Decoration::BuiltIn && + (dec->get()->getImmediateOperand(3) == (unsigned)spv::BuiltIn::ResourceHeapEXT || + dec->get()->getImmediateOperand(3) == (unsigned)spv::BuiltIn::SamplerHeapEXT)) { + if (bt) + *bt = (spv::BuiltIn)dec->get()->getImmediateOperand(3); + return currentIdx; + } + } + // New base. + if (baseInst->getOpCode() == spv::Op::OpTypeStruct) { + if (!baseInst->isIdOperand(index) || idx == indexChain.size() - 1) + return 0; + return isStructureHeapMember(baseInst->getIdOperand(index), indexChain, currentIdx + 1, bt, firstArrIndex); + } + + return 0; +} + +// Comments in header +Id Builder::createDescHeapAccessChain() +{ + uint32_t rsrcOffsetIdx = accessChain.descHeapInfo.structRsrcTyOffsetCount; + if (rsrcOffsetIdx != 0) + accessChain.base = accessChain.descHeapInfo.structRemappedBase; + Id base = accessChain.base; + Id untypedResultTy = accessChain.descHeapInfo.descHeapBaseTy; + uint32_t explicitArrayStride = accessChain.descHeapInfo.descHeapBaseArrayStride; + std::vector& offsets = accessChain.indexChain; + uint32_t firstArrIndex = accessChain.descHeapInfo.structRsrcTyFirstArrIndex; + // both typeBufferEXT and UntypedPointer only contains storage class info. + StorageClass storageClass = (StorageClass)accessChain.descHeapInfo.descHeapStorageClass; + Id resultTy = makeUntypedPointer(storageClass == spv::StorageClass::StorageBuffer ? spv::StorageClass::StorageBuffer + : spv::StorageClass::Uniform); + + // Make the untyped access chain instruction + Instruction* chain = new Instruction(getUniqueId(), makeUntypedPointer(getStorageClass(base)), Op::OpUntypedAccessChainKHR); + + if (storageClass == spv::StorageClass::Uniform || storageClass == spv::StorageClass::StorageBuffer) { + // For buffer and uniform heap, split first index as heap array index + // Insert BufferPointer op and construct another access chain with following indexes. + Id bufferTy = makeUntypedPointer(storageClass, true); + Id strideId = NoResult; + if (explicitArrayStride == 0) { + strideId = createConstantSizeOfEXT(bufferTy); + } else { + strideId = makeUintConstant(explicitArrayStride); + } + Id runtimeArrTy = makeRuntimeArray(bufferTy); + addDecorationId(runtimeArrTy, spv::Decoration::ArrayStrideIdEXT, strideId); + chain->addIdOperand(runtimeArrTy); + chain->addIdOperand(base); + // We would only re-target current member resource directly to resource/sampler heap base. + // So the previous access chain index towards final resource type is not needed? + // In current draft, only keep the first 'array index' into last access chain index. + // As those resource can't be declared as an array, in current first draft, array index will + // be the second index. This will be refined later. + chain->addIdOperand(offsets[firstArrIndex]); + if (rsrcOffsetIdx != 0) { + for (uint32_t i = 0; i < rsrcOffsetIdx + 1; i++) { + if (rsrcOffsetIdx + i + 1 < offsets.size()) + offsets[i] = offsets[i + rsrcOffsetIdx + 1]; + } + } else { + for (uint32_t i = 0; i < offsets.size() - 1; i++) { + offsets[i] = offsets[i + 1]; + } + } + for (uint32_t i = 0; i < rsrcOffsetIdx + 1; i++) + offsets.pop_back(); + addInstruction(std::unique_ptr(chain)); + // Create OpBufferPointer for loading target buffer descriptor. + Instruction* bufferUntypedDataPtr = new Instruction(getUniqueId(), resultTy, Op::OpBufferPointerEXT); + bufferUntypedDataPtr->addIdOperand(chain->getResultId()); + addInstruction(std::unique_ptr(bufferUntypedDataPtr)); + // Final/Second untyped access chain loading will be created during loading, current results only + // refer to the loading 'base'. + return bufferUntypedDataPtr->getResultId(); + } else { + // image/sampler heap + Id strideId = NoResult; + if (explicitArrayStride == 0) { + strideId = createConstantSizeOfEXT(untypedResultTy); + } else { + strideId = makeUintConstant(explicitArrayStride); + } + Id runtimeArrTy = makeRuntimeArray(untypedResultTy); + addDecorationId(runtimeArrTy, spv::Decoration::ArrayStrideIdEXT, strideId); + chain->addIdOperand(runtimeArrTy); + chain->addIdOperand(base); + for (int i = 0; i < (int)offsets.size(); ++i) + chain->addIdOperand(offsets[i]); + addInstruction(std::unique_ptr(chain)); + return chain->getResultId(); + } +} + // Comments in header Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vector& offsets) { @@ -2904,9 +3312,9 @@ Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vec return chain->getResultId(); } -Id Builder::createArrayLength(Id base, unsigned int member) +Id Builder::createArrayLength(Id base, unsigned int member, unsigned int bits) { - spv::Id intType = makeUintType(32); + spv::Id intType = makeUintType(bits); Instruction* length = new Instruction(getUniqueId(), intType, Op::OpArrayLength); length->reserveOperands(2); length->addIdOperand(base); @@ -3146,6 +3554,18 @@ Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) return op->getResultId(); } +Id Builder::createConstData(Op opCode, Id typeId, const std::vector operands) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, opCode); + op->reserveOperands(operands.size()); + for (auto id : operands) + op->addStringOperand(id); + module.mapInstruction(op); + constantsTypesGlobals.push_back(std::unique_ptr(op)); + + return op->getResultId(); +} + Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) { Instruction* op = new Instruction(getUniqueId(), typeId, opCode); @@ -3269,12 +3689,21 @@ Id Builder::createLvalueSwizzle(Id typeId, Id target, Id source, const std::vect // Comments in header void Builder::promoteScalar(Decoration precision, Id& left, Id& right) { - int direction = getNumComponents(right) - getNumComponents(left); + // choose direction of promotion (+1 for left to right, -1 for right to left) + int direction = !isScalar(right) - !isScalar(left); + + auto const &makeVec = [&](Id component, Id other) { + if (isCooperativeVector(other)) { + return makeCooperativeVectorTypeNV(getTypeId(component), getCooperativeVectorNumComponents(getTypeId(other))); + } else { + return makeVectorType(getTypeId(component), getNumComponents(other)); + } + }; if (direction > 0) - left = smearScalar(precision, left, makeVectorType(getTypeId(left), getNumComponents(right))); + left = smearScalar(precision, left, makeVec(left, right)); else if (direction < 0) - right = smearScalar(precision, right, makeVectorType(getTypeId(right), getNumComponents(left))); + right = smearScalar(precision, right, makeVec(right, left)); return; } @@ -3286,7 +3715,7 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) assert(getTypeId(scalar) == getScalarTypeId(vectorType)); int numComponents = getNumTypeComponents(vectorType); - if (numComponents == 1 && !isCooperativeVectorType(vectorType)) + if (numComponents == 1 && !isCooperativeVectorType(vectorType) && !isVectorType(vectorType)) return scalar; Instruction* smear = nullptr; @@ -3698,7 +4127,7 @@ Id Builder::createCompositeConstruct(Id typeId, const std::vector& constitue { assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && getNumTypeConstituents(typeId) == constituents.size()) || - (isCooperativeVectorType(typeId) && constituents.size() == 1)); + ((isCooperativeVectorType(typeId) || isVectorType(typeId)) && constituents.size() == 1)); if (generatingOpCodeForSpecConst) { // Sometime, even in spec-constant-op mode, the constant composite to be @@ -3787,9 +4216,16 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc return smearScalar(precision, sources[0], resultTypeId); // Special case: 2 vectors of equal size - if (sources.size() == 1 && isVector(sources[0]) && numTargetComponents == getNumComponents(sources[0])) { - assert(resultTypeId == getTypeId(sources[0])); - return sources[0]; + if (sources.size() == 1 && + (isVector(sources[0]) || isCooperativeVector(sources[0])) && + numTargetComponents == getNumComponents(sources[0])) { + if (isCooperativeVector(sources[0]) != isCooperativeVectorType(resultTypeId)) { + assert(isVector(sources[0]) != isVectorType(resultTypeId)); + return createUnaryOp(spv::Op::OpBitcast, resultTypeId, sources[0]); + } else { + assert(resultTypeId == getTypeId(sources[0])); + return sources[0]; + } } // accumulate the arguments for OpCompositeConstruct @@ -3798,7 +4234,7 @@ Id Builder::createConstructor(Decoration precision, const std::vector& sourc // lambda to store the result of visiting an argument component const auto latchResult = [&](Id comp) { - if (numTargetComponents > 1) + if (numTargetComponents > 1 || isVectorType(resultTypeId)) constituents.push_back(comp); else result = comp; @@ -4176,6 +4612,13 @@ void Builder::clearAccessChain() accessChain.isRValue = false; accessChain.coherentFlags.clear(); accessChain.alignment = 0; + accessChain.descHeapInfo.descHeapBaseTy = NoResult; + accessChain.descHeapInfo.descHeapStorageClass = StorageClass::Max; + accessChain.descHeapInfo.descHeapInstId.clear(); + accessChain.descHeapInfo.descHeapBaseArrayStride = NoResult; + accessChain.descHeapInfo.structRemappedBase = NoResult; + accessChain.descHeapInfo.structRsrcTyOffsetCount = 0; + accessChain.descHeapInfo.structRsrcTyFirstArrIndex = 0; } // Comments in header @@ -4212,10 +4655,13 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce transferAccessChainSwizzle(true); + // MeshShadingEXT outputs don't support loads, so split swizzled stores + bool isMeshOutput = getStorageClass(accessChain.base) == StorageClass::Output && + capabilities.find(spv::Capability::MeshShadingEXT) != capabilities.end(); + // If a swizzle exists and is not full and is not dynamic, then the swizzle will be broken into individual stores. if (accessChain.swizzle.size() > 0 && - getNumTypeComponents(getResultingAccessChainType()) != accessChain.swizzle.size() && - accessChain.component == NoResult) { + ((getNumTypeComponents(getResultingAccessChainType()) != accessChain.swizzle.size() && accessChain.component == NoResult) || isMeshOutput)) { for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) { accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle[i])); accessChain.instr = NoResult; @@ -4294,7 +4740,7 @@ Id Builder::accessChainLoad(Decoration precision, Decoration l_nonUniform, if (constant) { id = createCompositeExtract(accessChain.base, swizzleBase, indexes); setPrecision(id, precision); - } else if (isCooperativeVector(accessChain.base)) { + } else if (isVector(accessChain.base) || isCooperativeVector(accessChain.base)) { assert(accessChain.indexChain.size() == 1); id = createVectorExtractDynamic(accessChain.base, resultType, accessChain.indexChain[0]); } else { @@ -4383,10 +4829,13 @@ Id Builder::accessChainGetLValue() Id Builder::accessChainGetInferredType() { // anything to operate on? - if (accessChain.base == NoResult) + // for untyped pointer, it may be remapped to a descriptor heap. + // for descriptor heap, its base data type will be determined later, + // according to load/store results' types. + if (accessChain.base == NoResult || isUntypedPointer(accessChain.base) || + isStructureHeapMember(getTypeId(accessChain.base), accessChain.indexChain, 0) != 0) return NoType; Id type = getTypeId(accessChain.base); - // do initial dereference if (! accessChain.isRValue) type = getContainedTypeId(type); @@ -4504,7 +4953,13 @@ Id Builder::collapseAccessChain() // emit the access chain StorageClass storageClass = (StorageClass)module.getStorageClass(getTypeId(accessChain.base)); - accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); + // when descHeap info is set, use another access chain process. + if ((isUntypedPointer(accessChain.base) || accessChain.descHeapInfo.structRsrcTyOffsetCount!= 0) && + accessChain.descHeapInfo.descHeapStorageClass != StorageClass::Max) { + accessChain.instr = createDescHeapAccessChain(); + } else { + accessChain.instr = createAccessChain(storageClass, accessChain.base, accessChain.indexChain); + } return accessChain.instr; } @@ -4613,6 +5068,16 @@ void Builder::createBranch(bool implicit, Block* block) block->addPredecessor(buildPoint); } +// Create OpConstantSizeOfEXT +Id Builder::createConstantSizeOfEXT(Id typeId) +{ + Instruction* inst = new Instruction(getUniqueId(), makeIntType(32), Op::OpConstantSizeOfEXT); + inst->addIdOperand(typeId); + constantsTypesGlobals.push_back(std::unique_ptr(inst)); + module.mapInstruction(inst); + return inst->getResultId(); +} + void Builder::createSelectionMerge(Block* mergeBlock, SelectionControlMask control) { Instruction* merge = new Instruction(Op::OpSelectionMerge); diff --git a/src/libraries/glslang/SPIRV/SpvBuilder.h b/src/libraries/glslang/SPIRV/SpvBuilder.h index 006e15350..2a8e760ee 100644 --- a/src/libraries/glslang/SPIRV/SpvBuilder.h +++ b/src/libraries/glslang/SPIRV/SpvBuilder.h @@ -56,7 +56,7 @@ namespace spv { #include "GLSL.ext.KHR.h" #include "GLSL.ext.EXT.h" - #include "NonSemanticShaderDebugInfo100.h" + #include "NonSemanticShaderDebugInfo.h" } #include @@ -82,6 +82,14 @@ typedef enum { Spv_1_6 = (1 << 16) | (6 << 8), } SpvVersion; +struct StructMemberDebugInfo { + std::string name {}; + int line {0}; + int column {0}; + // Set if the caller knows a better debug type than what is associated with the functional SPIR-V type. + spv::Id debugTypeOverride {0}; +}; + class Builder { public: Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger); @@ -130,7 +138,7 @@ public: if (trackDebugInfo) { dirtyLineTracker = true; if (line != 0) { - // TODO: This is special handling of some AST nodes having (untracked) line 0. + // TODO: This is special handling of some AST nodes having (untracked) line 0. // But they should have a valid line number. currentLine = line; if (filename) { @@ -198,12 +206,31 @@ public: return id; } + // Maps the given OpType Id to a Non-Semantic DebugType Id. + Id getDebugType(Id type) { + if (auto it = debugTypeIdLookup.find(type); it != debugTypeIdLookup.end()) { + return it->second; + } + + return NoType; + } + + // Maps the given OpFunction Id to a Non-Semantic DebugFunction Id. + Id getDebugFunction(Id func) { + if (auto it = debugFuncIdLookup.find(func); it != debugFuncIdLookup.end()) { + return it->second; + } + + return NoResult; + } + // For creating new types (will return old type if the requested one was already made). Id makeVoidType(); Id makeBoolType(); Id makePointer(StorageClass, Id pointee); Id makeForwardPointer(StorageClass); Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee); + Id makeUntypedPointer(StorageClass storageClass, bool setBufferPointer = false); Id makeIntegerType(int width, bool hasSign); // generic Id makeIntType(int width) { return makeIntegerType(width, true); } Id makeUintType(int width) { return makeIntegerType(width, false); } @@ -211,40 +238,39 @@ public: Id makeBFloat16Type(); Id makeFloatE5M2Type(); Id makeFloatE4M3Type(); - Id makeStructType(const std::vector& members, const char* name, bool const compilerGenerated = true); + Id makeStructType(const std::vector& members, const std::vector& memberDebugInfo, + const char* name, bool const compilerGenerated = true); Id makeStructResultType(Id type0, Id type1); Id makeVectorType(Id component, int size); Id makeMatrixType(Id component, int cols, int rows); Id makeArrayType(Id element, Id sizeId, int stride); // 0 stride means no stride decoration Id makeRuntimeArray(Id element); Id makeFunctionType(Id returnType, const std::vector& paramTypes); - Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format); - Id makeSamplerType(); - Id makeSampledImageType(Id imageType); + Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format, const char* debugNames); + Id makeSamplerType(const char* debugName); + Id makeSampledImageType(Id imageType, const char* debugName); Id makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use); Id makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols); Id makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType); Id makeCooperativeVectorTypeNV(Id componentType, Id components); + Id makeTensorTypeARM(Id elementType, Id rank); Id makeGenericType(spv::Op opcode, std::vector& operands); // SPIR-V NonSemantic Shader DebugInfo Instructions - struct DebugTypeLoc { - std::string name {}; - int line {0}; - int column {0}; - }; - std::unordered_map debugTypeLocs; Id makeDebugInfoNone(); Id makeBoolDebugType(int const size); Id makeIntegerDebugType(int const width, bool const hasSign); - Id makeFloatDebugType(int const width); - Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType); + Id makeFloatDebugType(int const width, Id const fpEncoding = NoType); + Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfoInstructions const sequenceType); Id makeArrayDebugType(Id const baseType, Id const componentCount); Id makeVectorDebugType(Id const baseType, int const componentCount); Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true); - Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc); - Id makeCompositeDebugType(std::vector const& memberTypes, char const*const name, - NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false); + Id makeMemberDebugType(Id const memberType, StructMemberDebugInfo const& debugTypeLoc); + Id makeCompositeDebugType(std::vector const& memberTypes, std::vector const& memberDebugInfo, + char const* const name, NonSemanticShaderDebugInfoDebugCompositeType const tag); + Id makeOpaqueDebugType(char const* const name); + Id makeVectorIdDebugType(Id componentType, Id componentCount); + Id makeCooperativeMatrixDebugTypeKHR(Id componentType, Id scope, Id rows, Id cols, Id use); Id makePointerDebugType(StorageClass storageClass, Id const baseType); Id makeForwardPointerDebugType(StorageClass storageClass); Id makeDebugSource(const Id fileName); @@ -271,6 +297,8 @@ public: Id makeRayQueryType(); // hitObjectNV type Id makeHitObjectNVType(); + // hitObjectEXT type + Id makeHitObjectEXTType(); // For querying about types. Id getTypeId(Id resultId) const { return module.getTypeId(resultId); } @@ -292,6 +320,14 @@ public: Id getCooperativeVectorNumComponents(Id typeId) const { return module.getInstruction(typeId)->getIdOperand(1); } bool isPointer(Id resultId) const { return isPointerType(getTypeId(resultId)); } + bool isUntypedPointer(Id resultId) const + { + const Id tid = getTypeId(resultId); + // Expect that OpString have no type + if (tid == 0) + return false; + return isUntypedPointerType(tid); + } bool isScalar(Id resultId) const { return isScalarType(getTypeId(resultId)); } bool isVector(Id resultId) const { return isVectorType(getTypeId(resultId)); } bool isMatrix(Id resultId) const { return isMatrixType(getTypeId(resultId)); } @@ -309,6 +345,7 @@ public: { return getTypeClass(typeId) == Op::OpTypeInt && module.getInstruction(typeId)->getImmediateOperand(1) == 0; } bool isFloatType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeFloat; } bool isPointerType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypePointer; } + bool isUntypedPointerType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeUntypedPointerKHR; } bool isScalarType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeFloat || getTypeClass(typeId) == Op::OpTypeInt || getTypeClass(typeId) == Op::OpTypeBool; } @@ -322,6 +359,7 @@ public: } bool isTensorViewType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorViewNV; } bool isCooperativeVectorType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeCooperativeVectorNV; } + bool isTensorTypeARM(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeTensorARM; } bool isAggregateType(Id typeId) const { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); } bool isImageType(Id typeId) const { return getTypeClass(typeId) == Op::OpTypeImage; } @@ -421,6 +459,11 @@ public: Id makeFpConstant(Id type, double d, bool specConstant = false); Id importNonSemanticShaderDebugInfoInstructions(); + // Ensure the NonSemantic.Shader.DebugInfo import string names at least `version`. + // If the import instruction already exists, its name is patched in place. + // If it has not been created yet, importNonSemanticShaderDebugInfoInstructions() + // will use the updated version when it runs. + void requireNonSemanticShaderDebugInfoVersion(unsigned version); // Turn the array of constants into a proper spv constant of the requested type. Id makeCompositeConstant(Id type, const std::vector& comps, bool specConst = false); @@ -443,6 +486,7 @@ public: void addMemberDecoration(Id, unsigned int member, Decoration, const char*); void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector& literals); void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector& strings); + void addMemberDecorationIdEXT(Id, unsigned int member, Decoration, const std::vector& operands); // At the end of what block do the next create*() instructions go? // Also reset current last DebugScope and current source line to unknown @@ -497,13 +541,24 @@ public: // such as OpEmitMeshTasksEXT void makeStatementTerminator(spv::Op opcode, const std::vector& operands, const char* name); + // Create a global/local constant. Because OpConstant is automatically emitted by getting the constant + // ids, this function only handles debug info. + void createConstVariable(Id type, const char* name, Id constant, bool isGlobal); + // Create a global or function local or IO variable. Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr, Id initializer = NoResult, bool const compilerGenerated = true); + // Create an untyped global or function local or IO variable. + Id createUntypedVariable(Decoration precision, StorageClass storageClass, const char* name = nullptr, + Id dataType = NoResult, Id initializer = NoResult); + // Create an intermediate with an undefined value. Id createUndefined(Id type); + // Create load/store instruction with a remapped descriptor heap base. + Instruction* createDescHeapLoadStoreBaseRemap(Id base, Op op); + // Store into an Id and return the l-value void createStore(Id rValue, Id lValue, spv::MemoryAccessMask memoryAccess = spv::MemoryAccessMask::MaskNone, spv::Scope scope = spv::Scope::Max, unsigned int alignment = 0); @@ -517,7 +572,7 @@ public: Id createAccessChain(StorageClass, Id base, const std::vector& offsets); // Create an OpArrayLength instruction - Id createArrayLength(Id base, unsigned int member); + Id createArrayLength(Id base, unsigned int member, unsigned int bits); // Create an OpCooperativeMatrixLengthKHR instruction Id createCooperativeMatrixLengthKHR(Id type); @@ -544,6 +599,7 @@ public: Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3); Id createOp(Op, Id typeId, const std::vector& operands); Id createOp(Op, Id typeId, const std::vector& operands); + Id createConstData(Op opCode, Id typeId, const std::vector operands); Id createFunctionCall(spv::Function*, const std::vector&); Id createSpecConstantOp(Op, Id typeId, const std::vector& operands, const std::vector& literals); @@ -760,6 +816,18 @@ public: unsigned int alignment; // bitwise OR of alignment values passed in. Accumulates worst alignment. // Only tracks base and (optional) component selection alignment. + struct DescHeapInfo { + Id descHeapBaseTy; // for descriptor heap, record its base data type. + StorageClass descHeapStorageClass; // for descriptor heap, record its basic storage class. + uint32_t descHeapBaseArrayStride; // for descriptor heap, record its explicit array stride. + std::vector descHeapInstId; + // for descriptor heap, record its data type for loading/store results. + uint32_t structRsrcTyOffsetCount; + uint32_t structRsrcTyFirstArrIndex; + Id structRemappedBase; + }; + DescHeapInfo descHeapInfo; + // Accumulate whether anything in the chain of structures has coherent decorations. struct CoherentFlags { CoherentFlags() { clear(); } @@ -826,10 +894,15 @@ public: // clear accessChain void clearAccessChain(); + Id createDescHeapAccessChain(); + Id createConstantSizeOfEXT(Id typeId); + uint32_t isStructureHeapMember(Id id, std::vector indexChain, unsigned int idx, spv::BuiltIn* bt = nullptr, + uint32_t* firstArrIndex = nullptr); + // set new base as an l-value base void setAccessChainLValue(Id lValue) { - assert(isPointer(lValue)); + assert(isPointer(lValue) || isUntypedPointer(lValue)); accessChain.base = lValue; } @@ -840,6 +913,25 @@ public: accessChain.base = rValue; } + // set access chain info for untyped descriptor heap variable + void setAccessChainDescHeapInfo(StorageClass storageClass = StorageClass::Max, Id baseTy = NoResult, + uint32_t explicitArrayStride = NoResult, uint32_t structRsrcTyOffsetCount = 0, + spv::Id structRemappedBase = NoResult, uint32_t firstArrIndex = NoResult) + { + if (accessChain.descHeapInfo.descHeapStorageClass == StorageClass::Max) + accessChain.descHeapInfo.descHeapStorageClass = storageClass; + if (accessChain.descHeapInfo.descHeapBaseTy == NoResult) + accessChain.descHeapInfo.descHeapBaseTy = baseTy; + if (accessChain.descHeapInfo.descHeapBaseArrayStride == NoResult) + accessChain.descHeapInfo.descHeapBaseArrayStride = explicitArrayStride; + if (accessChain.descHeapInfo.structRemappedBase == NoResult) + accessChain.descHeapInfo.structRemappedBase = structRemappedBase; + if (accessChain.descHeapInfo.structRsrcTyOffsetCount == 0) + accessChain.descHeapInfo.structRsrcTyOffsetCount = structRsrcTyOffsetCount; + if (accessChain.descHeapInfo.structRsrcTyFirstArrIndex == 0) + accessChain.descHeapInfo.structRsrcTyFirstArrIndex = firstArrIndex; + } + // push offset onto the end of the chain void accessChainPush(Id offset, AccessChain::CoherentFlags coherentFlags, unsigned int alignment) { @@ -922,7 +1014,11 @@ public: void setUseReplicatedComposites(bool use) { useReplicatedComposites = use; } - protected: +private: + // Helper to get size of a scalar (in bytes) + unsigned int postProcessGetLargestScalarSize(const Instruction& type); + +protected: Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value); Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2); Id findCompositeConstant(Op typeClass, Op opcode, Id typeId, const std::vector& comps, size_t numMembers); @@ -948,6 +1044,12 @@ public: int sourceVersion; spv::Id nonSemanticShaderCompilationUnitId {0}; spv::Id nonSemanticShaderDebugInfo {0}; + // Pointer to the OpExtInstImport instruction for NonSemantic.Shader.DebugInfo. + // Kept so requireNonSemanticShaderDebugInfoVersion() can patch the name in place. + Instruction* nonSemanticShaderDebugInfoImportInst {nullptr}; + // Spec version encoded in the NonSemantic.Shader.DebugInfo import name. + // Defaults to 100. Promoted to N the first time a version-N opcode is emitted. + unsigned int nonSemanticShaderDebugInfoVersion{100}; spv::Id debugInfoNone {0}; spv::Id debugExpression {0}; // Debug expression with zero operations. std::string sourceText; @@ -988,6 +1090,8 @@ public: Block* buildPoint; Id uniqueId; Function* entryPointFunction; + // This tracks the current function being built, or nullptr if not in a function. + Function const* currentFunction { nullptr }; bool generatingOpCodeForSpecConst; bool useReplicatedComposites { false }; AccessChain accessChain; @@ -1005,8 +1109,58 @@ public: // not output, internally used for quick & dirty canonical (unique) creation + // Key for scalar constants (handles both 32-bit and 64-bit) + struct ScalarConstantKey { + unsigned int typeClass; // OpTypeInt, OpTypeFloat, OpTypeBool + unsigned int opcode; // OpConstant, OpSpecConstant, OpConstantTrue, etc. + Id typeId; // The specific type + unsigned value1; // First operand (or only operand) + unsigned value2; // Second operand (0 for single-operand constants) + + bool operator==(const ScalarConstantKey& other) const { + return typeClass == other.typeClass && + opcode == other.opcode && + typeId == other.typeId && + value1 == other.value1 && + value2 == other.value2; + } + }; + + struct ScalarConstantKeyHash { + // 64/32 bit mix function from MurmurHash3 + inline std::size_t hash_mix(std::size_t h) const { + if constexpr (sizeof(std::size_t) == 8) { + h ^= h >> 33; + h *= UINT64_C(0xff51afd7ed558ccd); + h ^= h >> 33; + h *= UINT64_C(0xc4ceb9fe1a85ec53); + h ^= h >> 33; + return h; + } else { + h ^= h >> 16; + h *= UINT32_C(0x85ebca6b); + h ^= h >> 13; + h *= UINT32_C(0xc2b2ae35); + h ^= h >> 16; + return h; + } + } + + // Hash combine from boost + inline std::size_t hash_combine(std::size_t seed, std::size_t v) const { + return hash_mix(seed + 0x9e3779b9 + v); + } + + std::size_t operator()(const ScalarConstantKey& k) const { + size_t hash1 = hash_combine(std::hash{}(k.typeClass), std::hash{}(k.opcode)); + size_t hash2 = hash_combine(std::hash{}(k.value1), std::hash{}(k.value2)); + size_t hash3 = hash_combine(hash1, hash2); + return hash_combine(hash3, std::hash{}(k.typeId)); + } + }; + // map type opcodes to constant inst. - std::unordered_map> groupedConstants; + std::unordered_map> groupedCompositeConstants; // map struct-id to constant instructions std::unordered_map> groupedStructConstants; // map type opcodes to type instructions @@ -1015,6 +1169,8 @@ public: std::unordered_map> groupedDebugTypes; // list of OpConstantNull instructions std::vector nullConstants; + // map scalar constants to result IDs + std::unordered_map groupedScalarConstantResultIDs; // Track which types have explicit layouts, to avoid reusing in storage classes without layout. // Currently only tracks array types. @@ -1032,8 +1188,11 @@ public: // map from include file name ids to their contents std::map includeFiles; - // map from core id to debug id - std::map debugId; + // maps from OpTypeXXX id to DebugTypeXXX id + std::unordered_map debugTypeIdLookup; + + // maps from OpFunction id to DebugFunction id + std::unordered_map debugFuncIdLookup; // map from file name string id to DebugSource id std::unordered_map debugSourceId; diff --git a/src/libraries/glslang/SPIRV/SpvPostProcess.cpp b/src/libraries/glslang/SPIRV/SpvPostProcess.cpp index 4f61864a8..aa80cce34 100644 --- a/src/libraries/glslang/SPIRV/SpvPostProcess.cpp +++ b/src/libraries/glslang/SPIRV/SpvPostProcess.cpp @@ -43,6 +43,7 @@ #include #include +#include "../SPIRV/spvIR.h" #include "SpvBuilder.h" #include "spirv.hpp11" #include "spvUtil.h" @@ -82,7 +83,10 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) if (containsType(typeId, Op::OpTypeFloat, 16)) addCapability(Capability::Float16); } else { - StorageClass storageClass = getStorageClass(inst.getIdOperand(0)); + StorageClass storageClass = StorageClass::Max; + if (module.getInstruction(inst.getIdOperand(0))->getOpCode() != Op::OpUntypedAccessChainKHR) { + storageClass = getStorageClass(inst.getIdOperand(0)); + } if (width == 8) { switch (storageClass) { case StorageClass::PhysicalStorageBufferEXT: @@ -171,6 +175,15 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) default: break; } + if (basicTypeOp == Op::OpTypeInt) { + if (width == 16) + addCapability(Capability::Int16); + else if (width == 8) + addCapability(Capability::Int8); + } else if (basicTypeOp == Op::OpTypeFloat) { + if (width == 16) + addCapability(Capability::Float16); + } break; case Op::OpAccessChain: case Op::OpPtrAccessChain: @@ -201,6 +214,37 @@ void Builder::postProcessType(const Instruction& inst, Id typeId) } } +unsigned int Builder::postProcessGetLargestScalarSize(const Instruction& type) +{ + switch (type.getOpCode()) { + case Op::OpTypeBool: + return 1; + case Op::OpTypeInt: + case Op::OpTypeFloat: + return type.getImmediateOperand(0) / 8; + case Op::OpTypePointer: + return 8; + case Op::OpTypeVector: + case Op::OpTypeMatrix: + case Op::OpTypeArray: + case Op::OpTypeRuntimeArray: { + const Instruction* elem_type = module.getInstruction(type.getIdOperand(0)); + return postProcessGetLargestScalarSize(*elem_type); + } + case Op::OpTypeStruct: { + unsigned int largest = 0; + for (int i = 0; i < type.getNumOperands(); ++i) { + const Instruction* elem_type = module.getInstruction(type.getIdOperand(i)); + unsigned int elem_size = postProcessGetLargestScalarSize(*elem_type); + largest = std::max(largest, elem_size); + } + return largest; + } + default: + return 0; + } +} + // Called for each instruction that resides in a block. void Builder::postProcess(Instruction& inst) { @@ -249,12 +293,12 @@ void Builder::postProcess(Instruction& inst) // and this function computes the rest from the SPIR-V Offset decorations. Instruction *accessChain = module.getInstruction(inst.getIdOperand(0)); if (accessChain->getOpCode() == Op::OpAccessChain) { - Instruction *base = module.getInstruction(accessChain->getIdOperand(0)); + const Instruction* base = module.getInstruction(accessChain->getIdOperand(0)); // Get the type of the base of the access chain. It must be a pointer type. Id typeId = base->getTypeId(); Instruction *type = module.getInstruction(typeId); assert(type->getOpCode() == Op::OpTypePointer); - if (type->getImmediateOperand(0) != StorageClass::PhysicalStorageBufferEXT) { + if (type->getImmediateOperand(0) != StorageClass::PhysicalStorageBuffer) { break; } // Get the pointee type. @@ -265,6 +309,7 @@ void Builder::postProcess(Instruction& inst) // Offset/ArrayStride/MatrixStride decorations, and bitwise OR them all // together. int alignment = 0; + bool first_struct_elem = false; for (int i = 1; i < accessChain->getNumOperands(); ++i) { Instruction *idx = module.getInstruction(accessChain->getIdOperand(i)); if (type->getOpCode() == Op::OpTypeStruct) { @@ -277,7 +322,12 @@ void Builder::postProcess(Instruction& inst) decoration.get()->getImmediateOperand(1) == c && (decoration.get()->getImmediateOperand(2) == Decoration::Offset || decoration.get()->getImmediateOperand(2) == Decoration::MatrixStride)) { - alignment |= decoration.get()->getImmediateOperand(3); + unsigned int opernad_value = decoration.get()->getImmediateOperand(3); + alignment |= opernad_value; + if (opernad_value == 0 && + decoration.get()->getImmediateOperand(2) == Decoration::Offset) { + first_struct_elem = true; + } } }; std::for_each(decorations.begin(), decorations.end(), function); @@ -303,18 +353,51 @@ void Builder::postProcess(Instruction& inst) } } assert(inst.getNumOperands() >= 3); - auto const memoryAccess = (MemoryAccessMask)inst.getImmediateOperand((inst.getOpCode() == Op::OpStore) ? 2 : 1); + const bool is_store = inst.getOpCode() == Op::OpStore; + auto const memoryAccess = (MemoryAccessMask)inst.getImmediateOperand(is_store ? 2 : 1); assert(anySet(memoryAccess, MemoryAccessMask::Aligned)); static_cast(memoryAccess); + // Compute the index of the alignment operand. int alignmentIdx = 2; - if (inst.getOpCode() == Op::OpStore) + if (is_store) alignmentIdx++; // Merge new and old (mis)alignment alignment |= inst.getImmediateOperand(alignmentIdx); + + if (!is_store) { + Instruction* inst_type = module.getInstruction(inst.getTypeId()); + if (inst_type->getOpCode() == Op::OpTypePointer && + inst_type->getImmediateOperand(0) == StorageClass::PhysicalStorageBuffer) { + // This means we are loading a pointer which means need to ensure it is at least 8-byte aligned + // See https://github.com/KhronosGroup/glslang/issues/4084 + // In case the alignment is currently 4, need to ensure it is 8 before grabbing the LSB + alignment |= 8; + alignment &= 8; + } + } + // Pick the LSB alignment = alignment & ~(alignment & (alignment-1)); + + // The edge case we find is when copying a struct to another struct, we never find the alignment anywhere, + // so in this case, fallback to doing a full size lookup on the type + if (alignment == 0 && first_struct_elem) { + // Quick get the struct type back + const Instruction* pointer_type = module.getInstruction(base->getTypeId()); + const Instruction* struct_type = module.getInstruction(pointer_type->getIdOperand(1)); + assert(struct_type->getOpCode() == Op::OpTypeStruct); + + const Instruction* elem_type = module.getInstruction(struct_type->getIdOperand(0)); + unsigned int largest_scalar = postProcessGetLargestScalarSize(*elem_type); + if (largest_scalar != 0) { + alignment = largest_scalar; + } else { + alignment = 16; // fallback if can't determine a godo alignment + } + } // update the Aligned operand + assert(alignment != 0); inst.setImmediateOperand(alignmentIdx, alignment); } break; diff --git a/src/libraries/glslang/SPIRV/SpvTools.cpp b/src/libraries/glslang/SPIRV/SpvTools.cpp index 58bca56cb..794178bd5 100644 --- a/src/libraries/glslang/SPIRV/SpvTools.cpp +++ b/src/libraries/glslang/SPIRV/SpvTools.cpp @@ -166,6 +166,7 @@ void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector< spvValidatorOptionsSetScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); spvValidatorOptionsSetWorkgroupScalarBlockLayout(options, intermediate.usingScalarBlockLayout()); spvValidatorOptionsSetAllowOffsetTextureOperand(options, intermediate.usingTextureOffsetNonConst()); + spvValidatorOptionsSetAllowVulkan32BitBitwise(options, true); spvValidateWithOptions(context, options, &binary, &diagnostic); // report diff --git a/src/libraries/glslang/SPIRV/disassemble.cpp b/src/libraries/glslang/SPIRV/disassemble.cpp index 248df0ac7..8045e50d6 100644 --- a/src/libraries/glslang/SPIRV/disassemble.cpp +++ b/src/libraries/glslang/SPIRV/disassemble.cpp @@ -57,17 +57,17 @@ namespace spv { #include "GLSL.ext.AMD.h" #include "GLSL.ext.NV.h" #include "GLSL.ext.ARM.h" - #include "NonSemanticShaderDebugInfo100.h" + #include "NonSemanticShaderDebugInfo.h" #include "GLSL.ext.QCOM.h" } } -const char* GlslStd450DebugNames[spv::GLSLstd450Count]; +static const char* GlslStd450DebugNames[spv::GLSLstd450Count]; namespace spv { static const char* GLSLextAMDGetDebugNames(const char*, unsigned); static const char* GLSLextNVGetDebugNames(const char*, unsigned); -static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned); +static const char* NonSemanticShaderDebugInfoGetDebugNames(unsigned); static void Kill(std::ostream& out, const char* message) { @@ -83,7 +83,7 @@ enum ExtInstSet { OpenCLExtInst, NonSemanticDebugPrintfExtInst, NonSemanticDebugBreakExtInst, - NonSemanticShaderDebugInfo100 + NonSemanticShaderDebugInfo }; // Container class for a single instance of a SPIR-V stream, with methods for disassembly. @@ -414,6 +414,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, idDescriptor[resultId] = "struct"; break; case Op::OpTypePointer: + case Op::OpTypeUntypedPointerKHR: idDescriptor[resultId] = "ptr"; break; case Op::OpTypeVector: @@ -546,8 +547,9 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, extInstSet = NonSemanticDebugPrintfExtInst; } else if (strcmp("NonSemantic.DebugBreak", name) == 0) { extInstSet = NonSemanticDebugBreakExtInst; - } else if (strcmp("NonSemantic.Shader.DebugInfo.100", name) == 0) { - extInstSet = NonSemanticShaderDebugInfo100; + } else if (strncmp("NonSemantic.Shader.DebugInfo.", name, strlen("NonSemantic.Shader.DebugInfo.")) == + 0) { + extInstSet = NonSemanticShaderDebugInfo; } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 || strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 || strcmp(spv::E_SPV_AMD_shader_explicit_vertex_parameter, name) == 0 || @@ -575,8 +577,8 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, out << "(DebugPrintf)"; } else if (extInstSet == NonSemanticDebugBreakExtInst) { out << "(DebugBreak)"; - } else if (extInstSet == NonSemanticShaderDebugInfo100) { - out << "(" << NonSemanticShaderDebugInfo100GetDebugNames(entrypoint) << ")"; + } else if (extInstSet == NonSemanticShaderDebugInfo) { + out << "(" << NonSemanticShaderDebugInfoGetDebugNames(entrypoint) << ")"; } } break; @@ -823,53 +825,55 @@ static const char* GLSLextNVGetDebugNames(const char* name, unsigned entrypoint) return "Bad"; } -static const char* NonSemanticShaderDebugInfo100GetDebugNames(unsigned entrypoint) +static const char* NonSemanticShaderDebugInfoGetDebugNames(unsigned entrypoint) { switch (entrypoint) { - case NonSemanticShaderDebugInfo100DebugInfoNone: return "DebugInfoNone"; - case NonSemanticShaderDebugInfo100DebugCompilationUnit: return "DebugCompilationUnit"; - case NonSemanticShaderDebugInfo100DebugTypeBasic: return "DebugTypeBasic"; - case NonSemanticShaderDebugInfo100DebugTypePointer: return "DebugTypePointer"; - case NonSemanticShaderDebugInfo100DebugTypeQualifier: return "DebugTypeQualifier"; - case NonSemanticShaderDebugInfo100DebugTypeArray: return "DebugTypeArray"; - case NonSemanticShaderDebugInfo100DebugTypeVector: return "DebugTypeVector"; - case NonSemanticShaderDebugInfo100DebugTypedef: return "DebugTypedef"; - case NonSemanticShaderDebugInfo100DebugTypeFunction: return "DebugTypeFunction"; - case NonSemanticShaderDebugInfo100DebugTypeEnum: return "DebugTypeEnum"; - case NonSemanticShaderDebugInfo100DebugTypeComposite: return "DebugTypeComposite"; - case NonSemanticShaderDebugInfo100DebugTypeMember: return "DebugTypeMember"; - case NonSemanticShaderDebugInfo100DebugTypeInheritance: return "DebugTypeInheritance"; - case NonSemanticShaderDebugInfo100DebugTypePtrToMember: return "DebugTypePtrToMember"; - case NonSemanticShaderDebugInfo100DebugTypeTemplate: return "DebugTypeTemplate"; - case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter: return "DebugTypeTemplateParameter"; - case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter"; - case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack"; - case NonSemanticShaderDebugInfo100DebugGlobalVariable: return "DebugGlobalVariable"; - case NonSemanticShaderDebugInfo100DebugFunctionDeclaration: return "DebugFunctionDeclaration"; - case NonSemanticShaderDebugInfo100DebugFunction: return "DebugFunction"; - case NonSemanticShaderDebugInfo100DebugLexicalBlock: return "DebugLexicalBlock"; - case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator"; - case NonSemanticShaderDebugInfo100DebugScope: return "DebugScope"; - case NonSemanticShaderDebugInfo100DebugNoScope: return "DebugNoScope"; - case NonSemanticShaderDebugInfo100DebugInlinedAt: return "DebugInlinedAt"; - case NonSemanticShaderDebugInfo100DebugLocalVariable: return "DebugLocalVariable"; - case NonSemanticShaderDebugInfo100DebugInlinedVariable: return "DebugInlinedVariable"; - case NonSemanticShaderDebugInfo100DebugDeclare: return "DebugDeclare"; - case NonSemanticShaderDebugInfo100DebugValue: return "DebugValue"; - case NonSemanticShaderDebugInfo100DebugOperation: return "DebugOperation"; - case NonSemanticShaderDebugInfo100DebugExpression: return "DebugExpression"; - case NonSemanticShaderDebugInfo100DebugMacroDef: return "DebugMacroDef"; - case NonSemanticShaderDebugInfo100DebugMacroUndef: return "DebugMacroUndef"; - case NonSemanticShaderDebugInfo100DebugImportedEntity: return "DebugImportedEntity"; - case NonSemanticShaderDebugInfo100DebugSource: return "DebugSource"; - case NonSemanticShaderDebugInfo100DebugFunctionDefinition: return "DebugFunctionDefinition"; - case NonSemanticShaderDebugInfo100DebugSourceContinued: return "DebugSourceContinued"; - case NonSemanticShaderDebugInfo100DebugLine: return "DebugLine"; - case NonSemanticShaderDebugInfo100DebugNoLine: return "DebugNoLine"; - case NonSemanticShaderDebugInfo100DebugBuildIdentifier: return "DebugBuildIdentifier"; - case NonSemanticShaderDebugInfo100DebugStoragePath: return "DebugStoragePath"; - case NonSemanticShaderDebugInfo100DebugEntryPoint: return "DebugEntryPoint"; - case NonSemanticShaderDebugInfo100DebugTypeMatrix: return "DebugTypeMatrix"; + case NonSemanticShaderDebugInfoDebugInfoNone: return "DebugInfoNone"; + case NonSemanticShaderDebugInfoDebugCompilationUnit: return "DebugCompilationUnit"; + case NonSemanticShaderDebugInfoDebugTypeBasic: return "DebugTypeBasic"; + case NonSemanticShaderDebugInfoDebugTypePointer: return "DebugTypePointer"; + case NonSemanticShaderDebugInfoDebugTypeQualifier: return "DebugTypeQualifier"; + case NonSemanticShaderDebugInfoDebugTypeArray: return "DebugTypeArray"; + case NonSemanticShaderDebugInfoDebugTypeVector: return "DebugTypeVector"; + case NonSemanticShaderDebugInfoDebugTypedef: return "DebugTypedef"; + case NonSemanticShaderDebugInfoDebugTypeFunction: return "DebugTypeFunction"; + case NonSemanticShaderDebugInfoDebugTypeEnum: return "DebugTypeEnum"; + case NonSemanticShaderDebugInfoDebugTypeComposite: return "DebugTypeComposite"; + case NonSemanticShaderDebugInfoDebugTypeMember: return "DebugTypeMember"; + case NonSemanticShaderDebugInfoDebugTypeInheritance: return "DebugTypeInheritance"; + case NonSemanticShaderDebugInfoDebugTypePtrToMember: return "DebugTypePtrToMember"; + case NonSemanticShaderDebugInfoDebugTypeTemplate: return "DebugTypeTemplate"; + case NonSemanticShaderDebugInfoDebugTypeTemplateParameter: return "DebugTypeTemplateParameter"; + case NonSemanticShaderDebugInfoDebugTypeTemplateTemplateParameter: return "DebugTypeTemplateTemplateParameter"; + case NonSemanticShaderDebugInfoDebugTypeTemplateParameterPack: return "DebugTypeTemplateParameterPack"; + case NonSemanticShaderDebugInfoDebugGlobalVariable: return "DebugGlobalVariable"; + case NonSemanticShaderDebugInfoDebugFunctionDeclaration: return "DebugFunctionDeclaration"; + case NonSemanticShaderDebugInfoDebugFunction: return "DebugFunction"; + case NonSemanticShaderDebugInfoDebugLexicalBlock: return "DebugLexicalBlock"; + case NonSemanticShaderDebugInfoDebugLexicalBlockDiscriminator: return "DebugLexicalBlockDiscriminator"; + case NonSemanticShaderDebugInfoDebugScope: return "DebugScope"; + case NonSemanticShaderDebugInfoDebugNoScope: return "DebugNoScope"; + case NonSemanticShaderDebugInfoDebugInlinedAt: return "DebugInlinedAt"; + case NonSemanticShaderDebugInfoDebugLocalVariable: return "DebugLocalVariable"; + case NonSemanticShaderDebugInfoDebugInlinedVariable: return "DebugInlinedVariable"; + case NonSemanticShaderDebugInfoDebugDeclare: return "DebugDeclare"; + case NonSemanticShaderDebugInfoDebugValue: return "DebugValue"; + case NonSemanticShaderDebugInfoDebugOperation: return "DebugOperation"; + case NonSemanticShaderDebugInfoDebugExpression: return "DebugExpression"; + case NonSemanticShaderDebugInfoDebugMacroDef: return "DebugMacroDef"; + case NonSemanticShaderDebugInfoDebugMacroUndef: return "DebugMacroUndef"; + case NonSemanticShaderDebugInfoDebugImportedEntity: return "DebugImportedEntity"; + case NonSemanticShaderDebugInfoDebugSource: return "DebugSource"; + case NonSemanticShaderDebugInfoDebugFunctionDefinition: return "DebugFunctionDefinition"; + case NonSemanticShaderDebugInfoDebugSourceContinued: return "DebugSourceContinued"; + case NonSemanticShaderDebugInfoDebugLine: return "DebugLine"; + case NonSemanticShaderDebugInfoDebugNoLine: return "DebugNoLine"; + case NonSemanticShaderDebugInfoDebugBuildIdentifier: return "DebugBuildIdentifier"; + case NonSemanticShaderDebugInfoDebugStoragePath: return "DebugStoragePath"; + case NonSemanticShaderDebugInfoDebugEntryPoint: return "DebugEntryPoint"; + case NonSemanticShaderDebugInfoDebugTypeMatrix: return "DebugTypeMatrix"; + case NonSemanticShaderDebugInfoDebugTypeVectorIdEXT: return "DebugTypeVectorIdEXT"; + case NonSemanticShaderDebugInfoDebugTypeCooperativeMatrixKHR: return "DebugTypeCooperativeMatrixKHR"; default: return "Bad"; } diff --git a/src/libraries/glslang/SPIRV/doc.cpp b/src/libraries/glslang/SPIRV/doc.cpp index 8244b560e..d3185073e 100644 --- a/src/libraries/glslang/SPIRV/doc.cpp +++ b/src/libraries/glslang/SPIRV/doc.cpp @@ -209,8 +209,11 @@ const char* ExecutionModeString(int mode) case (int)ExecutionMode::OutputLinesNV: return "OutputLinesNV"; case (int)ExecutionMode::OutputPrimitivesNV: return "OutputPrimitivesNV"; case (int)ExecutionMode::OutputTrianglesNV: return "OutputTrianglesNV"; - case (int)ExecutionMode::DerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV"; - case (int)ExecutionMode::DerivativeGroupLinearNV: return "DerivativeGroupLinearNV"; + + // DerivativeGroupQuadsKHR is an alias of DerivativeGroupQuadsNV + case (int)ExecutionMode::DerivativeGroupQuadsKHR: return "DerivativeGroupQuadsKHR"; + // DerivativeGroupLinearKHR is an alias of DerivativeGroupLinearNV + case (int)ExecutionMode::DerivativeGroupLinearKHR: return "DerivativeGroupLinearKHR"; case (int)ExecutionMode::PixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT"; case (int)ExecutionMode::PixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT"; @@ -231,6 +234,8 @@ const char* ExecutionModeString(int mode) case (int)ExecutionMode::NonCoherentDepthAttachmentReadEXT: return "NonCoherentDepthAttachmentReadEXT"; case (int)ExecutionMode::NonCoherentStencilAttachmentReadEXT: return "NonCoherentStencilAttachmentReadEXT"; + case (int)ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; + case ExecutionModeCeiling: default: return "Bad"; } @@ -265,6 +270,7 @@ const char* StorageClassString(int StorageClass) case (int)StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; case (int)StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; case (int)StorageClass::TileImageEXT: return "TileImageEXT"; + case (int)StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; default: return "Bad"; } } @@ -344,8 +350,16 @@ const char* DecorationString(int decoration) case (int)Decoration::AliasedPointerEXT: return "DecorationAliasedPointerEXT"; case (int)Decoration::HitObjectShaderRecordBufferNV: return "DecorationHitObjectShaderRecordBufferNV"; + case (int)Decoration::HitObjectShaderRecordBufferEXT: return "DecorationHitObjectShaderRecordBufferEXT"; case (int)Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "DecorationSaturatedToLargestFloat8NormalConversionEXT"; + + case (int)Decoration::BankNV: return "BankNV"; + case (int)Decoration::MemberOffsetNV: return "MemberOffsetNV"; + + case (int)Decoration::ArrayStrideIdEXT: return "DecorationArrayStrideIdEXT"; + case (int)Decoration::OffsetIdEXT: return "DecorationOffsetIdEXT"; + case (int)Decoration::UTFEncodedKHR: return "UTF8EncodedKHR"; } } @@ -487,6 +501,8 @@ const char* BuiltInString(int builtIn) case (int)BuiltIn::CoreMaxIDARM: return "CoreMaxIDARM"; case (int)BuiltIn::WarpIDARM: return "WarpIDARM"; case (int)BuiltIn::WarpMaxIDARM: return "BuiltInWarpMaxIDARM"; + case (int)BuiltIn::SamplerHeapEXT: return "SamplerHeapEXT"; + case (int)BuiltIn::ResourceHeapEXT: return "ResourceHeapEXT"; default: return "Bad"; } @@ -977,7 +993,7 @@ const char* CapabilityString(int info) case (int)Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; case (int)Capability::DrawParameters: return "DrawParameters"; case (int)Capability::SubgroupVoteKHR: return "SubgroupVoteKHR"; - case (int)Capability::GroupNonUniformRotateKHR: return "CapabilityGroupNonUniformRotateKHR"; + case (int)Capability::GroupNonUniformRotateKHR: return "GroupNonUniformRotateKHR"; case (int)Capability::StorageUniformBufferBlock16: return "StorageUniformBufferBlock16"; case (int)Capability::StorageUniform16: return "StorageUniform16"; @@ -1023,10 +1039,12 @@ const char* CapabilityString(int info) case (int)Capability::RayTracingPositionFetchKHR: return "RayTracingPositionFetchKHR"; case (int)Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; case (int)Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; - case (int)Capability::RayTracingDisplacementMicromapNV: return "CapabilityRayTracingDisplacementMicromapNV"; + case (int)Capability::RayTracingDisplacementMicromapNV: return "RayTracingDisplacementMicromapNV"; case (int)Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; - case (int)Capability::ComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV"; - case (int)Capability::ComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV"; + // ComputeDerivativeGroupQuadsKHR is an alias of ComputeDerivativeGroupQuadsNV + case (int)Capability::ComputeDerivativeGroupQuadsKHR: return "ComputeDerivativeGroupQuadsKHR"; + // ComputeDerivativeGroupLinearKHR is an alias of ComputeDerivativeGroupLinearNV + case (int)Capability::ComputeDerivativeGroupLinearKHR: return "ComputeDerivativeGroupLinearKHR"; case (int)Capability::FragmentBarycentricKHR: return "FragmentBarycentricKHR"; case (int)Capability::MeshShadingNV: return "MeshShadingNV"; case (int)Capability::ImageFootprintNV: return "ImageFootprintNV"; @@ -1071,15 +1089,16 @@ const char* CapabilityString(int info) case (int)Capability::CooperativeVectorNV: return "CooperativeVectorNV"; case (int)Capability::CooperativeVectorTrainingNV: return "CooperativeVectorTrainingNV"; - case (int)Capability::FragmentShaderSampleInterlockEXT: return "CapabilityFragmentShaderSampleInterlockEXT"; - case (int)Capability::FragmentShaderPixelInterlockEXT: return "CapabilityFragmentShaderPixelInterlockEXT"; - case (int)Capability::FragmentShaderShadingRateInterlockEXT: return "CapabilityFragmentShaderShadingRateInterlockEXT"; + case (int)Capability::FragmentShaderSampleInterlockEXT: return "FragmentShaderSampleInterlockEXT"; + case (int)Capability::FragmentShaderPixelInterlockEXT: return "FragmentShaderPixelInterlockEXT"; + case (int)Capability::FragmentShaderShadingRateInterlockEXT: return "FragmentShaderShadingRateInterlockEXT"; case (int)Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; case (int)Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; case (int)Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; case (int)Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; + case (int)Capability::TensorsARM: return "TensorsARM"; case (int)Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; @@ -1088,10 +1107,14 @@ const char* CapabilityString(int info) case (int)Capability::ShaderClockKHR: return "ShaderClockKHR"; case (int)Capability::QuadControlKHR: return "QuadControlKHR"; case (int)Capability::Int64ImageEXT: return "Int64ImageEXT"; + case (int)Capability::DescriptorHeapEXT: return "DescriptorHeapEXT"; + case (int)Capability::UntypedPointersKHR: return "UntypedPointersKHR"; - case (int)Capability::IntegerFunctions2INTEL: return "CapabilityIntegerFunctions2INTEL"; + case (int)Capability::IntegerFunctions2INTEL: return "IntegerFunctions2INTEL"; case (int)Capability::ExpectAssumeKHR: return "ExpectAssumeKHR"; + case (int)Capability::AbortKHR: return "AbortKHR"; + case (int)Capability::ConstantDataKHR: return "ConstantDataKHR"; case (int)Capability::AtomicFloat16AddEXT: return "AtomicFloat16AddEXT"; case (int)Capability::AtomicFloat32AddEXT: return "AtomicFloat32AddEXT"; @@ -1100,12 +1123,13 @@ const char* CapabilityString(int info) case (int)Capability::AtomicFloat32MinMaxEXT: return "AtomicFloat32MinMaxEXT"; case (int)Capability::AtomicFloat64MinMaxEXT: return "AtomicFloat64MinMaxEXT"; - case (int)Capability::WorkgroupMemoryExplicitLayoutKHR: return "CapabilityWorkgroupMemoryExplicitLayoutKHR"; - case (int)Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR"; - case (int)Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR"; + case (int)Capability::WorkgroupMemoryExplicitLayoutKHR: return "WorkgroupMemoryExplicitLayoutKHR"; + case (int)Capability::WorkgroupMemoryExplicitLayout8BitAccessKHR: return "WorkgroupMemoryExplicitLayout8BitAccessKHR"; + case (int)Capability::WorkgroupMemoryExplicitLayout16BitAccessKHR: return "WorkgroupMemoryExplicitLayout16BitAccessKHR"; case (int)Capability::CoreBuiltinsARM: return "CoreBuiltinsARM"; case (int)Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case (int)Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; case (int)Capability::TextureSampleWeightedQCOM: return "TextureSampleWeightedQCOM"; case (int)Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; @@ -1113,7 +1137,9 @@ const char* CapabilityString(int info) case (int)Capability::TileShadingQCOM: return "TileShadingQCOM"; case (int)Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; - case (int)Capability::ReplicatedCompositesEXT: return "CapabilityReplicatedCompositesEXT"; + case (int)Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; + + case (int)Capability::ReplicatedCompositesEXT: return "ReplicatedCompositesEXT"; case (int)Capability::DotProductKHR: return "DotProductKHR"; case (int)Capability::DotProductInputAllKHR: return "DotProductInputAllKHR"; @@ -1125,12 +1151,17 @@ const char* CapabilityString(int info) case (int)Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; case (int)Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; - case (int)Capability::BFloat16TypeKHR: return "CapabilityBFloat16TypeKHR"; - case (int)Capability::BFloat16DotProductKHR: return "CapabilityBFloat16DotProductKHR"; - case (int)Capability::BFloat16CooperativeMatrixKHR: return "CapabilityBFloat16CooperativeMatrixKHR"; + case (int)Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; + case (int)Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; + case (int)Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; - case (int)Capability::Float8EXT: return "CapabilityFloat8EXT"; - case (int)Capability::Float8CooperativeMatrixEXT: return "CapabilityFloat8CooperativeMatrixEXT"; + case (int)Capability::Float8EXT: return "Float8EXT"; + case (int)Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + + case (int)Capability::PushConstantBanksNV: return "PushConstantBanksNV"; + + case (int)Capability::Shader64BitIndexingEXT: return "CapabilityShader64BitIndexingEXT"; + case (int)Capability::LongVectorEXT: return "LongVectorEXT"; default: return "Bad"; } @@ -1513,6 +1544,18 @@ const char* OpcodeString(int op) case (int)Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; case (int)Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case (int)Op::OpBufferPointerEXT: return "OpBufferPointerEXT"; + case (int)Op::OpConstantSizeOfEXT: return "OpConstantSizeOfEXT"; + case (int)Op::OpTypeBufferEXT: return "OpTypeBufferEXT"; + case (int)Op::OpUntypedAccessChainKHR: return "OpUntypedAccessChainKHR"; + case (int)Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR"; + case (int)Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; + case (int)Op::OpMemberDecorateIdEXT: return "OpMemberDecorateIdEXT"; + case (int)Op::OpUntypedImageTexelPointerEXT: return "OpUntypedImageTexelPointerEXT"; + + case (int)Op::OpAbortKHR: return "OpAbortKHR"; + case (int)Op::OpConstantDataKHR: return "OpConstantDataKHR"; + case (int)Op::OpSpecConstantDataKHR: return "OpSpecConstantDataKHR"; case (int)Op::OpAtomicFAddEXT: return "OpAtomicFAddEXT"; case (int)Op::OpAtomicFMinEXT: return "OpAtomicFMinEXT"; @@ -1626,6 +1669,11 @@ const char* OpcodeString(int op) case (int)Op::OpTensorViewSetStrideNV: return "OpTensorViewSetStrideNV"; case (int)Op::OpTensorViewSetClipNV: return "OpTensorViewSetClipNV"; + case (int)Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case (int)Op::OpTensorReadARM: return "OpTensorReadARM"; + case (int)Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case (int)Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; + case (int)Op::OpTypeCooperativeVectorNV: return "OpTypeCooperativeVectorNV"; case (int)Op::OpCooperativeVectorMatrixMulNV: return "OpCooperativeVectorMatrixMulNV"; case (int)Op::OpCooperativeVectorMatrixMulAddNV: return "OpCooperativeVectorMatrixMulAddNV"; @@ -1694,6 +1742,11 @@ const char* OpcodeString(int op) case (int)Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; case (int)Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case (int)Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; + case (int)Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case (int)Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case (int)Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; + case (int)Op::OpConstantCompositeReplicateEXT: return "OpConstantCompositeReplicateEXT"; case (int)Op::OpSpecConstantCompositeReplicateEXT: return "OpSpecConstantCompositeReplicateEXT"; case (int)Op::OpCompositeConstructReplicateEXT: return "OpCompositeConstructReplicateEXT"; @@ -1705,6 +1758,43 @@ const char* OpcodeString(int op) case (int)Op::OpUDotAccSatKHR: return "OpUDotAccSatKHR"; case (int)Op::OpSUDotAccSatKHR: return "OpSUDotAccSatKHR"; + case (int)Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case (int)Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case (int)Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case (int)Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case (int)Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case (int)Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case (int)Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case (int)Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case (int)Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case (int)Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case (int)Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case (int)Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case (int)Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case (int)Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case (int)Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case (int)Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case (int)Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case (int)Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case (int)Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case (int)Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case (int)Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case (int)Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case (int)Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; + case (int)Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case (int)Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case (int)Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case (int)Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case (int)Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; + case (int)Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case (int)Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case (int)Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case (int)Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteEXT"; + case (int)Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case (int)Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case (int)Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case (int)Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + default: return "Bad"; } @@ -1762,6 +1852,7 @@ void Parameterize() InstructionDesc[enumCast(Op::OpTypeStruct)].setResultAndType(true, false); InstructionDesc[enumCast(Op::OpTypeOpaque)].setResultAndType(true, false); InstructionDesc[enumCast(Op::OpTypePointer)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTypeUntypedPointerKHR)].setResultAndType(true, false); InstructionDesc[enumCast(Op::OpTypeForwardPointer)].setResultAndType(false, false); InstructionDesc[enumCast(Op::OpTypeFunction)].setResultAndType(true, false); InstructionDesc[enumCast(Op::OpTypeEvent)].setResultAndType(true, false); @@ -1832,6 +1923,11 @@ void Parameterize() InstructionDesc[enumCast(Op::OpCooperativeVectorStoreNV)].setResultAndType(false, false); InstructionDesc[enumCast(Op::OpCooperativeVectorOuterProductAccumulateNV)].setResultAndType(false, false); InstructionDesc[enumCast(Op::OpCooperativeVectorReduceSumAccumulateNV)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpMemberDecorateIdEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpTypeTensorARM)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpTensorReadARM)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].setResultAndType(false, false); // Specific additional context-dependent operands @@ -1982,6 +2078,7 @@ void Parameterize() InstructionDesc[enumCast(Op::OpTypeStruct)].operands.push(OperandVariableIds, "'Member 0 type', +\n'member 1 type', +\n..."); InstructionDesc[enumCast(Op::OpTypeOpaque)].operands.push(OperandLiteralString, "The name of the opaque type."); + InstructionDesc[enumCast(Op::OpTypeUntypedPointerKHR)].operands.push(OperandStorage, ""); InstructionDesc[enumCast(Op::OpTypePointer)].operands.push(OperandStorage, ""); InstructionDesc[enumCast(Op::OpTypePointer)].operands.push(OperandId, "'Type'"); @@ -2009,6 +2106,9 @@ void Parameterize() InstructionDesc[enumCast(Op::OpSpecConstantOp)].operands.push(OperandLiteralNumber, "'Opcode'"); InstructionDesc[enumCast(Op::OpSpecConstantOp)].operands.push(OperandVariableIds, "'Operands'"); + InstructionDesc[enumCast(Op::OpUntypedVariableKHR)].operands.push(OperandStorage, ""); + InstructionDesc[enumCast(Op::OpUntypedVariableKHR)].operands.push(OperandId, "'Type'", true); + InstructionDesc[enumCast(Op::OpUntypedVariableKHR)].operands.push(OperandId, "'Initializer'", true); InstructionDesc[enumCast(Op::OpVariable)].operands.push(OperandStorage, ""); InstructionDesc[enumCast(Op::OpVariable)].operands.push(OperandId, "'Initializer'", true); @@ -2056,6 +2156,11 @@ void Parameterize() InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandDecoration, ""); InstructionDesc[enumCast(Op::OpMemberDecorate)].operands.push(OperandVariableLiterals, "See <>."); + InstructionDesc[enumCast(Op::OpMemberDecorateIdEXT)].operands.push(OperandId, "'Structure Type'"); + InstructionDesc[enumCast(Op::OpMemberDecorateIdEXT)].operands.push(OperandLiteralNumber, "'Member'"); + InstructionDesc[enumCast(Op::OpMemberDecorateIdEXT)].operands.push(OperandDecoration, ""); + InstructionDesc[enumCast(Op::OpMemberDecorateIdEXT)].operands.push(OperandVariableIds, "See <>."); + InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandId, "'Structure Type'"); InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandLiteralNumber, "'Member'"); InstructionDesc[enumCast(Op::OpMemberDecorateStringGOOGLE)].operands.push(OperandDecoration, ""); @@ -2262,6 +2367,9 @@ void Parameterize() InstructionDesc[enumCast(Op::OpAccessChain)].operands.push(OperandId, "'Base'"); InstructionDesc[enumCast(Op::OpAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); + InstructionDesc[enumCast(Op::OpUntypedAccessChainKHR)].operands.push(OperandId, "'Base Type'"); + InstructionDesc[enumCast(Op::OpUntypedAccessChainKHR)].operands.push(OperandId, "'Base'"); + InstructionDesc[enumCast(Op::OpUntypedAccessChainKHR)].operands.push(OperandVariableIds, "'Indexes'"); InstructionDesc[enumCast(Op::OpInBoundsAccessChain)].operands.push(OperandId, "'Base'"); InstructionDesc[enumCast(Op::OpInBoundsAccessChain)].operands.push(OperandVariableIds, "'Indexes'"); @@ -3099,12 +3207,31 @@ void Parameterize() InstructionDesc[enumCast(Op::OpFragmentFetchAMD)].operands.push(OperandId, "'Coordinate'"); InstructionDesc[enumCast(Op::OpFragmentFetchAMD)].operands.push(OperandId, "'Fragment Index'"); + + InstructionDesc[enumCast(Op::OpTypeBufferEXT)].operands.push(OperandStorage, ""); + InstructionDesc[enumCast(Op::OpTypeBufferEXT)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpConstantSizeOfEXT)].operands.push(OperandId, "'Type'"); + + InstructionDesc[enumCast(Op::OpBufferPointerEXT)].operands.push(OperandId, "'Buffer'"); + + InstructionDesc[enumCast(Op::OpUntypedImageTexelPointerEXT)].operands.push(OperandId, "'ImageType'"); + InstructionDesc[enumCast(Op::OpUntypedImageTexelPointerEXT)].operands.push(OperandId, "'Image'"); + InstructionDesc[enumCast(Op::OpUntypedImageTexelPointerEXT)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpUntypedImageTexelPointerEXT)].operands.push(OperandId, "'Sample'"); + InstructionDesc[enumCast(Op::OpGroupNonUniformPartitionNV)].operands.push(OperandId, "X"); InstructionDesc[enumCast(Op::OpGroupNonUniformQuadAllKHR)].operands.push(OperandId, "'Predicate'"); InstructionDesc[enumCast(Op::OpGroupNonUniformQuadAnyKHR)].operands.push(OperandId, "'Predicate'"); InstructionDesc[enumCast(Op::OpTypeAccelerationStructureKHR)].setResultAndType(true, false); + InstructionDesc[enumCast(Op::OpConstantDataKHR)].operands.push(OperandLiteralString, "'Data'"); + InstructionDesc[enumCast(Op::OpSpecConstantDataKHR)].operands.push(OperandLiteralString, "'Data'"); + InstructionDesc[enumCast(Op::OpAbortKHR)].operands.push(OperandId, "'Message Type'"); + InstructionDesc[enumCast(Op::OpAbortKHR)].operands.push(OperandId, "'Message'"); + InstructionDesc[enumCast(Op::OpAbortKHR)].setResultAndType(false, false); + InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Acceleration Structure'"); InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Ray Flags'"); InstructionDesc[enumCast(Op::OpTraceNV)].operands.push(OperandId, "'Cull Mask'"); @@ -3714,6 +3841,19 @@ void Parameterize() InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].operands.push(OperandImageOperands, "", true); InstructionDesc[enumCast(Op::OpImageBlockMatchGatherSADQCOM)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpBitCastArrayQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpCompositeConstructCoopMatQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpCompositeConstructCoopMatQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpCompositeExtractCoopMatQCOM)].operands.push(OperandId, "'source cooperative matrix'"); + InstructionDesc[enumCast(Op::OpCompositeExtractCoopMatQCOM)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].operands.push(OperandId, "'source array'"); + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].operands.push(OperandId, "'start index'"); + InstructionDesc[enumCast(Op::OpExtractSubArrayQCOM)].setResultAndType(true, true); + InstructionDesc[enumCast(Op::OpConstantCompositeReplicateEXT)].operands.push(OperandId, "'Value'"); InstructionDesc[enumCast(Op::OpSpecConstantCompositeReplicateEXT)].operands.push(OperandId, "'Value'"); InstructionDesc[enumCast(Op::OpCompositeConstructReplicateEXT)].operands.push(OperandId, "'Value'"); @@ -3805,6 +3945,210 @@ void Parameterize() InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Vector2'"); InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandId, "'Accumulator'"); InstructionDesc[enumCast(Op::OpSUDotAccSatKHR)].operands.push(OperandLiteralNumber, "'PackedVectorFormat'"); + + InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Element Type'"); + InstructionDesc[enumCast(Op::OpTypeTensorARM)].operands.push(OperandId, "'Rank'"); + + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true); + InstructionDesc[enumCast(Op::OpTensorReadARM)].operands.push(OperandVariableIds, "'Tensor Operands'"); + + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Coordinate'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandId, "'Object'"); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandLiteralNumber, "'Tensor Operand'", true); + InstructionDesc[enumCast(Op::OpTensorWriteARM)].operands.push(OperandVariableIds, "'Tensor Operands'"); + + InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Tensor'"); + InstructionDesc[enumCast(Op::OpTensorQuerySizeARM)].operands.push(OperandId, "'Dimension'", true); + + InstructionDesc[enumCast(Op::OpTypeHitObjectEXT)].setResultAndType(true, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleNV)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderRecordBufferHandleEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHintEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpReorderThreadWithHitObjectEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetCurrentTimeEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetHitKindEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetPrimitiveIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetGeometryIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceIdEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetInstanceCustomIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayDirectionEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectRayOriginEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayDirectionEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldRayOriginEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetWorldToObjectEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetObjectToWorldEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMaxEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayTMinEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetRayFlagsEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetShaderBindingTableRecordIndexEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsEmptyEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsHitEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectIsMissEXT)].setResultAndType(true, true); + + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[enumCast(Op::OpHitObjectGetAttributesEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectExecuteShaderEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'SBT Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].operands.push(OperandId, "'Current Time'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordMissMotionEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordEmptyEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceRayMotionEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectSetShaderBindingTableRecordIndexEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectReorderExecuteShaderEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceReorderExecuteEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Acceleration Structure'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'RayFlags'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Cullmask'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Offset'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'SBT Record Stride'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Miss Index'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Origin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMin'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Direction'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'TMax'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Time'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Payload'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Hint'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].operands.push(OperandId, "'Bits'"); + InstructionDesc[enumCast(Op::OpHitObjectTraceMotionReorderExecuteEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'RayQuery'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'SBT Record Index'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'HitObjectAttribute'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].operands.push(OperandId, "'Hit Kind'"); + InstructionDesc[enumCast(Op::OpHitObjectRecordFromQueryEXT)].setResultAndType(false, false); + + InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].operands.push(OperandId, "'HitObject'"); + InstructionDesc[enumCast(Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT)].setResultAndType(true, true); + }); } diff --git a/src/libraries/glslang/SPIRV/hex_float.h b/src/libraries/glslang/SPIRV/hex_float.h index 22bcefb75..c2259e3f4 100644 --- a/src/libraries/glslang/SPIRV/hex_float.h +++ b/src/libraries/glslang/SPIRV/hex_float.h @@ -252,6 +252,7 @@ struct HexFloatTraits { // The bias of the exponent. (How much we need to subtract from the stored // value to get the correct value.) static const uint32_t exponent_bias = 0; + static bool supportsInfinity() { return true; } }; // Traits for IEEE float. @@ -266,6 +267,7 @@ struct HexFloatTraits> { static const uint_type num_exponent_bits = 8; static const uint_type num_fraction_bits = 23; static const uint_type exponent_bias = 127; + static bool supportsInfinity() { return true; } }; // Traits for IEEE double. @@ -280,6 +282,7 @@ struct HexFloatTraits> { static const uint_type num_exponent_bits = 11; static const uint_type num_fraction_bits = 52; static const uint_type exponent_bias = 1023; + static bool supportsInfinity() { return true; } }; // Traits for IEEE half. @@ -294,6 +297,7 @@ struct HexFloatTraits> { static const uint_type num_exponent_bits = 5; static const uint_type num_fraction_bits = 10; static const uint_type exponent_bias = 15; + static bool supportsInfinity() { return true; } }; template <> @@ -306,6 +310,7 @@ struct HexFloatTraits> { static const uint_type num_exponent_bits = 5; static const uint_type num_fraction_bits = 2; static const uint_type exponent_bias = 15; + static bool supportsInfinity() { return true; } }; template <> @@ -318,6 +323,7 @@ struct HexFloatTraits> { static const uint_type num_exponent_bits = 4; static const uint_type num_fraction_bits = 3; static const uint_type exponent_bias = 7; + static bool supportsInfinity() { return false; } }; enum round_direction { @@ -337,6 +343,7 @@ class HexFloat { typedef typename Traits::int_type int_type; typedef typename Traits::underlying_type underlying_type; typedef typename Traits::native_type native_type; + using Traits_T = Traits; explicit HexFloat(T f) : value_(f) {} @@ -678,14 +685,22 @@ class HexFloat { (getBits() & exponent_mask) == exponent_mask && significand != 0; bool is_inf = !is_nan && - ((exponent + carried) > static_cast(other_T::exponent_bias) || + (((exponent + carried) > static_cast(other_T::exponent_bias) && other_T::Traits_T::supportsInfinity()) || + ((exponent + carried) > static_cast(other_T::exponent_bias + 1) && !other_T::Traits_T::supportsInfinity()) || (significand == 0 && (getBits() & exponent_mask) == exponent_mask)); // If we are Nan or Inf we should pass that through. if (is_inf) { - other.set_value(BitwiseCast( - static_cast( - (negate ? other_T::sign_mask : 0) | other_T::exponent_mask))); + if (other_T::Traits_T::supportsInfinity()) { + // encode as +/-inf + other.set_value(BitwiseCast( + static_cast( + (negate ? other_T::sign_mask : 0) | other_T::exponent_mask))); + } else { + // encode as +/-nan + other.set_value(BitwiseCast( + static_cast(negate ? ~0 : ~other_T::sign_mask))); + } return; } if (is_nan) { diff --git a/src/libraries/glslang/SPIRV/spirv.hpp11 b/src/libraries/glslang/SPIRV/spirv.hpp11 index 14f2fc227..b35139e61 100644 --- a/src/libraries/glslang/SPIRV/spirv.hpp11 +++ b/src/libraries/glslang/SPIRV/spirv.hpp11 @@ -207,6 +207,7 @@ enum class ExecutionMode : unsigned { SampleInterlockUnorderedEXT = 5369, ShadingRateInterlockOrderedEXT = 5370, ShadingRateInterlockUnorderedEXT = 5371, + Shader64BitIndexingEXT = 5427, SharedLocalMemorySizeINTEL = 5618, RoundingModeRTPINTEL = 5620, RoundingModeRTNINTEL = 5621, @@ -261,6 +262,7 @@ enum class StorageClass : unsigned { PhysicalStorageBufferEXT = 5349, HitObjectAttributeNV = 5385, TaskPayloadWorkgroupEXT = 5402, + HitObjectAttributeEXT = 5411, CodeSectionINTEL = 5605, DeviceOnlyINTEL = 5936, HostOnlyINTEL = 5937, @@ -546,7 +548,7 @@ enum class Decoration : unsigned { Alignment = 44, MaxByteOffset = 45, AlignmentId = 46, - MaxByteOffsetId = 47, + MaxByteOffsetId = 47, SaturatedToLargestFloat8NormalConversionEXT = 4216, NoSignedWrap = 4469, NoUnsignedWrap = 4470, @@ -562,6 +564,9 @@ enum class Decoration : unsigned { PayloadNodeSparseArrayAMDX = 5099, PayloadNodeArraySizeAMDX = 5100, PayloadDispatchIndirectAMDX = 5105, + ArrayStrideIdEXT = 5124, + OffsetIdEXT = 5125, + UTFEncodedKHR = 5145, OverrideCoverageNV = 5248, PassthroughNV = 5250, ViewportRelativeNV = 5252, @@ -578,7 +583,10 @@ enum class Decoration : unsigned { RestrictPointerEXT = 5355, AliasedPointer = 5356, AliasedPointerEXT = 5356, + MemberOffsetNV = 5358, HitObjectShaderRecordBufferNV = 5386, + HitObjectShaderRecordBufferEXT = 5389, + BankNV = 5397, BindlessSamplerNV = 5398, BindlessImageNV = 5399, BoundSamplerNV = 5400, @@ -730,6 +738,8 @@ enum class BuiltIn : unsigned { FragStencilRefEXT = 5014, RemainingRecursionLevelsAMDX = 5021, ShaderIndexAMDX = 5073, + SamplerHeapEXT = 5122, + ResourceHeapEXT = 5123, ViewportMaskNV = 5253, SecondaryPositionNV = 5257, SecondaryViewportMaskNV = 5258, @@ -1070,8 +1080,9 @@ enum class Capability : unsigned { TileImageColorReadAccessEXT = 4166, TileImageDepthReadAccessEXT = 4167, TileImageStencilReadAccessEXT = 4168, - CooperativeMatrixLayoutsARM = 4201, - Float8EXT = 4212, + TensorsARM = 4174, + CooperativeMatrixLayoutsARM = 4201, + Float8EXT = 4212, Float8CooperativeMatrixEXT = 4213, FragmentShadingRateKHR = 4422, SubgroupBallotKHR = 4423, @@ -1109,6 +1120,7 @@ enum class Capability : unsigned { TextureBoxFilterQCOM = 4485, TextureBlockMatchQCOM = 4486, TileShadingQCOM = 4495, + CooperativeMatrixConversionQCOM = 4496, TextureBlockMatch2QCOM = 4498, Float16ImageAMD = 5008, ImageGatherBiasLodAMD = 5009, @@ -1122,6 +1134,9 @@ enum class Capability : unsigned { BFloat16TypeKHR = 5116, BFloat16DotProductKHR = 5117, BFloat16CooperativeMatrixKHR = 5118, + AbortKHR = 5120, + DescriptorHeapEXT = 5128, + ConstantDataKHR = 5146, SampleMaskOverrideCoverageNV = 5249, GeometryShaderPassthroughNV = 5251, ShaderViewportIndexLayerEXT = 5254, @@ -1186,6 +1201,7 @@ enum class Capability : unsigned { DisplacementMicromapNV = 5380, RayTracingOpacityMicromapEXT = 5381, ShaderInvocationReorderNV = 5383, + ShaderInvocationReorderEXT = 5388, BindlessTextureNV = 5390, RayQueryPositionFetchKHR = 5391, CooperativeVectorNV = 5394, @@ -1194,6 +1210,9 @@ enum class Capability : unsigned { RawAccessChainsNV = 5414, RayTracingSpheresGeometryNV = 5418, RayTracingLinearSweptSpheresGeometryNV = 5419, + PushConstantBanksNV = 5423, + LongVectorEXT = 5425, + Shader64BitIndexingEXT = 5426, CooperativeMatrixReductionsNV = 5430, CooperativeMatrixConversionsNV = 5431, CooperativeMatrixPerElementOperationsNV = 5432, @@ -1460,6 +1479,18 @@ enum class TensorAddressingOperandsMask : unsigned { DecodeFunc = 0x00000002, }; +enum class TensorOperandsShift : unsigned { + NontemporalARM = 0, + OutOfBoundsValueARM = 1, + Max = 0x7fffffff, +}; + +enum class TensorOperandsMask : unsigned { + MaskNone = 0, + NontemporalARM = 0x00000001, + OutOfBoundsValueARM = 0x00000002, +}; + enum class InitializationModeQualifier : unsigned { InitOnDeviceReprogramINTEL = 0, InitOnDeviceResetINTEL = 1, @@ -1546,8 +1577,8 @@ enum class RawAccessChainOperandsMask : unsigned { enum class FPEncoding : unsigned { BFloat16KHR = 0, - Float8E4M3EXT = 4214, - Float8E5M2EXT = 4215, + Float8E4M3EXT = 4214, + Float8E5M2EXT = 4215, Max = 0x7fffffff, }; @@ -1926,6 +1957,10 @@ enum class Op : unsigned { OpColorAttachmentReadEXT = 4160, OpDepthAttachmentReadEXT = 4161, OpStencilAttachmentReadEXT = 4162, + OpTypeTensorARM = 4163, + OpTensorReadARM = 4164, + OpTensorWriteARM = 4165, + OpTensorQuerySizeARM = 4166, OpTerminateInvocation = 4416, OpTypeUntypedPointerKHR = 4417, OpUntypedVariableKHR = 4418, @@ -1979,10 +2014,14 @@ enum class Op : unsigned { OpImageBoxFilterQCOM = 4481, OpImageBlockMatchSSDQCOM = 4482, OpImageBlockMatchSADQCOM = 4483, + OpBitCastArrayQCOM = 4497, OpImageBlockMatchWindowSSDQCOM = 4500, OpImageBlockMatchWindowSADQCOM = 4501, OpImageBlockMatchGatherSSDQCOM = 4502, OpImageBlockMatchGatherSADQCOM = 4503, + OpCompositeConstructCoopMatQCOM = 4540, + OpCompositeExtractCoopMatQCOM = 4541, + OpExtractSubArrayQCOM = 4542, OpGroupIAddNonUniformAMD = 5000, OpGroupFAddNonUniformAMD = 5001, OpGroupFMinNonUniformAMD = 5002, @@ -2004,6 +2043,14 @@ enum class Op : unsigned { OpSpecConstantStringAMDX = 5104, OpGroupNonUniformQuadAllKHR = 5110, OpGroupNonUniformQuadAnyKHR = 5111, + OpTypeBufferEXT = 5115, + OpBufferPointerEXT = 5119, + OpAbortKHR = 5121, + OpUntypedImageTexelPointerEXT = 5126, + OpMemberDecorateIdEXT = 5127, + OpConstantSizeOfEXT = 5129, + OpConstantDataKHR = 5147, + OpSpecConstantDataKHR = 5148, OpHitObjectRecordHitMotionNV = 5249, OpHitObjectRecordHitWithIndexMotionNV = 5250, OpHitObjectRecordMissMotionNV = 5251, @@ -2039,6 +2086,7 @@ enum class Op : unsigned { OpTypeHitObjectNV = 5281, OpImageSampleFootprintNV = 5283, OpTypeCooperativeVectorNV = 5288, + OpTypeVectorIdEXT = 5288, OpCooperativeVectorMatrixMulNV = 5289, OpCooperativeVectorOuterProductAccumulateNV = 5290, OpCooperativeVectorReduceSumAccumulateNV = 5291, @@ -2052,6 +2100,36 @@ enum class Op : unsigned { OpFetchMicroTriangleVertexBarycentricNV = 5301, OpCooperativeVectorLoadNV = 5302, OpCooperativeVectorStoreNV = 5303, + OpHitObjectRecordFromQueryEXT = 5304, + OpHitObjectRecordMissEXT = 5305, + OpHitObjectRecordMissMotionEXT = 5306, + OpHitObjectGetIntersectionTriangleVertexPositionsEXT = 5307, + OpHitObjectGetRayFlagsEXT = 5308, + OpHitObjectSetShaderBindingTableRecordIndexEXT = 5309, + OpHitObjectReorderExecuteShaderEXT = 5310, + OpHitObjectTraceReorderExecuteEXT = 5311, + OpHitObjectTraceMotionReorderExecuteEXT = 5312, + OpTypeHitObjectEXT = 5313, + OpReorderThreadWithHintEXT = 5314, + OpReorderThreadWithHitObjectEXT = 5315, + OpHitObjectTraceRayEXT = 5316, + OpHitObjectTraceRayMotionEXT = 5317, + OpHitObjectRecordEmptyEXT = 5318, + OpHitObjectExecuteShaderEXT = 5319, + OpHitObjectGetCurrentTimeEXT = 5320, + OpHitObjectGetAttributesEXT = 5321, + OpHitObjectGetHitKindEXT = 5322, + OpHitObjectGetPrimitiveIndexEXT = 5323, + OpHitObjectGetGeometryIndexEXT = 5324, + OpHitObjectGetInstanceIdEXT = 5325, + OpHitObjectGetInstanceCustomIndexEXT = 5326, + OpHitObjectGetObjectRayOriginEXT = 5327, + OpHitObjectGetObjectRayDirectionEXT = 5328, + OpHitObjectGetWorldRayDirectionEXT = 5329, + OpHitObjectGetWorldRayOriginEXT = 5330, + OpHitObjectGetObjectToWorldEXT = 5331, + OpHitObjectGetWorldToObjectEXT = 5332, + OpHitObjectGetRayTMaxEXT = 5333, OpReportIntersectionKHR = 5334, OpReportIntersectionNV = 5334, OpIgnoreIntersectionNV = 5335, @@ -2065,6 +2143,12 @@ enum class Op : unsigned { OpExecuteCallableNV = 5344, OpRayQueryGetClusterIdNV = 5345, OpHitObjectGetClusterIdNV = 5346, + OpHitObjectGetRayTMinEXT = 5347, + OpHitObjectGetShaderBindingTableRecordIndexEXT = 5348, + OpHitObjectGetShaderRecordBufferHandleEXT = 5349, + OpHitObjectIsEmptyEXT = 5350, + OpHitObjectIsHitEXT = 5351, + OpHitObjectIsMissEXT = 5352, OpTypeCooperativeMatrixNV = 5358, OpCooperativeMatrixLoadNV = 5359, OpCooperativeMatrixStoreNV = 5360, @@ -2735,6 +2819,10 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpColorAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case Op::OpDepthAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; case Op::OpStencilAttachmentReadEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeTensorARM: *hasResult = true; *hasResultType = false; break; + case Op::OpTensorReadARM: *hasResult = true; *hasResultType = true; break; + case Op::OpTensorWriteARM: *hasResult = false; *hasResultType = false; break; + case Op::OpTensorQuerySizeARM: *hasResult = true; *hasResultType = true; break; case Op::OpTerminateInvocation: *hasResult = false; *hasResultType = false; break; case Op::OpTypeUntypedPointerKHR: *hasResult = true; *hasResultType = false; break; case Op::OpUntypedVariableKHR: *hasResult = true; *hasResultType = true; break; @@ -2749,6 +2837,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpBufferPointerEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpUntypedImageTexelPointerEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpMemberDecorateIdEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantSizeOfEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpTypeBufferEXT: *hasResult = true; *hasResultType = false; break; case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break; case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break; case Op::OpExtInstWithForwardRefsKHR: *hasResult = true; *hasResultType = true; break; @@ -2782,10 +2875,14 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpImageBoxFilterQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchSSDQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpBitCastArrayQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchWindowSSDQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchWindowSADQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchGatherSSDQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpImageBlockMatchGatherSADQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeConstructCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpCompositeExtractCoopMatQCOM: *hasResult = true; *hasResultType = true; break; + case Op::OpExtractSubArrayQCOM: *hasResult = true; *hasResultType = true; break; case Op::OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break; case Op::OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break; @@ -2807,6 +2904,9 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpSpecConstantStringAMDX: *hasResult = true; *hasResultType = false; break; case Op::OpGroupNonUniformQuadAllKHR: *hasResult = true; *hasResultType = true; break; case Op::OpGroupNonUniformQuadAnyKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpAbortKHR: *hasResult = false; *hasResultType = false; break; + case Op::OpConstantDataKHR: *hasResult = true; *hasResultType = true; break; + case Op::OpSpecConstantDataKHR : *hasResult = true; *hasResultType = true; break; case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break; case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break; case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break; @@ -2855,6 +2955,36 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpFetchMicroTriangleVertexBarycentricNV: *hasResult = true; *hasResultType = true; break; case Op::OpCooperativeVectorLoadNV: *hasResult = true; *hasResultType = true; break; case Op::OpCooperativeVectorStoreNV: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordFromQueryEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordMissMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayFlagsEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectReorderExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpTypeHitObjectEXT: *hasResult = true; *hasResultType = false; break; + case Op::OpReorderThreadWithHintEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpReorderThreadWithHitObjectEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectTraceRayMotionEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectRecordEmptyEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectExecuteShaderEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetCurrentTimeEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetAttributesEXT: *hasResult = false; *hasResultType = false; break; + case Op::OpHitObjectGetHitKindEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetPrimitiveIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetGeometryIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceIdEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetInstanceCustomIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayDirectionEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldRayOriginEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetObjectToWorldEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetWorldToObjectEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMaxEXT: *hasResult = true; *hasResultType = true; break; case Op::OpReportIntersectionKHR: *hasResult = true; *hasResultType = true; break; case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break; case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break; @@ -2866,6 +2996,12 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) { case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break; case Op::OpRayQueryGetClusterIdNV: *hasResult = true; *hasResultType = true; break; case Op::OpHitObjectGetClusterIdNV: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetRayTMinEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsEmptyEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsHitEXT: *hasResult = true; *hasResultType = true; break; + case Op::OpHitObjectIsMissEXT: *hasResult = true; *hasResultType = true; break; case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break; case Op::OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break; case Op::OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break; @@ -3320,6 +3456,7 @@ inline const char* ExecutionModeToString(ExecutionMode value) { case ExecutionMode::SampleInterlockUnorderedEXT: return "SampleInterlockUnorderedEXT"; case ExecutionMode::ShadingRateInterlockOrderedEXT: return "ShadingRateInterlockOrderedEXT"; case ExecutionMode::ShadingRateInterlockUnorderedEXT: return "ShadingRateInterlockUnorderedEXT"; + case ExecutionMode::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; case ExecutionMode::SharedLocalMemorySizeINTEL: return "SharedLocalMemorySizeINTEL"; case ExecutionMode::RoundingModeRTPINTEL: return "RoundingModeRTPINTEL"; case ExecutionMode::RoundingModeRTNINTEL: return "RoundingModeRTNINTEL"; @@ -3369,6 +3506,7 @@ inline const char* StorageClassToString(StorageClass value) { case StorageClass::PhysicalStorageBuffer: return "PhysicalStorageBuffer"; case StorageClass::HitObjectAttributeNV: return "HitObjectAttributeNV"; case StorageClass::TaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT"; + case StorageClass::HitObjectAttributeEXT: return "HitObjectAttributeEXT"; case StorageClass::CodeSectionINTEL: return "CodeSectionINTEL"; case StorageClass::DeviceOnlyINTEL: return "DeviceOnlyINTEL"; case StorageClass::HostOnlyINTEL: return "HostOnlyINTEL"; @@ -3600,7 +3738,7 @@ inline const char* DecorationToString(Decoration value) { case Decoration::Alignment: return "Alignment"; case Decoration::MaxByteOffset: return "MaxByteOffset"; case Decoration::AlignmentId: return "AlignmentId"; - case Decoration::MaxByteOffsetId: return "MaxByteOffsetId"; + case Decoration::MaxByteOffsetId: return "MaxByteOffsetId"; case Decoration::SaturatedToLargestFloat8NormalConversionEXT: return "SaturatedToLargestFloat8NormalConversionEXT"; case Decoration::NoSignedWrap: return "NoSignedWrap"; case Decoration::NoUnsignedWrap: return "NoUnsignedWrap"; @@ -3616,6 +3754,7 @@ inline const char* DecorationToString(Decoration value) { case Decoration::PayloadNodeSparseArrayAMDX: return "PayloadNodeSparseArrayAMDX"; case Decoration::PayloadNodeArraySizeAMDX: return "PayloadNodeArraySizeAMDX"; case Decoration::PayloadDispatchIndirectAMDX: return "PayloadDispatchIndirectAMDX"; + case Decoration::UTFEncodedKHR: return "UTFEncodedKHR"; case Decoration::OverrideCoverageNV: return "OverrideCoverageNV"; case Decoration::PassthroughNV: return "PassthroughNV"; case Decoration::ViewportRelativeNV: return "ViewportRelativeNV"; @@ -3627,7 +3766,10 @@ inline const char* DecorationToString(Decoration value) { case Decoration::NonUniform: return "NonUniform"; case Decoration::RestrictPointer: return "RestrictPointer"; case Decoration::AliasedPointer: return "AliasedPointer"; + case Decoration::MemberOffsetNV: return "MemberOffsetNV"; case Decoration::HitObjectShaderRecordBufferNV: return "HitObjectShaderRecordBufferNV"; + case Decoration::BankNV: return "BankNV"; + case Decoration::HitObjectShaderRecordBufferEXT: return "HitObjectShaderRecordBufferEXT"; case Decoration::BindlessSamplerNV: return "BindlessSamplerNV"; case Decoration::BindlessImageNV: return "BindlessImageNV"; case Decoration::BoundSamplerNV: return "BoundSamplerNV"; @@ -3944,9 +4086,10 @@ inline const char* CapabilityToString(Capability value) { case Capability::TileImageColorReadAccessEXT: return "TileImageColorReadAccessEXT"; case Capability::TileImageDepthReadAccessEXT: return "TileImageDepthReadAccessEXT"; case Capability::TileImageStencilReadAccessEXT: return "TileImageStencilReadAccessEXT"; + case Capability::TensorsARM: return "TensorsARM"; case Capability::CooperativeMatrixLayoutsARM: return "CooperativeMatrixLayoutsARM"; - case Capability::Float8EXT: return "Float8EXT"; - case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; + case Capability::Float8EXT: return "Float8EXT"; + case Capability::Float8CooperativeMatrixEXT: return "Float8CooperativeMatrixEXT"; case Capability::FragmentShadingRateKHR: return "FragmentShadingRateKHR"; case Capability::SubgroupBallotKHR: return "SubgroupBallotKHR"; case Capability::DrawParameters: return "DrawParameters"; @@ -3981,6 +4124,7 @@ inline const char* CapabilityToString(Capability value) { case Capability::TextureBoxFilterQCOM: return "TextureBoxFilterQCOM"; case Capability::TextureBlockMatchQCOM: return "TextureBlockMatchQCOM"; case Capability::TileShadingQCOM: return "TileShadingQCOM"; + case Capability::CooperativeMatrixConversionQCOM: return "CooperativeMatrixConversionQCOM"; case Capability::TextureBlockMatch2QCOM: return "TextureBlockMatch2QCOM"; case Capability::Float16ImageAMD: return "Float16ImageAMD"; case Capability::ImageGatherBiasLodAMD: return "ImageGatherBiasLodAMD"; @@ -3994,6 +4138,8 @@ inline const char* CapabilityToString(Capability value) { case Capability::BFloat16TypeKHR: return "BFloat16TypeKHR"; case Capability::BFloat16DotProductKHR: return "BFloat16DotProductKHR"; case Capability::BFloat16CooperativeMatrixKHR: return "BFloat16CooperativeMatrixKHR"; + case Capability::AbortKHR: return "AbortKHR"; + case Capability::ConstantDataKHR: return "ConstantDataKHR"; case Capability::SampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV"; case Capability::GeometryShaderPassthroughNV: return "GeometryShaderPassthroughNV"; case Capability::ShaderViewportIndexLayerEXT: return "ShaderViewportIndexLayerEXT"; @@ -4037,6 +4183,7 @@ inline const char* CapabilityToString(Capability value) { case Capability::DisplacementMicromapNV: return "DisplacementMicromapNV"; case Capability::RayTracingOpacityMicromapEXT: return "RayTracingOpacityMicromapEXT"; case Capability::ShaderInvocationReorderNV: return "ShaderInvocationReorderNV"; + case Capability::ShaderInvocationReorderEXT: return "ShaderInvocationReorderEXT"; case Capability::BindlessTextureNV: return "BindlessTextureNV"; case Capability::RayQueryPositionFetchKHR: return "RayQueryPositionFetchKHR"; case Capability::CooperativeVectorNV: return "CooperativeVectorNV"; @@ -4045,6 +4192,9 @@ inline const char* CapabilityToString(Capability value) { case Capability::RawAccessChainsNV: return "RawAccessChainsNV"; case Capability::RayTracingSpheresGeometryNV: return "RayTracingSpheresGeometryNV"; case Capability::RayTracingLinearSweptSpheresGeometryNV: return "RayTracingLinearSweptSpheresGeometryNV"; + case Capability::PushConstantBanksNV: return "PushConstantBanksNV"; + case Capability::LongVectorEXT: return "LongVectorEXT"; + case Capability::Shader64BitIndexingEXT: return "Shader64BitIndexingEXT"; case Capability::CooperativeMatrixReductionsNV: return "CooperativeMatrixReductionsNV"; case Capability::CooperativeMatrixConversionsNV: return "CooperativeMatrixConversionsNV"; case Capability::CooperativeMatrixPerElementOperationsNV: return "CooperativeMatrixPerElementOperationsNV"; @@ -4285,8 +4435,8 @@ inline const char* NamedMaximumNumberOfRegistersToString(NamedMaximumNumberOfReg inline const char* FPEncodingToString(FPEncoding value) { switch (value) { case FPEncoding::BFloat16KHR: return "BFloat16KHR"; - case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT"; - case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT"; + case FPEncoding::Float8E4M3EXT: return "Float8E4M3EXT"; + case FPEncoding::Float8E5M2EXT: return "Float8E5M2EXT"; default: return "Unknown"; } } @@ -4671,6 +4821,10 @@ inline const char* OpToString(Op value) { case Op::OpColorAttachmentReadEXT: return "OpColorAttachmentReadEXT"; case Op::OpDepthAttachmentReadEXT: return "OpDepthAttachmentReadEXT"; case Op::OpStencilAttachmentReadEXT: return "OpStencilAttachmentReadEXT"; + case Op::OpTypeTensorARM: return "OpTypeTensorARM"; + case Op::OpTensorReadARM: return "OpTensorReadARM"; + case Op::OpTensorWriteARM: return "OpTensorWriteARM"; + case Op::OpTensorQuerySizeARM: return "OpTensorQuerySizeARM"; case Op::OpTerminateInvocation: return "OpTerminateInvocation"; case Op::OpTypeUntypedPointerKHR: return "OpTypeUntypedPointerKHR"; case Op::OpUntypedVariableKHR: return "OpUntypedVariableKHR"; @@ -4685,6 +4839,11 @@ inline const char* OpToString(Op value) { case Op::OpSubgroupAllKHR: return "OpSubgroupAllKHR"; case Op::OpSubgroupAnyKHR: return "OpSubgroupAnyKHR"; case Op::OpSubgroupAllEqualKHR: return "OpSubgroupAllEqualKHR"; + case Op::OpBufferPointerEXT: return "OpBufferPointerEXT"; + case Op::OpUntypedImageTexelPointerEXT: return "OpUntypedImageTexelPointerEXT"; + case Op::OpMemberDecorateIdEXT: return "OpMemberDecorateIdEXT"; + case Op::OpConstantSizeOfEXT: return "OpConstantSizeOfEXT"; + case Op::OpTypeBufferEXT: return "OpTypeBufferEXT"; case Op::OpGroupNonUniformRotateKHR: return "OpGroupNonUniformRotateKHR"; case Op::OpSubgroupReadInvocationKHR: return "OpSubgroupReadInvocationKHR"; case Op::OpExtInstWithForwardRefsKHR: return "OpExtInstWithForwardRefsKHR"; @@ -4718,10 +4877,14 @@ inline const char* OpToString(Op value) { case Op::OpImageBoxFilterQCOM: return "OpImageBoxFilterQCOM"; case Op::OpImageBlockMatchSSDQCOM: return "OpImageBlockMatchSSDQCOM"; case Op::OpImageBlockMatchSADQCOM: return "OpImageBlockMatchSADQCOM"; + case Op::OpBitCastArrayQCOM: return "OpBitCastArrayQCOM"; case Op::OpImageBlockMatchWindowSSDQCOM: return "OpImageBlockMatchWindowSSDQCOM"; case Op::OpImageBlockMatchWindowSADQCOM: return "OpImageBlockMatchWindowSADQCOM"; case Op::OpImageBlockMatchGatherSSDQCOM: return "OpImageBlockMatchGatherSSDQCOM"; case Op::OpImageBlockMatchGatherSADQCOM: return "OpImageBlockMatchGatherSADQCOM"; + case Op::OpCompositeConstructCoopMatQCOM: return "OpCompositeConstructCoopMatQCOM"; + case Op::OpCompositeExtractCoopMatQCOM: return "OpCompositeExtractCoopMatQCOM"; + case Op::OpExtractSubArrayQCOM: return "OpExtractSubArrayQCOM"; case Op::OpGroupIAddNonUniformAMD: return "OpGroupIAddNonUniformAMD"; case Op::OpGroupFAddNonUniformAMD: return "OpGroupFAddNonUniformAMD"; case Op::OpGroupFMinNonUniformAMD: return "OpGroupFMinNonUniformAMD"; @@ -4743,6 +4906,9 @@ inline const char* OpToString(Op value) { case Op::OpSpecConstantStringAMDX: return "OpSpecConstantStringAMDX"; case Op::OpGroupNonUniformQuadAllKHR: return "OpGroupNonUniformQuadAllKHR"; case Op::OpGroupNonUniformQuadAnyKHR: return "OpGroupNonUniformQuadAnyKHR"; + case Op::OpAbortKHR: return "OpAbortKHR"; + case Op::OpConstantDataKHR: return "OpConstantDataKHR"; + case Op::OpSpecConstantDataKHR: return "OpSpecConstantDataKHR"; case Op::OpHitObjectRecordHitMotionNV: return "OpHitObjectRecordHitMotionNV"; case Op::OpHitObjectRecordHitWithIndexMotionNV: return "OpHitObjectRecordHitWithIndexMotionNV"; case Op::OpHitObjectRecordMissMotionNV: return "OpHitObjectRecordMissMotionNV"; @@ -4791,6 +4957,36 @@ inline const char* OpToString(Op value) { case Op::OpFetchMicroTriangleVertexBarycentricNV: return "OpFetchMicroTriangleVertexBarycentricNV"; case Op::OpCooperativeVectorLoadNV: return "OpCooperativeVectorLoadNV"; case Op::OpCooperativeVectorStoreNV: return "OpCooperativeVectorStoreNV"; + case Op::OpHitObjectRecordFromQueryEXT: return "OpHitObjectRecordFromQueryEXT"; + case Op::OpHitObjectRecordMissEXT: return "OpHitObjectRecordMissEXT"; + case Op::OpHitObjectRecordMissMotionEXT: return "OpHitObjectRecordMissMotionEXT"; + case Op::OpHitObjectGetIntersectionTriangleVertexPositionsEXT: return "OpHitObjectGetIntersectionTriangleVertexPositionsEXT"; + case Op::OpHitObjectGetRayFlagsEXT: return "OpHitObjectGetRayFlagsEXT"; + case Op::OpHitObjectSetShaderBindingTableRecordIndexEXT: return "OpHitObjectSetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectReorderExecuteShaderEXT: return "OpHitObjectReorderExecuteShaderEXT"; + case Op::OpHitObjectTraceReorderExecuteEXT: return "OpHitObjectTraceReorderExecuteEXT"; + case Op::OpHitObjectTraceMotionReorderExecuteEXT: return "OpHitObjectTraceMotionReorderExecuteEXT"; + case Op::OpTypeHitObjectEXT: return "OpTypeHitObjectEXT"; + case Op::OpReorderThreadWithHintEXT: return "OpReorderThreadWithHintEXT"; + case Op::OpReorderThreadWithHitObjectEXT: return "OpReorderThreadWithHitObjectEXT"; + case Op::OpHitObjectTraceRayEXT: return "OpHitObjectTraceRayEXT"; + case Op::OpHitObjectTraceRayMotionEXT: return "OpHitObjectTraceRayMotionEXT"; + case Op::OpHitObjectRecordEmptyEXT: return "OpHitObjectRecordEmptyEXT"; + case Op::OpHitObjectExecuteShaderEXT: return "OpHitObjectExecuteShaderEXT"; + case Op::OpHitObjectGetCurrentTimeEXT: return "OpHitObjectGetCurrentTimeEXT"; + case Op::OpHitObjectGetAttributesEXT: return "OpHitObjectGetAttributesEXT"; + case Op::OpHitObjectGetHitKindEXT: return "OpHitObjectGetHitKindEXT"; + case Op::OpHitObjectGetPrimitiveIndexEXT: return "OpHitObjectGetPrimitiveIndexEXT"; + case Op::OpHitObjectGetGeometryIndexEXT: return "OpHitObjectGetGeometryIndexEXT"; + case Op::OpHitObjectGetInstanceIdEXT: return "OpHitObjectGetInstanceIdEXT"; + case Op::OpHitObjectGetInstanceCustomIndexEXT: return "OpHitObjectGetInstanceCustomIndexEXT"; + case Op::OpHitObjectGetObjectRayOriginEXT: return "OpHitObjectGetObjectRayOriginEXT"; + case Op::OpHitObjectGetObjectRayDirectionEXT: return "OpHitObjectGetObjectRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayDirectionEXT: return "OpHitObjectGetWorldRayDirectionEXT"; + case Op::OpHitObjectGetWorldRayOriginEXT: return "OpHitObjectGetWorldRayOriginEXT"; + case Op::OpHitObjectGetObjectToWorldEXT: return "OpHitObjectGetObjectToWorldEXT"; + case Op::OpHitObjectGetWorldToObjectEXT: return "OpHitObjectGetWorldToObjectEXT"; + case Op::OpHitObjectGetRayTMaxEXT: return "OpHitObjectGetRayTMaxEXT"; case Op::OpReportIntersectionKHR: return "OpReportIntersectionKHR"; case Op::OpIgnoreIntersectionNV: return "OpIgnoreIntersectionNV"; case Op::OpTerminateRayNV: return "OpTerminateRayNV"; @@ -4802,6 +4998,12 @@ inline const char* OpToString(Op value) { case Op::OpExecuteCallableNV: return "OpExecuteCallableNV"; case Op::OpRayQueryGetClusterIdNV: return "OpRayQueryGetClusterIdNV"; case Op::OpHitObjectGetClusterIdNV: return "OpHitObjectGetClusterIdNV"; + case Op::OpHitObjectGetRayTMinEXT: return "OpHitObjectGetRayTMinEXT"; + case Op::OpHitObjectGetShaderBindingTableRecordIndexEXT: return "OpHitObjectGetShaderBindingTableRecordIndexEXT"; + case Op::OpHitObjectGetShaderRecordBufferHandleEXT: return "OpHitObjectGetShaderRecordBufferHandleEXT"; + case Op::OpHitObjectIsEmptyEXT: return "OpHitObjectIsEmptyEXT"; + case Op::OpHitObjectIsHitEXT: return "OpHitObjectIsHitEXT"; + case Op::OpHitObjectIsMissEXT: return "OpHitObjectIsMissEXT"; case Op::OpTypeCooperativeMatrixNV: return "OpTypeCooperativeMatrixNV"; case Op::OpCooperativeMatrixLoadNV: return "OpCooperativeMatrixLoadNV"; case Op::OpCooperativeMatrixStoreNV: return "OpCooperativeMatrixStoreNV"; @@ -5171,6 +5373,10 @@ constexpr TensorAddressingOperandsMask operator|(TensorAddressingOperandsMask a, constexpr TensorAddressingOperandsMask operator&(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) & unsigned(b)); } constexpr TensorAddressingOperandsMask operator^(TensorAddressingOperandsMask a, TensorAddressingOperandsMask b) { return TensorAddressingOperandsMask(unsigned(a) ^ unsigned(b)); } constexpr TensorAddressingOperandsMask operator~(TensorAddressingOperandsMask a) { return TensorAddressingOperandsMask(~unsigned(a)); } +constexpr TensorOperandsMask operator|(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) | unsigned(b)); } +constexpr TensorOperandsMask operator&(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) & unsigned(b)); } +constexpr TensorOperandsMask operator^(TensorOperandsMask a, TensorOperandsMask b) { return TensorOperandsMask(unsigned(a) ^ unsigned(b)); } +constexpr TensorOperandsMask operator~(TensorOperandsMask a) { return TensorOperandsMask(~unsigned(a)); } constexpr MatrixMultiplyAccumulateOperandsMask operator|(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) | unsigned(b)); } constexpr MatrixMultiplyAccumulateOperandsMask operator&(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) & unsigned(b)); } constexpr MatrixMultiplyAccumulateOperandsMask operator^(MatrixMultiplyAccumulateOperandsMask a, MatrixMultiplyAccumulateOperandsMask b) { return MatrixMultiplyAccumulateOperandsMask(unsigned(a) ^ unsigned(b)); } diff --git a/src/libraries/glslang/SPIRV/spvIR.h b/src/libraries/glslang/SPIRV/spvIR.h index f1039cfdb..9eebd9c70 100644 --- a/src/libraries/glslang/SPIRV/spvIR.h +++ b/src/libraries/glslang/SPIRV/spvIR.h @@ -189,6 +189,11 @@ public: operands[idx] = immediate; } + void clearOperands() { + operands.clear(); + idOperand.clear(); + } + void addStringOperand(const char* str) { unsigned int word = 0; @@ -222,6 +227,7 @@ public: } Id getResultId() const { return resultId; } Id getTypeId() const { return typeId; } + void setTypeId(Id tId) { typeId = tId; } Id getIdOperand(int op) const { assert(idOperand[op]); return operands[op]; @@ -380,6 +386,7 @@ public: case Op::OpReturn: case Op::OpReturnValue: case Op::OpUnreachable: + case Op::OpAbortKHR: return true; default: return false; @@ -574,7 +581,8 @@ public: } StorageClass getStorageClass(Id typeId) const { - assert(idToInstruction[typeId]->getOpCode() == spv::Op::OpTypePointer); + assert(idToInstruction[typeId]->getOpCode() == spv::Op::OpTypePointer || + idToInstruction[typeId]->getOpCode() == spv::Op::OpTypeUntypedPointerKHR); return (StorageClass)idToInstruction[typeId]->getImmediateOperand(0); } diff --git a/src/libraries/glslang/glslang/Include/BaseTypes.h b/src/libraries/glslang/glslang/Include/BaseTypes.h index 2f3496bdf..e681ca0dc 100644 --- a/src/libraries/glslang/glslang/Include/BaseTypes.h +++ b/src/libraries/glslang/glslang/Include/BaseTypes.h @@ -69,11 +69,14 @@ enum TBasicType { EbtReference, EbtRayQuery, EbtHitObjectNV, + EbtHitObjectEXT, EbtCoopmat, EbtFunction, EbtTensorLayoutNV, EbtTensorViewNV, EbtCoopvecNV, + EbtTensorARM, + EbtLongVector, // SPIR-V type defined by spirv_type EbtSpirvType, @@ -110,6 +113,7 @@ enum TStorageQualifier { EvqCallableData, EvqCallableDataIn, EvqHitObjectAttrNV, + EvqHitObjectAttrEXT, EvqtaskPayloadSharedEXT, @@ -140,6 +144,10 @@ enum TStorageQualifier { EvqTileImageEXT, + // EXT_structured_descriptor_heap + EvqSamplerHeap, + EvqResourceHeap, + // end of list EvqLast }; @@ -350,6 +358,9 @@ enum TBuiltInVariable { EbvTileOffsetQCOM, EbvTileDimensionQCOM, EbvTileApronSizeQCOM, + // GL_EXT_descriptor_heap + EbvSamplerHeapEXT, + EbvResourceHeapEXT, EbvLast }; @@ -397,7 +408,8 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q) case EvqCallableData: return "callableDataNV"; break; case EvqCallableDataIn: return "callableDataInNV"; break; case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break; - case EvqHitObjectAttrNV:return "hitObjectAttributeNV"; break; + case EvqHitObjectAttrNV: return "hitObjectAttributeNV"; break; + case EvqHitObjectAttrEXT:return "hitObjectAttributeEXT"; break; default: return "unknown qualifier"; } } @@ -599,6 +611,22 @@ __inline bool isTypeUnsignedInt(TBasicType type) } } +__inline TBasicType unsignedTypeToSigned(TBasicType type) +{ + switch (type) { + case EbtUint8: + return EbtInt8; + case EbtUint16: + return EbtInt16; + case EbtUint: + return EbtInt; + case EbtUint64: + return EbtInt64; + default: + return type; + } +} + __inline bool isTypeInt(TBasicType type) { return isTypeSignedInt(type) || isTypeUnsignedInt(type); diff --git a/src/libraries/glslang/glslang/Include/ConstantUnion.h b/src/libraries/glslang/glslang/Include/ConstantUnion.h index da4737b65..bf6b8a88b 100644 --- a/src/libraries/glslang/glslang/Include/ConstantUnion.h +++ b/src/libraries/glslang/glslang/Include/ConstantUnion.h @@ -899,6 +899,17 @@ public: unionArray = new TConstUnionVector(size, val); } + TConstUnionArray* clone() const + { + TConstUnionArray *copy = new TConstUnionArray(size()); + if (unionArray) { + for (const auto i : *unionArray) { + copy->unionArray->push_back(i); + } + } + return copy; + } + int size() const { return unionArray ? (int)unionArray->size() : 0; } TConstUnion& operator[](size_t index) { return (*unionArray)[index]; } const TConstUnion& operator[](size_t index) const { return (*unionArray)[index]; } diff --git a/src/libraries/glslang/glslang/Include/PoolAlloc.h b/src/libraries/glslang/glslang/Include/PoolAlloc.h index 8a9284144..cb88bacf0 100644 --- a/src/libraries/glslang/glslang/Include/PoolAlloc.h +++ b/src/libraries/glslang/glslang/Include/PoolAlloc.h @@ -84,9 +84,9 @@ public: // makes the compiler print warnings about 0 length memsets, // even with the if() protecting them. # ifdef GUARD_BLOCKS - memset(preGuard(), guardBlockBeginVal, guardBlockSize); + memset(preGuard(), guardBlockBeginVal, guardBlockSize()); memset(data(), userDataFill, size); - memset(postGuard(), guardBlockEndVal, guardBlockSize); + memset(postGuard(), guardBlockEndVal, guardBlockSize()); # endif } @@ -100,12 +100,12 @@ public: // Return total size needed to accommodate user buffer of 'size', // plus our tracking data. inline static size_t allocationSize(size_t size) { - return size + 2 * guardBlockSize + headerSize(); + return size + 2 * guardBlockSize() + headerSize(); } // Offset from surrounding buffer to get to user data buffer. inline static unsigned char* offsetAllocation(unsigned char* m) { - return m + guardBlockSize + headerSize(); + return m + guardBlockSize() + headerSize(); } private: @@ -113,7 +113,7 @@ private: // Find offsets to pre and post guard blocks, and user data buffer unsigned char* preGuard() const { return mem + headerSize(); } - unsigned char* data() const { return preGuard() + guardBlockSize; } + unsigned char* data() const { return preGuard() + guardBlockSize(); } unsigned char* postGuard() const { return data() + size; } size_t size; // size of the user data area @@ -125,15 +125,19 @@ private: static inline constexpr unsigned char userDataFill = 0xcd; # ifdef GUARD_BLOCKS - static inline constexpr size_t guardBlockSize = 16; + inline static constexpr size_t headerSize() { return sizeof(TAllocation); } + inline static constexpr size_t guardBlockSize() { + constexpr size_t minGuardSize = 16; + constexpr size_t alignmentSize = 16; + constexpr size_t guardLayoutSize = + (minGuardSize + sizeof(TAllocation) + alignmentSize - 1) & ~(alignmentSize - 1); + static_assert((guardLayoutSize % alignmentSize) == 0, + "Guard block layout is not 16-byte aligned."); + return guardLayoutSize - sizeof(TAllocation); + } # else - static inline constexpr size_t guardBlockSize = 0; -# endif - -# ifdef GUARD_BLOCKS - inline static size_t headerSize() { return sizeof(TAllocation); } -# else - inline static size_t headerSize() { return 0; } + inline static constexpr size_t headerSize() { return 0; } + inline static constexpr size_t guardBlockSize() { return 0; } # endif }; @@ -292,8 +296,7 @@ public: template pool_allocator(const pool_allocator& p) : allocator(p.getAllocator()) { } - - GLSLANG_EXPORT_FOR_TESTS + pointer allocate(size_type n) { return reinterpret_cast(getAllocator().allocate(n * sizeof(T))); } pointer allocate(size_type n, const void*) { diff --git a/src/libraries/glslang/glslang/Include/Types.h b/src/libraries/glslang/glslang/Include/Types.h index 3ccf0d169..e2a75201e 100644 --- a/src/libraries/glslang/glslang/Include/Types.h +++ b/src/libraries/glslang/glslang/Include/Types.h @@ -47,6 +47,7 @@ #include "SpirvIntrinsics.h" #include +#include namespace glslang { @@ -130,6 +131,13 @@ struct TSampler { // misnomer now; includes images, textures without sampler, bool isTileAttachmentQCOM() const { return tileQCOM; } + // For combined sampler, returns the underlying texture. Otherwise, returns identity. + TSampler removeCombined() const { + TSampler result = *this; + result.combined = false; + return result; + } + void clear() { type = EbtVoid; @@ -238,9 +246,9 @@ struct TSampler { // misnomer now; includes images, textures without sampler, return ! operator==(right); } - TString getString() const + std::string getString() const { - TString s; + std::string s; if (isPureSampler()) { s.append("sampler"); @@ -510,6 +518,7 @@ public: spirvByReference = false; spirvLiteral = false; defaultBlock = false; + usedByAtomic = false; } // drop qualifiers that don't belong in a temporary variable @@ -529,6 +538,7 @@ public: spirvDecorate = nullptr; spirvByReference = false; spirvLiteral = false; + usedByAtomic = false; } void clearInterstage() @@ -610,6 +620,7 @@ public: bool nullInit : 1; bool spirvByReference : 1; bool spirvLiteral : 1; + bool usedByAtomic : 1; // EXT_descriptor_heap bool isWriteOnly() const { return writeonly; } bool isReadOnly() const { return readonly; } bool isRestrict() const { return restrict; } @@ -653,6 +664,8 @@ public: bool isSpirvByReference() const { return spirvByReference; } void setSpirvLiteral() { spirvLiteral = true; } bool isSpirvLiteral() const { return spirvLiteral; } + void setUsedByAtomic() { usedByAtomic = true; } + bool isUsedByAtomic() const { return usedByAtomic; } bool isPipeInput() const { @@ -818,6 +831,9 @@ public: bool isHitObjectAttrNV() const { return storage == EvqHitObjectAttrNV; } + bool isHitObjectAttrEXT() const { + return storage == EvqHitObjectAttrEXT; + } // True if this type of IO is supposed to be arrayed with extra level for per-vertex data bool isArrayedIo(EShLanguage language) const @@ -854,6 +870,7 @@ public: layoutFullQuads = false; layoutQuadDeriv = false; layoutHitObjectShaderRecordNV = false; + layoutHitObjectShaderRecordEXT = false; layoutBindlessSampler = false; layoutBindlessImage = false; layoutBufferReferenceAlign = layoutBufferReferenceAlignEnd; @@ -864,6 +881,11 @@ public: clearInterstageLayout(); layoutSpecConstantId = layoutSpecConstantIdEnd; + layoutBank = layoutBankEnd; + layoutDescriptorHeap = false; + layoutDescriptorStride = layoutDescriptorStrideEnd; + layoutHeapOffset = 0; + layoutDescriptorInnerBlock = false; } void clearInterstageLayout() { @@ -905,6 +927,7 @@ public: TLayoutPacking layoutPacking : 4; int layoutOffset; int layoutAlign; + int layoutMemberOffset; unsigned int layoutLocation : 12; static const unsigned int layoutLocationEnd = 0xFFF; @@ -936,8 +959,14 @@ public: unsigned int layoutAttachment : 8; // for input_attachment_index static const unsigned int layoutAttachmentEnd = 0XFF; - unsigned int layoutSpecConstantId : 11; - static const unsigned int layoutSpecConstantIdEnd = 0x7FF; + unsigned int layoutSpecConstantId; + static const unsigned int layoutSpecConstantIdEnd = UINT_MAX; + + unsigned int layoutBank : 4; + static const unsigned int layoutBankEnd = 0xF; + + unsigned int layoutDescriptorStride; + static const unsigned int layoutDescriptorStrideEnd = 0x0; // stored as log2 of the actual alignment value unsigned int layoutBufferReferenceAlign : 6; @@ -954,6 +983,10 @@ public: bool layoutFullQuads; bool layoutQuadDeriv; bool layoutHitObjectShaderRecordNV; + bool layoutHitObjectShaderRecordEXT; + bool layoutDescriptorHeap; + bool layoutDescriptorInnerBlock; + int layoutHeapOffset; // GL_EXT_spirv_intrinsics int spirvStorageClass; @@ -979,6 +1012,7 @@ public: layoutPacking = ElpNone; layoutOffset = layoutNotSet; layoutAlign = layoutNotSet; + layoutMemberOffset = layoutNotSet; layoutSet = layoutSetEnd; layoutBinding = layoutBindingEnd; @@ -1065,6 +1099,7 @@ public: bool isFullQuads() const { return layoutFullQuads; } bool isQuadDeriv() const { return layoutQuadDeriv; } bool hasHitObjectShaderRecordNV() const { return layoutHitObjectShaderRecordNV; } + bool hasHitObjectShaderRecordEXT() const { return layoutHitObjectShaderRecordEXT; } bool hasBufferReference() const { return layoutBufferReference; } bool hasBufferReferenceAlign() const { @@ -1102,6 +1137,14 @@ public: // is just whether or not it was declared with an ID. return layoutSpecConstantId != layoutSpecConstantIdEnd; } + bool hasBank() const + { + return layoutBank != layoutBankEnd; + } + bool hasMemberOffset() const + { + return layoutMemberOffset != layoutNotSet; + } bool isSpecConstant() const { // True if type is a specialization constant, whether or not it @@ -1299,6 +1342,12 @@ public: } }; +enum TDerivativeGroupExtension { + EdgNone, + EdgNV, + EdgKHR, +}; + // Qualifiers that don't need to be kept per object. They have shader scope, not object scope. // So, they will not be part of TType, TQualifier, etc. struct TShaderQualifiers { @@ -1325,8 +1374,9 @@ struct TShaderQualifiers { int numViews; // multiview extenstions TInterlockOrdering interlockOrdering; bool layoutOverrideCoverage; // true if layout override_coverage set - bool layoutDerivativeGroupQuads; // true if layout derivative_group_quadsNV set - bool layoutDerivativeGroupLinear; // true if layout derivative_group_linearNV set + bool layoutDerivativeGroupQuads; // true if a derivative_group_quads* layout is set + bool layoutDerivativeGroupLinear; // true if a derivative_group_linear* layout is set + TDerivativeGroupExtension derivativeGroupExtension; int primitives; // mesh shader "max_primitives"DerivativeGroupLinear; // true if layout derivative_group_linearNV set bool layoutPrimitiveCulling; // true if layout primitive_culling set bool layoutNonCoherentTileAttachmentReadQCOM; // fragment shaders -- per object @@ -1367,6 +1417,7 @@ struct TShaderQualifiers { layoutOverrideCoverage = false; layoutDerivativeGroupQuads = false; layoutDerivativeGroupLinear = false; + derivativeGroupExtension = EdgNone; layoutPrimitiveCulling = false; layoutNonCoherentTileAttachmentReadQCOM = false; layoutTileShadingRateQCOM[0] = 0; @@ -1438,6 +1489,8 @@ struct TShaderQualifiers { layoutDerivativeGroupQuads = src.layoutDerivativeGroupQuads; if (src.layoutDerivativeGroupLinear) layoutDerivativeGroupLinear = src.layoutDerivativeGroupLinear; + if (src.derivativeGroupExtension != EdgNone) + derivativeGroupExtension = src.derivativeGroupExtension; if (src.primitives != TQualifier::layoutNotSet) primitives = src.primitives; if (src.interlockOrdering != EioNone) @@ -1501,7 +1554,9 @@ public: bool coopmatNV : 1; bool coopmatKHR : 1; bool coopvecNV : 1; + bool longVector : 1; bool tileAttachmentQCOM: 1; + uint32_t tensorRankARM : 4; TArraySizes* arraySizes; const TType* userDef; TSourceLoc loc; @@ -1513,11 +1568,17 @@ public: bool isCoopmatNV() const { return coopmatNV; } bool isCoopmatKHR() const { return coopmatKHR; } bool isCoopvecNV() const { return coopvecNV; } - bool isCoopmatOrvec() const { return isCoopmat() || isCoopvecNV(); } + bool isCoopmatOrvec() const { return isCoopmat() || isCoopvecNV() || isLongVector(); } + bool isLongVector() const { return longVector; } + bool isCoopvecOrLongVector() const { return isCoopvecNV() || isLongVector(); } + bool isTensorARM() const { return tensorRankARM; } + bool hasTypeParameter() const { return isCoopmat() || isCoopvecNV() || isLongVector() || isTensorARM(); } bool isTensorLayoutNV() const { return basicType == EbtTensorLayoutNV; } bool isTensorViewNV() const { return basicType == EbtTensorViewNV; } + const TTypeParameters* getTypeParameters() const { return typeParameters; } + void initType(const TSourceLoc& l) { basicType = EbtVoid; @@ -1531,7 +1592,9 @@ public: coopmatNV = false; coopmatKHR = false; coopvecNV = false; + longVector = false; tileAttachmentQCOM = false; + tensorRankARM = 0; spirvType = nullptr; } @@ -1591,8 +1654,8 @@ public: // for "empty" type (no args) or simple scalar/vector/matrix explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : - basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), - tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), longVector(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { assert(vs >= 0); @@ -1607,8 +1670,8 @@ public: // for explicit precision qualifier TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0, bool isVector = false) : - basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), - tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + basicType(t), vectorSize(static_cast(vs) & 0b1111), matrixCols(static_cast(mc) & 0b1111), matrixRows(static_cast(mr) & 0b1111), vector1(isVector && vs == 1), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), longVector(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { assert(vs >= 0); @@ -1625,8 +1688,8 @@ public: // for turning a TPublicType into a TType, using a shallow copy explicit TType(const TPublicType& p) : basicType(p.basicType), - vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV), - tileAttachmentQCOM(p.tileAttachmentQCOM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters), + vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmatNV(p.coopmatNV), coopmatKHR(p.coopmatKHR), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(p.coopvecNV), longVector(p.longVector), + tileAttachmentQCOM(p.tileAttachmentQCOM), tensorRankARM(p.tensorRankARM), arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters), spirvType(p.spirvType) { if (basicType == EbtSampler) @@ -1676,14 +1739,20 @@ public: coopmatKHRUseValid = true; } } - if (p.isCoopvecNV() && p.typeParameters) { + if ((p.isCoopvecNV() || p.isLongVector()) && p.typeParameters) { basicType = p.typeParameters->basicType; } + if (p.isTensorARM() && p.typeParameters) { + basicType = p.typeParameters->basicType; + if (p.typeParameters->arraySizes->getNumDims() > 0) { + tensorRankARM = static_cast(p.typeParameters->arraySizes->getDimSize(0)) & 0b1111; + } + } } // for construction of sampler types TType(const TSampler& sampler, TStorageQualifier q = EvqUniform, TArraySizes* as = nullptr) : - basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), - tileAttachmentQCOM(false), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr), + basicType(EbtSampler), vectorSize(1u), matrixCols(0u), matrixRows(0u), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), longVector(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr), sampler(sampler), typeParameters(nullptr), spirvType(nullptr) { qualifier.clear(); @@ -1725,12 +1794,13 @@ public: // dereference from vector to scalar vectorSize = 1; vector1 = false; - } else if (isCoopMat() || isCoopVecNV()) { + } else if (isCoopMat() || isCoopVecNV() || isLongVector()) { coopmatNV = false; coopmatKHR = false; coopmatKHRuse = 0; coopmatKHRUseValid = false; coopvecNV = false; + longVector = false; typeParameters = nullptr; } else if (isTileAttachmentQCOM()) { tileAttachmentQCOM = false; @@ -1740,8 +1810,8 @@ public: } // for making structures, ... TType(TTypeList* userDef, const TString& n) : - basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), - tileAttachmentQCOM(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), + basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), longVector(false), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), spirvType(nullptr) { sampler.clear(); @@ -1750,8 +1820,8 @@ public: } // For interface blocks TType(TTypeList* userDef, const TString& n, const TQualifier& q) : - basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), - tileAttachmentQCOM(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), + basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), coopvecNV(false), longVector(false), + tileAttachmentQCOM(false), tensorRankARM(0), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr), spirvType(nullptr) { sampler.clear(); @@ -1760,7 +1830,7 @@ public: // for block reference (first parameter must be EbtReference) explicit TType(TBasicType t, const TType &p, const TString& n) : basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmatNV(false), coopmatKHR(false), coopmatKHRuse(0), coopmatKHRUseValid(false), - tileAttachmentQCOM(false), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), + tileAttachmentQCOM(false), tensorRankARM(0), arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr), spirvType(nullptr) { assert(t == EbtReference); @@ -1799,7 +1869,9 @@ public: coopmatKHRuse = copyOf.coopmatKHRuse; coopmatKHRUseValid = copyOf.coopmatKHRUseValid; coopvecNV = copyOf.isCoopVecNV(); + longVector = copyOf.isLongVector(); tileAttachmentQCOM = copyOf.tileAttachmentQCOM; + tensorRankARM = copyOf.tensorRankARM; } // Make complete copy of the whole type graph rooted at 'copyOf'. @@ -1839,6 +1911,7 @@ public: return *typeName; } + virtual bool hasFieldName() const { return (fieldName != nullptr); } virtual const TString& getFieldName() const { assert(fieldName); @@ -1883,7 +1956,7 @@ public: virtual const TTypeParameters* getTypeParameters() const { return typeParameters; } virtual TTypeParameters* getTypeParameters() { return typeParameters; } - virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray() && ! isCoopVecNV(); } + virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray() && ! isCoopVecNV() && ! isLongVector(); } virtual bool isScalarOrVec1() const { return isScalar() || vector1; } virtual bool isScalarOrVector() const { return !isMatrix() && !isStruct() && !isArray(); } virtual bool isVector() const { return vectorSize > 1u || vector1; } @@ -1919,7 +1992,9 @@ public: } virtual bool isOpaque() const { return basicType == EbtSampler || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery - || basicType == EbtHitObjectNV || isTileAttachmentQCOM(); } + || basicType == EbtHitObjectNV || basicType == EbtHitObjectEXT || isTileAttachmentQCOM() + || isTensorARM(); + } virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; } virtual bool isAttachmentEXT() const { return basicType == EbtSampler && getSampler().isAttachmentEXT(); } @@ -1936,8 +2011,13 @@ public: bool isCoopMatNV() const { return coopmatNV; } bool isCoopMatKHR() const { return coopmatKHR; } bool isCoopVecNV() const { return coopvecNV; } - bool isCoopMatOrVec() const { return isCoopMat() || isCoopVecNV(); } + bool isCoopMatOrVec() const { return isCoopMat() || isCoopVecNV() || isLongVector(); } + bool isLongVector() const { return longVector; } + bool isCoopVecOrLongVector() const { return isCoopVecNV() || isLongVector(); } bool isTileAttachmentQCOM() const { return tileAttachmentQCOM; } + bool isTensorARM() const { return tensorRankARM; } + bool hasTypeParameter() const { return isCoopMat() || isCoopVecNV() || isLongVector() || isTensorARM(); } + int getTensorRankARM() const { return static_cast(tensorRankARM); } bool isReference() const { return getBasicType() == EbtReference; } bool isSpirvType() const { return getBasicType() == EbtSpirvType; } int getCoopMatKHRuse() const { return static_cast(coopmatKHRuse); } @@ -1969,6 +2049,22 @@ public: return contains([](const TType* t) { return t->isArray(); } ); } + // Recursively check the structure for any arrays, needed for some error checks + virtual bool containsHeapArray() const + { + const auto containsResourceArray = [](const TType* t) { + return (t->isArray() && + (t->isImage() || t->isTexture() || t->getBasicType() == EbtSampler || + t->getBasicType() == EbtAccStruct || + t->getQualifier().storage == EvqUniform || + t->getQualifier().storage == EvqResourceHeap || + t->getQualifier().storage == EvqSamplerHeap || + t->getQualifier().storage == EvqBuffer)); + }; + + return contains(containsResourceArray); + } + // Check the structure for any structures, needed for some error checks virtual bool containsStructure() const { @@ -1999,6 +2095,11 @@ public: virtual bool containsNonOpaque() const { + if (isTensorARM()) { + // Tensors have a numerical basicType even though it is Opaque + return false; + } + const auto nonOpaque = [](const TType* t) { switch (t->basicType) { case EbtVoid: @@ -2044,6 +2145,10 @@ public: { return containsBasicType(EbtBFloat16); } + bool contains8BitFloat() const + { + return containsBasicType(EbtFloatE5M2) || containsBasicType(EbtFloatE4M3); + } bool contains64BitInt() const { return containsBasicType(EbtInt64) || containsBasicType(EbtUint64); @@ -2064,6 +2169,10 @@ public: { return contains([](const TType* t) { return t->coopvecNV; } ); } + bool containsLongVector() const + { + return contains([](const TType* t) { return t->longVector; } ); + } bool containsReference() const { return containsBasicType(EbtReference); @@ -2187,6 +2296,8 @@ public: case EbtTensorLayoutNV: return "tensorLayoutNV"; case EbtTensorViewNV: return "tensorViewNV"; case EbtCoopvecNV: return "coopvecNV"; + case EbtTensorARM: return "tensorARM"; + case EbtLongVector: return "vector"; default: return "unknown type"; } } @@ -2301,12 +2412,32 @@ public: appendStr(" quad_derivatives"); if (qualifier.layoutHitObjectShaderRecordNV) appendStr(" hitobjectshaderrecordnv"); + if (qualifier.layoutHitObjectShaderRecordEXT) + appendStr(" hitobjectshaderrecordext"); + + if (qualifier.hasBank()) { + appendStr(" bank="); + appendUint(qualifier.layoutBank); + } + if (qualifier.hasMemberOffset()) { + appendStr(" member_offset="); + appendInt(qualifier.layoutMemberOffset); + } if (qualifier.layoutBindlessSampler) appendStr(" layoutBindlessSampler"); if (qualifier.layoutBindlessImage) appendStr(" layoutBindlessImage"); + if (qualifier.layoutDescriptorHeap) + appendStr(" descriptor_heap"); + if (qualifier.layoutDescriptorStride != TQualifier::layoutDescriptorStrideEnd) { + appendStr(" descriptor_stride="); + appendInt(qualifier.layoutDescriptorStride); + } + if (qualifier.layoutHeapOffset) + appendStr(" heap_offset="); + appendStr(")"); } } @@ -2511,6 +2642,10 @@ public: appendStr(" "); appendStr("coopvecNV"); } + if (isLongVector()) { + appendStr(" "); + appendStr("vector"); + } appendStr("<"); for (int i = 0; i < (int)typeParameters->arraySizes->getNumDims(); ++i) { @@ -2570,7 +2705,7 @@ public: TString getBasicTypeString() const { if (basicType == EbtSampler) - return sampler.getString(); + return TString{sampler.getString()}; else return getBasicString(); } @@ -2592,8 +2727,14 @@ public: { uint32_t components = 0; - if (isCoopVecNV()) { - components = typeParameters->arraySizes->getDimSize(0); + if (isCoopVecOrLongVector()) { + auto* arraySizes = typeParameters->arraySizes; + if (!arraySizes || arraySizes->getNumDims() < 1) { + // This is a malformed vector type. A later step will + // catch the error and emit a diagnostic. + return 0; + } + components = arraySizes->getDimSize(0); } else if (getBasicType() == EbtStruct || getBasicType() == EbtBlock) { for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) components += ((*tl).type)->computeNumComponents(); @@ -2609,6 +2750,10 @@ public: return static_cast(components); } + bool hasSpecConstantVectorComponents() const { + return getTypeParameters() && getTypeParameters()->arraySizes->getDimNode(0) != nullptr; + } + // append this type's mangled name to the passed in 'name' void appendMangledName(TString& name) const { @@ -2799,6 +2944,8 @@ public: isCoopMatNV() == right.isCoopMatNV() && isCoopMatKHR() == right.isCoopMatKHR() && isCoopVecNV() == right.isCoopVecNV() && + isLongVector() == right.isLongVector() && + isTensorARM() == right.isTensorARM() && sameStructType(right, lpidx, rpidx) && sameReferenceType(right); } @@ -2866,9 +3013,18 @@ public: if (isTensorViewNV()) { return right.isTensorViewNV() && right.typeParameters == nullptr && typeParameters != nullptr; } + if (isTensorARM()) { + return right.isTensorARM() && right.typeParameters == nullptr && typeParameters != nullptr; + } + return false; } + bool sameTensorBaseTypeARM(const TType &right) const { + return (typeParameters == nullptr || right.typeParameters == nullptr || + (tensorRankARM == right.tensorRankARM && getBasicType() == right.getBasicType())); + } + bool sameCoopVecBaseType(const TType &right) const { bool rv = false; @@ -2885,6 +3041,26 @@ public: return rv; } + bool sameLongVectorBaseType(const TType &right) const { + bool rv = false; + + if (isLongVector() && right.isLongVector()) { + if (isFloatingDomain()) + rv = right.isFloatingDomain() || right.getBasicType() == EbtLongVector; + else if (isTypeUnsignedInt(getBasicType())) + rv = isTypeUnsignedInt(right.getBasicType()) || right.getBasicType() == EbtLongVector; + else if (isTypeSignedInt(getBasicType())) + rv = isTypeSignedInt(right.getBasicType()) || right.getBasicType() == EbtLongVector; + else if (getBasicType() == EbtBool) + rv = right.getBasicType() == EbtBool || right.getBasicType() == EbtLongVector; + else if (getBasicType() == EbtLongVector) + rv = right.isLongVector(); + else + rv = false; + } + return rv; + } + bool sameCoopMatUse(const TType &right) const { return coopmatKHRuse == right.coopmatKHRuse; } @@ -2915,6 +3091,31 @@ public: return true; } + bool sameLongVectorShape(const TType &right) const + { + if (!isLongVector() || !right.isLongVector() || !typeParameters || !right.typeParameters) + return false; + + return typeParameters->arraySizes->getDimSize(0) == right.typeParameters->arraySizes->getDimSize(0); + } + + static bool vectorAndLongVectorMatch(const TType &left, const TType &right) + { + if (left.isVector() && right.isLongVector() && + right.getTypeParameters() && + !right.hasSpecConstantVectorComponents() && + left.getVectorSize() == right.getTypeParameters()->arraySizes->getDimSize(0)) { + return true; + } + if (right.isVector() && left.isLongVector() && + left.getTypeParameters() && + !left.hasSpecConstantVectorComponents() && + right.getVectorSize() == left.getTypeParameters()->arraySizes->getDimSize(0)) { + return true; + } + return false; + } + // See if two types match in all ways (just the actual type, not qualification) bool operator==(const TType& right) const { @@ -3015,7 +3216,9 @@ protected: uint32_t coopmatKHRuse : 3; // Accepts one of three values: 0, 1, 2 (gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator) bool coopmatKHRUseValid : 1; // True if coopmatKHRuse has been set bool coopvecNV : 1; + bool longVector : 1; bool tileAttachmentQCOM : 1; + uint32_t tensorRankARM : 4; // 0 means not a tensor; non-zero indicates the tensor rank. TQualifier qualifier; TArraySizes* arraySizes; // nullptr unless an array; can be shared across types diff --git a/src/libraries/glslang/glslang/Include/arrays.h b/src/libraries/glslang/glslang/Include/arrays.h index 91e190835..261af6837 100644 --- a/src/libraries/glslang/glslang/Include/arrays.h +++ b/src/libraries/glslang/glslang/Include/arrays.h @@ -66,6 +66,7 @@ struct TArraySize { return SameSpecializationConstants(node, rhs.node); } + bool operator!=(const TArraySize& rhs) const { return !(*this == rhs); } }; // @@ -198,6 +199,12 @@ struct TSmallArrayVector { } bool operator!=(const TSmallArrayVector& rhs) const { return ! operator==(rhs); } + const TArraySize& operator[](int index) const + { + assert(sizes && index < (int)sizes->size()); + return (*sizes)[index]; + } + protected: TSmallArrayVector(const TSmallArrayVector&); @@ -336,6 +343,10 @@ struct TArraySizes { return true; } + const TArraySize& getArraySize(int index) const + { + return sizes[index]; + } void setVariablyIndexed() { variablyIndexed = true; } bool isVariablyIndexed() const { return variablyIndexed; } diff --git a/src/libraries/glslang/glslang/Include/defer.h b/src/libraries/glslang/glslang/Include/defer.h new file mode 100644 index 000000000..0fd21e0bb --- /dev/null +++ b/src/libraries/glslang/glslang/Include/defer.h @@ -0,0 +1,63 @@ +// +// Copyright 2026 Google LLC +// +// 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. +// + +#ifndef GLSLANG_INCLUDE_DEFER_H +#define GLSLANG_INCLUDE_DEFER_H + +#include + +namespace glslang { + +// An object that, when destroyed, executes a given function. +// Use this to perform work along all exit paths from a function. +template +class Defer { + public: + explicit Defer(F&& f) : f_(std::move(f)) { } + Defer(Defer&&) = default; + ~Defer() { f_(); } // Run the given function. + private: + Defer(const Defer&) = delete; + Defer& operator=(const Defer&) = delete; + F f_; +}; + +// Template argument deduction guide for Defer. +template +Defer(T) -> Defer; + +} // namespace glslang + +#endif diff --git a/src/libraries/glslang/glslang/Include/intermediate.h b/src/libraries/glslang/glslang/Include/intermediate.h index db909a17c..3c98309c6 100644 --- a/src/libraries/glslang/glslang/Include/intermediate.h +++ b/src/libraries/glslang/glslang/Include/intermediate.h @@ -479,6 +479,10 @@ enum TOperator { EOpCooperativeVectorOuterProductAccumulateNV, EOpCooperativeVectorReduceSumAccumulateNV, + EOpTensorReadARM, + EOpTensorWriteARM, + EOpTensorSizeARM, + EOpBeginInvocationInterlock, // Fragment only EOpEndInvocationInterlock, // Fragment only @@ -871,6 +875,44 @@ enum TOperator { EOpFetchMicroTriangleVertexPositionNV, EOpFetchMicroTriangleVertexBarycentricNV, + // + // GL_EXT_shader_invocation_reorder + // + + EOpHitObjectTraceRayEXT, + EOpHitObjectTraceRayMotionEXT, + EOpHitObjectRecordMissEXT, + EOpHitObjectRecordMissMotionEXT, + EOpHitObjectRecordEmptyEXT, + EOpHitObjectExecuteShaderEXT, + EOpHitObjectIsEmptyEXT, + EOpHitObjectIsMissEXT, + EOpHitObjectIsHitEXT, + EOpHitObjectGetRayTMinEXT, + EOpHitObjectGetRayTMaxEXT, + EOpHitObjectGetRayFlagsEXT, + EOpHitObjectGetObjectRayOriginEXT, + EOpHitObjectGetObjectRayDirectionEXT, + EOpHitObjectGetWorldRayOriginEXT, + EOpHitObjectGetWorldRayDirectionEXT, + EOpHitObjectGetWorldToObjectEXT, + EOpHitObjectGetObjectToWorldEXT, + EOpHitObjectGetInstanceCustomIndexEXT, + EOpHitObjectGetInstanceIdEXT, + EOpHitObjectGetGeometryIndexEXT, + EOpHitObjectGetPrimitiveIndexEXT, + EOpHitObjectGetHitKindEXT, + EOpHitObjectGetShaderBindingTableRecordIndexEXT, + EOpHitObjectSetShaderBindingTableRecordIndexEXT, + EOpHitObjectGetShaderRecordBufferHandleEXT, + EOpHitObjectGetAttributesEXT, + EOpHitObjectGetCurrentTimeEXT, + EOpReorderThreadEXT, + EOpHitObjectReorderExecuteEXT, + EOpHitObjectTraceReorderExecuteEXT, + EOpHitObjectTraceMotionReorderExecuteEXT, + EOpHitObjectRecordFromQueryEXT, + EOpHitObjectGetIntersectionTriangleVertexPositionsEXT, // HLSL operations // @@ -958,6 +1000,9 @@ enum TOperator { EOpAssumeEXT, EOpExpectEXT, + // GL_EXT_abort + EOpAbortEXT, + // Shader Clock Ops EOpReadClockSubgroupKHR, EOpReadClockDeviceKHR, @@ -981,6 +1026,12 @@ enum TOperator { EOpImageBlockMatchGatherSSDQCOM, EOpImageBlockMatchGatherSADQCOM, + // Cooperative Matrix Conversion + EOpBitCastArrayQCOM, + EOpExtractSubArrayQCOM, + EOpCompositeConstructCoopMatQCOM, + EOpCompositeExtractCoopMatQCOM, + // GL_NV_cluster_acceleration_structure EOpRayQueryGetIntersectionClusterIdNV, EOpHitObjectGetClusterIdNV, @@ -1011,6 +1062,7 @@ enum TLinkType { }; class TIntermTraverser; +class TIntermVariableDecl; class TIntermOperator; class TIntermAggregate; class TIntermUnary; @@ -1039,6 +1091,7 @@ public: virtual const glslang::TSourceLoc& getLoc() const { return loc; } virtual void setLoc(const glslang::TSourceLoc& l) { loc = l; } virtual void traverse(glslang::TIntermTraverser*) = 0; + virtual glslang::TIntermVariableDecl* getAsVariableDecl() { return nullptr; } virtual glslang::TIntermTyped* getAsTyped() { return nullptr; } virtual glslang::TIntermOperator* getAsOperator() { return nullptr; } virtual glslang::TIntermConstantUnion* getAsConstantUnion() { return nullptr; } @@ -1052,6 +1105,7 @@ public: virtual glslang::TIntermBranch* getAsBranchNode() { return nullptr; } virtual glslang::TIntermLoop* getAsLoopNode() { return nullptr; } + virtual const glslang::TIntermVariableDecl* getAsVariableDecl() const { return nullptr; } virtual const glslang::TIntermTyped* getAsTyped() const { return nullptr; } virtual const glslang::TIntermOperator* getAsOperator() const { return nullptr; } virtual const glslang::TIntermConstantUnion* getAsConstantUnion() const { return nullptr; } @@ -1082,6 +1136,37 @@ struct TIntermNodePair { TIntermNode* node2; }; +// +// Represent declaration of a variable. +// +class TIntermVariableDecl : public TIntermNode { +public: + TIntermVariableDecl(TIntermSymbol* declSymbol, TIntermNode* initNode) : declSymbol(declSymbol), initNode(initNode) + { + } + TIntermVariableDecl(const TIntermVariableDecl&) = delete; + TIntermVariableDecl& operator=(const TIntermVariableDecl&) = delete; + + void traverse(glslang::TIntermTraverser* traverser) override; + + TIntermVariableDecl* getAsVariableDecl() override { return this; } + const TIntermVariableDecl* getAsVariableDecl() const override { return this; } + + TIntermSymbol* getDeclSymbol() { return declSymbol; } + const TIntermSymbol* getDeclSymbol() const { return declSymbol; } + + TIntermNode* getInitNode() { return initNode; } + const TIntermNode* getInitNode() const { return initNode; } + +private: + // This symbol represents the declared variable at its declaration point. + // It's not traversed by default. To traverse it, the visitor needs to have includeDeclSymbol enabled. + TIntermSymbol* declSymbol = nullptr; + + // The initializer + TIntermNode* initNode = nullptr; +}; + // // Intermediate class for nodes that have a type. // @@ -1104,6 +1189,7 @@ public: virtual int getVectorSize() const { return type.getVectorSize(); } virtual int getMatrixCols() const { return type.getMatrixCols(); } virtual int getMatrixRows() const { return type.getMatrixRows(); } + virtual int getTensorRankARM() const { return type.getTensorRankARM(); } virtual bool isMatrix() const { return type.isMatrix(); } virtual bool isArray() const { return type.isArray(); } virtual bool isVector() const { return type.isVector(); } @@ -1125,7 +1211,7 @@ protected: // class TIntermLoop : public TIntermNode { public: - TIntermLoop(TIntermNode* aBody, TIntermTyped* aTest, TIntermTyped* aTerminal, bool testFirst) : + TIntermLoop(TIntermNode* aBody, TIntermNode* aTest, TIntermTyped* aTerminal, bool testFirst) : body(aBody), test(aTest), terminal(aTerminal), @@ -1144,10 +1230,20 @@ public: virtual const TIntermLoop* getAsLoopNode() const { return this; } virtual void traverse(TIntermTraverser*); TIntermNode* getBody() const { return body; } - TIntermTyped* getTest() const { return test; } + TIntermNode* getTest() const { return test; } TIntermTyped* getTerminal() const { return terminal; } bool testFirst() const { return first; } + // Because the test node can be a declaration in a while loop, this function unwraps it to get the actual expression. + TIntermTyped* getTestExpr() const { + if (auto decl = test->getAsVariableDecl()) { + return decl->getInitNode()->getAsTyped(); + } + else { + return test->getAsTyped(); + } + } + void setUnroll() { unroll = true; } void setDontUnroll() { dontUnroll = true; @@ -1181,7 +1277,7 @@ public: protected: TIntermNode* body; // code to loop over - TIntermTyped* test; // exit condition associated with loop, could be 0 for 'for' loops + TIntermNode* test; // exit condition associated with loop, could be 0 for 'for' loops TIntermTyped* terminal; // exists for for-loops bool first; // true for while and for, not for do-while bool unroll; // true if unroll requested @@ -1742,24 +1838,26 @@ enum TVisit class TIntermTraverser { public: POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator()) - TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false) : + TIntermTraverser(bool preVisit = true, bool inVisit = false, bool postVisit = false, bool rightToLeft = false, bool includeDeclSymbol = false) : preVisit(preVisit), inVisit(inVisit), postVisit(postVisit), rightToLeft(rightToLeft), + includeDeclSymbol(includeDeclSymbol), depth(0), maxDepth(0) { } virtual ~TIntermTraverser() { } - virtual void visitSymbol(TIntermSymbol*) { } - virtual void visitConstantUnion(TIntermConstantUnion*) { } - virtual bool visitBinary(TVisit, TIntermBinary*) { return true; } - virtual bool visitUnary(TVisit, TIntermUnary*) { return true; } - virtual bool visitSelection(TVisit, TIntermSelection*) { return true; } - virtual bool visitAggregate(TVisit, TIntermAggregate*) { return true; } - virtual bool visitLoop(TVisit, TIntermLoop*) { return true; } - virtual bool visitBranch(TVisit, TIntermBranch*) { return true; } - virtual bool visitSwitch(TVisit, TIntermSwitch*) { return true; } + virtual void visitSymbol(TIntermSymbol*) { } + virtual void visitConstantUnion(TIntermConstantUnion*) { } + virtual bool visitBinary(TVisit, TIntermBinary*) { return true; } + virtual bool visitUnary(TVisit, TIntermUnary*) { return true; } + virtual bool visitSelection(TVisit, TIntermSelection*) { return true; } + virtual bool visitAggregate(TVisit, TIntermAggregate*) { return true; } + virtual bool visitLoop(TVisit, TIntermLoop*) { return true; } + virtual bool visitBranch(TVisit, TIntermBranch*) { return true; } + virtual bool visitSwitch(TVisit, TIntermSwitch*) { return true; } + virtual bool visitVariableDecl(TVisit, TIntermVariableDecl*) { return true; } int getMaxDepth() const { return maxDepth; } @@ -1786,6 +1884,11 @@ public: const bool postVisit; const bool rightToLeft; + // Whether to traverse declaration symbols in the traversal. + // By default, declaration symbols are not visited in the traversal to avoid + // visiting them in SPIR-V generation where they are not needed. + const bool includeDeclSymbol; + protected: TIntermTraverser& operator=(TIntermTraverser&); diff --git a/src/libraries/glslang/glslang/Include/visibility.h b/src/libraries/glslang/glslang/Include/visibility.h index 9bb8f3faa..dd32351f8 100644 --- a/src/libraries/glslang/glslang/Include/visibility.h +++ b/src/libraries/glslang/glslang/Include/visibility.h @@ -51,4 +51,8 @@ // Symbols marked with this macro are only meant for public use by the test suite // and do not appear in publicly installed headers. They are not considered to be // part of the glslang library ABI. -#define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT +#ifdef GLSLANG_TEST_BUILD + #define GLSLANG_EXPORT_FOR_TESTS GLSLANG_EXPORT +#else + #define GLSLANG_EXPORT_FOR_TESTS +#endif diff --git a/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp b/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp index d6528b735..dc73271d1 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Constant.cpp @@ -46,7 +46,7 @@ namespace { using namespace glslang; -const double pi = 3.1415926535897932384626433832795; +constexpr double pi = 3.1415926535897932384626433832795; } // end anonymous namespace diff --git a/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp b/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp index a8658f72d..1e37fa2b2 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp @@ -394,6 +394,83 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function) } } +// Add long vector prototype for the builtin function. This is similar to +// AddTabledBuiltin, but only generates builtins where one type is an +// arbitrary vector. See comments on "enum ArgClass" for more details. +void AddLongVectorBuiltin(TString& decls, const BuiltInFunction& function) +{ + const auto isScalarType = [](int type) { return (type & TypeStringColumnMask) == 0; }; + + // loop across these two: + // 0: the varying arg set, and + // 1: the fixed scalar args + const ArgClass ClassFixed = (ArgClass)(ClassLS | ClassXLS | ClassLS2 | ClassFS | ClassFS2); + for (int fixed = 0; fixed < ((function.classes & ClassFixed) > 0 ? 2 : 1); ++fixed) { + + if (fixed == 0 && (function.classes & ClassXLS)) + continue; + + // Iterate over the different scalar types (needed for ClassRS) + for (int type = 0; type < TypeStringCount; ++type) { + if (!isScalarType(type)) + continue; + + // skip types not selected: go from type to row number to type bit + if ((function.types & (1 << (type >> TypeStringRowShift))) == 0) + continue; + + // skip scalar-only + if (function.classes & ClassV1) + continue; + + // skip 3-vector + if (function.classes & ClassV3) + continue; + + TString decl; + // return type + if (function.classes & ClassB) + decl.append("vector"); + else if (function.classes & ClassRS) + decl.append(TypeString[type & TypeStringScalarMask]); + else + decl.append("vector"); + decl.append(" "); + decl.append(function.name); + decl.append("("); + + // arguments + for (int arg = 0; arg < function.numArguments; ++arg) { + if (arg == function.numArguments - 1 && (function.classes & ClassLO)) + decl.append("out "); + if (arg == 0) { + if (function.classes & ClassCVN) + decl.append("coherent volatile nontemporal "); + if (function.classes & ClassFIO) + decl.append("inout "); + if (function.classes & ClassFO) + decl.append("out "); + } + if ((function.classes & ClassLB) && arg == function.numArguments - 1) + decl.append("vector"); + else if (fixed && ((arg == function.numArguments - 1 && (function.classes & (ClassLS | ClassXLS | + ClassLS2))) || + (arg == function.numArguments - 2 && (function.classes & ClassLS2)) || + (arg == 0 && (function.classes & (ClassFS | ClassFS2))) || + (arg == 1 && (function.classes & ClassFS2)))) + decl.append(TypeString[type & TypeStringScalarMask]); + else + decl.append("vector"); + if (arg < function.numArguments - 1) + decl.append(","); + } + decl.append(");\n"); + + decls.append(decl); + } + } +} + // See if the tabled versioning information allows the current version. bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */) { @@ -432,8 +509,12 @@ void TBuiltIns::addTabledBuiltins(int version, EProfile profile, const SpvVersio { const auto forEachFunction = [&](TString& decls, const span& functions) { for (const auto& fn : functions) { - if (ValidVersion(fn, version, profile, spvVersion)) + if (ValidVersion(fn, version, profile, spvVersion)) { AddTabledBuiltin(decls, fn); + if (profile != EEsProfile) { + AddLongVectorBuiltin(decls, fn); + } + } } }; @@ -524,6 +605,23 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV // // Derivatives Functions. // + TString derivatives ( + "float dFdx(float p);" + "vec2 dFdx(vec2 p);" + "vec3 dFdx(vec3 p);" + "vec4 dFdx(vec4 p);" + + "float dFdy(float p);" + "vec2 dFdy(vec2 p);" + "vec3 dFdy(vec3 p);" + "vec4 dFdy(vec4 p);" + + "float fwidth(float p);" + "vec2 fwidth(vec2 p);" + "vec3 fwidth(vec3 p);" + "vec4 fwidth(vec4 p);" + ); + TString derivativeControls ( "float dFdxFine(float p);" "vec2 dFdxFine(vec2 p);" @@ -2498,6 +2596,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV snprintf(buf, bufSize, op, intTypes[j], intTypes[j]); commonBuiltins.append(buf); } + snprintf(buf, bufSize, op, "vector", "vector"); + commonBuiltins.append(buf); } stageBuiltins[EShLangCompute].append( @@ -4211,6 +4311,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "i8vec3 bitCount(u8vec3);" "i8vec4 bitCount(u8vec4);" + "int8_t bitfieldReverse(highp int8_t);" + "i8vec2 bitfieldReverse(highp i8vec2);" + "i8vec3 bitfieldReverse(highp i8vec3);" + "i8vec4 bitfieldReverse(highp i8vec4);" + + "uint8_t bitfieldReverse(highp uint8_t);" + "u8vec2 bitfieldReverse(highp u8vec2);" + "u8vec3 bitfieldReverse(highp u8vec3);" + "u8vec4 bitfieldReverse(highp u8vec4);" + " int8_t findLSB( int8_t);" "i8vec2 findLSB(i8vec2);" "i8vec3 findLSB(i8vec3);" @@ -4429,6 +4539,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "i16vec3 bitCount(u16vec3);" "i16vec4 bitCount(u16vec4);" + "int16_t bitfieldReverse(highp int16_t);" + "i16vec2 bitfieldReverse(highp i16vec2);" + "i16vec3 bitfieldReverse(highp i16vec3);" + "i16vec4 bitfieldReverse(highp i16vec4);" + + "uint16_t bitfieldReverse(highp uint16_t);" + "u16vec2 bitfieldReverse(highp u16vec2);" + "u16vec3 bitfieldReverse(highp u16vec3);" + "u16vec4 bitfieldReverse(highp u16vec4);" + " int16_t findLSB( int16_t);" "i16vec2 findLSB(i16vec2);" "i16vec3 findLSB(i16vec3);" @@ -4729,6 +4849,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV commonBuiltins.append("void debugPrintfEXT();\n"); + commonBuiltins.append("void abortEXT();\n"); + if (profile != EEsProfile && version >= 450) { // coopMatStoreNV perhaps ought to have "out" on the buf parameter, but // adding it introduces undesirable tempArgs on the stack. What we want @@ -4830,17 +4952,19 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "uint", "uvec2", "uvec4", "uint64_t", "u64vec2", "u64vec4", }; - for (auto t : allTypes) { - cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, uint element, uint stride, int matrixLayout);\n"; - cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, uint element, uint stride, int matrixLayout);\n"; + for (auto elemTy : {"uint", "uint64_t"}) { + for (auto t : allTypes) { + cooperativeMatrixFuncs << "void coopMatLoad(out coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; + cooperativeMatrixFuncs << "void coopMatStore(coopmat m, volatile coherent nontemporal " << t << "[] buf, " << elemTy << " element, uint stride, int matrixLayout);\n"; + } + // Just use uint8_t for buffer type, we have special matching rules to allow any conversion + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, __function f);\n"; + cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v, __function f);\n"; + cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t);\n"; + cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, " << elemTy << " element, tensorLayoutNV t, tensorViewNV v);\n"; } - // Just use uint8_t for buffer type, we have special matching rules to allow any conversion - cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t);\n"; - cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v);\n"; - cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, __function f);\n"; - cooperativeMatrixFuncs << "void coopMatLoadTensorNV(inout coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v, __function f);\n"; - cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t);\n"; - cooperativeMatrixFuncs << "void coopMatStoreTensorNV(coopmat m, volatile coherent nontemporal uint8_t[] buf, uint element, tensorLayoutNV t, tensorViewNV v);\n"; } cooperativeMatrixFuncs << @@ -4884,6 +5008,31 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n" ); + { + std::stringstream coopMatConvFuncs; + + const std::string eltTypes[] = {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}; + + for (auto srcEltTy : eltTypes) { + for (auto dstEltTy : eltTypes) { + coopMatConvFuncs << "void bitcastQCOM(" << srcEltTy.c_str() << " SrcArr[], " << dstEltTy.c_str() + << " DstArr[]);\n"; + } + } + coopMatConvFuncs << "\n"; + + for (auto eltTy : {"float32_t", "float16_t", "int8_t", "uint8_t", "uint32_t", "uint", "int32_t", "int"}) { + coopMatConvFuncs << "void vectorToCoopmatQCOM(" << eltTy << " SrcVec[], coopmat CM);\n"; + coopMatConvFuncs << "void coopmatToVectorQCOM(coopmat CM, " << eltTy << " Dstvec[]);\n"; + } + + for (auto eltTy : {"uint32_t", "uint", "int32_t", "int", "float32_t", "float", "float16_t"}) { + coopMatConvFuncs << "void extractSubArrayQCOM(" << eltTy << " arr[], uint index, " << eltTy << " subarr[]);\n"; + } + + commonBuiltins.append(coopMatConvFuncs.str().c_str()); + } + commonBuiltins.append( "tensorLayoutNV createTensorLayoutNV(uint Dim);\n" "tensorLayoutNV createTensorLayoutNV(uint Dim, uint Mode);\n" @@ -4937,6 +5086,30 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "tensorViewNV setTensorViewClipNV(tensorViewNV v, uint clipRowOffset, uint clipRowSpan, uint clipColOffset, uint clipColSpan);\n" "\n" ); + + // GL_ARM_tensors builtins. + static const char *tensorDataTypesARM[] = { + "bool", + "int8_t", "int16_t", "int32_t", "int64_t", + "uint8_t", "uint16_t", "uint32_t", "uint64_t", + "float16_t", "float32_t", "float64_t", + "bfloat16_t", "floate5m2_t", "floate4m3_t", + }; + std::ostringstream ostream; + for (auto t : tensorDataTypesARM) { + // Scalar + ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], out " + << t << " data, uint tensorOperands = 0U, ...);\n"; + ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " + << t << " data, uint tensorOperands = 0U, ...);\n"; + // Array + ostream << "void tensorReadARM(readonly tensorARM t, uint coords[], " + << t << " data[], uint tensorOperands = 0U, ...);\n"; + ostream << "void tensorWriteARM(writeonly tensorARM t, uint coords[], " + << t << " data[], uint tensorOperands = 0U, ...);\n"; + } + ostream << "uint tensorSizeARM(readonly writeonly tensorARM t, uint dim);\n"; + commonBuiltins.append(ostream.str()); } if (profile != EEsProfile && version >= 450) { @@ -4953,49 +5126,54 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "float32_t", "float64_t", }; - for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) { - std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") + - std::string("coopvecNV v, ") + - std::string("int inputInterpretation, ") + - std::string(basicTypes[i]) + std::string("[] matrix, ") + - std::string("uint matrixOffset, ") + - std::string("int matrixInterpretation, ") + - std::string("uint M, ") + - std::string("uint K, ") + - std::string("int matrixLayout, ") + - std::string("bool transpose, ") + - std::string("uint matrixStride);\n"); - commonBuiltins.append(func.c_str()); + std::string coopVecOffsetTypes[] = { + "uint", + "uint64_t", + }; + for (auto offsetTy : coopVecOffsetTypes) { + for (uint32_t i = 0; i < sizeof(basicTypes)/sizeof(basicTypes[0]); ++i) { + std::string func = std::string("void coopVecMatMulNV(out coopvecNV result, ") + + std::string("coopvecNV v, ") + + std::string("int inputInterpretation, ") + + std::string(basicTypes[i]) + std::string("[] matrix, ") + + offsetTy + std::string(" matrixOffset, ") + + std::string("int matrixInterpretation, ") + + std::string("uint M, ") + + std::string("uint K, ") + + std::string("int matrixLayout, ") + + std::string("bool transpose, ") + + std::string("uint matrixStride);\n"); + commonBuiltins.append(func.c_str()); - for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) { - func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") + - std::string("coopvecNV v, ") + - std::string("int inputInterpretation, ") + - std::string(basicTypes[i]) + std::string("[] matrix, ") + - std::string("uint matrixOffset, ") + - std::string("int matrixInterpretation, ") + - std::string(basicTypes[j]) + std::string("[] bias, ") + - std::string("uint biasOffset, ") + - std::string("int biasInterpretation, ") + - std::string("uint M, ") + - std::string("uint K, ") + - std::string("int matrixLayout, ") + - std::string("bool transpose, ") + - std::string("uint matrixStride);\n"); + for (uint32_t j = 0; j < sizeof(basicTypes)/sizeof(basicTypes[0]); ++j) { + func = std::string("void coopVecMatMulAddNV(out coopvecNV result, ") + + std::string("coopvecNV v, ") + + std::string("int inputInterpretation, ") + + std::string(basicTypes[i]) + std::string("[] matrix, ") + + offsetTy + std::string(" matrixOffset, ") + + std::string("int matrixInterpretation, ") + + std::string(basicTypes[j]) + std::string("[] bias, ") + + offsetTy + std::string(" biasOffset, ") + + std::string("int biasInterpretation, ") + + std::string("uint M, ") + + std::string("uint K, ") + + std::string("int matrixLayout, ") + + std::string("bool transpose, ") + + std::string("uint matrixStride);\n"); + commonBuiltins.append(func.c_str()); + } + + func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") + + std::string(basicTypes[i]) + + std::string("[] buf, ") + offsetTy + std::string(" offset, uint stride, int matrixLayout, int matrixInterpretation);\n"); + commonBuiltins.append(func.c_str()); + + func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") + + std::string(basicTypes[i]) + + std::string("[] buf, ") + offsetTy + std::string(" offset);\n"); commonBuiltins.append(func.c_str()); } - - func = std::string("void coopVecOuterProductAccumulateNV(coopvecNV v1, coopvecNV v2, ") + - std::string(basicTypes[i]) + - std::string("[] buf, uint offset, uint stride, int matrixLayout, int matrixInterpretation);\n"); - commonBuiltins.append(func.c_str()); - - func = std::string("void coopVecReduceSumAccumulateNV(coopvecNV v, ") + - std::string(basicTypes[i]) + - std::string("[] buf, uint offset);\n"); - commonBuiltins.append(func.c_str()); } - std::string cooperativeVectorFuncs = "coopvecNV fma(coopvecNV, coopvecNV, coopvecNV);\n" "coopvecNV min(coopvecNV, coopvecNV);\n" @@ -5005,12 +5183,124 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "coopvecNV log(coopvecNV);\n" "coopvecNV tanh(coopvecNV);\n" "coopvecNV atan(coopvecNV);\n" - "coopvecNV clamp(coopvecNV, coopvecNV, coopvecNV);\n" - "\n" - ; + "coopvecNV clamp(coopvecNV, coopvecNV, coopvecNV);\n"; commonBuiltins.append(cooperativeVectorFuncs.c_str()); + if (profile != EEsProfile) { + std::string longVectorFuncs = + + // manually add long vector prototypes for functions not in BaseFunctions/etc + "vector frexp(vector, vector);\n" + "vector ldexp(vector, vector);\n" + "vector fma(vector, vector, vector);\n" + + "vector floatBitsToInt(vector);\n" + "vector floatBitsToUint(vector);\n" + "vector intBitsToFloat(vector);\n" + "vector uintBitsToFloat(vector);\n" + "vector doubleBitsToInt64(vector);" + "vector doubleBitsToUint64(vector);" + "vector int64BitsToDouble(vector);" + "vector uint64BitsToDouble(vector);" + "vector bfloat16BitsToIntEXT(vector);" + "vector bfloat16BitsToUintEXT(vector);" + "vector intBitsToBFloat16EXT(vector);" + "vector uintBitsToBFloat16EXT(vector);" + "vector halfBitsToInt16(vector);" + "vector halfBitsToUint16(vector);" + "vector float16BitsToInt16(vector);" + "vector float16BitsToUint16(vector);" + "vector int16BitsToFloat16(vector);" + "vector uint16BitsToFloat16(vector);" + "vector int16BitsToHalf(vector);" + "vector uint16BitsToHalf(vector);" + "vector floate5m2BitsToIntEXT(vector);" + "vector floate5m2BitsToUintEXT(vector);" + "vector intBitsToFloate5m2EXT(vector);" + "vector uintBitsToFloate5m2EXT(vector);" + "vector floate4m3BitsToIntEXT(vector);" + "vector floate4m3BitsToUintEXT(vector);" + "vector intBitsToFloate4m3EXT(vector);" + "vector uintBitsToFloate4m3EXT(vector);" + + "vector uaddCarry(highp vector, highp vector, out lowp vector carry);" + "vector usubBorrow(highp vector, highp vector, out lowp vector borrow);" + "void umulExtended(highp vector, highp vector, out highp vector, out highp vector);" + "void imulExtended(highp vector, highp vector, out highp vector, out highp vector);" + "vector bitfieldExtract(vector, int, int);" + "vector bitfieldInsert(vector, vector, int, int);" + "vector bitfieldReverse(highp vector);" + "vector bitCount(vector);" + "vector findLSB(vector);" + "vector findMSB(vector);" + + // BaseFunctions overloads with a scalar parameter don't get generated in AddLongVectorBuiltin + "vector mod(vector, double);\n" + "vector min(vector, double);\n" + "vector max(vector, double);\n" + "vector clamp(vector, double, double);" + "vector mix(vector, vector, double);" + "vector step(double, vector);" + "vector smoothstep(double, double, vector);" + "vector refract(vector, vector, double);" + + "vector mod(vector, float16_t);\n" + "vector min(vector, float16_t);\n" + "vector max(vector, float16_t);\n" + "vector clamp(vector, float16_t, float16_t);" + "vector mix(vector, vector, float16_t);" + "vector step(float16_t, vector);" + "vector smoothstep(float16_t, float16_t, vector);" + "vector refract(vector, vector, float16_t);" + + "vector min(vector, uint64_t);\n" + "vector max(vector, uint64_t);\n" + "vector clamp(vector, uint64_t, uint64_t);" + "vector mix(vector, vector, uint64_t);" + + "vector min(vector, int64_t);\n" + "vector max(vector, int64_t);\n" + "vector clamp(vector, int64_t, int64_t);" + "vector mix(vector, vector, int64_t);" + + "vector min(vector, uint16_t);\n" + "vector max(vector, uint16_t);\n" + "vector clamp(vector, uint16_t, uint16_t);" + "vector mix(vector, vector, uint16_t);" + + "vector min(vector, int16_t);\n" + "vector max(vector, int16_t);\n" + "vector clamp(vector, int16_t, int16_t);" + "vector mix(vector, vector, int16_t);" + + "vector min(vector, uint8_t);\n" + "vector max(vector, uint8_t);\n" + "vector clamp(vector, uint8_t, uint8_t);" + "vector mix(vector, vector, uint8_t);" + + "vector min(vector, int8_t);\n" + "vector max(vector, int8_t);\n" + "vector clamp(vector, int8_t, int8_t);" + "vector mix(vector, vector, int8_t);" + + "vector expectEXT(vector, vector);" + ; + + std::string longVectorDerivativeFuncs = + "vector dFdxFine(vector);" + "vector dFdyFine(vector);" + "vector fwidthFine(vector);" + "vector dFdxCoarse(vector);" + "vector dFdyCoarse(vector);" + "vector fwidthCoarse(vector);" + + ; + commonBuiltins.append(longVectorFuncs.c_str()); + stageBuiltins[EShLangFragment].append(longVectorDerivativeFuncs.c_str()); + stageBuiltins[EShLangCompute].append(longVectorDerivativeFuncs.c_str()); + } + const char *scalarAndVectorTypes[] = { "int8_t", "int16_t", @@ -5057,13 +5347,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "f32vec4", "f64vec4", }; - for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) { - std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") + - std::string(scalarAndVectorTypes[i]) + std::string("[] buf, uint offset);"); - std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") + - std::string(scalarAndVectorTypes[i]) + std::string("[] buf, uint offset);"); - commonBuiltins.append(load.c_str()); - commonBuiltins.append(store.c_str()); + + for (auto offsetTy : coopVecOffsetTypes) { + for (uint32_t i = 0; i < sizeof(scalarAndVectorTypes)/sizeof(scalarAndVectorTypes[0]); ++i) { + std::string load = std::string("void coopVecLoadNV(out coopvecNV v, volatile coherent ") + + std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); + std::string store = std::string("void coopVecStoreNV(coopvecNV v, volatile coherent ") + + std::string(scalarAndVectorTypes[i]) + std::string("[] buf, ") + offsetTy + std::string(" offset);"); + commonBuiltins.append(load.c_str()); + commonBuiltins.append(store.c_str()); + } } commonBuiltins.append( @@ -5349,6 +5642,46 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" "bool hitObjectIsSphereHitNV(hitObjectNV);" "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectReorderExecuteEXT(hitObjectEXT,int);" + "void hitObjectReorderExecuteEXT(hitObjectEXT,uint,uint,int);" + "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,uint,uint,int);" + "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectTraceMotionReorderExecuteEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,uint,uint,int);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int, uint);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" + "void reorderThreadEXT(uint, uint);" + "void reorderThreadEXT(hitObjectEXT);" + "void reorderThreadEXT(hitObjectEXT, uint, uint);" "\n"); stageBuiltins[EShLangIntersect].append( "bool reportIntersectionNV(float, uint);" @@ -5401,6 +5734,37 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" "bool hitObjectIsSphereHitNV(hitObjectNV);" "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT,uint, int);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT,uint, int, uint);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" "\n"); stageBuiltins[EShLangMiss].append( "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" @@ -5445,6 +5809,37 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "void hitObjectGetLSSRadiiNV(hitObjectNV, out float[2]);" "bool hitObjectIsSphereHitNV(hitObjectNV);" "bool hitObjectIsLSSHitNV(hitObjectNV);" + "void hitObjectTraceRayEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);" + "void hitObjectTraceRayMotionEXT(hitObjectEXT,accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);" + "void hitObjectRecordMissEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float);" + "void hitObjectRecordMissMotionEXT(hitObjectEXT,uint,uint,vec3,float,vec3,float,float);" + "void hitObjectRecordEmptyEXT(hitObjectEXT);" + "void hitObjectExecuteShaderEXT(hitObjectEXT,int);" + "bool hitObjectIsEmptyEXT(hitObjectEXT);" + "bool hitObjectIsMissEXT(hitObjectEXT);" + "bool hitObjectIsHitEXT(hitObjectEXT);" + "float hitObjectGetRayTMinEXT(hitObjectEXT);" + "float hitObjectGetRayTMaxEXT(hitObjectEXT);" + "uint hitObjectGetRayFlagsEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetWorldRayDirectionEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayOriginEXT(hitObjectEXT);" + "vec3 hitObjectGetObjectRayDirectionEXT(hitObjectEXT);" + "mat4x3 hitObjectGetWorldToObjectEXT(hitObjectEXT);" + "mat4x3 hitObjectGetObjectToWorldEXT(hitObjectEXT);" + "int hitObjectGetInstanceCustomIndexEXT(hitObjectEXT);" + "int hitObjectGetInstanceIdEXT(hitObjectEXT);" + "int hitObjectGetGeometryIndexEXT(hitObjectEXT);" + "int hitObjectGetPrimitiveIndexEXT(hitObjectEXT);" + "uint hitObjectGetHitKindEXT(hitObjectEXT);" + "void hitObjectGetAttributesEXT(hitObjectEXT,int);" + "float hitObjectGetCurrentTimeEXT(hitObjectEXT);" + "uint hitObjectGetShaderBindingTableRecordIndexEXT(hitObjectEXT);" + "uvec2 hitObjectGetShaderRecordBufferHandleEXT(hitObjectEXT);" + "void hitObjectSetShaderBindingTableRecordIndexEXT(hitObjectEXT, uint);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int);" + "void hitObjectRecordFromQueryEXT(hitObjectEXT, rayQueryEXT, uint, int, uint);" + "void hitObjectGetIntersectionTriangleVertexPositionsEXT(hitObjectEXT, out vec3[3]);" "\n"); stageBuiltins[EShLangCallable].append( "void executeCallableNV(uint, int);" @@ -5452,15 +5847,34 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } - //E_SPV_NV_compute_shader_derivatives + // GL_KHR_compute_shader_derivatives / SPV_NV_compute_shader_derivatives if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) { + if (profile != EEsProfile) { + stageBuiltins[EShLangCompute].append(derivatives); + stageBuiltins[EShLangTask].append(derivatives); + stageBuiltins[EShLangMesh].append(derivatives); + } + stageBuiltins[EShLangCompute].append(derivativeControls); stageBuiltins[EShLangCompute].append("\n"); + + if (profile != EEsProfile) { + stageBuiltins[EShLangTask].append(derivativeControls); + stageBuiltins[EShLangTask].append("\n"); + stageBuiltins[EShLangMesh].append(derivativeControls); + stageBuiltins[EShLangMesh].append("\n"); + } } if (profile != EEsProfile && version >= 450) { stageBuiltins[EShLangCompute].append(derivativesAndControl16bits); stageBuiltins[EShLangCompute].append(derivativesAndControl64bits); stageBuiltins[EShLangCompute].append("\n"); + stageBuiltins[EShLangTask].append(derivativesAndControl16bits); + stageBuiltins[EShLangTask].append(derivativesAndControl64bits); + stageBuiltins[EShLangTask].append("\n"); + stageBuiltins[EShLangMesh].append(derivativesAndControl16bits); + stageBuiltins[EShLangMesh].append(derivativesAndControl64bits); + stageBuiltins[EShLangMesh].append("\n"); } // Builtins for GL_NV_mesh_shader @@ -6917,7 +7331,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV false, ms ? true : false); - TString typeName = sampler.getString(); + TString typeName = TString{sampler.getString()}; addQueryFunctions(sampler, typeName, version, profile); addImageFunctions(sampler, typeName, version, profile); @@ -7020,7 +7434,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c ms ? true : false); } - TString typeName = sampler.getString(); + TString typeName = TString{sampler.getString()}; if (dim == EsdSubpass) { addSubpassSampling(sampler, typeName, version, profile); @@ -7044,7 +7458,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c // texture types. sampler.setTexture(sampler.type, sampler.dim, sampler.arrayed, sampler.shadow, sampler.ms); - TString textureTypeName = sampler.getString(); + TString textureTypeName = TString{sampler.getString()}; addSamplingFunctions(sampler, textureTypeName, version, profile); addQueryFunctions(sampler, textureTypeName, version, profile); } @@ -7116,7 +7530,7 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int } // - // textureQueryLod(), fragment stage only + // textureQueryLod() // Also enabled with extension GL_ARB_texture_query_lod // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension. @@ -7155,6 +7569,26 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]); } stageBuiltins[EShLangCompute].append(");\n"); + + stageBuiltins[EShLangTask].append(funcName[i]); + stageBuiltins[EShLangTask].append(typeName); + if (dimMap[sampler.dim] == 1) + stageBuiltins[EShLangTask].append(", float"); + else { + stageBuiltins[EShLangTask].append(", vec"); + stageBuiltins[EShLangTask].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangTask].append(");\n"); + + stageBuiltins[EShLangMesh].append(funcName[i]); + stageBuiltins[EShLangMesh].append(typeName); + if (dimMap[sampler.dim] == 1) + stageBuiltins[EShLangMesh].append(", float"); + else { + stageBuiltins[EShLangMesh].append(", vec"); + stageBuiltins[EShLangMesh].append(postfixes[dimMap[sampler.dim]]); + } + stageBuiltins[EShLangMesh].append(");\n"); } } @@ -7910,9 +8344,12 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in } s.append(");\n"); - if (bias) + if (bias) { stageBuiltins[EShLangFragment].append(s); - else + stageBuiltins[EShLangCompute].append(s); + stageBuiltins[EShLangTask].append(s); + stageBuiltins[EShLangMesh].append(s); + } else commonBuiltins.append(s); } } @@ -8328,6 +8765,12 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf snprintf(builtInConstant, maxSize, "const int gl_MaxComputeTextureImageUnits = %d;", resources.maxComputeTextureImageUnits); s.append(builtInConstant); + // GL_ARM_tensors operands. + snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsNonTemporalARM = 0x1U;"); + s.append(builtInConstant); + snprintf(builtInConstant, maxSize, "const uint gl_TensorOperandsOutOfBoundsValueARM = 0x2U;"); + s.append(builtInConstant); + s.append("\n"); } @@ -9637,6 +10080,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("controlBarrier", 1, &E_GL_KHR_memory_scope_semantics); symbolTable.setFunctionExtensions("debugPrintfEXT", 1, &E_GL_EXT_debug_printf); + symbolTable.setFunctionExtensions("abortEXT", 1, &E_GL_EXT_abort); // GL_ARB_shader_ballot if (profile != EEsProfile) { @@ -9728,10 +10172,32 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } { - symbolTable.setFunctionExtensions("coopMatLoad", 1, &E_GL_KHR_cooperative_matrix); - symbolTable.setFunctionExtensions("coopMatStore", 1, &E_GL_KHR_cooperative_matrix); + auto coopMatKHRCallback = [](const char *name) -> std::vector { + std::vector ret; + if (strstr(name, "u64") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_KHR_cooperative_matrix); + } + return ret; + }; + auto coopMat2NVCallback = [](const char *name) -> std::vector { + std::vector ret; + if (strstr(name, "u64") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_NV_cooperative_matrix2); + } + return ret; + }; + + symbolTable.setFunctionExtensionsCallback("coopMatLoad", coopMatKHRCallback); + symbolTable.setFunctionExtensionsCallback("coopMatStore", coopMatKHRCallback); symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix); + symbolTable.setFunctionExtensionsCallback("coopMatLoadTensorNV", coopMat2NVCallback); + symbolTable.setFunctionExtensionsCallback("coopMatStoreTensorNV", coopMat2NVCallback); + symbolTable.setFunctionExtensions("coopMatReduceNV", 1, &E_GL_NV_cooperative_matrix2); symbolTable.setFunctionExtensions("coopMatPerElementNV", 1, &E_GL_NV_cooperative_matrix2); symbolTable.setFunctionExtensions("coopMatTransposeNV", 1, &E_GL_NV_cooperative_matrix2); @@ -9750,22 +10216,59 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } { - symbolTable.setFunctionExtensions("coopVecMatMulNV", 1, &E_GL_NV_cooperative_vector); - symbolTable.setFunctionExtensions("coopVecMatMulAddNV", 1, &E_GL_NV_cooperative_vector); - symbolTable.setFunctionExtensions("coopVecOuterProductAccumulateNV", 1, &E_GL_NV_cooperative_vector); - symbolTable.setFunctionExtensions("coopVecReduceSumAccumulateNV", 1, &E_GL_NV_cooperative_vector); + symbolTable.setFunctionExtensions("tensorReadARM", 1, &E_GL_ARM_tensors); + symbolTable.setFunctionExtensions("tensorWriteARM", 1, &E_GL_ARM_tensors); + symbolTable.setFunctionExtensions("tensorSizeARM", 1, &E_GL_ARM_tensors); + } + { + auto coopVecCallback = [](const char *name) -> std::vector { + std::vector ret; + // This looks for u64 as the last parameter (the offset) + if (strstr(name, "u641;") != nullptr) { + ret.push_back(E_GL_EXT_shader_64bit_indexing); + } else { + ret.push_back(E_GL_NV_cooperative_vector); + } + return ret; + }; + symbolTable.setFunctionExtensionsCallback("coopVecMatMulNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecMatMulAddNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecLoadNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecStoreNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecOuterProductAccumulateNV", coopVecCallback); + symbolTable.setFunctionExtensionsCallback("coopVecReduceSumAccumulateNV", coopVecCallback); + } + + { + symbolTable.setFunctionExtensions("bitcastQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("extractSubArrayQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("vectorToCoopmatQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); + symbolTable.setFunctionExtensions("coopmatToVectorQCOM", 1, &E_GL_QCOM_cooperative_matrix_conversion); } if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) { - symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_NV_compute_shader_derivatives); - symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_NV_compute_shader_derivatives); + const char* const derivativeExts[] = { E_GL_NV_compute_shader_derivatives, E_GL_KHR_compute_shader_derivatives }; + if (language == EShLangCompute) { + symbolTable.setFunctionExtensions("dFdx", 2, derivativeExts); + symbolTable.setFunctionExtensions("dFdy", 2, derivativeExts); + symbolTable.setFunctionExtensions("fwidth", 2, derivativeExts); + symbolTable.setFunctionExtensions("dFdxFine", 2, derivativeExts); + symbolTable.setFunctionExtensions("dFdyFine", 2, derivativeExts); + symbolTable.setFunctionExtensions("fwidthFine", 2, derivativeExts); + symbolTable.setFunctionExtensions("dFdxCoarse", 2, derivativeExts); + symbolTable.setFunctionExtensions("dFdyCoarse", 2, derivativeExts); + symbolTable.setFunctionExtensions("fwidthCoarse", 2, derivativeExts); + } else if (language == EShLangTask || language == EShLangMesh) { + symbolTable.setFunctionExtensions("dFdx", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdy", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidth", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxFine", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyFine", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthFine", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdxCoarse", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("dFdyCoarse", 1, &E_GL_KHR_compute_shader_derivatives); + symbolTable.setFunctionExtensions("fwidthCoarse", 1, &E_GL_KHR_compute_shader_derivatives); + } } if ((profile == EEsProfile && version >= 310) || @@ -9930,6 +10433,40 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.setFunctionExtensions("hitObjectGetLSSRadiiNV", 1, &E_GL_NV_linear_swept_spheres); symbolTable.setFunctionExtensions("hitObjectIsSphereHitNV", 1, &E_GL_NV_linear_swept_spheres); symbolTable.setFunctionExtensions("hitObjectIsLSSHitNV", 1, &E_GL_NV_linear_swept_spheres); + symbolTable.setFunctionExtensions("hitObjectTraceRayEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceRayMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordMissMotionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectExecuteShaderEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsEmptyEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsMissEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectIsHitEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMinEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayTMaxEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetRayFlagsEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayOriginEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldRayDirectionEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetWorldToObjectEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetObjectToWorldEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceCustomIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetInstanceIdEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetGeometryIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetPrimitiveIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetHitKindEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetAttributesEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetCurrentTimeEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetShaderRecordBufferHandleEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectSetShaderBindingTableRecordIndexEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("reorderThreadEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectTraceMotionReorderExecuteEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectRecordFromQueryEXT", 1, &E_GL_EXT_shader_invocation_reorder); + symbolTable.setFunctionExtensions("hitObjectGetIntersectionTriangleVertexPositionsEXT", 1, &E_GL_EXT_shader_invocation_reorder); BuiltInVariable("gl_LaunchIDNV", EbvLaunchId, symbolTable); @@ -10602,6 +11139,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("debugPrintfEXT", EOpDebugPrintf); symbolTable.relateToOperator("assumeEXT", EOpAssumeEXT); symbolTable.relateToOperator("expectEXT", EOpExpectEXT); + symbolTable.relateToOperator("abortEXT", EOpAbortEXT); if (PureOperatorBuiltins) { @@ -11065,6 +11603,15 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("setTensorViewStrideNV", EOpTensorViewSetStrideNV); symbolTable.relateToOperator("setTensorViewClipNV", EOpTensorViewSetClipNV); + symbolTable.relateToOperator("tensorReadARM", EOpTensorReadARM); + symbolTable.relateToOperator("tensorWriteARM", EOpTensorWriteARM); + symbolTable.relateToOperator("tensorSizeARM", EOpTensorSizeARM); + + symbolTable.relateToOperator("bitcastQCOM", EOpBitCastArrayQCOM); + symbolTable.relateToOperator("extractSubArrayQCOM", EOpExtractSubArrayQCOM); + symbolTable.relateToOperator("vectorToCoopmatQCOM", EOpCompositeConstructCoopMatQCOM); + symbolTable.relateToOperator("coopmatToVectorQCOM", EOpCompositeExtractCoopMatQCOM); + if (profile != EEsProfile && version >= 460) { symbolTable.relateToOperator("fetchMicroTriangleVertexPositionNV", EOpFetchMicroTriangleVertexPositionNV); symbolTable.relateToOperator("fetchMicroTriangleVertexBarycentricNV", EOpFetchMicroTriangleVertexBarycentricNV); @@ -11124,6 +11671,40 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion symbolTable.relateToOperator("hitObjectGetLSSRadiiNV", EOpHitObjectGetLSSRadiiNV); symbolTable.relateToOperator("hitObjectIsSphereHitNV", EOpHitObjectIsSphereHitNV); symbolTable.relateToOperator("hitObjectIsLSSHitNV", EOpHitObjectIsLSSHitNV); + symbolTable.relateToOperator("hitObjectTraceRayEXT", EOpHitObjectTraceRayEXT); + symbolTable.relateToOperator("hitObjectTraceRayMotionEXT", EOpHitObjectTraceRayMotionEXT); + symbolTable.relateToOperator("hitObjectRecordMissEXT", EOpHitObjectRecordMissEXT); + symbolTable.relateToOperator("hitObjectRecordMissMotionEXT", EOpHitObjectRecordMissMotionEXT); + symbolTable.relateToOperator("hitObjectRecordEmptyEXT", EOpHitObjectRecordEmptyEXT); + symbolTable.relateToOperator("hitObjectExecuteShaderEXT", EOpHitObjectExecuteShaderEXT); + symbolTable.relateToOperator("hitObjectIsEmptyEXT", EOpHitObjectIsEmptyEXT); + symbolTable.relateToOperator("hitObjectIsMissEXT", EOpHitObjectIsMissEXT); + symbolTable.relateToOperator("hitObjectIsHitEXT", EOpHitObjectIsHitEXT); + symbolTable.relateToOperator("hitObjectGetRayTMinEXT", EOpHitObjectGetRayTMinEXT); + symbolTable.relateToOperator("hitObjectGetRayTMaxEXT", EOpHitObjectGetRayTMaxEXT); + symbolTable.relateToOperator("hitObjectGetRayFlagsEXT", EOpHitObjectGetRayFlagsEXT); + symbolTable.relateToOperator("hitObjectGetObjectRayOriginEXT", EOpHitObjectGetObjectRayOriginEXT); + symbolTable.relateToOperator("hitObjectGetObjectRayDirectionEXT", EOpHitObjectGetObjectRayDirectionEXT); + symbolTable.relateToOperator("hitObjectGetWorldRayOriginEXT", EOpHitObjectGetWorldRayOriginEXT); + symbolTable.relateToOperator("hitObjectGetWorldRayDirectionEXT", EOpHitObjectGetWorldRayDirectionEXT); + symbolTable.relateToOperator("hitObjectGetWorldToObjectEXT", EOpHitObjectGetWorldToObjectEXT); + symbolTable.relateToOperator("hitObjectGetObjectToWorldEXT", EOpHitObjectGetObjectToWorldEXT); + symbolTable.relateToOperator("hitObjectGetInstanceCustomIndexEXT", EOpHitObjectGetInstanceCustomIndexEXT); + symbolTable.relateToOperator("hitObjectGetInstanceIdEXT", EOpHitObjectGetInstanceIdEXT); + symbolTable.relateToOperator("hitObjectGetGeometryIndexEXT", EOpHitObjectGetGeometryIndexEXT); + symbolTable.relateToOperator("hitObjectGetPrimitiveIndexEXT", EOpHitObjectGetPrimitiveIndexEXT); + symbolTable.relateToOperator("hitObjectGetHitKindEXT", EOpHitObjectGetHitKindEXT); + symbolTable.relateToOperator("hitObjectGetAttributesEXT", EOpHitObjectGetAttributesEXT); + symbolTable.relateToOperator("hitObjectGetCurrentTimeEXT", EOpHitObjectGetCurrentTimeEXT); + symbolTable.relateToOperator("hitObjectGetShaderBindingTableRecordIndexEXT", EOpHitObjectGetShaderBindingTableRecordIndexEXT); + symbolTable.relateToOperator("hitObjectGetShaderRecordBufferHandleEXT", EOpHitObjectGetShaderRecordBufferHandleEXT); + symbolTable.relateToOperator("hitObjectSetShaderBindingTableRecordIndexEXT", EOpHitObjectSetShaderBindingTableRecordIndexEXT); + symbolTable.relateToOperator("reorderThreadEXT", EOpReorderThreadEXT); + symbolTable.relateToOperator("hitObjectReorderExecuteEXT", EOpHitObjectReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectTraceReorderExecuteEXT", EOpHitObjectTraceReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectTraceMotionReorderExecuteEXT", EOpHitObjectTraceMotionReorderExecuteEXT); + symbolTable.relateToOperator("hitObjectRecordFromQueryEXT", EOpHitObjectRecordFromQueryEXT); + symbolTable.relateToOperator("hitObjectGetIntersectionTriangleVertexPositionsEXT", EOpHitObjectGetIntersectionTriangleVertexPositionsEXT); } break; case EShLangIntersect: @@ -11262,4 +11843,407 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion } } +// Determine whether this fnCandidate overload is supported for these arguments. +// Some of this is based on the BaseFunctions table, but for functions not in that +// table there's some handcoded logic. +// If the overload is supported, then this sets the specific parameter/result +// types and returns true. +bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultType, TIntermNode* arguments) +{ + TOperator op = fnCandidate->getBuiltInOp(); + + const auto &getArg = [&](uint32_t i) { + TIntermAggregate* aggregate = arguments->getAsAggregate(); + return fnCandidate->getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped()); + }; + + bool valid = true; + + const auto &checkFnTypes = [&](TIntermTyped *t, uint32_t types) { + if (t->getType().isFloatingDomain() && !(types & TypeF)) { + valid = false; + } + if (isTypeSignedInt(t->getType().getBasicType()) && !(types & TypeI)) { + valid = false; + } + if (isTypeUnsignedInt(t->getType().getBasicType()) && !(types & TypeU)) { + valid = false; + } + if (t->getType().getBasicType() == EbtBool && !(types & TypeB)) { + valid = false; + } + }; + + const auto &checkShape = [&](TIntermTyped *t0, TIntermTyped *t1) { + if (!t0->getType().sameLongVectorShape(t1->getType())) { + valid = false; + } + }; + + const auto &checkSameType = [&](TIntermTyped *t0, TIntermTyped *t1) { + if (t0->getType() != t1->getType()) { + valid = false; + } + }; + + const auto &checkArgsMatch = [&](uint32_t argStart, uint32_t argEnd, uint32_t types) { + for (uint32_t i = argStart; i < argEnd; ++i) { + checkFnTypes(getArg(i), types); + if (i != argStart) { + checkSameType(getArg(argStart), getArg(i)); + } + } + }; + + uint32_t paramCount = fnCandidate->getParamCount(); + + bool foundInBase = false; + for (const auto &fn : BaseFunctions) { + if (fn.op != op) { + continue; + } + valid = true; + foundInBase = true; + + TIntermTyped *firstLongVector = nullptr; + for (uint32_t i = 0; i < paramCount; ++i) { + TIntermTyped* arg = getArg(i); + + ArgType argType = fn.types; + if (i == paramCount - 1 && (fn.classes & ClassLB)) { + argType = TypeB; + } + + checkFnTypes(arg, argType); + + if ((fn.classes & ClassLS) && getArg(paramCount-1)->getType().isScalar()) { + if (getArg(paramCount-1)->getType().getBasicType() != arg->getBasicType()) { + valid = false; + } + } + + if (arg->getType().isLongVector()) { + if (firstLongVector != nullptr) { + checkShape(firstLongVector, arg); + } + if (firstLongVector == nullptr) { + firstLongVector = arg; + } + } + } + + uint32_t argsToMatchStart = 0; + uint32_t argsToMatchEnd = paramCount; + if (fn.classes & ClassFS) + argsToMatchStart++; + if (fn.classes & ClassFS2) + argsToMatchStart += 2; + if ((fn.classes & ClassLS) && getArg(paramCount-1)->getType().isScalar()) + argsToMatchEnd--; + if (fn.classes & ClassXLS) + argsToMatchEnd--; + if (fn.classes & ClassLS2) + argsToMatchEnd -= 2; + if (fn.classes & ClassLB) + argsToMatchEnd--; + + checkArgsMatch(argsToMatchStart, argsToMatchEnd, fn.types); + + // These ops (arbitrarily) don't support double precision + switch (op) { + case EOpRadians: + case EOpDegrees: + case EOpSin: + case EOpCos: + case EOpTan: + case EOpAcos: + case EOpAsin: + case EOpAtan: + case EOpAcosh: + case EOpAsinh: + case EOpAtanh: + case EOpTanh: + case EOpCosh: + case EOpSinh: + case EOpPow: + case EOpExp: + case EOpLog: + case EOpExp2: + case EOpLog2: + if (getArg(0)->getType().getBasicType() == EbtDouble) { + return false; + } + break; + default: + break; + } + + if (valid) { + // It's valid, so override the types and return true + assert(firstLongVector); + resultType->deepCopy(firstLongVector->getType()); + if (fn.classes & ClassB) { + resultType->setBasicType(EbtBool); + } + if (fn.classes & ClassRS) { + resultType->deepCopy(TType(firstLongVector->getType().getBasicType())); + } + if (fn.classes & ClassLO) { + getArg(fnCandidate->getParamCount() - 1)->setType(getArg(0)->getType()); + } + return true; + } + } + // If it was in the base table but not supported, fail. The rest of the logic + // is for ops not in the base table. + if (foundInBase) { + return false; + } + + // Check the arg0 type and if this and other checks have passed, then set + // the result type to the bitcasted result + const auto &checkBitCast = [&](TBasicType fromBasicType, TBasicType newBasicType) { + if (getArg(0)->getType().getBasicType() != fromBasicType) { + valid = false; + } + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + resultType->setBasicType(newBasicType); + } + }; + + valid = true; + switch (op) { + case EOpFrexp: + case EOpLdexp: + checkFnTypes(getArg(0), TypeF); + checkFnTypes(getArg(1), TypeI); + checkShape(getArg(0), getArg(1)); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpFloatBitsToInt: + if (fnCandidate->getName() == "bfloat16BitsToIntEXT") { + checkBitCast(EbtBFloat16, EbtInt16); + } else if (fnCandidate->getName() == "floate5m2BitsToIntEXT") { + checkBitCast(EbtFloatE5M2, EbtInt8); + } else if (fnCandidate->getName() == "floate4m3BitsToIntEXT") { + checkBitCast(EbtFloatE4M3, EbtInt8); + } else { + checkBitCast(EbtFloat, EbtInt); + } + return valid; + case EOpFloatBitsToUint: + if (fnCandidate->getName() == "bfloat16BitsToUintEXT") { + checkBitCast(EbtBFloat16, EbtUint16); + } else if (fnCandidate->getName() == "floate5m2BitsToUintEXT") { + checkBitCast(EbtFloatE5M2, EbtUint8); + } else if (fnCandidate->getName() == "floate4m3BitsToUintEXT") { + checkBitCast(EbtFloatE4M3, EbtUint8); + } else { + checkBitCast(EbtFloat, EbtUint); + } + return valid; + case EOpIntBitsToFloat: + if (fnCandidate->getName() == "intBitsToBFloat16EXT") { + checkBitCast(EbtInt16, EbtBFloat16); + } else if (fnCandidate->getName() == "intBitsToFloate5m2EXT") { + checkBitCast(EbtInt8, EbtFloatE5M2); + } else if (fnCandidate->getName() == "intBitsToFloate4m3EXT") { + checkBitCast(EbtInt8, EbtFloatE4M3); + } else { + checkBitCast(EbtInt, EbtFloat); + } + return valid; + case EOpUintBitsToFloat: + if (fnCandidate->getName() == "uintBitsToBFloat16EXT") { + checkBitCast(EbtUint16, EbtBFloat16); + } else if (fnCandidate->getName() == "uintBitsToFloate5m2EXT") { + checkBitCast(EbtUint8, EbtFloatE5M2); + } else if (fnCandidate->getName() == "uintBitsToFloate4m3EXT") { + checkBitCast(EbtUint8, EbtFloatE4M3); + } else { + checkBitCast(EbtUint, EbtFloat); + } + return valid; + case EOpDoubleBitsToInt64: + checkBitCast(EbtDouble, EbtInt64); + return valid; + case EOpDoubleBitsToUint64: + checkBitCast(EbtDouble, EbtUint64); + return valid; + case EOpInt64BitsToDouble: + checkBitCast(EbtInt64, EbtDouble); + return valid; + case EOpUint64BitsToDouble: + checkBitCast(EbtUint64, EbtDouble); + return valid; + case EOpFloat16BitsToInt16: + checkBitCast(EbtFloat16, EbtInt16); + return valid; + case EOpFloat16BitsToUint16: + checkBitCast(EbtFloat16, EbtUint16); + return valid; + case EOpInt16BitsToFloat16: + checkBitCast(EbtInt16, EbtFloat16); + return valid; + case EOpUint16BitsToFloat16: + checkBitCast(EbtUint16, EbtFloat16); + return valid; + + case EOpFma: + checkArgsMatch(0, paramCount, TypeF); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpAddCarry: + case EOpSubBorrow: + checkArgsMatch(0, paramCount, TypeU); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpUMulExtended: + checkArgsMatch(0, paramCount, TypeU); + return valid; + case EOpIMulExtended: + checkArgsMatch(0, paramCount, TypeI); + return valid; + case EOpBitfieldExtract: + case EOpBitFieldReverse: + checkFnTypes(getArg(0), TypeIU); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpBitfieldInsert: + checkArgsMatch(0, 2, TypeIU); + checkSameType(getArg(0), getArg(1)); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpFindLSB: + case EOpFindMSB: + case EOpBitCount: + checkFnTypes(getArg(0), TypeIU); + if (valid) { + TType newType; + newType.deepCopy(getArg(0)->getType()); + newType.setBasicType(unsignedTypeToSigned(newType.getBasicType())); + resultType->deepCopy(newType); + } + return valid; + case EOpDPdx: + case EOpDPdxFine: + case EOpDPdxCoarse: + case EOpDPdy: + case EOpDPdyFine: + case EOpDPdyCoarse: + case EOpFwidth: + case EOpFwidthFine: + case EOpFwidthCoarse: + checkFnTypes(getArg(0), TypeF); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpExpectEXT: + checkArgsMatch(0, paramCount, TypeIU | TypeB); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + + case EOpSubgroupPartition: + resultType->deepCopy(TType(EbtUint, EvqTemporary, 4)); + return valid; + case EOpSubgroupAllEqual: + resultType->deepCopy(TType(EbtBool)); + return valid; + + case EOpSubgroupAnd: + case EOpSubgroupOr: + case EOpSubgroupXor: + case EOpSubgroupInclusiveAnd: + case EOpSubgroupInclusiveOr: + case EOpSubgroupInclusiveXor: + case EOpSubgroupExclusiveAnd: + case EOpSubgroupExclusiveOr: + case EOpSubgroupExclusiveXor: + case EOpSubgroupClusteredAnd: + case EOpSubgroupClusteredOr: + case EOpSubgroupClusteredXor: + case EOpSubgroupPartitionedAnd: + case EOpSubgroupPartitionedOr: + case EOpSubgroupPartitionedXor: + case EOpSubgroupPartitionedInclusiveAnd: + case EOpSubgroupPartitionedInclusiveOr: + case EOpSubgroupPartitionedInclusiveXor: + case EOpSubgroupPartitionedExclusiveAnd: + case EOpSubgroupPartitionedExclusiveOr: + case EOpSubgroupPartitionedExclusiveXor: + checkFnTypes(getArg(0), TypeIU | TypeB); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpSubgroupBroadcast: + case EOpSubgroupBroadcastFirst: + case EOpSubgroupShuffle: + case EOpSubgroupShuffleXor: + case EOpSubgroupShuffleUp: + case EOpSubgroupShuffleDown: + case EOpSubgroupRotate: + case EOpSubgroupClusteredRotate: + case EOpSubgroupQuadBroadcast: + case EOpSubgroupQuadSwapHorizontal: + case EOpSubgroupQuadSwapVertical: + case EOpSubgroupQuadSwapDiagonal: + checkFnTypes(getArg(0), TypeIU | TypeB | TypeF); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + case EOpSubgroupAdd: + case EOpSubgroupMul: + case EOpSubgroupMin: + case EOpSubgroupMax: + case EOpSubgroupInclusiveAdd: + case EOpSubgroupInclusiveMul: + case EOpSubgroupInclusiveMin: + case EOpSubgroupInclusiveMax: + case EOpSubgroupExclusiveAdd: + case EOpSubgroupExclusiveMul: + case EOpSubgroupExclusiveMin: + case EOpSubgroupExclusiveMax: + case EOpSubgroupClusteredAdd: + case EOpSubgroupClusteredMul: + case EOpSubgroupClusteredMin: + case EOpSubgroupClusteredMax: + case EOpSubgroupPartitionedAdd: + case EOpSubgroupPartitionedMul: + case EOpSubgroupPartitionedMin: + case EOpSubgroupPartitionedMax: + case EOpSubgroupPartitionedInclusiveAdd: + case EOpSubgroupPartitionedInclusiveMul: + case EOpSubgroupPartitionedInclusiveMin: + case EOpSubgroupPartitionedInclusiveMax: + case EOpSubgroupPartitionedExclusiveAdd: + case EOpSubgroupPartitionedExclusiveMul: + case EOpSubgroupPartitionedExclusiveMin: + case EOpSubgroupPartitionedExclusiveMax: + checkFnTypes(getArg(0), TypeIU | TypeF); + if (valid) { + resultType->deepCopy(getArg(0)->getType()); + } + return valid; + default: + break; + } + return false; +} + } // end namespace glslang diff --git a/src/libraries/glslang/glslang/MachineIndependent/Initialize.h b/src/libraries/glslang/glslang/MachineIndependent/Initialize.h index 42c32ddbb..849399af3 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Initialize.h +++ b/src/libraries/glslang/glslang/MachineIndependent/Initialize.h @@ -110,6 +110,9 @@ protected: // change this back to false if depending on textual spellings of texturing calls when consuming the AST // Using PureOperatorBuiltins=false is deprecated. constexpr bool PureOperatorBuiltins = true; + +bool IsSupportedLongVectorBuiltin(const TFunction* fnCandidate, TType* resultType, TIntermNode* arguments); + } // end namespace glslang #endif // _INITIALIZE_INCLUDED_ diff --git a/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp b/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp index 553b1b5ff..447e8cb6c 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/IntermTraverse.cpp @@ -306,4 +306,35 @@ void TIntermSwitch::traverse(TIntermTraverser* it) it->visitSwitch(EvPostVisit, this); } +// +// Traverse a variable declaration. +// +void TIntermVariableDecl::traverse(TIntermTraverser *it) +{ + bool visit = true; + + if (it->preVisit) + visit = it->visitVariableDecl(EvPreVisit, this); + + if (visit) { + it->incrementDepth(this); + if (it->rightToLeft) { + if (it->includeDeclSymbol) + declSymbol->traverse(it); + if (initNode) + initNode->traverse(it); + } + else { + if (initNode) + initNode->traverse(it); + if (it->includeDeclSymbol) + declSymbol->traverse(it); + } + it->decrementDepth(); + } + + if (visit && it->postVisit) + it->visitVariableDecl(EvPostVisit, this); +} + } // end namespace glslang diff --git a/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp b/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp index 1f10ee83d..68e57e387 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -118,7 +118,8 @@ TIntermSymbol* TIntermediate::addSymbol(const TType& type, const TSourceLoc& loc TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, const TSourceLoc& loc) { // No operations work on blocks - if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock) + if (left->getType().getBasicType() == EbtBlock || right->getType().getBasicType() == EbtBlock || + left->getType().getBasicType() == EbtString || right->getType().getBasicType() == EbtString) return nullptr; // Convert "reference +/- int" and "reference - reference" to integer math @@ -406,11 +407,15 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, } if (newType != EbtVoid) { - child = addConversion(op, TType(newType, EvqTemporary, child->getVectorSize(), - child->getMatrixCols(), - child->getMatrixRows(), - child->isVector()), - child); + TType newTType(newType, EvqTemporary, child->getVectorSize(), child->getMatrixCols(), child->getMatrixRows(), child->isVector()); + if (child->getType().isLongVector()) { + newTType.shallowCopy(child->getType()); + newTType.setBasicType(newType); + newTType.makeTemporary(); + newTType.getQualifier().clear(); + } + + child = addConversion(op, newTType, child); if (child == nullptr) return nullptr; } @@ -646,6 +651,12 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped } TType newType(convertTo, EvqTemporary, node->getVectorSize(), node->getMatrixCols(), node->getMatrixRows()); + if (node->getType().isLongVector()) { + newType.shallowCopy(node->getType()); + newType.setBasicType(convertTo); + newType.makeTemporary(); + newType.getQualifier().clear(); + } newNode = addUnaryNode(newOp, node, node->getLoc(), newType); if (node->getAsConstantUnion()) { @@ -839,7 +850,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // Reject implicit conversions to cooperative matrix types if (node->getType().isCoopMat() && op != EOpConstructCooperativeMatrixNV && - op != EOpConstructCooperativeMatrixKHR) + op != EOpConstructCooperativeMatrixKHR && + op != glslang::EOpCompositeConstructCoopMatQCOM) return nullptr; if (node->getType().isTensorLayoutNV() || @@ -1857,7 +1869,7 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const if (type.isCoopMatKHR()) return EOpConstructCooperativeMatrixKHR; - if (type.isCoopVecNV()) + if (type.isCoopVecOrLongVector()) return EOpConstructCooperativeVectorNV; switch (type.getBasicType()) { @@ -2381,7 +2393,8 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true trueBlock = std::get<0>(children); falseBlock = std::get<1>(children); - if (trueBlock == nullptr || falseBlock == nullptr) + if (trueBlock == nullptr || falseBlock == nullptr || + trueBlock->getBasicType() == EbtString || falseBlock->getBasicType() == EbtString) return nullptr; // Handle a vector condition as a mix @@ -2649,7 +2662,7 @@ const TIntermTyped* TIntermediate::traverseLValueBase(const TIntermTyped* node, // // Create while and do-while loop nodes. // -TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, +TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermNode* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc) { TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); @@ -2661,7 +2674,7 @@ TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TInte // // Create a for-loop sequence. // -TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermNode* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc, TIntermLoop*& node) { node = new TIntermLoop(body, test, terminal, testFirst); @@ -3453,6 +3466,8 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) return false; } + bool vectorAndLongVectorMatch = TType::vectorAndLongVectorMatch(left->getType(), right->getType()); + // Finish handling the case, for all ops, where both operands are scalars. if (left->isScalar() && right->isScalar()) return true; @@ -3461,6 +3476,10 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize() && right->getVectorSize() > 1) return false; + // Finish handling the case, for all ops, where there are two vectors of different sizes + if (left->getType().isLongVector() && right->getType().isLongVector() && !left->getType().sameLongVectorShape(right->getType())) + return false; + // // We now have a mix of scalars, vectors, or matrices, for non-relational operations. // @@ -3546,7 +3565,8 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) break; case EOpAssign: - if (left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) + if ((left->getVectorSize() != right->getVectorSize() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixRows() != right->getMatrixRows()) && + !vectorAndLongVectorMatch) return false; [[fallthrough]]; @@ -3573,7 +3593,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) return false; if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize()) return false; - if (right->isVector() || right->isMatrix()) { + if ((right->isVector() || right->isMatrix()) && !vectorAndLongVectorMatch) { node.getWritableType().shallowCopy(right->getType()); node.getWritableType().getQualifier().makeTemporary(); } @@ -3903,12 +3923,15 @@ void TIntermediate::performTextureUpgradeAndSamplerRemovalTransformation(TInterm const char* TIntermediate::getResourceName(TResourceType res) { switch (res) { - case EResSampler: return "shift-sampler-binding"; - case EResTexture: return "shift-texture-binding"; - case EResImage: return "shift-image-binding"; - case EResUbo: return "shift-UBO-binding"; - case EResSsbo: return "shift-ssbo-binding"; - case EResUav: return "shift-uav-binding"; + case EResSampler: return "shift-sampler-binding"; + case EResTexture: return "shift-texture-binding"; + case EResImage: return "shift-image-binding"; + case EResUbo: return "shift-ubo-binding"; + case EResSsbo: return "shift-ssbo-binding"; + case EResUav: return "shift-uav-binding"; + case EResCombinedSampler: return "shift-combined-sampler-binding"; + case EResAs: return "shift-as-binding"; + case EResTensor: return nullptr; default: assert(0); // internal error: should only be called with valid resource types. return nullptr; diff --git a/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h b/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h index 0e9d748ca..76ccfec12 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h +++ b/src/libraries/glslang/glslang/MachineIndependent/LiveTraverser.h @@ -59,8 +59,8 @@ namespace glslang { class TLiveTraverser : public TIntermTraverser { public: TLiveTraverser(const TIntermediate& i, bool traverseAll = false, - bool preVisit = true, bool inVisit = false, bool postVisit = false) : - TIntermTraverser(preVisit, inVisit, postVisit), + bool preVisit = true, bool inVisit = false, bool postVisit = false, bool includeDeclSymbol = false) : + TIntermTraverser(preVisit, inVisit, postVisit, false, includeDeclSymbol), intermediate(i), traverseAll(traverseAll) { } diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp index 986b94194..45ada17db 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp @@ -171,6 +171,9 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op, case EbtHitObjectNV: message = "can't modify hitObjectNV"; break; + case EbtHitObjectEXT: + message = "can't modify hitObjectEXT"; + break; default: break; } @@ -279,7 +282,7 @@ void TParseContextBase::trackLinkage(TSymbol& symbol) // Ensure index is in bounds, correct if necessary. // Give an error if not. -void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int& index) +void TParseContextBase::checkIndex(const TSourceLoc& loc, const TType& type, int64_t& index) { const auto sizeIsSpecializationExpression = [&type]() { return type.containsSpecializationSize() && @@ -424,7 +427,7 @@ const TFunction* TParseContextBase::selectFunction( // to even be a potential match, number of arguments must be >= the number of // fixed (non-default) parameters, and <= the total (including parameter with defaults). if (call.getParamCount() < candidate.getFixedParamCount() || - call.getParamCount() > candidate.getParamCount()) + (call.getParamCount() > candidate.getParamCount() && !candidate.isVariadic())) continue; // see if arguments are convertible @@ -463,7 +466,8 @@ const TFunction* TParseContextBase::selectFunction( const auto betterParam = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool { // is call -> can2 better than call -> can1 for any parameter bool hasBetterParam = false; - for (int param = 0; param < call.getParamCount(); ++param) { + const int paramCount = std::min({call.getParamCount(), can1.getParamCount(), can2.getParamCount()}); + for (int param = 0; param < paramCount; ++param) { if (better(*call[param].type, *can1[param].type, *can2[param].type)) { hasBetterParam = true; break; @@ -474,7 +478,8 @@ const TFunction* TParseContextBase::selectFunction( const auto equivalentParams = [&call, &better](const TFunction& can1, const TFunction& can2) -> bool { // is call -> can2 equivalent to call -> can1 for all the call parameters? - for (int param = 0; param < call.getParamCount(); ++param) { + const int paramCount = std::min({call.getParamCount(), can1.getParamCount(), can2.getParamCount()}); + for (int param = 0; param < paramCount; ++param) { if (better(*call[param].type, *can1[param].type, *can2[param].type) || better(*call[param].type, *can2[param].type, *can1[param].type)) return false; @@ -482,6 +487,16 @@ const TFunction* TParseContextBase::selectFunction( return true; }; + const auto enabled = [this](const TFunction& candidate) -> bool { + bool enabled = candidate.getNumExtensions() == 0; + for (int i = 0; i < candidate.getNumExtensions(); ++i) { + TExtensionBehavior behavior = getExtensionBehavior(candidate.getExtensions()[i]); + if (behavior == EBhEnable || behavior == EBhRequire) + enabled = true; + } + return enabled; + }; + const TFunction* incumbent = viableCandidates.front(); for (auto it = viableCandidates.begin() + 1; it != viableCandidates.end(); ++it) { const TFunction& candidate = *(*it); @@ -497,7 +512,7 @@ const TFunction* TParseContextBase::selectFunction( // In the case of default parameters, it may have an identical initial set, which is // also ambiguous - if (betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate)) + if ((betterParam(*incumbent, candidate) || equivalentParams(*incumbent, candidate)) && enabled(candidate)) tie = true; } diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp index d53bab659..76c8a1ca9 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -43,6 +43,7 @@ #include "Scan.h" #include +#include #include "Versions.h" #include "preprocessor/PpContext.h" @@ -60,7 +61,8 @@ TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, b inMain(false), blockName(nullptr), limits(resources.limits), - atomicUintOffsets(nullptr), anyIndexLimits(false) + atomicUintOffsets(nullptr), anyIndexLimits(false), + khrDerivativeLayoutQualifierSpecified(false) { // decide whether precision qualifiers should be ignored or respected if (isEsProfile() || spvVersion.vulkan > 0) { @@ -404,6 +406,14 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& if (tokens.size() != 1) error(loc, "extra tokens", "#pragma", ""); intermediate.setReplicatedComposites(); + } else if (spvVersion.spv > 0 && tokens[0].compare("promote_uint32_indices") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setPromoteUint32Indices(); + } else if (spvVersion.spv > 0 && tokens[0].compare("shader_64bit_indexing") == 0) { + if (tokens.size() != 1) + error(loc, "extra tokens", "#pragma", ""); + intermediate.setShader64BitIndexing(); } else if (tokens[0].compare("once") == 0) { warn(loc, "not implemented", "#pragma once", ""); } else if (tokens[0].compare("glslang_binary_double_output") == 0) { @@ -542,15 +552,21 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb // TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) { - int indexValue = 0; - if (index->getQualifier().isFrontEndConstant()) - indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); - + int64_t indexValue = 0; + if (index->getQualifier().isFrontEndConstant()) { + if (index->getType().contains64BitInt()) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getI64Const(); + } else if (index->getType().getBasicType() == EbtUint) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getUConst(); + } else { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); + } + } // basic type checks... variableCheck(base); if (! base->isArray() && ! base->isMatrix() && ! base->isVector() && ! base->getType().isCoopMat() && - ! base->isReference() && ! base->getType().isCoopVecNV()) { + ! base->isReference() && ! base->getType().isCoopVecOrLongVector()) { if (base->getAsSymbolNode()) error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), ""); else @@ -624,7 +640,8 @@ TIntermTyped* TParseContext::handleBracketDereference(const TSourceLoc& loc, TIn TType& leftType = binaryNode->getLeft()->getWritableType(); TArraySizes& arraySizes = *leftType.getArraySizes(); assert(arraySizes.getNumDims() == 2); - arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), indexValue + 1)); + assert(indexValue < std::numeric_limits::max()); + arraySizes.setDimSize(1, std::max(arraySizes.getDimSize(1), (int)indexValue + 1)); } } } else @@ -912,7 +929,8 @@ TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char* if (((left->getType().contains16BitFloat() || right->getType().contains16BitFloat()) && !float16Arithmetic()) || ((left->getType().contains16BitInt() || right->getType().contains16BitInt()) && !int16Arithmetic()) || ((left->getType().contains8BitInt() || right->getType().contains8BitInt()) && !int8Arithmetic()) || - (left->getType().containsBFloat16() || right->getType().containsBFloat16())) { + (left->getType().containsBFloat16() || right->getType().containsBFloat16()) || + (left->getType().contains8BitFloat() || right->getType().contains8BitFloat())) { allowed = false; } @@ -940,7 +958,8 @@ TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char* if ((childNode->getType().contains16BitFloat() && !float16Arithmetic()) || (childNode->getType().contains16BitInt() && !int16Arithmetic()) || (childNode->getType().contains8BitInt() && !int8Arithmetic()) || - (childNode->getType().containsBFloat16())) { + (childNode->getType().containsBFloat16()) || + (childNode->getType().contains8BitFloat())) { allowed = false; } @@ -970,21 +989,26 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm // Save away the name in the AST for now. Processing is completed in // handleLengthMethod(). // - if (field == "length") { + if (field == "length" || field == "length64") { if (base->isArray()) { - profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, ".length"); - profileRequires(loc, EEsProfile, 300, nullptr, ".length"); + profileRequires(loc, ENoProfile, 120, E_GL_3DL_array_objects, (TString(".") + field).c_str()); + profileRequires(loc, EEsProfile, 300, nullptr, (TString(".") + field).c_str()); } else if (base->isVector() || base->isMatrix()) { const char* feature = ".length() on vectors and matrices"; requireProfile(loc, ~EEsProfile, feature); profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, feature); - } else if (!base->getType().isCoopMat() && !base->getType().isCoopVecNV()) { + } else if (!base->getType().isCoopMat() && !base->getType().isCoopVecOrLongVector()) { bool enhanced = intermediate.getEnhancedMsgs(); error(loc, "does not operate on this type:", field.c_str(), base->getType().getCompleteString(enhanced).c_str()); return base; } - return intermediate.addMethod(base, TType(EbtInt), &field, loc); + if (field == "length") { + return intermediate.addMethod(base, TType(EbtInt), &field, loc); + } else { + requireExtensions(loc, 1, &E_GL_EXT_shader_64bit_indexing, "length64"); + return intermediate.addMethod(base, TType(EbtInt64), &field, loc); + } } // It's not .length() if we get to here. @@ -1103,9 +1127,10 @@ TIntermTyped* TParseContext::handleDotSwizzle(const TSourceLoc& loc, TIntermType } } - if (base->getType().getQualifier().isFrontEndConstant()) + if (base->getType().getQualifier().isFrontEndConstant()) { + rValueErrorCheck(loc, ".", base); result = intermediate.foldSwizzle(base, selectors, loc); - else { + } else { if (selectors.size() == 1) { TIntermTyped* index = intermediate.addConstantUnion(selectors[0], loc); result = intermediate.addIndex(EOpIndexDirect, base, index, loc); @@ -1123,6 +1148,22 @@ TIntermTyped* TParseContext::handleDotSwizzle(const TSourceLoc& loc, TIntermType return result; } +TIntermTyped* TParseContext::handleTypeCast(const TSourceLoc& loc, TType *castType, TIntermTyped *base) +{ + TIntermTyped *result = base; + requireExtensions(loc, 1, &E_GL_NV_explicit_typecast, "explicit typecast"); + if (castType->isScalar() || castType->isVector() || castType->isMatrix() || castType->isReference()) { + if (base->getAsAggregate() && !base->getAsAggregate()->getSequence().empty() ) { + warn(loc, "typecast is unary operator and takes only a single expression","",""); + } + result = addConstructor(loc, base, *castType); + } + else + error(loc, "type cast has to be either scalar, vector, matrix or buffer reference", "", ""); + + + return result; +} void TParseContext::blockMemberExtensionCheck(const TSourceLoc& loc, const TIntermTyped* base, int member, const TString& memberName) { // a block that needs extension checking is either 'base', or if arrayed, @@ -1398,6 +1439,7 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction if ((*fnCandidate)[0].type->getSampler().isMultiSample() && version <= 140) requireExtensions(loc, 1, &E_GL_ARB_texture_multisample, fnCandidate->getName().c_str()); } + bool hasLongVectorArg = false; if (arguments != nullptr) { // Make sure qualifications work for these arguments. TIntermAggregate* aggregate = arguments->getAsAggregate(); @@ -1405,6 +1447,24 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction // At this early point there is a slight ambiguity between whether an aggregate 'arguments' // is the single argument itself or its children are the arguments. Only one argument // means take 'arguments' itself as the one argument. + if ((*fnCandidate)[i].defaultValue) { + if (!aggregate) { + // Only one argument was passed (rest are default arguments) so arguments isn't a TIntermAggregate. + // But the function takes at least one more argument, so a TIntermAggregate is needed. + aggregate = new TIntermAggregate; + aggregate->getSequence().push_back(arguments); + arguments = aggregate; + } + if (i >= static_cast(aggregate->getSequence().size())) { + // Append the default value if there are no more arguments left in the aggregate. + TIntermConstantUnion *defaultValue = nullptr; + if (const auto *constUnion = (*fnCandidate)[i].defaultValue->getAsConstantUnion()) { + defaultValue = new TIntermConstantUnion(constUnion->getConstArray(), constUnion->getType()); + } + assert(defaultValue && "unsupported default value construct"); + aggregate->getSequence().push_back(defaultValue); + } + } TIntermNode* arg = fnCandidate->getParamCount() == 1 ? arguments : (aggregate ? aggregate->getSequence()[i] : arguments); TQualifier& formalQualifier = (*fnCandidate)[i].type->getQualifier(); if (formalQualifier.isParamOutput()) { @@ -1464,6 +1524,21 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction i == 1 && arg->getAsTyped()->getType().getBasicType() != aggregate->getSequence()[0]->getAsTyped()->getType().getBasicType()) error(arguments->getLoc(), "cooperative vector basic types must match", fnCandidate->getName().c_str(), ""); + // Check that coopVecLoadNV and coopVecStoreNV buffer parameter is in buffer or shared storage + if (builtIn && (fnCandidate->getBuiltInOp() == EOpCooperativeVectorLoadNV || + fnCandidate->getBuiltInOp() == EOpCooperativeVectorStoreNV) && + i == 1) { + TStorageQualifier storage = arg->getAsTyped()->getType().getQualifier().storage; + if (storage != EvqBuffer && storage != EvqShared) { + error(arguments->getLoc(), "buffer argument must be in buffer or shared storage", + fnCandidate->getName().c_str(), ""); + } + } + + if (argType.isLongVector()) { + hasLongVectorArg = true; + } + // TODO 4.5 functionality: A shader will fail to compile // if the value passed to the memargument of an atomic memory function does not correspond to a buffer or // shared variable. It is acceptable to pass an element of an array or a single component of a vector to the @@ -1506,6 +1581,12 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction userFunctionCallCheck(loc, *call); } + if (hasLongVectorArg && fnCandidate->getBuiltInOp() != EOpNull) { + TType longVectorResultType(EbtVoid); + handleLongVectorBuiltin(loc, fnCandidate, &longVectorResultType, arguments); + result->setType(longVectorResultType); + } + // Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore. // Built-ins with a single argument aren't called with an aggregate, but they also don't have an output. // Also, build the qualifier list for user function calls, which are always called with an aggregate. @@ -1520,7 +1601,9 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction handleCoopMat2FunctionCall(loc, fnCandidate, result, arguments); - if (result->getAsTyped()->getType().isCoopVecNV() && + handleVector2CoopMatConversionCall(loc, fnCandidate, result, arguments); + + if (result->getAsTyped()->getType().isCoopVecOrLongVector() && !result->getAsTyped()->getType().isParameterized()) { if (auto unaryNode = result->getAsUnaryNode()) result->setType(unaryNode->getOperand()->getAsTyped()->getType()); @@ -1755,12 +1838,383 @@ void TParseContext::handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFun // Set result type to match type of first parameter result->setType(result->getAsAggregate()->getSequence()[0]->getAsTyped()->getType()); } else { - // For MulAdd, set result type to match type of C parameter + // The only remaining operation is MulAdd + assert(fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAdd || + fnCandidate->getBuiltInOp() == EOpCooperativeMatrixMulAddNV); + + // Validate that the matrix sizes are compatible for multiplication and addition + const auto &sequence = arguments->getAsAggregate()->getSequence(); + + using ArrayDim = const TArraySize&; + auto getDim = [](const TIntermSequence& seq, int idx) -> std::tuple { + const auto &type = seq[idx]->getAsTyped()->getType(); + const auto *size = type.getTypeParameters()->arraySizes; + + if (type.isCoopMatNV()) { + // coopmatNV don't encode usage, so provide the correct usage by default + return {size->getArraySize(2), size->getArraySize(3), idx}; + } else { + assert(type.isCoopMatKHR()); + return {size->getArraySize(1), size->getArraySize(2), size->getDimSize(3)}; + } + }; + + // sizes look like: [scope, rows, cols, use] + auto [aRows, aCols, aUse] = getDim(sequence, 0); + auto [bRows, bCols, bUse] = getDim(sequence, 1); + auto [cRows, cCols, cUse] = getDim(sequence, 2); + + auto toString = [](ArrayDim dim) -> std::string { + std::stringstream buf; + if (dim.node == nullptr) { + buf << dim.size; + } else { + buf << "spec_const"; + } + return buf.str(); + }; + + if (aCols != bRows) { + auto aRowsStr = toString(aRows); + auto aColsStr = toString(aCols); + auto bRowsStr = toString(bRows); + auto bColsStr = toString(bCols); + error(loc, "cannot multiply coop matrices with incompatible sizes", + sequence[0]->getAsSymbolNode()->getMangledName().c_str(), + "%s x %s with %s x %s", + aRowsStr.c_str(), + aColsStr.c_str(), + bRowsStr.c_str(), + bColsStr.c_str()); + } else if (aRows != cRows || bCols != cCols) { + auto aRowsStr = toString(aRows); + auto bColsStr = toString(bCols); + auto cRowsStr = toString(cRows); + auto cColsStr = toString(cCols); + error(loc, "cannot add coop matrices with incompatible sizes", + sequence[2]->getAsSymbolNode()->getMangledName().c_str(), + "%s x %s with %s x %s", + aRowsStr.c_str(), + bColsStr.c_str(), + cRowsStr.c_str(), + cColsStr.c_str()); + } else if (aUse != 0) { + error(loc, "coop matrix A in MulAdd operation has incompatible usage property,", + sequence[0]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 0", aUse); + } else if (bUse != 1) { + error(loc, "coop matrix B in MulAdd operation has incompatible usage property,", + sequence[1]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 1", bUse); + } else if (cUse != 2) { + error(loc, "coop matrix C in MulAdd operation has incompatible usage property,", + sequence[2]->getAsSymbolNode()->getMangledName().c_str(), + "found %d, but needed 2", cUse); + } + + // Set result type to match type of C parameter result->setType(result->getAsAggregate()->getSequence()[2]->getAsTyped()->getType()); } } } + +static const uint32_t spv_Scope_Subgroup = 3; + +void TParseContext::handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate, + TIntermTyped*& result, TIntermNode* arguments) +{ + const uint32_t CM_MatrixUseA = 0; // == gl_MatrixUseA + const uint32_t CM_MatrixUseB = 1; // == gl_MatrixUseB + const uint32_t CM_MatrixUseAccumulator = 2; // == gl_MatrixUseAccumulator + + TOperator builtinOp = fnCandidate->getBuiltInOp(); + + if (!(builtinOp == EOpBitCastArrayQCOM || builtinOp == EOpExtractSubArrayQCOM || + builtinOp == EOpCompositeConstructCoopMatQCOM || builtinOp == EOpCompositeExtractCoopMatQCOM)) + return; + + TPublicType pubType{}; + auto* oldResult = result; + + if (builtinOp == EOpBitCastArrayQCOM) { + auto srcArr = arguments->getAsAggregate()->getSequence()[0]->getAsTyped(); + auto& srcTy = srcArr->getType(); + auto srcArrLen = srcTy.getArraySizes()->getDimSize(0); + auto srcLenAsNode = srcTy.getArraySizes()->getDimNode(0); + + auto dstArr = arguments->getAsAggregate()->getSequence()[1]->getAsTyped(); + auto& dstTy = dstArr->getType(); + auto dstArrLen = dstTy.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstTy.getArraySizes()->getDimNode(0); + + if (srcLenAsNode == nullptr && dstLenAsNode == nullptr) { + //do basic tests: + if ((srcArrLen * GetNumBits(srcTy.getBasicType())) != (dstArrLen * GetNumBits(dstTy.getBasicType()))) + error(loc, "source and target arrays have different bit sizes", "", ""); + } + + pubType.basicType = dstTy.getBasicType(); + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + pubType.arraySizes = new TArraySizes; + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + pubType.typeParameters = nullptr; + } + + if (builtinOp == EOpExtractSubArrayQCOM) { + auto dstArr = arguments->getAsAggregate()->getSequence()[2]->getAsTyped(); + auto& dstTy = dstArr->getType(); + auto dstArrLen = dstTy.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstTy.getArraySizes()->getDimNode(0); + + if (dstLenAsNode == nullptr) { + if ((dstArrLen * GetNumBits(dstTy.getBasicType())) == 32) + error(loc, "the byte size of the target array must be 32", "", ""); + } + + pubType.basicType = dstTy.getBasicType(); + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + pubType.arraySizes = new TArraySizes; + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + pubType.typeParameters = nullptr; + } + + if (builtinOp == EOpCompositeConstructCoopMatQCOM) { + + auto& srcType = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + auto& dstType = arguments->getAsAggregate()->getSequence()[1]->getAsTyped()->getType(); + + glslang::TBasicType srcBasicType = srcType.getBasicType(); + glslang::TBasicType dstBasicType = dstType.getBasicType(); + + if (srcBasicType != EbtUint && srcBasicType != dstBasicType) + error(loc, "source and destination element types are not compatible", "", ""); + + uint32_t scope = spv_Scope_Subgroup; + uint32_t coopMatKHRuse = !0u; + uint32_t coopMatNumRows = !0u, coopMatNumCols = !0u; + TIntermTyped *nodeNumRows = nullptr, *nodeNumCols = nullptr; + const TTypeParameters* dstTypeParameters = dstType.getTypeParameters(); + if (dstTypeParameters->arraySizes == nullptr || dstTypeParameters->arraySizes->getNumDims() != 4) { + error(loc, "destination cooperative matrix has an unsupported type", "", ""); + } else { + auto arraySizes = dstTypeParameters->arraySizes; + scope = arraySizes->getDimSize(0); + coopMatNumRows = arraySizes->getDimSize(1); + nodeNumRows = arraySizes->getDimNode(1); + coopMatNumCols = arraySizes->getDimSize(2); + nodeNumCols = arraySizes->getDimNode(2); + coopMatKHRuse = arraySizes->getDimSize(3); + } + + if (scope != spv_Scope_Subgroup) { + scope = spv_Scope_Subgroup; + error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", ""); + } + + if (coopMatKHRuse > CM_MatrixUseAccumulator) { + coopMatKHRuse = CM_MatrixUseA; + error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator", + "", ""); + } + + uint32_t dstBasicTypeSize = GetNumBits(dstBasicType) / 8; + + unsigned numRows = coopMatNumRows; + TIntermTyped* specConstRows = nodeNumRows; + unsigned numCols = coopMatNumCols; + TIntermTyped* specConstCols = nodeNumCols; + + // input array type + const TType& type = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + uint32_t arrayLen = type.getArraySizes()->getDimSize(0); + auto arrayDimNode = type.getArraySizes()->getDimNode(0); + + if (coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseAccumulator) { + // update numCols + if (arrayDimNode == nullptr && specConstCols == nullptr) + numCols = arrayLen * (sizeof(uint32_t) / dstBasicTypeSize); + } else if (coopMatKHRuse == CM_MatrixUseB) { + // update numRows + if (arrayDimNode == nullptr && specConstRows == nullptr) { + numRows = arrayLen * (sizeof(uint32_t) / dstBasicTypeSize); + } + } + + // construct the type + TArraySizes* arraySizes = new TArraySizes; + + // add Scope + arraySizes->addInnerSize(scope); + + // add the row size + arraySizes->addInnerSize(numRows, specConstRows); // copy from source + // add the column size + arraySizes->addInnerSize(numCols, specConstCols); // copy from source + // add cooperative matrix use + arraySizes->addInnerSize(coopMatKHRuse); + + pubType.basicType = dstBasicType; + pubType.vectorSize = 1u; + pubType.qualifier = srcType.getQualifier(); + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = dstType.isCoopMatNV(); + pubType.coopmatKHR = dstType.isCoopMatKHR(); + pubType.arraySizes = nullptr; + pubType.typeParameters = const_cast(dstTypeParameters); + } + + if (builtinOp == EOpCompositeExtractCoopMatQCOM) { + auto& srcType = arguments->getAsAggregate()->getSequence()[0]->getAsTyped()->getType(); + auto& dstType = arguments->getAsAggregate()->getSequence()[1]->getAsTyped()->getType(); + + glslang::TBasicType srcBasicType = srcType.getBasicType(); + glslang::TBasicType dstBasicType = dstType.getBasicType(); + + if (dstBasicType != EbtUint && srcBasicType != dstBasicType) + error(loc, "source and destination element types are not compatible", "", ""); + + uint32_t scope = spv_Scope_Subgroup; + unsigned coopMatKHRuse = !0u; + const TTypeParameters* srcTypeParameters = srcType.getTypeParameters(); + if (srcTypeParameters->arraySizes == nullptr || srcTypeParameters->arraySizes->getNumDims() != 4) { + error(loc, "source cooperative matrix has an unsupported type", "", ""); + } else { + auto arraySizes = srcTypeParameters->arraySizes; + scope = arraySizes->getDimSize(0); + coopMatKHRuse = arraySizes->getDimSize(3); + } + + if (scope != spv_Scope_Subgroup) { + scope = spv_Scope_Subgroup; + error(loc, "cooperative matrix has unsupported scope; gl_SubgroupScope is expected", "", ""); + } + + if (coopMatKHRuse > CM_MatrixUseAccumulator) { + coopMatKHRuse = CM_MatrixUseA; + error(loc, "cooperative matrix use must be one of gl_MatrixUseA, gl_MatrixUseB, gl_MatrixUseAccumulator", + "", ""); + } + + auto dstArrLen = dstType.getArraySizes()->getDimSize(0); + auto dstLenAsNode = dstType.getArraySizes()->getDimNode(0); + + if (dstLenAsNode == nullptr) { + bool ok = true; + switch (dstBasicType) { + case EbtUint: + case EbtInt: + case EbtFloat: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 8) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + case EbtFloat16: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 16) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + case EbtInt8: + case EbtUint8: + ok = (((coopMatKHRuse == CM_MatrixUseA || coopMatKHRuse == CM_MatrixUseB) && dstArrLen == 32) || + (coopMatKHRuse == + CM_MatrixUseAccumulator) /* && (dstArrLen == 64 || dstArrLen == 32 || dstArrLen == 16))*/); + break; + default: + error(loc, "unsupported element type", "", ""); + } + if (!ok) + error(loc, "unsupported destination array length", "", ""); + } + + pubType.basicType = dstBasicType; + pubType.vectorSize = 1u; + pubType.qualifier.precision = EpqNone; + pubType.coopmatNV = false; + pubType.coopmatKHR = false; + + pubType.arraySizes = new TArraySizes; + + { + //int coopMatKHRuse = srcTypeParameters->arraySizes->getDimSize(3); + uint32_t index = !0u; + if (coopMatKHRuse == CM_MatrixUseA) { + index = 2; + } else if (coopMatKHRuse == CM_MatrixUseB) { + index = 1; + } else if (coopMatKHRuse == CM_MatrixUseAccumulator) { + index = 2; + } else { + error(loc, "source cooperative matrix has an unexpected cooperative matrix use", "", ""); + } + int32_t numRowsOrCols = srcTypeParameters->arraySizes->getDimSize(index); + auto dimNode = srcTypeParameters->arraySizes->getDimNode(index); + if (dimNode != nullptr && dstLenAsNode == nullptr) { + numRowsOrCols = dstType.getArraySizes()->getDimSize(0); + dimNode = nullptr; + } + //int32_t dstArrLen = dstType.getArraySizes()->getDimSize(0); + pubType.arraySizes->addInnerSize(dstArrLen, dstLenAsNode); + if (dimNode == nullptr && dstLenAsNode == nullptr) { + const char* msg = nullptr; + if (coopMatKHRuse == CM_MatrixUseA && (numRowsOrCols != dstArrLen && dstArrLen != 8)) { + msg = "the source matrix's column is not compatible with the destination array"; + } else if (coopMatKHRuse == CM_MatrixUseB && (numRowsOrCols != dstArrLen && dstArrLen != 8)) { + msg = "the source matrix's row is not compatible with the destination array"; + } else if (coopMatKHRuse == CM_MatrixUseAccumulator && + (numRowsOrCols != dstArrLen && + (srcBasicType == EbtFloat16 && numRowsOrCols != 2 * dstArrLen))) { + msg = "the source matrix's column is not compatible with the destination array"; + } + if (msg != nullptr) + error(loc, msg, "", ""); + } + } + + pubType.typeParameters = nullptr; + } + + TType resultType(pubType); + if (pubType.typeParameters != nullptr) + resultType.copyTypeParameters(*pubType.typeParameters); + // need to make StorageQualifier temp + resultType.makeTemporary(); + result->setType(resultType); + + // the RHS of an assignment to be formed + auto rhs = result; + + // the LHS of an assignment to be formed; pick the last argument + int lhsIdx = (builtinOp == EOpExtractSubArrayQCOM ? 2 : 1); + auto lhs = arguments->getAsAggregate()->getSequence()[lhsIdx]->getAsTyped(); + // pop the last argument from the arguments sequence + arguments->getAsAggregate()->getSequence().pop_back(); + + // Create OpAssign + { + arrayObjectCheck(loc, lhs->getType(), "array assignment"); + storage16BitAssignmentCheck(loc, lhs->getType(), "="); + lValueErrorCheck(loc, "assign", lhs); + rValueErrorCheck(loc, "assign", rhs); + result = addAssign(loc, EOpAssign, lhs, rhs); + if (result == nullptr) + result = oldResult; + } +} + +void TParseContext::handleLongVectorBuiltin(const TSourceLoc& loc, const TFunction* fnCandidate, TType* resultType, TIntermNode* arguments) +{ + if (!IsSupportedLongVectorBuiltin(fnCandidate, resultType, arguments)) { + error(loc, "can't resolve types (ambiguous long vector overload)", fnCandidate->getName().c_str(), ""); + } +} + TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNode* arguments, const TFunction& function) { @@ -1768,6 +2222,26 @@ TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNo TIntermTyped *result = intermediate.addBuiltInFunctionCall(loc, function.getBuiltInOp(), function.getParamCount() == 1, arguments, function.getType()); + + // EXT_descriptor_heap + // All the image atomic ops' first param is image variable. + if (extensionTurnedOn(E_GL_EXT_descriptor_heap) && function.getBuiltInOp() <= EOpImageAtomicStore && + function.getBuiltInOp() >= EOpImageAtomicAdd) { + TIntermNode* imageNode = nullptr; + if (arguments->getAsAggregate() && arguments->getAsAggregate()->getSequence().size() > 0) + imageNode = arguments->getAsAggregate()->getSequence()[0]; + else if (arguments->getAsUnaryNode()) + imageNode = arguments->getAsUnaryNode(); + + if (imageNode && imageNode->getAsBinaryNode()) { + auto imageSymbol = imageNode->getAsBinaryNode()->getLeft(); + if (imageSymbol && imageSymbol->getType().isImage()) { + imageSymbol->getQualifier().setUsedByAtomic(); + result->getQualifier().setUsedByAtomic(); + } + } + } + if (result != nullptr && obeyPrecisionQualifiers()) computeBuiltinPrecisions(*result, function); @@ -1876,6 +2350,7 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction numArgs = 1; break; case EOpDebugPrintf: + case EOpAbortEXT: case EOpCooperativeMatrixPerElementOpNV: case EOpCooperativeMatrixReduceNV: case EOpConstructSaturated: @@ -1887,6 +2362,8 @@ void TParseContext::computeBuiltinPrecisions(TIntermTyped& node, const TFunction // find the maximum precision from the arguments and parameters for (unsigned int arg = 0; arg < numArgs; ++arg) { operationPrecision = std::max(operationPrecision, sequence[arg]->getAsTyped()->getQualifier().precision); + } + for (int arg = 0; arg < function.getParamCount(); ++arg) { operationPrecision = std::max(operationPrecision, function[arg].type->getQualifier().precision); } // compute the result precision @@ -2039,7 +2516,7 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier"); else if (isRuntimeLength(*intermNode->getAsTyped())) { // Create a unary op and let the back end handle it - return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, function->getType()); } else error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method"); } @@ -2054,7 +2531,7 @@ TIntermTyped* TParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction length = type.getMatrixCols(); else if (type.isVector()) length = type.getVectorSize(); - else if (type.isCoopMat() || type.isCoopVecNV()) + else if (type.isCoopMat() || type.isCoopVecOrLongVector()) return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); else { // we should not get here, because earlier semantic checking should have prevented this path @@ -2083,7 +2560,10 @@ void TParseContext::addInputArgumentConversions(const TFunction& function, TInte TIntermTyped* arg = function.getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped()); if (*function[i].type != arg->getType()) { if (function[i].type->getQualifier().isParamInput() && - !function[i].type->isCoopMat()) { + !function[i].type->isCoopMat() && !function[i].type->isTensorARM() && + // tensor layout/view type declarations don't do conversions, so we can't convert these parameters either + (function.getName() != "createTensorLayoutNV") && + (function.getName() != "createTensorViewNV")) { // In-qualified arguments just need an extra node added above the argument to // convert to the correct type. arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg); @@ -2210,6 +2690,9 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& const int gl_StorageSemanticsImage = 0x800; const int gl_StorageSemanticsOutput = 0x1000; + const int nonRelaxedMemoryOrder = gl_SemanticsAcquire | + gl_SemanticsRelease | + gl_SemanticsAcquireRelease; unsigned int semantics = 0, storageClassSemantics = 0; unsigned int semantics2 = 0, storageClassSemantics2 = 0; @@ -2276,22 +2759,6 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& break; } - if ((semantics & gl_SemanticsAcquire) && - (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore)) { - error(loc, "gl_SemanticsAcquire must not be used with (image) atomic store", - fnCandidate.getName().c_str(), ""); - } - if ((semantics & gl_SemanticsRelease) && - (callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) { - error(loc, "gl_SemanticsRelease must not be used with (image) atomic load", - fnCandidate.getName().c_str(), ""); - } - if ((semantics & gl_SemanticsAcquireRelease) && - (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore || - callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) { - error(loc, "gl_SemanticsAcquireRelease must not be used with (image) atomic load/store", - fnCandidate.getName().c_str(), ""); - } if (((semantics | semantics2) & ~(gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease | @@ -2300,6 +2767,7 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& gl_SemanticsVolatile))) { error(loc, "Invalid semantics value", fnCandidate.getName().c_str(), ""); } + if (((storageClassSemantics | storageClassSemantics2) & ~(gl_StorageSemanticsBuffer | gl_StorageSemanticsShared | gl_StorageSemanticsImage | @@ -2307,57 +2775,101 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& error(loc, "Invalid storage class semantics value", fnCandidate.getName().c_str(), ""); } - if (callNode.getOp() == EOpMemoryBarrier) { - if (!IsPow2(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { - error(loc, "Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or " - "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); - } - } else { - if (semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { - if (!IsPow2(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { - error(loc, "Semantics must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " - "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); - } - } - if (semantics2 & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { - if (!IsPow2(semantics2 & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { - error(loc, "semUnequal must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " - "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); - } - } - } - if (callNode.getOp() == EOpMemoryBarrier) { - if (storageClassSemantics == 0) { - error(loc, "Storage class semantics must not be zero", fnCandidate.getName().c_str(), ""); - } - } - if (callNode.getOp() == EOpBarrier && semantics != 0 && storageClassSemantics == 0) { - error(loc, "Storage class semantics must not be zero", fnCandidate.getName().c_str(), ""); - } - if ((callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) && - (semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { - error(loc, "semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease", + if (((semantics & nonRelaxedMemoryOrder) && !IsPow2(semantics & nonRelaxedMemoryOrder)) || + ((semantics2 & nonRelaxedMemoryOrder) && !IsPow2(semantics2 & nonRelaxedMemoryOrder))) { + error(loc, + "Semantics must not include multiple of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); } - if ((semantics & gl_SemanticsMakeAvailable) && - !(semantics & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + + if (((semantics & nonRelaxedMemoryOrder) && !storageClassSemantics) || + ((semantics2 & nonRelaxedMemoryOrder) && !storageClassSemantics2)) { + error(loc, + "Storage class semantics must not be zero when used with gl_SemanticsRelease, " + "gl_SemanticsAcquire, or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + + if ((storageClassSemantics && !(semantics & nonRelaxedMemoryOrder)) || + (storageClassSemantics2 && !(semantics2 & nonRelaxedMemoryOrder))) { + error(loc, + "Semantics must be gl_SemanticsRelease, gl_SemanticsAcquire, or gl_SemanticsAcquireRelease when used " + "with non-zero storage class semantics", + fnCandidate.getName().c_str(), ""); + } + + if (((semantics & gl_SemanticsMakeAvailable) && + !(semantics & (gl_SemanticsRelease | gl_SemanticsAcquireRelease))) || + ((semantics2 & gl_SemanticsMakeAvailable) && + !(semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease)))) { error(loc, "gl_SemanticsMakeAvailable requires gl_SemanticsRelease or gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); } - if ((semantics & gl_SemanticsMakeVisible) && - !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) { + + if (((semantics & gl_SemanticsMakeVisible) && !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) || + ((semantics2 & gl_SemanticsMakeVisible) && + !(semantics2 & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease)))) { error(loc, "gl_SemanticsMakeVisible requires gl_SemanticsAcquire or gl_SemanticsAcquireRelease", fnCandidate.getName().c_str(), ""); } - if ((semantics & gl_SemanticsVolatile) && - (callNode.getOp() == EOpMemoryBarrier || callNode.getOp() == EOpBarrier)) { + + if ((callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore) && + (semantics & gl_SemanticsAcquire)) { + error(loc, "gl_SemanticsAcquire must not be used with (image) atomic store", fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad) && + (semantics & gl_SemanticsRelease)) { + error(loc, "gl_SemanticsRelease must not be used with (image) atomic load", fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore || + callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad) && + (semantics & gl_SemanticsAcquireRelease)) { + error(loc, "gl_SemanticsAcquireRelease must not be used with (image) atomic load/store", + fnCandidate.getName().c_str(), ""); + } + + if (callNode.getOp() == EOpMemoryBarrier && + !(semantics & (gl_SemanticsAcquire | gl_SemanticsRelease | gl_SemanticsAcquireRelease))) { + error(loc, + "Semantics must include exactly one of gl_SemanticsRelease, gl_SemanticsAcquire, or " + "gl_SemanticsAcquireRelease when used with memoryBarrier", + fnCandidate.getName().c_str(), ""); + } + + if ((callNode.getOp() == EOpMemoryBarrier || callNode.getOp() == EOpBarrier) && + (semantics & gl_SemanticsVolatile)) { error(loc, "gl_SemanticsVolatile must not be used with memoryBarrier or controlBarrier", fnCandidate.getName().c_str(), ""); } - if ((callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) && - ((semantics ^ semantics2) & gl_SemanticsVolatile)) { - error(loc, "semEqual and semUnequal must either both include gl_SemanticsVolatile or neither", - fnCandidate.getName().c_str(), ""); + + if (callNode.getOp() == EOpAtomicCompSwap || callNode.getOp() == EOpImageAtomicCompSwap) { + if (semantics2 & (gl_SemanticsRelease | gl_SemanticsAcquireRelease)) { + error(loc, "semUnequal must not be gl_SemanticsRelease or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics2 & gl_SemanticsAcquire) && !(semantics & (gl_SemanticsAcquire | gl_SemanticsAcquireRelease))) { + error(loc, + "semUnequal must not be gl_SemanticsAcquire unless semEqual is gl_SemanticsAcquire " + "or gl_SemanticsAcquireRelease", + fnCandidate.getName().c_str(), ""); + } + if ((semantics2 & gl_SemanticsMakeVisible) && !(semantics & gl_SemanticsMakeVisible)) { + error(loc, + "semUnequal must not include gl_SemanticsMakeVisible unless semEqual also includes " + "gl_SemanticsMakeVisible", + fnCandidate.getName().c_str(), ""); + } + if (storageClassSemantics2 & ~(storageClassSemantics)) { + error(loc, "semStorageUnequal must not include any option that is not present in semStorageEqual", + fnCandidate.getName().c_str(), ""); + } + if ((semantics ^ semantics2) & gl_SemanticsVolatile) { + error(loc, "semEqual and semUnequal must either both include gl_SemanticsVolatile or neither", + fnCandidate.getName().c_str(), ""); + } } } @@ -2367,6 +2879,22 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction& // // Assumes there has been a semantically correct match to a built-in function prototype. // +void TParseContext::requireDerivativeLayout(const TSourceLoc& loc, const char* featureDesc) +{ + if (language != EShLangCompute && language != EShLangTask && language != EShLangMesh) + return; + + if (language == EShLangCompute) { + const char* const derivativeExts[] = { E_GL_NV_compute_shader_derivatives, E_GL_KHR_compute_shader_derivatives }; + requireExtensions(loc, 2, derivativeExts, featureDesc); + } else { + requireExtensions(loc, 1, &E_GL_KHR_compute_shader_derivatives, featureDesc); + } + + if (!intermediate.hasLayoutDerivativeModeNone()) + error(loc, "requires a derivative_group_quads* or derivative_group_linear* layout qualifier", featureDesc, ""); +} + void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermOperator& callNode) { // Set up convenience accessors to the argument(s). There is almost always @@ -2387,7 +2915,32 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan TString featureString; const char* feature = nullptr; + + auto checkConstantArgWithLocation = [&](int argIndex, const char* argDescription, + const char* errMsg, int ioRTLocationSet) { + //ioRTLocationSet refers to grouping of locations of RT input/outputs as defined in TIntermediate::usedIoRT + if (!(*argp)[argIndex]->getAsConstantUnion()) { + error(loc, "argument must be compile-time constant", argDescription, argIndex == 10 ? "a" : ""); + } else if (ioRTLocationSet >= 0) { + unsigned int location = (*argp)[argIndex]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); + if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(ioRTLocationSet, location) < 0) + error(loc, "with layout(location =", errMsg, "%d)", location); + } + }; + switch (callNode.getOp()) { + case EOpDPdx: + case EOpDPdxFine: + case EOpDPdxCoarse: + case EOpDPdy: + case EOpDPdyFine: + case EOpDPdyCoarse: + case EOpFwidth: + case EOpFwidthFine: + case EOpFwidthCoarse: + requireDerivativeLayout(loc, fnCandidate.getName().c_str()); + break; + case EOpTextureGather: case EOpTextureGatherOffset: case EOpTextureGatherOffsets: @@ -2432,7 +2985,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (! fnCandidate[0].type->getSampler().shadow) compArg = 3; // check for constant offsets - if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion() + if (! (*argp)[fnCandidate[0].type->getSampler().shadow ? 3 : 2]->getAsConstantUnion() // NV_gpu_shader5 relaxes this limitation and allows for non-constant offsets && !extensionTurnedOn(E_GL_NV_gpu_shader5)) error(loc, "must be a compile-time constant:", feature, "offsets argument"); @@ -2470,6 +3023,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpTexture: case EOpTextureLod: { + if (callNode.getOp() == EOpTexture && fnCandidate.getParamCount() > 2) + requireDerivativeLayout(loc, (fnCandidate.getName() + " with bias argument").c_str()); + if ((fnCandidate.getParamCount() > 2) && ((*argp)[1]->getAsTyped()->getType().getBasicType() == EbtFloat) && ((*argp)[1]->getAsTyped()->getType().getVectorSize() == 4) && fnCandidate[0].type->getSampler().shadow) { featureString = fnCandidate.getName(); @@ -2497,6 +3053,12 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan break; } + case EOpTextureProj: + case EOpSparseTexture: + case EOpTextureQueryLod: + requireDerivativeLayout(loc, fnCandidate.getName().c_str()); + break; + case EOpSparseTextureGather: case EOpSparseTextureGatherOffset: case EOpSparseTextureGatherOffsets: @@ -2578,6 +3140,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpSparseTextureLodOffset: case EOpSparseTextureGradOffset: { + if (callNode.getOp() == EOpTextureOffset || callNode.getOp() == EOpTextureProjOffset || + callNode.getOp() == EOpSparseTextureOffset) + requireDerivativeLayout(loc, fnCandidate.getName().c_str()); + // Handle texture-offset limits checking // Pick which argument has to hold constant offsets int arg = -1; @@ -2676,108 +3242,46 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan break; } + case EOpTraceNV: - if (!(*argp)[10]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", "a"); + checkConstantArgWithLocation(10, "payload number", nullptr, -1); break; case EOpTraceRayMotionNV: - if (!(*argp)[11]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", "a"); + checkConstantArgWithLocation(11, "payload number", nullptr, -1); break; case EOpTraceKHR: - if (!(*argp)[10]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", "a"); - else { - unsigned int location = (*argp)[10]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) - error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); - } + checkConstantArgWithLocation(10, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); break; case EOpExecuteCallableNV: - if (!(*argp)[1]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "callable data number", ""); + checkConstantArgWithLocation(1, "callable data number", nullptr, -1); break; case EOpExecuteCallableKHR: - if (!(*argp)[1]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "callable data number", ""); - else { - unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(1, location) < 0) - error(loc, "with layout(location =", "no callableDataEXT/callableDataInEXT declared", "%d)", location); - } + checkConstantArgWithLocation(1, "callable data number", "no callableDataEXT/callableDataInEXT declared", 1); break; case EOpHitObjectTraceRayNV: - if (!(*argp)[11]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", ""); - else { - unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) - error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); - } + checkConstantArgWithLocation(11, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); break; case EOpHitObjectTraceRayMotionNV: - if (!(*argp)[12]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", ""); - else { - unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) - error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); - } + checkConstantArgWithLocation(12, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); break; case EOpHitObjectExecuteShaderNV: - if (!(*argp)[1]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "payload number", ""); - else { - unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0) - error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location); - } + checkConstantArgWithLocation(1, "payload number", "no rayPayloadEXT/rayPayloadInEXT declared", 0); break; case EOpHitObjectRecordHitNV: - if (!(*argp)[12]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); - else { - unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) - error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); - } + checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); break; case EOpHitObjectRecordHitMotionNV: - if (!(*argp)[13]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); - else { - unsigned int location = (*argp)[13]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) - error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); - } + checkConstantArgWithLocation(13, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); break; case EOpHitObjectRecordHitWithIndexNV: - if (!(*argp)[11]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); - else { - unsigned int location = (*argp)[11]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) - error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); - } + checkConstantArgWithLocation(11, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); break; case EOpHitObjectRecordHitWithIndexMotionNV: - if (!(*argp)[12]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); - else { - unsigned int location = (*argp)[12]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) - error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); - } + checkConstantArgWithLocation(12, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); break; case EOpHitObjectGetAttributesNV: - if (!(*argp)[1]->getAsConstantUnion()) - error(loc, "argument must be compile-time constant", "hitobjectattribute number", ""); - else { - unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst(); - if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(2, location) < 0) - error(loc, "with layout(location =", "no hitObjectAttributeNV declared", "%d)", location); - } + checkConstantArgWithLocation(1, "hitobjectattribute number", "no hitObjectAttributeNV declared", 2); break; case EOpRayQueryGetIntersectionType: @@ -3129,6 +3633,30 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan if (!(*argp)[6]->getAsTyped()->getType().getQualifier().isConstant()) error(loc, "argument must be compile-time constant", "matrixInterpretation", ""); break; + + case EOpCooperativeMatrixLoad: + case EOpCooperativeMatrixLoadNV: + case EOpCooperativeMatrixLoadTensorNV: + case EOpCooperativeMatrixStore: + case EOpCooperativeMatrixStoreNV: + case EOpCooperativeMatrixStoreTensorNV: + { + const TIntermTyped *arg1 = (*argp)[1]->getAsTyped(); + const TIntermTyped* base = TIntermediate::traverseLValueBase(arg1, true, true); + const char* errMsg = "Only l-values corresponding to storage block or shared variables can be used with " + "cooperative matrix load/store functions."; + if (base) { + const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr; + const TQualifier& qualifier = + (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier(); + if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer) + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } else { + error(loc, errMsg, fnCandidate.getName().c_str(), ""); + } + } + break; + default: break; } @@ -3169,10 +3697,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan error(loc, "second parameter must not have floate5m2 or floate4m3 basic type", "", ""); } - if (!(op0Type.isScalar() || op0Type.isVector() || op0Type.isCoopMatKHR())) { + if (!(op0Type.isScalar() || op0Type.isVector() || op0Type.isLongVector() || op0Type.isCoopMatKHR())) { error(loc, "first parameter must be scalar, vector, or cooperative matrix", "", ""); } - if (!(op1Type.isScalar() || op1Type.isVector() || op1Type.isCoopMatKHR())) { + if (!(op1Type.isScalar() || op1Type.isVector() || op1Type.isLongVector() || op1Type.isCoopMatKHR())) { error(loc, "second parameter must be scalar, vector, or cooperative matrix", "", ""); } if (!(op0Type.sameElementShape(op1Type) || op0Type.sameCoopMatShape(op1Type))) { @@ -3180,6 +3708,76 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan } break; } + case EOpTensorReadARM: + case EOpTensorWriteARM: + { + const TType &tensorType = (*argp)[0]->getAsTyped()->getType(); + + // Check that coordinates argument length matches rank of tensor argument. + int tensorRank = tensorType.getTensorRankARM(); + const TArraySizes *coordArgArrayTy = (*argp)[1]->getAsTyped()->getType().getArraySizes(); + assert(coordArgArrayTy->getNumDims() == 1 && "expecting 1D coordinate array"); + if (coordArgArrayTy->getDimSize(0) != tensorRank) { + error(loc, "number of coordinates does not match tensor rank", "coord", ""); + } + + // Check that tensor element type matches data argument. + TBasicType eltTy = tensorType.getBasicType(); + TBasicType argTy = (*argp)[2]->getAsTyped()->getType().getBasicType(); + if (eltTy != argTy) { + error(loc, "", "data", "data argument type (%s) does not match tensor element type (%s)", + TType::getBasicString(argTy), TType::getBasicString(eltTy)); + } + + // Check optional tensor operands. + if (argp->size() > 3) { + const TIntermConstantUnion* opArg = (*argp)[3]->getAsConstantUnion(); + if (!opArg) { + error(loc, "tensor operands argument must be a constant integral expression", "tensorOps", ""); + } + const unsigned int ops = opArg ? opArg->getConstArray()[0].getUConst() : 0; + const int gl_TensorOperandsOutOfBoundsValueARM = 0x2; + if (ops & gl_TensorOperandsOutOfBoundsValueARM) { + // Out-of-bounds values can only be used with reads. + if (callNode.getOp() != EOpTensorReadARM) { + error(loc, "out-of-bounds value is only valid with tensorReadARM", "tensorOps", ""); + } + // Check that an out-of-bounds value is present. + if (argp->size() == 4) { + error(loc, "expecting out-of-bounds value as next argument", "tensorOps", ""); + } else { + // Check constantness of out-of-bounds value. + const TIntermConstantUnion* oobArg = (*argp)[4]->getAsConstantUnion(); + if (!oobArg) { + error(loc, "argument following gl_TensorOperandsOutOfBoundsValueARM must be constant", "vararg", + ""); + } else if (oobArg->getType().getBasicType() != tensorType.getBasicType()) { + // The type of the OOB value does not match the tensor type. + error(loc, "", "vararg", + "out-of-bounds value type (%s) does not match tensor element type (%s)", + TType::getBasicString(oobArg->getBasicType()), TType::getBasicString(eltTy)); + + } + } + } + } + break; + } + + case EOpTensorSizeARM: + { + unsigned int tensorRank = (*argp)[0]->getAsTyped()->getType().getTensorRankARM(); + const TIntermConstantUnion *dimArg = (*argp)[1]->getAsConstantUnion(); + if (dimArg) { + if (dimArg->getConstArray()[0].getUConst() >= tensorRank) { + error(loc, "dimension argument exceeds tensor rank", "dim", ""); + } + } else { + error(loc, "dimension argument must be constant", "dim", ""); + } + break; + } + default: break; } @@ -3654,6 +4252,21 @@ void TParseContext::integerCheck(const TIntermTyped* node, const char* token) error(node->getLoc(), "scalar integer expression required", token, ""); } +// +// Both test, and if necessary spit out an error, to see if the node is really +// supported as an array index. +// +void TParseContext::arrayIndexCheck(const TIntermTyped* node, const char* token) +{ + auto from_type = node->getBasicType(); + + if ((from_type == EbtInt64 || from_type == EbtUint64) && + extensionTurnedOn(E_GL_EXT_shader_64bit_indexing)) + return; + + integerCheck(node, token); +} + // // Both test, and if necessary spit out an error, to see if we are currently // globally scoped. @@ -3672,6 +4285,10 @@ void TParseContext::reservedErrorCheck(const TSourceLoc& loc, const TString& ide // "Identifiers starting with "gl_" are reserved for use by OpenGL, and may not be // declared in a shader; this results in a compile-time error." if (! symbolTable.atBuiltInLevel()) { + // The extension GL_EXT_conservative_depth allows us to declare "gl_FragDepth". + if (identifier == "gl_FragDepth" && extensionTurnedOn(E_GL_EXT_conservative_depth)) + return; + if (builtInName(identifier) && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) // The extension GL_EXT_spirv_intrinsics allows us to declare identifiers starting with "gl_". error(loc, "identifiers starting with \"gl_\" are reserved", identifier.c_str(), ""); @@ -4094,6 +4711,10 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T return true; } + if (type.isLongVector() && !isValidLongVectorElseError(loc, type)) { + return true; + } + if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) || (op == EOpConstructStruct && size < type.computeNumComponents())) { error(loc, "not enough data provided for construction", constructorString.c_str(), ""); @@ -4300,6 +4921,9 @@ void TParseContext::samplerCheck(const TSourceLoc& loc, const TType& type, const error(loc, "sampler/image types can only be used in uniform variables or function parameters:", type.getBasicTypeString().c_str(), identifier.c_str()); } } + else if (type.isTensorARM() && type.getQualifier().storage != EvqUniform) { + error(loc, "tensorARM types can only be used in uniform variables or function parameters:", "tensorARM", identifier.c_str()); + } } void TParseContext::atomicUintCheck(const TSourceLoc& loc, const TType& type, const TString& identifier) @@ -4326,11 +4950,22 @@ void TParseContext::accStructCheck(const TSourceLoc& loc, const TType& type, con } +void TParseContext::hitObjectEXTCheck(const TSourceLoc & loc, const TType & type, const TString & identifier) +{ + if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectEXT)) { + error(loc, "struct is not allowed to contain hitObjectEXT:", type.getTypeName().c_str(), identifier.c_str()); + } else if (type.getBasicType() == EbtHitObjectEXT) { + TStorageQualifier qualifier = type.getQualifier().storage; + if (qualifier != EvqGlobal && qualifier != EvqTemporary) { + error(loc, "hitObjectEXT can only be declared in global or function scope with no storage qualifier:", "hitObjectEXT", identifier.c_str()); + } + } +} void TParseContext::hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier) { - if (type.getBasicType() == EbtStruct && containsFieldWithBasicType(type, EbtHitObjectNV)) { + if (type.getBasicType() == EbtStruct && ( containsFieldWithBasicType(type, EbtHitObjectNV))) { error(loc, "struct is not allowed to contain hitObjectNV:", type.getTypeName().c_str(), identifier.c_str()); - } else if (type.getBasicType() == EbtHitObjectNV) { + } else if ((type.getBasicType() == EbtHitObjectNV)) { TStorageQualifier qualifier = type.getQualifier().storage; if (qualifier != EvqGlobal && qualifier != EvqTemporary) { error(loc, "hitObjectNV can only be declared in global or function scope with no storage qualifier:", "hitObjectNV", identifier.c_str()); @@ -4456,7 +5091,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali if (! symbolTable.atGlobalLevel()) return; - if (!(publicType.userDef && publicType.userDef->isReference()) && !parsingBuiltins) { + if (!(publicType.userDef && publicType.userDef->isReference()) && !publicType.isTensorARM() && !parsingBuiltins) { if (qualifier.isMemoryQualifierImageAndSSBOOnly() && ! publicType.isImage() && publicType.qualifier.storage != EvqBuffer) { error(loc, "memory qualifiers cannot be used on this type", "", ""); } else if (qualifier.isMemory() && (publicType.basicType != EbtSampler) && !publicType.qualifier.isUniformOrBuffer()) { @@ -4482,11 +5117,6 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali // now, knowing it is a shader in/out, do all the in/out semantic checks - if (publicType.basicType == EbtBool && !parsingBuiltins) { - error(loc, "cannot be bool", GetStorageQualifierString(qualifier.storage), ""); - return; - } - if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble) { profileRequires(loc, EEsProfile, 300, nullptr, "non-float shader input/output"); profileRequires(loc, ~EEsProfile, 130, nullptr, "non-float shader input/output"); @@ -4807,7 +5437,7 @@ TPrecisionQualifier TParseContext::getDefaultPrecision(TPublicType& publicType) return defaultPrecision[publicType.basicType]; } -void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool isCoopMatOrVec) +void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType baseType, TQualifier& qualifier, bool hasTypeParameter) { // Built-in symbols are allowed some ambiguous precisions, to be pinned down // later by context. @@ -4817,7 +5447,7 @@ void TParseContext::precisionQualifierCheck(const TSourceLoc& loc, TBasicType ba if (baseType == EbtAtomicUint && qualifier.precision != EpqNone && qualifier.precision != EpqHigh) error(loc, "atomic counters can only be highp", "atomic_uint", ""); - if (isCoopMatOrVec) + if (hasTypeParameter) return; if (baseType == EbtFloat || baseType == EbtUint || baseType == EbtInt || baseType == EbtSampler || baseType == EbtAtomicUint) { @@ -5060,6 +5690,9 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua if (qualifier.storage == EvqBuffer && lastMember) return; + if (qualifier.storage == EvqUniform && lastMember && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array)) + return; + arraySizeRequiredCheck(loc, *arraySizes); } @@ -5184,6 +5817,20 @@ void TParseContext::checkRuntimeSizable(const TSourceLoc& loc, const TIntermType } } + // Check for last member of a uniform block, which can be runtime sizeable + // when using GL_EXT_uniform_buffer_unsized_array + if (base.getType().getQualifier().storage == EvqUniform && extensionTurnedOn(E_GL_EXT_uniform_buffer_unsized_array)) { + const TIntermBinary* binary = base.getAsBinaryNode(); + if (binary != nullptr && + binary->getOp() == EOpIndexDirectStruct) { + + const int index = binary->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const int memberCount = (int)binary->getLeft()->getType().getStruct()->size(); + if (index == memberCount - 1) + return; + } + } + // check for additional things allowed by GL_EXT_nonuniform_qualifier if (base.getBasicType() == EbtSampler || base.getBasicType() == EbtAccStruct || base.getBasicType() == EbtRayQuery || base.getBasicType() == EbtHitObjectNV || (base.getBasicType() == EbtBlock && base.getType().getQualifier().isUniformOrBuffer())) @@ -5288,7 +5935,8 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS bool nonEsRedecls = (!isEsProfile() && (version >= 130 || identifier == "gl_TexCoord")); bool esRedecls = (isEsProfile() && - (version >= 320 || extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks))); + (version >= 320 || extensionsTurnedOn(Num_AEP_shader_io_blocks, AEP_shader_io_blocks) || + (identifier == "gl_FragDepth" && extensionTurnedOn(E_GL_EXT_conservative_depth)))); if (! esRedecls && ! nonEsRedecls) return nullptr; @@ -5742,9 +6390,11 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali paramCheckFixStorage(loc, qualifier.storage, type); } -void TParseContext::nestedBlockCheck(const TSourceLoc& loc) +void TParseContext::nestedBlockCheck(const TSourceLoc& loc, const bool allowedInnerStruct) { - if (structNestingLevel > 0 || blockNestingLevel > 0) + if ((!allowedInnerStruct && structNestingLevel > 0) || + (allowedInnerStruct && structNestingLevel <= 0) || + blockNestingLevel > 0) error(loc, "cannot nest a block definition inside a structure or block", "", ""); ++blockNestingLevel; } @@ -5826,7 +6476,8 @@ void TParseContext::structTypeCheck(const TSourceLoc& /*loc*/, TPublicType& publ const TSourceLoc& memberLoc = typeList[member].loc; if (memberQualifier.isAuxiliary() || memberQualifier.isInterpolation() || - (memberQualifier.storage != EvqTemporary && memberQualifier.storage != EvqGlobal)) + (memberQualifier.storage != EvqTemporary && memberQualifier.storage != EvqGlobal && + !memberQualifier.layoutDescriptorHeap && !memberQualifier.layoutDescriptorInnerBlock)) error(memberLoc, "cannot use storage or interpolation qualifiers on structure members", typeList[member].type->getFieldName().c_str(), ""); if (memberQualifier.isMemory()) error(memberLoc, "cannot use memory qualifiers on structure members", typeList[member].type->getFieldName().c_str(), ""); @@ -5892,9 +6543,9 @@ void TParseContext::inductiveLoopCheck(const TSourceLoc& loc, TIntermNode* init, inductiveLoopIds.insert(loopIndex); // condition's form must be "loop-index relational-operator constant-expression" - bool badCond = ! loop->getTest(); + bool badCond = ! loop->getTestExpr(); if (! badCond) { - TIntermBinary* binaryCond = loop->getTest()->getAsBinaryNode(); + TIntermBinary* binaryCond = loop->getTestExpr()->getAsBinaryNode(); badCond = ! binaryCond; if (! badCond) { switch (binaryCond->getOp()) { @@ -5993,6 +6644,9 @@ void TParseContext::finish() if (parsingBuiltins) return; + // Forward builtin alias to AST for later use + intermediate.setBuiltinAliasLookup(symbolTable.collectBuiltinAlias()); + // Check on array indexes for ES 2.0 (version 100) limitations. for (size_t i = 0; i < needsIndexLimitationChecking.size(); ++i) constantIndexExpressionCheck(needsIndexLimitationChecking[i]); @@ -6028,6 +6682,12 @@ void TParseContext::finish() break; } + if (intermediate.IsRequestedExtension(E_GL_KHR_compute_shader_derivatives) && + !khrDerivativeLayoutQualifierSpecified) { + error(getCurrentLoc(), "requires one of derivative_group_quadsKHR or derivative_group_linearKHR layout qualifiers", + E_GL_KHR_compute_shader_derivatives, ""); + } + // Set default outputs for GL_NV_geometry_shader_passthrough if (language == EShLangGeometry && extensionTurnedOn(E_SPV_NV_geometry_shader_passthrough)) { if (intermediate.getOutputPrimitive() == ElgNone) { @@ -6117,6 +6777,12 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } } + if (id == "descriptor_heap") { + requireExtensions(loc, 1, &E_GL_EXT_descriptor_heap, "descriptor_stride"); + requireVulkan(loc, "descriptor_heap"); + publicType.qualifier.layoutDescriptorHeap = true; + return; + } if (id == "push_constant") { requireVulkan(loc, "push_constant"); publicType.qualifier.layoutPushConstant = true; @@ -6294,8 +6960,10 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth+1)) { if (id == TQualifier::getLayoutDepthString(depth)) { - requireProfile(loc, ECoreProfile | ECompatibilityProfile, "depth layout qualifier"); - profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, nullptr, "depth layout qualifier"); + const char* feature = "depth layout qualifier"; + requireProfile(loc, ECoreProfile | ECompatibilityProfile | EEsProfile, feature); + profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, E_GL_ARB_conservative_depth, feature); + profileRequires(loc, EEsProfile, 0, E_GL_EXT_conservative_depth, feature); publicType.shaderQualifiers.layoutDepth = depth; return; } @@ -6385,21 +7053,40 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi requireExtensions(loc, 1, &E_GL_NV_shader_invocation_reorder, "hitobject shader record NV"); publicType.qualifier.layoutHitObjectShaderRecordNV = true; return; + } else if (id == "hitobjectshaderrecordext") { + requireExtensions(loc, 1, &E_GL_EXT_shader_invocation_reorder, "hitobject shader record EXT"); + publicType.qualifier.layoutHitObjectShaderRecordEXT = true; + return; } } } - if (language == EShLangCompute) { + if (language == EShLangCompute || language == EShLangTask || language == EShLangMesh) { if (id.compare(0, 17, "derivative_group_") == 0) { - requireExtensions(loc, 1, &E_GL_NV_compute_shader_derivatives, "compute shader derivatives"); - if (id == "derivative_group_quadsnv") { + if (id == "derivative_group_quadsnv" || id == "derivative_group_linearnv") { + requireExtensions(loc, 1, &E_GL_NV_compute_shader_derivatives, "compute shader derivatives"); + if (language != EShLangCompute) { + error(loc, "can only apply to compute shaders", id.c_str(), ""); + return; + } + } else if (id == "derivative_group_quadskhr" || id == "derivative_group_linearkhr") { + requireExtensions(loc, 1, &E_GL_KHR_compute_shader_derivatives, "compute shader derivatives"); + khrDerivativeLayoutQualifierSpecified = true; + } + if (id == "derivative_group_quadsnv" || id == "derivative_group_quadskhr") { publicType.shaderQualifiers.layoutDerivativeGroupQuads = true; + publicType.shaderQualifiers.derivativeGroupExtension = + id == "derivative_group_quadsnv" ? EdgNV : EdgKHR; return; - } else if (id == "derivative_group_linearnv") { + } else if (id == "derivative_group_linearnv" || id == "derivative_group_linearkhr") { publicType.shaderQualifiers.layoutDerivativeGroupLinear = true; + publicType.shaderQualifiers.derivativeGroupExtension = + id == "derivative_group_linearnv" ? EdgNV : EdgKHR; return; } } + } + if (language == EShLangCompute) { if (id == "tile_attachmentqcom") { requireExtensions(loc, 1, &E_GL_QCOM_tile_shading, "tile shading QCOM"); publicType.qualifier.layoutTileAttachmentQCOM = true; @@ -6521,7 +7208,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi } if (id == "constant_id") { requireSpv(loc, "constant_id"); - if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + if ((unsigned)value >= TQualifier::layoutSpecConstantIdEnd) { error(loc, "specialization-constant id is too large", id.c_str(), ""); } else { publicType.qualifier.layoutSpecConstantId = value; @@ -6631,6 +7318,45 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi return; } + if (id == "bank") { + requireExtensions(loc, 1, &E_GL_NV_push_constant_bank, "bank"); + if (nonLiteral) + error(loc, "needs a literal integer", id.c_str(), ""); + else if (value < 0 || (unsigned int)value >= TQualifier::layoutBankEnd) + error(loc, "bank out of range", id.c_str(), ""); + else + publicType.qualifier.layoutBank = value; + return; + } + if (id == "member_offset") { + requireExtensions(loc, 1, &E_GL_NV_push_constant_bank, "member_offset"); + if (nonLiteral) + error(loc, "needs a literal integer", id.c_str(), ""); + else if (value < 0) + error(loc, "must be equal or greater than 0", id.c_str(), ""); + else + publicType.qualifier.layoutMemberOffset = value; + return; + } + + if (id == "descriptor_stride") { + requireExtensions(loc, 1, &E_GL_EXT_descriptor_heap, "descriptor_stride"); + requireVulkan(loc, "descriptor_stride"); + if (!IsPow2(value)) + error(loc, "must be a power of 2", "descriptor_stride", ""); + else + publicType.qualifier.layoutDescriptorStride = uint32_t(value); + return; + } + + if (id == "heap_offset") { + requireExtensions(loc, 1, &E_GL_EXT_descriptor_heap, "heap_offset"); + requireExtensions(loc, 1, &E_GL_EXT_structured_descriptor_heap, "heap_offset"); + requireVulkan(loc, "heap_offset"); + publicType.qualifier.layoutHeapOffset = uint32_t(value); + return; + } + switch (language) { case EShLangTessControl: if (id == "vertices") { @@ -6871,6 +7597,14 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie dst.layoutXfbOffset = src.layoutXfbOffset; if (src.hasAttachment()) dst.layoutAttachment = src.layoutAttachment; + if (src.layoutDescriptorHeap) + dst.layoutDescriptorHeap = true; + if (src.layoutDescriptorInnerBlock) + dst.layoutDescriptorInnerBlock = true; + if (src.layoutDescriptorStride != TQualifier::layoutDescriptorStrideEnd) + dst.layoutDescriptorStride = src.layoutDescriptorStride; + if (src.layoutHeapOffset != 0) + dst.layoutHeapOffset = src.layoutHeapOffset; if (src.layoutPushConstant) dst.layoutPushConstant = true; @@ -6900,6 +7634,12 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie if (src.layoutHitObjectShaderRecordNV) dst.layoutHitObjectShaderRecordNV = true; dst.layoutTileAttachmentQCOM |= src.layoutTileAttachmentQCOM; + if (src.layoutHitObjectShaderRecordEXT) + dst.layoutHitObjectShaderRecordEXT = true; + if (src.hasBank()) + dst.layoutBank = src.layoutBank; + if (src.hasMemberOffset()) + dst.layoutMemberOffset = src.layoutMemberOffset; } } @@ -6975,6 +7715,22 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb break; } } + + // Check that an in/out variable or block doesn't contain a boolean member + // Don't enforce if redeclaring a builtin, which are allowed to contain bool + if (!parsingBuiltins && type.containsBasicType(EbtBool) && !builtInName(symbol.getName())) { + switch(qualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + { + const char *reason = type.getBasicType() == EbtBool ? "cannot be bool" : "cannot contain bool"; + error(loc, reason, GetStorageQualifierString(qualifier.storage), ""); + break; + } + default: + break; + } + } } // "For some blocks declared as arrays, the location can only be applied at the block level: @@ -7050,6 +7806,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) case EvqCallableData: case EvqCallableDataIn: case EvqHitObjectAttrNV: + case EvqHitObjectAttrEXT: case EvqSpirvStorageClass: break; case EvqTileImageEXT: @@ -7138,7 +7895,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) // SPIR-V if (spvVersion.spv > 0) { - if (qualifier.isUniformOrBuffer()) { + if (qualifier.isUniformOrBuffer() && !intermediate.IsRequestedExtension(E_GL_EXT_descriptor_heap)) { if (type.getBasicType() == EbtBlock && !qualifier.isPushConstant() && !qualifier.isShaderRecord() && !qualifier.hasAttachment() && @@ -7262,6 +8019,8 @@ static bool storageCanHaveLayoutInBlock(const enum TStorageQualifier storage) case EvqUniform: case EvqBuffer: case EvqShared: + case EvqSamplerHeap: + case EvqResourceHeap: return true; default: return false; @@ -7397,6 +8156,21 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier if (qualifier.storage == EvqHitAttr && qualifier.hasLayout()) { error(loc, "cannot apply layout qualifiers to hitAttributeNV variable", "hitAttributeNV", ""); } + if (qualifier.hasBank()) { + if (!qualifier.isPushConstant()) + error(loc, "can only be used with push_constant", "bank", ""); + } + if (qualifier.hasMemberOffset()) { + if (!qualifier.isPushConstant()) + error(loc, "can only be used with push_constant", "member_offset", ""); + } + + if (qualifier.layoutDescriptorStride != TQualifier::layoutDescriptorStrideEnd && + !qualifier.layoutDescriptorHeap) + error(loc, "must specify 'descriptor_heap' to use 'descriptor_stride'", "descriptor_stride", ""); + if (qualifier.layoutHeapOffset != 0 && !qualifier.layoutDescriptorHeap && + qualifier.storage != EvqSamplerHeap && qualifier.storage != EvqResourceHeap) + error(loc, "must specify 'descriptor_heap' to use 'heap_offset'", "heap_offset", ""); } // For places that can't have shader-level layout qualifiers @@ -7523,6 +8297,12 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct if (symbol) return symbol->getAsFunction(); } + // abortEXT has usage (var args) as similar as debugPrintfEXT. + if (call.getName() == "abortEXT") { + TSymbol* symbol = symbolTable.find("abortEXT(", &builtIn); + if (symbol) + return symbol->getAsFunction(); + } // coopMatPerElementNV is variadic. There is some function signature error // checking in handleCoopMat2FunctionCall. @@ -7722,19 +8502,24 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu TType toElementType(to, 0); // Load/store tensor functions allow any element type for the pointer if ((op == EOpCooperativeMatrixLoadTensorNV || op == EOpCooperativeMatrixStoreTensorNV) && - param == 1 && - (from.getQualifier().storage == EvqBuffer || from.getQualifier().storage == EvqShared)) { + param == 1) { return true; } if (fromElementType == toElementType) return true; } + if (TType::vectorAndLongVectorMatch(from, to)) + return true; if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) return false; if (from.isCoopMat() && to.isCoopMat()) return from.sameCoopMatBaseType(to); if (from.isCoopVecNV() && to.isCoopVecNV()) return from.sameCoopVecBaseType(to); + if (from.isLongVector() && to.isLongVector()) + return from.sameLongVectorBaseType(to); + if (from.isTensorARM() && to.isTensorARM()) + return from.sameTensorBaseTypeARM(to); return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); }; @@ -7743,10 +8528,13 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu // Assumes 'convertible' already said true. const auto better = [&](const TType& from, const TType& to1, const TType& to2) -> bool { // 1. exact match - if (from == to2) - return from != to1; - if (from == to1) + bool to2Matches = from == to2 || (from.isLongVector() && to2.getBasicType() == EbtLongVector); + bool to1Matches = from == to1 || (from.isLongVector() && to1.getBasicType() == EbtLongVector); + if (to2Matches) + return !to1Matches; + if (to1Matches) return false; + if (extensionTurnedOn(E_GL_NV_gpu_shader5)) { // This map refers to the conversion table mentioned under the // section "Modify Section 6.1, Function Definitions, p. 63" in NV_gpu_shader5 spec @@ -7797,7 +8585,7 @@ const TFunction* TParseContext::findFunction400(const TSourceLoc& loc, const TFu // "To determine whether the conversion for a single argument in one match // is better than that for another match, the conversion is assigned of the // three ranks ordered from best to worst: -// 1. Exact match: no conversion. +// 1. Exact match: no conversion. // 2. Promotion: integral or floating-point promotion. // 3. Conversion: integral conversion, floating-point conversion, // floating-integral conversion. @@ -7834,19 +8622,24 @@ const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, TType toElementType(to, 0); // Load/store tensor functions allow any element type for the pointer if ((op == EOpCooperativeMatrixLoadTensorNV || op == EOpCooperativeMatrixStoreTensorNV) && - param == 1 && - (from.getQualifier().storage == EvqBuffer || from.getQualifier().storage == EvqShared)) { + param == 1) { return true; } if (fromElementType == toElementType) return true; } + if (TType::vectorAndLongVectorMatch(from, to)) + return true; if (from.isArray() || to.isArray() || ! from.sameElementShape(to)) return false; if (from.isCoopMat() && to.isCoopMat()) return from.sameCoopMatBaseType(to); if (from.isCoopVecNV() && to.isCoopVecNV()) return from.sameCoopVecBaseType(to); + if (from.isLongVector() && to.isLongVector()) + return from.sameLongVectorBaseType(to); + if (from.isTensorARM() && to.isTensorARM()) + return from.sameTensorBaseTypeARM(to); return intermediate.canImplicitlyPromote(from.getBasicType(), to.getBasicType()); }; @@ -7855,9 +8648,11 @@ const TFunction* TParseContext::findFunctionExplicitTypes(const TSourceLoc& loc, // Assumes 'convertible' already said true. const auto better = [this](const TType& from, const TType& to1, const TType& to2) -> bool { // 1. exact match - if (from == to2) - return from != to1; - if (from == to1) + bool to2Matches = from == to2 || (from.isLongVector() && to2.getBasicType() == EbtLongVector); + bool to1Matches = from == to1 || (from.isLongVector() && to1.getBasicType() == EbtLongVector); + if (to2Matches) + return !to1Matches; + if (to1Matches) return false; // 2. Promotion (integral, floating-point) is better @@ -8053,6 +8848,27 @@ void TParseContext::typeParametersCheck(const TSourceLoc& loc, const TPublicType } } } + if (publicType.isTensorARM()) { + if (publicType.typeParameters == nullptr) { + error(loc, "tensor type is missing type parameters", "", ""); + return; + } + if (publicType.typeParameters->arraySizes == nullptr) { + error(loc, "tensor type is missing rank information", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "tensor type requires exactly 1 rank specifier", "", ""); + return; + } + if (publicType.typeParameters->arraySizes->getDimSize(0) < 1) { + error(loc, "tensor rank must be greater than or equal to 1", "", ""); + return; + } + } + if (publicType.isLongVector() && !isValidLongVectorElseError(loc, publicType)) { + return; + } } bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString& identifier, const TPublicType& publicType, @@ -8133,6 +8949,11 @@ bool TParseContext::vkRelaxedRemapUniformVariable(const TSourceLoc& loc, TString // merge qualifiers mergeObjectLayoutQualifiers(updatedBlock->getWritableType().getQualifier(), type.getQualifier(), true); + // set default value for bank when no decoration is present. + if (updatedBlock->getWritableType().getQualifier().isPushConstant() && !updatedBlock->getWritableType().getQualifier().hasBank()) { + updatedBlock->getWritableType().getQualifier().layoutBank = 0; + } + return true; } @@ -8148,12 +8969,15 @@ static void ForEachOpaque(const TType& type, const TString& path, Function callb ++flatIndex) { TString subscriptPath = path; - for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + if (path != "") { - int index = indices[dimIndex]; - subscriptPath.append("["); - subscriptPath.append(String(index)); - subscriptPath.append("]"); + for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) + { + int index = indices[dimIndex]; + subscriptPath.append("["); + subscriptPath.append(String(index)); + subscriptPath.append("]"); + } } recursion(type, subscriptPath, true, recursion); @@ -8161,7 +8985,7 @@ static void ForEachOpaque(const TType& type, const TString& path, Function callb for (size_t dimIndex = 0; dimIndex < indices.size(); ++dimIndex) { ++indices[dimIndex]; - if (indices[dimIndex] < type.getArraySizes()->getDimSize(dimIndex)) + if (indices[dimIndex] < type.getArraySizes()->getDimSize(static_cast(dimIndex))) break; else indices[dimIndex] = 0; @@ -8175,8 +8999,11 @@ static void ForEachOpaque(const TType& type, const TString& path, Function callb for (const TTypeLoc& typeLoc : types) { TString nextPath = path; - nextPath.append("."); - nextPath.append(typeLoc.type->getFieldName()); + if (path != "") + { + nextPath.append("."); + nextPath.append(typeLoc.type->getFieldName()); + } recursion(*(typeLoc.type), nextPath, false, recursion); } @@ -8234,9 +9061,13 @@ void TParseContext::vkRelaxedRemapFunctionParameter(TFunction* function, TParame if (!param.type->isStruct() || !param.type->containsOpaque()) return; - ForEachOpaque(*param.type, (param.name ? *param.name : param.type->getFieldName()), + TString fieldName = param.name + ? *param.name + : param.type->hasFieldName() ? param.type->getFieldName() : ""; + + ForEachOpaque(*param.type, fieldName, [function, param, newParams](const TType& type, const TString& path) { - TString* memberName = NewPoolTString(path.c_str()); + TString* memberName = path != "" ? NewPoolTString(path.c_str()) : nullptr; TType* memberType = new TType(); memberType->shallowCopy(type); @@ -8417,7 +9248,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden if (initializer) { if (type.getBasicType() == EbtRayQuery) { error(loc, "ray queries can only be initialized by using the rayQueryInitializeEXT intrinsic:", "=", identifier.c_str()); - } else if (type.getBasicType() == EbtHitObjectNV) { + } else if ((type.getBasicType() == EbtHitObjectNV) || (type.getBasicType() == EbtHitObjectEXT)) { error(loc, "hit objects cannot be initialized using initializers", "=", identifier.c_str()); } @@ -8472,9 +9303,54 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden if (!publicType.typeParameters || !publicType.typeParameters->arraySizes || publicType.typeParameters->arraySizes->getNumDims() != 1) { error(loc, "expected two type parameters", identifier.c_str(), ""); - } else if (publicType.typeParameters->arraySizes->getDimSize(0) <= 0) { + } else if (publicType.typeParameters->arraySizes->getDimNode(0) == nullptr && publicType.typeParameters->arraySizes->getDimSize(0) <= 0) { error(loc, "expected positive number of components", identifier.c_str(), ""); } + } else if (type.isLongVector()) { + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || !publicType.typeParameters->arraySizes || publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "expected two type parameters", identifier.c_str(), ""); + } else if (publicType.typeParameters->arraySizes->getDimNode(0) == nullptr && publicType.typeParameters->arraySizes->getDimSize(0) <= 0) { + error(loc, "expected positive number of components", identifier.c_str(), ""); + } + } else if (type.isTensorARM()) { + intermediate.setUseStorageBuffer(); + + if (!publicType.typeParameters || publicType.typeParameters->arraySizes->getNumDims() != 1) { + error(loc, "expected two type parameters", identifier.c_str(), ""); + } + if (publicType.typeParameters) { + if (publicType.typeParameters->basicType != EbtBool && + publicType.typeParameters->basicType != EbtInt8 && + publicType.typeParameters->basicType != EbtInt16 && + publicType.typeParameters->basicType != EbtInt && + publicType.typeParameters->basicType != EbtInt64 && + publicType.typeParameters->basicType != EbtUint8 && + publicType.typeParameters->basicType != EbtUint16 && + publicType.typeParameters->basicType != EbtUint && + publicType.typeParameters->basicType != EbtUint64 && + publicType.typeParameters->basicType != EbtFloat16 && + publicType.typeParameters->basicType != EbtFloat && + publicType.typeParameters->basicType != EbtDouble && + publicType.typeParameters->basicType != EbtBFloat16 && + publicType.typeParameters->basicType != EbtFloatE5M2 && + publicType.typeParameters->basicType != EbtFloatE4M3) { + error(loc, "expected bool, integer or floating point type parameter", identifier.c_str(), ""); + } + + if (publicType.typeParameters->basicType == EbtBFloat16) { + requireExtensions(loc, 1, &E_GL_ARM_tensors_bfloat16, "tensor with bfloat16_t type"); + } + + if (publicType.typeParameters->basicType == EbtFloatE5M2) { + requireExtensions(loc, 1, &E_GL_ARM_tensors_float_e5m2, "tensor with floate5m2_t type"); + } + + if (publicType.typeParameters->basicType == EbtFloatE4M3) { + requireExtensions(loc, 1, &E_GL_ARM_tensors_float_e4m3, "tensor with floate4m3_t type"); + } + } } else { if (publicType.typeParameters && publicType.typeParameters->arraySizes->getNumDims() != 0) { error(loc, "unexpected type parameters", identifier.c_str(), ""); @@ -8494,6 +9370,7 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden atomicUintCheck(loc, type, identifier); accStructCheck(loc, type, identifier); hitObjectNVCheck(loc, type, identifier); + hitObjectEXTCheck(loc, type, identifier); checkAndResizeMeshViewDim(loc, type, /*isBlockMember*/ false); if (type.getQualifier().storage == EvqConst && type.containsReference()) { error(loc, "variables with reference type can't have qualifier 'const'", "qualifier", ""); @@ -8592,13 +9469,33 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden initNode = executeInitializer(loc, initializer, variable); } + // EXT_descriptor_heap + if (!untypedHeapCheck(symbol, type, loc, identifier.c_str())) { + return nullptr; + } + // look for errors in layout qualifier use layoutObjectCheck(loc, *symbol); // fix up fixOffset(loc, *symbol); - return initNode; + // TODO: The decl AST is turned on based on debug info right now. We should expose it as an explicit option. + if (intermediate.getDebugInfo()) { + TVariable* variable = symbol->getAsVariable(); + if (variable) { + auto decl = new TIntermVariableDecl(intermediate.addSymbol(*variable, loc), initNode); + decl->setLoc(loc); + return decl; + } + else { + // We ignore builtins redeclarations + return nullptr; + } + } + else { + return initNode; + } } // Pick up global defaults from the provide global defaults into dst. @@ -9430,6 +10327,34 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T return intermediate.setAggregateOperator(newNode, op, type, loc); } +void TParseContext::makeVariadic(TFunction *F, const TSourceLoc &loc) { + if (parsingBuiltins) { + F->setVariadic(); + } else { + error(loc, "variadic argument specifier is only available for builtins", "...", ""); + } +} + +TParameter TParseContext::getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer, + const TSourceLoc& loc) +{ + if (!parsingBuiltins) { + error(loc, "default argument values are only available for builtins", "=", ""); + initializer = nullptr; + } + if (ty.arraySizes) { + error(loc, "array arguments cannot be default-initialized", identifier->c_str(), ""); + initializer = nullptr; + } + if (ty.basicType == EbtVoid) { + error(loc, "illegal use of type 'void'", identifier->c_str(), ""); + initializer = nullptr; + } + reservedErrorCheck(loc, *identifier); + TParameter param = {identifier, new TType(ty), initializer}; + return param; +} + // This function tests for the type of the parameters to the structure or array constructor. Raises // an error message if the expected type does not match the parameter passed to the constructor. // @@ -9490,10 +10415,64 @@ void TParseContext::updateBindlessQualifier(TType& memberType) } } +void TParseContext::descHeapBuiltinRemap(TType* type, bool isInnerBlock) +{ + if (type->isStruct()) { + TTypeList* types = type->getWritableStruct(); + for (auto typeLoc : *types) { + descHeapBuiltinRemap(typeLoc.type, isInnerBlock); + } + } + + auto* qualifier = &type->getQualifier(); + if (type->getBasicType() == EbtSampler) { + if (type->isImage() || type->isTexture()) + qualifier->builtIn = EbvResourceHeapEXT; + else + qualifier->builtIn = EbvSamplerHeapEXT; + qualifier->layoutDescriptorHeap = true; + } else if (qualifier->isUniformOrBuffer() || type->getBasicType() == EbtAccStruct) { + qualifier->builtIn = EbvResourceHeapEXT; + qualifier->layoutDescriptorHeap = true; + qualifier->layoutDescriptorInnerBlock = isInnerBlock; + } + } + +bool TParseContext::untypedHeapCheck(TSymbol* symbol, const TType& type, const TSourceLoc& loc, const char* name) +{ + // EXT_descriptor_heap + bool isHeapStruct = + (type.getQualifier().storage == EvqSamplerHeap || type.getQualifier().storage == EvqResourceHeap); + + if (intermediate.IsRequestedExtension(E_GL_EXT_descriptor_heap) && spvVersion.vulkan > 0 && + !type.getQualifier().hasSet() && !type.getQualifier().hasBinding()) { + if (type.getQualifier().layoutDescriptorHeap || isHeapStruct) { + if ((intermediate.isEsProfile() && intermediate.getVersion() < 310) || + (!intermediate.isEsProfile() && intermediate.getVersion() < 420)) { + TString warnMsg = "layout(descriptor_heap) is turned on beyond version/profile limits."; + infoSink.info.message(EPrefixWarning, warnMsg.c_str()); + } + if (IsAnonymous(symbol->getName()) && + (type.getQualifier().isUniformOrBuffer() || type.getBasicType() == EbtBlock)) { + error(loc, "layout(descriptor_heap) decorated block should be explicitly " + "declared with a run-time sized array type.", name, ""); + return false; + } + if (!type.containsHeapArray()) { + error(loc, "layout(descriptor_heap) decorated variable could only be declared as an array.", + name, ""); + return false; + } + descHeapBuiltinRemap(&symbol->getWritableType(), isHeapStruct); + } + } + return true; +} + // -// Do everything needed to add an interface block. +// Do everything needed to add an interface block. Returns the declarator node if there's an instance declaration. // -void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, +TIntermNode* TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) { if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) @@ -9541,12 +10520,12 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con } // For bindless texture, sampler can be declared as uniform/storage block member, - if (memberType.containsOpaque()) { + if (memberType.containsOpaque() && !extensionTurnedOn(E_GL_EXT_structured_descriptor_heap)) { if (memberType.containsSampler() && extensionTurnedOn(E_GL_ARB_bindless_texture)) updateBindlessQualifier(memberType); else error(memberLoc, "member of block cannot be or contain a sampler, image, or atomic_uint type", typeList[member].type->getFieldName().c_str(), ""); - } + } if (memberType.containsCoopMat()) error(memberLoc, "member of block cannot be or contain a cooperative matrix type", typeList[member].type->getFieldName().c_str(), ""); @@ -9559,7 +10538,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // do all the rest. if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) { redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes); - return; + return nullptr; } // Not a redeclaration of a built-in; check that all names are user names. @@ -9725,7 +10704,7 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con } } if (!instanceName) { - return; + return nullptr; } } else { // @@ -9748,11 +10727,11 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con if (existingName->getType().getBasicType() == EbtBlock) { if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString()); - return; + return nullptr; } } else { error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); - return; + return nullptr; } } } @@ -9769,7 +10748,12 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con else error(loc, "block instance name redefinition", variable.getName().c_str(), ""); - return; + return nullptr; + } + + // EXT_descriptor_heap + if (!untypedHeapCheck(&variable, blockType, loc, blockName->c_str())) { + return nullptr; } // Check for general layout qualifier errors @@ -9784,6 +10768,17 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con // Save it in the AST for linker use. trackLinkage(variable); + + TIntermAggregate* declNode = nullptr; + if (intermediate.getDebugInfo()) { + auto blockDeclNode = new TIntermVariableDecl(intermediate.addSymbol(variable, loc), nullptr); + blockDeclNode->setLoc(loc); + + // We have to wrap the declaration with a sequence to fit the same processing logic with variables. + declNode = new TIntermAggregate(EOpSequence); + declNode->getSequence().push_back(blockDeclNode); + } + return declNode; } // @@ -9872,6 +10867,18 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q profileRequires(loc, ~EEsProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV block"); requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV block"); break; + case EvqHitObjectAttrEXT: + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT block"); + requireStage(loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeEXT block"); + break; + case EvqResourceHeap: + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_structured_descriptor_heap, "resourceheap block"); + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_descriptor_heap, "resourceheap block"); + break; + case EvqSamplerHeap: + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_structured_descriptor_heap, "samplerheap block"); + profileRequires(loc, ~EEsProfile, 460, E_GL_EXT_descriptor_heap, "samplerheap block"); + break; default: error(loc, "only uniform, buffer, in, or out blocks are supported", blockName->c_str(), ""); break; @@ -10497,19 +11504,20 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con if (publicType.shaderQualifiers.layoutDerivativeGroupQuads && publicType.shaderQualifiers.layoutDerivativeGroupLinear) { - error(loc, "cannot be both specified", "derivative_group_quadsNV and derivative_group_linearNV", ""); + error(loc, "cannot be both specified", "derivative_group_quads* and derivative_group_linear*", ""); } if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) { if (publicType.qualifier.storage == EvqVaryingIn) { if ((intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && (intermediate.getLocalSize(0) & 1)) || (intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && (intermediate.getLocalSize(1) & 1))) - error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", ""); + error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quads", ""); else - intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads); + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads, + publicType.shaderQualifiers.derivativeGroupExtension); } else - error(loc, "can only apply to 'in'", "derivative_group_quadsNV", ""); + error(loc, "can only apply to 'in'", "derivative_group_quads", ""); } if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) { if (publicType.qualifier.storage == EvqVaryingIn) { @@ -10519,12 +11527,13 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con (intermediate.getLocalSize(0) * intermediate.getLocalSize(1) * intermediate.getLocalSize(2)) % 4 != 0) - error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", ""); + error(loc, "requires total group size to be multiple of four", "derivative_group_linear", ""); else - intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupLinear); + intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupLinear, + publicType.shaderQualifiers.derivativeGroupExtension); } else - error(loc, "can only apply to 'in'", "derivative_group_linearNV", ""); + error(loc, "can only apply to 'in'", "derivative_group_linear", ""); } // Check mesh out array sizes, once all the necessary out qualifiers are defined. if ((language == EShLangMesh) && diff --git a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h index 47a72999f..57f7ff390 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h +++ b/src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h @@ -115,7 +115,7 @@ public: virtual void setLimits(const TBuiltInResource&) = 0; - void checkIndex(const TSourceLoc&, const TType&, int& index); + void checkIndex(const TSourceLoc&, const TType&, int64_t& index); EShLanguage getLanguage() const { return language; } void setScanContext(TScanContext* c) { scanContext = c; } @@ -344,6 +344,7 @@ public: TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field); TIntermTyped* handleDotSwizzle(const TSourceLoc&, TIntermTyped* base, const TString& field); + TIntermTyped* handleTypeCast(const TSourceLoc&, TType *castType, TIntermTyped *base); void blockMemberExtensionCheck(const TSourceLoc&, const TIntermTyped* base, int member, const TString& memberName); TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); @@ -357,6 +358,7 @@ public: TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&) const; TIntermTyped* addAssign(const TSourceLoc&, TOperator op, TIntermTyped* left, TIntermTyped* right); void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&); + void requireDerivativeLayout(const TSourceLoc&, const char* featureDesc); void nonOpBuiltInCheck(const TSourceLoc&, const TFunction&, TIntermAggregate&); void userFunctionCallCheck(const TSourceLoc&, TIntermAggregate&); void samplerConstructorLocationCheck(const TSourceLoc&, const char* token, TIntermNode*); @@ -381,6 +383,7 @@ public: void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override; void constantValueCheck(TIntermTyped* node, const char* token); void integerCheck(const TIntermTyped* node, const char* token); + void arrayIndexCheck(const TIntermTyped* node, const char* token); void globalCheck(const TSourceLoc&, const char* token); bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); @@ -397,6 +400,7 @@ public: void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer); void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier); void accStructCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); + void hitObjectEXTCheck(const TSourceLoc& loc, const TType& type, const TString& identifier); void hitObjectNVCheck(const TSourceLoc & loc, const TType & type, const TString & identifier); void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier); void memberQualifierCheck(glslang::TPublicType&); @@ -407,14 +411,14 @@ public: void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier); int computeSamplerTypeIndex(TSampler&); TPrecisionQualifier getDefaultPrecision(TPublicType&); - void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool isCoopMatOrVec); + void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool hasTypeParameter); void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type); bool containsFieldWithBasicType(const TType& type ,TBasicType basicType); TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&); void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); void paramCheckFixStorage(const TSourceLoc&, const TStorageQualifier&, TType& type); void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); - void nestedBlockCheck(const TSourceLoc&); + void nestedBlockCheck(const TSourceLoc&, const bool allowedInnerStruct = false); void nestedStructCheck(const TSourceLoc&); void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op); void opaqueCheck(const TSourceLoc&, const TType&, const char* op); @@ -450,8 +454,13 @@ public: TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&); TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); + void makeVariadic(TFunction *F, const TSourceLoc &loc); + TParameter getParamWithDefault(const TPublicType& ty, TString* identifier, TIntermTyped* initializer, + const TSourceLoc& loc); void inheritMemoryQualifiers(const TQualifier& from, TQualifier& to); - void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr); + void descHeapBuiltinRemap(TType* type, bool isInnerBlock); + bool untypedHeapCheck(TSymbol* symbol, const TType& type, const TSourceLoc& loc, const char* name); + TIntermNode* declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = nullptr, TArraySizes* arraySizes = nullptr); void blockStorageRemap(const TSourceLoc&, const TString*, TQualifier&); void blockStageIoCheck(const TSourceLoc&, const TQualifier&); void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName); @@ -510,6 +519,8 @@ protected: TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); void finish() override; void handleCoopMat2FunctionCall(const TSourceLoc& loc, const TFunction* fnCandidate, TIntermTyped* result, TIntermNode* arguments); + void handleVector2CoopMatConversionCall(const TSourceLoc& loc, const TFunction* fnCandidate, TIntermTyped* &result, TIntermNode* arguments); + void handleLongVectorBuiltin(const TSourceLoc& loc, const TFunction* fnCandidate, TType* resultType, TIntermNode* arguments); virtual const char* getGlobalUniformBlockName() const override; virtual void finalizeGlobalUniformBlockLayout(TVariable&) override; @@ -520,6 +531,32 @@ protected: virtual void setAtomicCounterBlockDefaults(TType& block) const override; virtual void setInvariant(const TSourceLoc& loc, const char* builtin) override; + // Returns true if the given long vector type is correctly parameterized. + // Otherwise emits an error and returns false. + template + bool isValidLongVectorElseError(const TSourceLoc& loc, const TTYPE& type) { + assert(type.isLongVector()); + const TTypeParameters* typeParams = type.getTypeParameters(); + if (typeParams == nullptr) { + error(loc, "vector type missing type parameters", "", ""); + return false; + } + const auto basicType = typeParams->basicType; + if (!isTypeInt(basicType) && !isTypeFloat(basicType) && basicType != EbtBool) { + error(loc, "invalid element type for vector", TType::getBasicString(typeParams->basicType), ""); + return false; + } + if (typeParams->arraySizes == nullptr) { + error(loc, "vector type missing element count", "", ""); + return false; + } + if (typeParams->arraySizes->getNumDims() != 1) { + error(loc, "vector type requires exactly 1 element count", "", ""); + return false; + } + return true; + } + public: // // Generally, bison productions, the scanner, and the PP need read/write access to these; just give them direct access @@ -548,6 +585,7 @@ protected: TString currentCaller; // name of last function body entered (not valid when at global scope) int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point bool anyIndexLimits; + bool khrDerivativeLayoutQualifierSpecified; TIdSetType inductiveLoopIds; TVector needsIndexLimitationChecking; TStructRecord matrixFixRecord; diff --git a/src/libraries/glslang/glslang/MachineIndependent/PoolAlloc.cpp b/src/libraries/glslang/glslang/MachineIndependent/PoolAlloc.cpp index 93a3b0d12..1ac9fbb28 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/PoolAlloc.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/PoolAlloc.cpp @@ -148,7 +148,7 @@ void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) co #endif { #ifdef GUARD_BLOCKS - for (size_t x = 0; x < guardBlockSize; x++) { + for (size_t x = 0; x < guardBlockSize(); x++) { if (blockMem[x] != val) { const int maxSize = 80; char assertMsg[maxSize]; @@ -160,7 +160,7 @@ void TAllocation::checkGuardBlock(unsigned char*, unsigned char, const char*) co } } #else - assert(guardBlockSize == 0); + assert(guardBlockSize() == 0); #endif } diff --git a/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.cpp b/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.cpp index 1d33bfd20..29baf1f1a 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/RemoveTree.cpp @@ -43,7 +43,7 @@ namespace glslang { // Code to recursively delete the intermediate tree. // struct TRemoveTraverser : TIntermTraverser { - TRemoveTraverser() : TIntermTraverser(false, false, true, false) {} + TRemoveTraverser() : TIntermTraverser(false, false, true, false, true) {} virtual void visitSymbol(TIntermSymbol* node) { @@ -103,6 +103,12 @@ struct TRemoveTraverser : TIntermTraverser { return true; } + + virtual bool visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* decl) + { + delete decl; + return true; + } }; // diff --git a/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp b/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp index add93b5a1..665a92e66 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Scan.cpp @@ -769,11 +769,19 @@ const std::unordered_map KeywordMap { {"hitObjectNV",HITOBJECTNV}, {"hitObjectAttributeNV",HITOBJECTATTRNV}, + {"tensorARM",TENSORARM}, + + {"hitObjectEXT",HITOBJECTEXT}, + {"hitObjectAttributeEXT",HITOBJECTATTREXT}, + {"__function",FUNCTION}, {"tensorLayoutNV",TENSORLAYOUTNV}, {"tensorViewNV",TENSORVIEWNV}, {"coopvecNV",COOPVECNV}, + {"vector",VECTOR}, + {"resourceheap",RESOURCEHEAP}, + {"samplerheap",SAMPLERHEAP}, }; const std::unordered_set ReservedSet { "common", @@ -834,12 +842,22 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) loc = ppToken.loc; parserToken->sType.lex.loc = loc; switch (token) { - case ';': afterType = false; afterBuffer = false; return SEMICOLON; - case ',': afterType = false; return COMMA; + case ';': afterType = false; afterBuffer = false; inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return SEMICOLON; + case ',': + // If we just processed a declarator (identifier after a type), this comma + // indicates that we're in a declarator list. Note that 'afterDeclarator' is + // only set when we are not inside a template parameter list, array expression, + // or function parameter list. + if (afterDeclarator) { + inDeclaratorList = true; + } + afterType = false; + afterDeclarator = false; + return COMMA; case ':': return COLON; - case '=': afterType = false; return EQUAL; - case '(': afterType = false; return LEFT_PAREN; - case ')': afterType = false; return RIGHT_PAREN; + case '=': afterType = false; inDeclaratorList = false; afterDeclarator = false; return EQUAL; + case '(': afterType = false; inDeclaratorList = false; afterDeclarator = false; parenDepth++; return LEFT_PAREN; + case ')': afterType = false; inDeclaratorList = false; afterDeclarator = false; if (parenDepth > 0) parenDepth--; return RIGHT_PAREN; case '.': field = true; return DOT; case '!': return BANG; case '-': return DASH; @@ -848,16 +866,16 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case '*': return STAR; case '/': return SLASH; case '%': return PERCENT; - case '<': return LEFT_ANGLE; - case '>': return RIGHT_ANGLE; + case '<': angleBracketDepth++; return LEFT_ANGLE; + case '>': if (angleBracketDepth > 0) angleBracketDepth--; return RIGHT_ANGLE; case '|': return VERTICAL_BAR; case '^': return CARET; case '&': return AMPERSAND; case '?': return QUESTION; - case '[': return LEFT_BRACKET; - case ']': return RIGHT_BRACKET; - case '{': afterStruct = false; afterBuffer = false; return LEFT_BRACE; - case '}': return RIGHT_BRACE; + case '[': squareBracketDepth++; return LEFT_BRACKET; + case ']': if (squareBracketDepth > 0) squareBracketDepth--; return RIGHT_BRACKET; + case '{': afterStruct = false; afterBuffer = false; inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return LEFT_BRACE; + case '}': inDeclaratorList = false; afterDeclarator = false; angleBracketDepth = 0; squareBracketDepth = 0; parenDepth = 0; return RIGHT_BRACE; case '\\': parseContext.error(loc, "illegal use of escape character", "\\", ""); break; @@ -1338,13 +1356,14 @@ int TScanContext::tokenizeIdentifier() case U64VEC2: case U64VEC3: case U64VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64) || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int64)) { + afterType = true; return keyword; + } return identifierOrType(); case INT8_T: @@ -1355,13 +1374,14 @@ int TScanContext::tokenizeIdentifier() case U8VEC2: case U8VEC3: case U8VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_EXT_shader_8bit_storage) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int8)) { + afterType = true; return keyword; + } return identifierOrType(); case INT16_T: @@ -1372,14 +1392,15 @@ int TScanContext::tokenizeIdentifier() case U16VEC2: case U16VEC3: case U16VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_int16) || parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int16)) { + afterType = true; return keyword; + } return identifierOrType(); case INT32_T: case UINT32_T: @@ -1389,23 +1410,25 @@ int TScanContext::tokenizeIdentifier() case U32VEC2: case U32VEC3: case U32VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_int32)) { + afterType = true; return keyword; + } return identifierOrType(); case FLOAT32_T: case F32VEC2: case F32VEC3: case F32VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) { + afterType = true; return keyword; + } return identifierOrType(); case F32MAT2: case F32MAT3: @@ -1419,25 +1442,27 @@ int TScanContext::tokenizeIdentifier() case F32MAT4X2: case F32MAT4X3: case F32MAT4X4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float32)) { + afterType = true; return keyword; + } return identifierOrType(); case FLOAT64_T: case F64VEC2: case F64VEC3: case F64VEC4: - afterType = true; - if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || - (parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) && - parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64)) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) - return keyword; - return identifierOrType(); + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || + (parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) && + parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_fp64)) || + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) { + afterType = true; + return keyword; + } + return identifierOrType(); case F64MAT2: case F64MAT3: case F64MAT4: @@ -1450,26 +1475,27 @@ int TScanContext::tokenizeIdentifier() case F64MAT4X2: case F64MAT4X3: case F64MAT4X4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64)) { + afterType = true; return keyword; + } return identifierOrType(); case FLOAT16_T: case F16VEC2: case F16VEC3: case F16VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || parseContext.extensionTurnedOn(E_GL_EXT_shader_16bit_storage) || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || parseContext.extensionTurnedOn(E_GL_NV_gpu_shader5) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) { + afterType = true; return keyword; - + } return identifierOrType(); case F16MAT2: @@ -1484,12 +1510,13 @@ int TScanContext::tokenizeIdentifier() case F16MAT4X2: case F16MAT4X3: case F16MAT4X4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float) || parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types) || - parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) + parseContext.extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float16)) { + afterType = true; return keyword; + } return identifierOrType(); @@ -1497,10 +1524,11 @@ int TScanContext::tokenizeIdentifier() case BF16VEC2: case BF16VEC3: case BF16VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_EXT_bfloat16)) + parseContext.extensionTurnedOn(E_GL_EXT_bfloat16)) { + afterType = true; return keyword; + } return identifierOrType(); @@ -1508,10 +1536,11 @@ int TScanContext::tokenizeIdentifier() case FE5M2VEC2: case FE5M2VEC3: case FE5M2VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_EXT_float_e5m2)) + parseContext.extensionTurnedOn(E_GL_EXT_float_e5m2)) { + afterType = true; return keyword; + } return identifierOrType(); @@ -1519,10 +1548,11 @@ int TScanContext::tokenizeIdentifier() case FE4M3VEC2: case FE4M3VEC3: case FE4M3VEC4: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_EXT_float_e4m3)) + parseContext.extensionTurnedOn(E_GL_EXT_float_e4m3)) { + afterType = true; return keyword; + } return identifierOrType(); @@ -1791,10 +1821,11 @@ int TScanContext::tokenizeIdentifier() case F16SUBPASSINPUT: case F16SUBPASSINPUTMS: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch)) + parseContext.extensionTurnedOn(E_GL_AMD_gpu_shader_half_float_fetch)) { + afterType = true; return keyword; + } return identifierOrType(); case EXPLICITINTERPAMD: @@ -1843,32 +1874,51 @@ int TScanContext::tokenizeIdentifier() return identifierOrType(); case FCOOPMATNV: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix)) + parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix)) { + afterType = true; return keyword; + } return identifierOrType(); case UCOOPMATNV: case ICOOPMATNV: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix)) + parseContext.extensionTurnedOn(E_GL_NV_integer_cooperative_matrix)) { + afterType = true; return keyword; + } + return identifierOrType(); + case TENSORARM: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_ARM_tensors)) { + afterType = true; + return keyword; + } return identifierOrType(); case COOPMAT: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix)) + parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix)) { + afterType = true; return keyword; + } return identifierOrType(); case COOPVECNV: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_NV_cooperative_vector)) + parseContext.extensionTurnedOn(E_GL_NV_cooperative_vector)) { + afterType = true; return keyword; + } + return identifierOrType(); + + case VECTOR: + if (parseContext.symbolTable.atBuiltInLevel() || + parseContext.extensionTurnedOn(E_GL_EXT_long_vector)) { + afterType = true; + return keyword; + } return identifierOrType(); case DEMOTE: @@ -1899,6 +1949,13 @@ int TScanContext::tokenizeIdentifier() return keyword; return identifierOrType(); + case HITOBJECTEXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + case HITOBJECTATTRNV: if (parseContext.symbolTable.atBuiltInLevel() || (!parseContext.isEsProfile() && parseContext.version >= 460 @@ -1906,12 +1963,27 @@ int TScanContext::tokenizeIdentifier() return keyword; return identifierOrType(); + case HITOBJECTATTREXT: + if (parseContext.symbolTable.atBuiltInLevel() || + (!parseContext.isEsProfile() && parseContext.version >= 460 + && parseContext.extensionTurnedOn(E_GL_EXT_shader_invocation_reorder))) + return keyword; + return identifierOrType(); + case FUNCTION: case TENSORLAYOUTNV: case TENSORVIEWNV: - afterType = true; if (parseContext.symbolTable.atBuiltInLevel() || - parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix2)) + parseContext.extensionTurnedOn(E_GL_NV_cooperative_matrix2)) { + afterType = true; + return keyword; + } + return identifierOrType(); + + case RESOURCEHEAP: + case SAMPLERHEAP: + if (parseContext.extensionTurnedOn(E_GL_EXT_structured_descriptor_heap) && + parseContext.extensionTurnedOn(E_GL_EXT_descriptor_heap)) return keyword; return identifierOrType(); @@ -1927,14 +1999,29 @@ int TScanContext::identifierOrType() if (field) return IDENTIFIER; + // If we see an identifier right after a type, this might be a declarator. + // But not in template parameters (inside angle brackets), array expressions (inside square brackets), + // or function parameters (inside parentheses) + if (afterType && angleBracketDepth == 0 && squareBracketDepth == 0 && parenDepth == 0) { + afterDeclarator = true; + afterType = false; + return IDENTIFIER; + } + parserToken->sType.lex.symbol = parseContext.symbolTable.find(*parserToken->sType.lex.string); if ((afterType == false && afterStruct == false) && parserToken->sType.lex.symbol != nullptr) { if (const TVariable* variable = parserToken->sType.lex.symbol->getAsVariable()) { if (variable->isUserType() && // treat redeclaration of forward-declared buffer/uniform reference as an identifier !(variable->getType().isReference() && afterBuffer)) { - afterType = true; + // If we're in a declarator list (like "float a, B;"), treat struct names as IDENTIFIER + // to fix GitHub issue #3931 + if (inDeclaratorList) { + return IDENTIFIER; + } + + afterType = true; return TYPE_NAME; } } diff --git a/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h b/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h index 74b2b3c74..ce2145eb9 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h +++ b/src/libraries/glslang/glslang/MachineIndependent/ScanContext.h @@ -53,7 +53,7 @@ public: explicit TScanContext(TParseContextBase& pc) : parseContext(pc), afterType(false), afterStruct(false), - field(false), afterBuffer(false) { } + field(false), afterBuffer(false), inDeclaratorList(false), afterDeclarator(false), angleBracketDepth(0), squareBracketDepth(0), parenDepth(0) { } virtual ~TScanContext() { } static void fillInKeywordMap(); @@ -82,6 +82,11 @@ protected: bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier bool field; // true if we're on a field, right after a '.' bool afterBuffer; // true if we've recognized the BUFFER keyword + bool inDeclaratorList; // true if we detected we're in a declarator list like "float a, b;" + bool afterDeclarator; // true if we just saw an identifier after a type (potential declarator) + int angleBracketDepth; // track nesting level of < > to detect template parameters + int squareBracketDepth; // track nesting level of [ ] to detect array expressions + int parenDepth; // track nesting level of ( ) to detect function parameters TSourceLoc loc; TParserToken* parserToken; TPpToken* ppToken; diff --git a/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp b/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp index 45edc5e4c..bc4b7234a 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp @@ -1855,6 +1855,7 @@ void TShader::setUniformLocationBase(int base) { intermediate->setUniformLocationBase(base); } +void TShader::setBindingsPerResourceType() { intermediate->setBindingsPerResourceType(); } void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); } void TShader::setResourceSetBinding(const std::vector& base) { intermediate->setResourceSetBinding(base); } void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); } diff --git a/src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp index 1d08797ac..9cb043aad 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp @@ -63,13 +63,13 @@ TSpirvRequirement* TParseContext::makeSpirvRequirement(const TSourceLoc& loc, co if (name == "extensions") { assert(extensions); - for (auto extension : extensions->getSequence()) { + for (const auto& extension : extensions->getSequence()) { assert(extension->getAsConstantUnion()); spirvReq->extensions.insert(*extension->getAsConstantUnion()->getConstArray()[0].getSConst()); } } else if (name == "capabilities") { assert(capabilities); - for (auto capability : capabilities->getSequence()) { + for (const auto& capability : capabilities->getSequence()) { assert(capability->getAsConstantUnion()); spirvReq->capabilities.insert(capability->getAsConstantUnion()->getConstArray()[0].getIConst()); } @@ -105,10 +105,10 @@ void TIntermediate::insertSpirvRequirement(const TSpirvRequirement* spirvReq) if (!spirvRequirement) spirvRequirement = new TSpirvRequirement; - for (auto extension : spirvReq->extensions) + for (const auto& extension : spirvReq->extensions) spirvRequirement->extensions.insert(extension); - for (auto capability : spirvReq->capabilities) + for (const auto& capability : spirvReq->capabilities) spirvRequirement->capabilities.insert(capability); } @@ -122,7 +122,7 @@ void TIntermediate::insertSpirvExecutionMode(int executionMode, const TIntermAgg TVector extraOperands; if (args) { - for (auto arg : args->getSequence()) { + for (const auto& arg : args->getSequence()) { auto extraOperand = arg->getAsConstantUnion(); assert(extraOperand != nullptr); extraOperands.push_back(extraOperand); @@ -139,7 +139,7 @@ void TIntermediate::insertSpirvExecutionModeId(int executionMode, const TIntermA assert(args); TVector extraOperands; - for (auto arg : args->getSequence()) { + for (const auto& arg : args->getSequence()) { auto extraOperand = arg->getAsTyped(); assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant()); extraOperands.push_back(extraOperand); @@ -157,7 +157,7 @@ void TQualifier::setSpirvDecorate(int decoration, const TIntermAggregate* args) TVector extraOperands; if (args) { - for (auto arg : args->getSequence()) { + for (const auto& arg : args->getSequence()) { auto extraOperand = arg->getAsConstantUnion(); assert(extraOperand != nullptr); extraOperands.push_back(extraOperand); @@ -173,7 +173,7 @@ void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args assert(args); TVector extraOperands; - for (auto arg : args->getSequence()) { + for (const auto& arg : args->getSequence()) { auto extraOperand = arg->getAsTyped(); assert(extraOperand != nullptr); extraOperands.push_back(extraOperand); @@ -188,7 +188,7 @@ void TQualifier::setSpirvDecorateString(int decoration, const TIntermAggregate* assert(args); TVector extraOperands; - for (auto arg : args->getSequence()) { + for (const auto& arg : args->getSequence()) { auto extraOperand = arg->getAsConstantUnion(); assert(extraOperand != nullptr); extraOperands.push_back(extraOperand); @@ -234,30 +234,30 @@ TString TQualifier::getSpirvDecorateQualifierString() const } }; - for (auto& decorate : spirvDecorate->decorates) { + for (const auto& decorate : spirvDecorate->decorates) { appendStr("spirv_decorate("); appendInt(decorate.first); - for (auto extraOperand : decorate.second) { + for (const auto& extraOperand : decorate.second) { appendStr(", "); appendDecorate(extraOperand); } appendStr(") "); } - for (auto& decorateId : spirvDecorate->decorateIds) { + for (const auto& decorateId : spirvDecorate->decorateIds) { appendStr("spirv_decorate_id("); appendInt(decorateId.first); - for (auto extraOperand : decorateId.second) { + for (const auto& extraOperand : decorateId.second) { appendStr(", "); appendDecorate(extraOperand); } appendStr(") "); } - for (auto& decorateString : spirvDecorate->decorateStrings) { + for (const auto& decorateString : spirvDecorate->decorateStrings) { appendStr("spirv_decorate_string("); appendInt(decorateString.first); - for (auto extraOperand : decorateString.second) { + for (const auto& extraOperand : decorateString.second) { appendStr(", "); appendDecorate(extraOperand); } diff --git a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp index cda3ee07a..fd8a690f2 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp @@ -55,7 +55,9 @@ namespace glslang { // void TType::buildMangledName(TString& mangledName) const { - if (isMatrix()) + if (isTensorARM()) + mangledName += 'T'; + else if (isMatrix()) mangledName += 'm'; else if (isVector()) mangledName += 'v'; @@ -84,6 +86,7 @@ void TType::buildMangledName(TString& mangledName) const case EbtRayQuery: mangledName += "rq"; break; case EbtSpirvType: mangledName += "spv-t"; break; case EbtHitObjectNV: mangledName += "ho"; break; + case EbtHitObjectEXT: mangledName += "ho"; break; case EbtTensorLayoutNV: mangledName += "tl"; break; case EbtTensorViewNV: mangledName += "tv"; break; case EbtSampler: @@ -344,6 +347,24 @@ void TSymbolTableLevel::setFunctionExtensions(const char* name, int num, const c } } +// Call the callback function to determine the required extensions +void TSymbolTableLevel::setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func) +{ + tLevel::const_iterator candidate = level.lower_bound(name); + while (candidate != level.end()) { + const TString& candidateName = (*candidate).first; + TString::size_type parenAt = candidateName.find_first_of('('); + if (parenAt != candidateName.npos && candidateName.compare(0, parenAt, name) == 0) { + TSymbol* symbol = candidate->second; + + auto exts = func(candidateName.c_str()); + symbol->setExtensions(exts.size(), exts.data()); + } else + break; + ++candidate; + } +} + // Make a single function require an extension(s). i.e., this will only set the extensions for the symbol that matches 'name' exactly. // This is different from setFunctionExtensions, which uses std::map::lower_bound to effectively set all symbols that start with 'name'. // Should only be used for a version/profile that actually needs the extension(s). @@ -423,6 +444,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf) defined = copyOf.defined; prototyped = copyOf.prototyped; implicitThis = copyOf.implicitThis; + variadic = copyOf.variadic; illegalImplicitThis = copyOf.illegalImplicitThis; defaultParamCount = copyOf.defaultParamCount; spirvInst = copyOf.spirvInst; diff --git a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h index 6d1a0c8e2..916192749 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h +++ b/src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h @@ -69,6 +69,9 @@ #include "../Include/intermediate.h" #include "../Include/InfoSink.h" +#include +#include + namespace glslang { // @@ -232,6 +235,13 @@ struct TParameter { name = nullptr; type = param.type->clone(); defaultValue = param.defaultValue; + if (defaultValue) { + // The defaultValue of a builtin is created in a TPoolAllocator that no longer exists + // when parsing the user program, so make a deep copy. + if (const auto *constUnion = defaultValue->getAsConstantUnion()) { + defaultValue = new TIntermConstantUnion(*constUnion->getConstArray().clone(), constUnion->getType()); + } + } return *this; } TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; } @@ -245,12 +255,12 @@ public: explicit TFunction(TOperator o) : TSymbol(nullptr), op(o), - defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0) { } + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0) { } TFunction(const TString *name, const TType& retType, TOperator tOp = EOpNull) : TSymbol(name), mangledName(*name + '('), op(tOp), - defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), defaultParamCount(0), + defined(false), prototyped(false), implicitThis(false), illegalImplicitThis(false), variadic(false), defaultParamCount(0), linkType(ELinkNone) { returnType.shallowCopy(retType); @@ -268,6 +278,7 @@ public: virtual void addParameter(TParameter& p) { assert(writable); + assert(!variadic && "cannot add more parameters if function is marked variadic"); parameters.push_back(p); p.type->appendMangledName(mangledName); @@ -310,6 +321,13 @@ public: virtual bool hasImplicitThis() const { return implicitThis; } virtual void setIllegalImplicitThis() { assert(writable); illegalImplicitThis = true; } virtual bool hasIllegalImplicitThis() const { return illegalImplicitThis; } + virtual void setVariadic() { + assert(writable); + assert(!variadic && "function was already marked variadic"); + variadic = true; + mangledName += 'z'; + } + virtual bool isVariadic() const { return variadic; } // Return total number of parameters virtual int getParamCount() const { return static_cast(parameters.size()); } @@ -352,6 +370,7 @@ protected: // even if it finds member variables in the symbol table. // This is important for a static member function that has member variables in scope, // but is not allowed to use them, or see hidden symbols instead. + bool variadic; int defaultParamCount; TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers @@ -487,6 +506,11 @@ public: retargetedSymbols.push_back({from, to}); } + void collectRetargetedSymbols(std::unordered_multimap &out) const { + for (const auto &[fromName, toName] : retargetedSymbols) + out.insert({std::string{toName}, std::string{fromName}}); + } + TSymbol* find(const TString& name) const { tLevel::const_iterator it = level.find(name); @@ -580,6 +604,7 @@ public: void relateToOperator(const char* name, TOperator op); void setFunctionExtensions(const char* name, int num, const char* const extensions[]); + void setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func); void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]); void dump(TInfoSink& infoSink, bool complete = false) const; TSymbolTableLevel* clone() const; @@ -643,9 +668,10 @@ public: // protected: static const uint32_t LevelFlagBitOffset = 56; - static const int globalLevel = 3; + static constexpr int builtinLevel = 2; + static constexpr int globalLevel = 3; static bool isSharedLevel(int level) { return level <= 1; } // exclude all per-compile levels - static bool isBuiltInLevel(int level) { return level <= 2; } // exclude user globals + static bool isBuiltInLevel(int level) { return level <= builtinLevel; } // exclude user globals static bool isGlobalLevel(int level) { return level <= globalLevel; } // include user globals public: bool isEmpty() { return table.size() == 0; } @@ -810,6 +836,13 @@ public: table[level]->retargetSymbol(from, to); } + std::unordered_multimap collectBuiltinAlias() { + std::unordered_multimap allRetargets; + for (int level = 0; level <= std::min(currentLevel(), builtinLevel); ++level) + table[level]->collectRetargetedSymbols(allRetargets); + + return allRetargets; + } // Find of a symbol that returns how many layers deep of nested // structures-with-member-functions ('this' scopes) deep the symbol was @@ -882,6 +915,12 @@ public: table[level]->setFunctionExtensions(name, num, extensions); } + void setFunctionExtensionsCallback(const char* name, std::function(const char *)> const &func) + { + for (unsigned int level = 0; level < table.size(); ++level) + table[level]->setFunctionExtensionsCallback(name, func); + } + void setSingleFunctionExtensions(const char* name, int num, const char* const extensions[]) { for (unsigned int level = 0; level < table.size(); ++level) diff --git a/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp b/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp index 76814fea4..8f29b9eee 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/Versions.cpp @@ -229,6 +229,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_draw_instanced] = EBhDisable; extensionBehavior[E_GL_ARB_bindless_texture] = EBhDisable; extensionBehavior[E_GL_ARB_fragment_coord_conventions] = EBhDisable; + extensionBehavior[E_GL_ARB_conservative_depth] = EBhDisable; extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable; @@ -268,6 +269,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_control_flow_attributes2] = EBhDisable; extensionBehavior[E_GL_EXT_spec_constant_composites] = EBhDisable; + extensionBehavior[E_GL_EXT_abort] = EBhDisable; extensionBehavior[E_GL_KHR_cooperative_matrix] = EBhDisable; extensionBehavior[E_GL_NV_cooperative_vector] = EBhDisable; @@ -304,6 +306,7 @@ void TParseVersions::initializeExtensionBehavior() 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_KHR_compute_shader_derivatives] = EBhDisable; extensionBehavior[E_GL_NV_compute_shader_derivatives] = EBhDisable; extensionBehavior[E_GL_NV_shader_texture_footprint] = EBhDisable; extensionBehavior[E_GL_NV_mesh_shader] = EBhDisable; @@ -316,14 +319,21 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_NV_cooperative_matrix2] = EBhDisable; extensionBehavior[E_GL_NV_cluster_acceleration_structure] = EBhDisable; extensionBehavior[E_GL_NV_linear_swept_spheres] = EBhDisable; + extensionBehavior[E_GL_NV_push_constant_bank] = EBhDisable; + extensionBehavior[E_GL_NV_explicit_typecast] = EBhDisable; // ARM extensionBehavior[E_GL_ARM_shader_core_builtins] = EBhDisable; + extensionBehavior[E_GL_ARM_tensors] = EBhDisable; + extensionBehavior[E_GL_ARM_tensors_bfloat16] = EBhDisable; + extensionBehavior[E_GL_ARM_tensors_float_e5m2] = EBhDisable; + extensionBehavior[E_GL_ARM_tensors_float_e4m3] = EBhDisable; // QCOM extensionBehavior[E_GL_QCOM_image_processing] = EBhDisable; extensionBehavior[E_GL_QCOM_image_processing2] = EBhDisable; extensionBehavior[E_GL_QCOM_tile_shading] = EBhDisable; + extensionBehavior[E_GL_QCOM_cooperative_matrix_conversion] = EBhDisable; // AEP extensionBehavior[E_GL_ANDROID_extension_pack_es31a] = EBhDisable; @@ -342,6 +352,7 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_texture_buffer] = EBhDisable; extensionBehavior[E_GL_EXT_texture_cube_map_array] = EBhDisable; extensionBehavior[E_GL_EXT_null_initializer] = EBhDisable; + extensionBehavior[E_GL_EXT_descriptor_heap] = EBhDisable; // OES matching AEP extensionBehavior[E_GL_OES_geometry_shader] = EBhDisable; @@ -383,6 +394,10 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_bfloat16] = EBhDisable; extensionBehavior[E_GL_EXT_float_e4m3] = EBhDisable; extensionBehavior[E_GL_EXT_float_e5m2] = EBhDisable; + extensionBehavior[E_GL_EXT_uniform_buffer_unsized_array] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_64bit_indexing] = EBhDisable; + extensionBehavior[E_GL_EXT_conservative_depth] = EBhDisable; + extensionBehavior[E_GL_EXT_long_vector] = EBhDisable; // OVR extensions extensionBehavior[E_GL_OVR_multiview] = EBhDisable; @@ -408,6 +423,8 @@ void TParseVersions::initializeExtensionBehavior() extensionBehavior[E_GL_EXT_integer_dot_product] = EBhDisable; + extensionBehavior[E_GL_EXT_shader_invocation_reorder] = EBhDisable; + // Record extensions not for spv. spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture); } @@ -429,6 +446,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_texture_lod 1\n" "#define GL_EXT_shadow_samplers 1\n" "#define GL_EXT_fragment_shading_rate 1\n" + "#define GL_EXT_conservative_depth 1\n" // AEP "#define GL_ANDROID_extension_pack_es31a 1\n" @@ -448,6 +466,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shader_implicit_conversions 1\n" "#define GL_EXT_shader_integer_mix 1\n" "#define GL_EXT_blend_func_extended 1\n" + "#define GL_EXT_descriptor_heap 1\n" // OES matching AEP "#define GL_OES_geometry_shader 1\n" @@ -464,6 +483,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_QCOM_image_processing 1\n" "#define GL_QCOM_image_processing2 1\n" "#define GL_QCOM_tile_shading 1\n" + "#define GL_QCOM_cooperative_matrix_conversion 1\n" ; if (version >= 300) { @@ -517,6 +537,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_gpu_shader5 1\n" "#define GL_ARB_draw_instanced 1\n" "#define GL_ARB_fragment_coord_conventions 1\n" + "#define GL_ARB_conservative_depth 1\n" "#define GL_EXT_shader_non_constant_global_initializers 1\n" "#define GL_EXT_shader_image_load_formatted 1\n" @@ -537,6 +558,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_shared_memory_block 1\n" "#define GL_EXT_shader_integer_mix 1\n" "#define GL_EXT_spec_constant_composites 1\n" + "#define GL_EXT_abort 1\n" // GL_KHR_shader_subgroup "#define GL_KHR_shader_subgroup_basic 1\n" @@ -584,6 +606,7 @@ void TParseVersions::getPreamble(std::string& preamble) "#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_KHR_compute_shader_derivatives 1\n" "#define GL_NV_compute_shader_derivatives 1\n" "#define GL_NV_shader_texture_footprint 1\n" "#define GL_NV_mesh_shader 1\n" @@ -591,10 +614,12 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_NV_integer_cooperative_matrix 1\n" "#define GL_NV_shader_invocation_reorder 1\n" "#define GL_NV_cooperative_matrix2 1\n" + "#define GL_NV_explicit_typecast 1\n" "#define GL_QCOM_image_processing 1\n" "#define GL_QCOM_image_processing2 1\n" "#define GL_QCOM_tile_shading 1\n" + "#define GL_QCOM_cooperative_matrix_conversion 1\n" "#define GL_EXT_shader_explicit_arithmetic_types 1\n" "#define GL_EXT_shader_explicit_arithmetic_types_int8 1\n" @@ -623,6 +648,11 @@ void TParseVersions::getPreamble(std::string& preamble) "#define GL_EXT_bfloat16 1\n" "#define GL_EXT_float_e5m2 1\n" "#define GL_EXT_float_e4m3 1\n" + "#define GL_EXT_uniform_buffer_unsized_array 1\n" + "#define GL_EXT_shader_64bit_indexing 1\n" + + "#define GL_EXT_shader_invocation_reorder 1\n" + "#define GL_EXT_descriptor_heap 1\n" ; if (spvVersion.spv == 0) { @@ -644,6 +674,20 @@ void TParseVersions::getPreamble(std::string& preamble) if (version >= 130) { preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n"; } + + if (version >= 460) { + preamble += + "#define GL_ARM_tensors 1\n" + "#define GL_ARM_tensors_bfloat16 1\n" + "#define GL_ARM_tensors_float_e5m2 1\n" + "#define GL_ARM_tensors_float_e4m3 1\n" + ; + } + } + + if ((!isEsProfile() && version >= 460) || + (isEsProfile() && version >= 320)) { + preamble += "#define GL_EXT_nontemporal_keyword 1\n"; } if ((!isEsProfile() && version >= 140) || @@ -712,8 +756,8 @@ void TParseVersions::getPreamble(std::string& preamble) case EShLangClosestHit: preamble += "#define GL_CLOSEST_HIT_SHADER_EXT 1 \n"; break; case EShLangMiss: preamble += "#define GL_MISS_SHADER_EXT 1 \n"; break; case EShLangCallable: preamble += "#define GL_CALLABLE_SHADER_EXT 1 \n"; break; - case EShLangTask: preamble += "#define GL_TASK_SHADER_NV 1 \n"; break; - case EShLangMesh: preamble += "#define GL_MESH_SHADER_NV 1 \n"; break; + case EShLangTask: preamble += "#define GL_TASK_SHADER_EXT 1 \n"; break; + case EShLangMesh: preamble += "#define GL_MESH_SHADER_EXT 1 \n"; break; default: break; } } @@ -1463,6 +1507,14 @@ void TParseVersions::coopmatCheck(const TSourceLoc& loc, const char* op, bool bu } } +void TParseVersions::coopmatConverisonCheckQCOM(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_KHR_cooperative_matrix}; + requireExtensions(loc, sizeof(extensions) / sizeof(extensions[0]), extensions, op); + } +} + void TParseVersions::tensorLayoutViewCheck(const TSourceLoc& loc, const char* op, bool builtIn) { if (!builtIn) { @@ -1487,6 +1539,22 @@ void TParseVersions::intattachmentCheck(const TSourceLoc& loc, const char* op, b } } +void TParseVersions::tensorCheckARM(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_ARM_tensors}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + +void TParseVersions::longVectorCheck(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (!builtIn) { + const char* const extensions[] = {E_GL_EXT_long_vector}; + requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op); + } +} + // Call for any operation removed because SPIR-V is in use. void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op) { diff --git a/src/libraries/glslang/glslang/MachineIndependent/Versions.h b/src/libraries/glslang/glslang/MachineIndependent/Versions.h index fb72e9783..bccc55ab8 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/Versions.h +++ b/src/libraries/glslang/glslang/MachineIndependent/Versions.h @@ -165,6 +165,7 @@ const char* const E_GL_ARB_vertex_attrib_64bit = "GL_ARB_vertex_attrib_ const char* const E_GL_ARB_draw_instanced = "GL_ARB_draw_instanced"; const char* const E_GL_ARB_fragment_coord_conventions = "GL_ARB_fragment_coord_conventions"; const char* const E_GL_ARB_bindless_texture = "GL_ARB_bindless_texture"; +const char* const E_GL_ARB_conservative_depth = "GL_ARB_conservative_depth"; 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"; @@ -185,6 +186,7 @@ const char* const E_GL_EXT_shader_image_load_formatted = "GL_EXT_shader_image_lo const char* const E_GL_EXT_shader_16bit_storage = "GL_EXT_shader_16bit_storage"; const char* const E_GL_EXT_shader_8bit_storage = "GL_EXT_shader_8bit_storage"; +const char* const E_GL_EXT_abort = "GL_EXT_abort"; // EXT extensions @@ -226,6 +228,10 @@ const char* const E_GL_EXT_control_flow_attributes2 = "GL_EXT_control_fl const char* const E_GL_EXT_spec_constant_composites = "GL_EXT_spec_constant_composites"; const char* const E_GL_EXT_texture_offset_non_const = "GL_EXT_texture_offset_non_const"; const char* const E_GL_EXT_nontemporal_keyword = "GL_EXT_nontemporal_keyword"; +const char* const E_GL_EXT_uniform_buffer_unsized_array = "GL_EXT_uniform_buffer_unsized_array"; +const char* const E_GL_EXT_conservative_depth = "GL_EXT_conservative_depth"; +const char* const E_GL_EXT_descriptor_heap = "GL_EXT_descriptor_heap"; +const char* const E_GL_EXT_structured_descriptor_heap = "GL_EXT_structured_descriptor_heap"; // Arrays of extensions for the above viewportEXTs duplications @@ -275,6 +281,7 @@ const char* const E_GL_NV_shading_rate_image = "GL_NV_shading 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_KHR_compute_shader_derivatives = "GL_KHR_compute_shader_derivatives"; 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"; const char* const E_GL_NV_mesh_shader = "GL_NV_mesh_shader"; @@ -290,9 +297,15 @@ const char* const E_GL_NV_cooperative_vector = "GL_NV_coopera const char* const E_GL_NV_cluster_acceleration_structure = "GL_NV_cluster_acceleration_structure"; const char* const E_GL_NV_linear_swept_spheres = "GL_NV_linear_swept_spheres"; const char* const E_GL_NV_gpu_shader5 = "GL_NV_gpu_shader5"; +const char* const E_GL_NV_push_constant_bank = "GL_NV_push_constant_bank"; +const char* const E_GL_NV_explicit_typecast = "GL_NV_explicit_typecast"; // ARM const char* const E_GL_ARM_shader_core_builtins = "GL_ARM_shader_core_builtins"; +const char* const E_GL_ARM_tensors = "GL_ARM_tensors"; +const char* const E_GL_ARM_tensors_bfloat16 = "GL_ARM_tensors_bfloat16"; +const char* const E_GL_ARM_tensors_float_e5m2 = "GL_ARM_tensors_float_e5m2"; +const char* const E_GL_ARM_tensors_float_e4m3 = "GL_ARM_tensors_float_e4m3"; // Arrays of extensions for the above viewportEXTs duplications @@ -303,6 +316,7 @@ const int Num_viewportEXTs = sizeof(viewportEXTs) / sizeof(viewportEXTs[0]); const char* const E_GL_QCOM_image_processing = "GL_QCOM_image_processing"; const char* const E_GL_QCOM_image_processing2 = "GL_QCOM_image_processing2"; const char* const E_GL_QCOM_tile_shading = "GL_QCOM_tile_shading"; +const char* const E_GL_QCOM_cooperative_matrix_conversion = "GL_QCOM_cooperative_matrix_conversion"; // AEP const char* const E_GL_ANDROID_extension_pack_es31a = "GL_ANDROID_extension_pack_es31a"; @@ -361,6 +375,11 @@ const char* const E_GL_EXT_integer_dot_product = "GL_EXT_inte const char* const E_GL_EXT_bfloat16 = "GL_EXT_bfloat16"; const char* const E_GL_EXT_float_e5m2 = "GL_EXT_float_e5m2"; const char* const E_GL_EXT_float_e4m3 = "GL_EXT_float_e4m3"; +const char* const E_GL_EXT_long_vector = "GL_EXT_long_vector"; + +const char* const E_GL_EXT_shader_64bit_indexing = "GL_EXT_shader_64bit_indexing"; + +const char* const E_GL_EXT_shader_invocation_reorder = "GL_EXT_shader_invocation_reorder"; // Arrays of extensions for the above AEP duplications diff --git a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp index 8d7d46c9e..8b56f4d01 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp @@ -301,440 +301,450 @@ enum yysymbol_kind_t YYSYMBOL_UCOOPMATNV = 177, /* UCOOPMATNV */ YYSYMBOL_COOPMAT = 178, /* COOPMAT */ YYSYMBOL_COOPVECNV = 179, /* COOPVECNV */ - YYSYMBOL_HITOBJECTNV = 180, /* HITOBJECTNV */ - YYSYMBOL_HITOBJECTATTRNV = 181, /* HITOBJECTATTRNV */ - YYSYMBOL_TENSORLAYOUTNV = 182, /* TENSORLAYOUTNV */ - YYSYMBOL_TENSORVIEWNV = 183, /* TENSORVIEWNV */ - YYSYMBOL_SAMPLERCUBEARRAY = 184, /* SAMPLERCUBEARRAY */ - YYSYMBOL_SAMPLERCUBEARRAYSHADOW = 185, /* SAMPLERCUBEARRAYSHADOW */ - YYSYMBOL_ISAMPLERCUBEARRAY = 186, /* ISAMPLERCUBEARRAY */ - YYSYMBOL_USAMPLERCUBEARRAY = 187, /* USAMPLERCUBEARRAY */ - YYSYMBOL_SAMPLER1D = 188, /* SAMPLER1D */ - YYSYMBOL_SAMPLER1DARRAY = 189, /* SAMPLER1DARRAY */ - YYSYMBOL_SAMPLER1DARRAYSHADOW = 190, /* SAMPLER1DARRAYSHADOW */ - YYSYMBOL_ISAMPLER1D = 191, /* ISAMPLER1D */ - YYSYMBOL_SAMPLER1DSHADOW = 192, /* SAMPLER1DSHADOW */ - YYSYMBOL_SAMPLER2DRECT = 193, /* SAMPLER2DRECT */ - YYSYMBOL_SAMPLER2DRECTSHADOW = 194, /* SAMPLER2DRECTSHADOW */ - YYSYMBOL_ISAMPLER2DRECT = 195, /* ISAMPLER2DRECT */ - YYSYMBOL_USAMPLER2DRECT = 196, /* USAMPLER2DRECT */ - YYSYMBOL_SAMPLERBUFFER = 197, /* SAMPLERBUFFER */ - YYSYMBOL_ISAMPLERBUFFER = 198, /* ISAMPLERBUFFER */ - YYSYMBOL_USAMPLERBUFFER = 199, /* USAMPLERBUFFER */ - YYSYMBOL_SAMPLER2DMS = 200, /* SAMPLER2DMS */ - YYSYMBOL_ISAMPLER2DMS = 201, /* ISAMPLER2DMS */ - YYSYMBOL_USAMPLER2DMS = 202, /* USAMPLER2DMS */ - YYSYMBOL_SAMPLER2DMSARRAY = 203, /* SAMPLER2DMSARRAY */ - YYSYMBOL_ISAMPLER2DMSARRAY = 204, /* ISAMPLER2DMSARRAY */ - YYSYMBOL_USAMPLER2DMSARRAY = 205, /* USAMPLER2DMSARRAY */ - YYSYMBOL_SAMPLEREXTERNALOES = 206, /* SAMPLEREXTERNALOES */ - YYSYMBOL_SAMPLEREXTERNAL2DY2YEXT = 207, /* SAMPLEREXTERNAL2DY2YEXT */ - YYSYMBOL_ISAMPLER1DARRAY = 208, /* ISAMPLER1DARRAY */ - YYSYMBOL_USAMPLER1D = 209, /* USAMPLER1D */ - YYSYMBOL_USAMPLER1DARRAY = 210, /* USAMPLER1DARRAY */ - YYSYMBOL_F16SAMPLER1D = 211, /* F16SAMPLER1D */ - YYSYMBOL_F16SAMPLER2D = 212, /* F16SAMPLER2D */ - YYSYMBOL_F16SAMPLER3D = 213, /* F16SAMPLER3D */ - YYSYMBOL_F16SAMPLER2DRECT = 214, /* F16SAMPLER2DRECT */ - YYSYMBOL_F16SAMPLERCUBE = 215, /* F16SAMPLERCUBE */ - YYSYMBOL_F16SAMPLER1DARRAY = 216, /* F16SAMPLER1DARRAY */ - YYSYMBOL_F16SAMPLER2DARRAY = 217, /* F16SAMPLER2DARRAY */ - YYSYMBOL_F16SAMPLERCUBEARRAY = 218, /* F16SAMPLERCUBEARRAY */ - YYSYMBOL_F16SAMPLERBUFFER = 219, /* F16SAMPLERBUFFER */ - YYSYMBOL_F16SAMPLER2DMS = 220, /* F16SAMPLER2DMS */ - YYSYMBOL_F16SAMPLER2DMSARRAY = 221, /* F16SAMPLER2DMSARRAY */ - YYSYMBOL_F16SAMPLER1DSHADOW = 222, /* F16SAMPLER1DSHADOW */ - YYSYMBOL_F16SAMPLER2DSHADOW = 223, /* F16SAMPLER2DSHADOW */ - YYSYMBOL_F16SAMPLER1DARRAYSHADOW = 224, /* F16SAMPLER1DARRAYSHADOW */ - YYSYMBOL_F16SAMPLER2DARRAYSHADOW = 225, /* F16SAMPLER2DARRAYSHADOW */ - YYSYMBOL_F16SAMPLER2DRECTSHADOW = 226, /* F16SAMPLER2DRECTSHADOW */ - YYSYMBOL_F16SAMPLERCUBESHADOW = 227, /* F16SAMPLERCUBESHADOW */ - YYSYMBOL_F16SAMPLERCUBEARRAYSHADOW = 228, /* F16SAMPLERCUBEARRAYSHADOW */ - YYSYMBOL_IMAGE1D = 229, /* IMAGE1D */ - YYSYMBOL_IIMAGE1D = 230, /* IIMAGE1D */ - YYSYMBOL_UIMAGE1D = 231, /* UIMAGE1D */ - YYSYMBOL_IMAGE2D = 232, /* IMAGE2D */ - YYSYMBOL_IIMAGE2D = 233, /* IIMAGE2D */ - YYSYMBOL_UIMAGE2D = 234, /* UIMAGE2D */ - YYSYMBOL_IMAGE3D = 235, /* IMAGE3D */ - YYSYMBOL_IIMAGE3D = 236, /* IIMAGE3D */ - YYSYMBOL_UIMAGE3D = 237, /* UIMAGE3D */ - YYSYMBOL_IMAGE2DRECT = 238, /* IMAGE2DRECT */ - YYSYMBOL_IIMAGE2DRECT = 239, /* IIMAGE2DRECT */ - YYSYMBOL_UIMAGE2DRECT = 240, /* UIMAGE2DRECT */ - YYSYMBOL_IMAGECUBE = 241, /* IMAGECUBE */ - YYSYMBOL_IIMAGECUBE = 242, /* IIMAGECUBE */ - YYSYMBOL_UIMAGECUBE = 243, /* UIMAGECUBE */ - YYSYMBOL_IMAGEBUFFER = 244, /* IMAGEBUFFER */ - YYSYMBOL_IIMAGEBUFFER = 245, /* IIMAGEBUFFER */ - YYSYMBOL_UIMAGEBUFFER = 246, /* UIMAGEBUFFER */ - YYSYMBOL_IMAGE1DARRAY = 247, /* IMAGE1DARRAY */ - YYSYMBOL_IIMAGE1DARRAY = 248, /* IIMAGE1DARRAY */ - YYSYMBOL_UIMAGE1DARRAY = 249, /* UIMAGE1DARRAY */ - YYSYMBOL_IMAGE2DARRAY = 250, /* IMAGE2DARRAY */ - YYSYMBOL_IIMAGE2DARRAY = 251, /* IIMAGE2DARRAY */ - YYSYMBOL_UIMAGE2DARRAY = 252, /* UIMAGE2DARRAY */ - YYSYMBOL_IMAGECUBEARRAY = 253, /* IMAGECUBEARRAY */ - YYSYMBOL_IIMAGECUBEARRAY = 254, /* IIMAGECUBEARRAY */ - YYSYMBOL_UIMAGECUBEARRAY = 255, /* UIMAGECUBEARRAY */ - YYSYMBOL_IMAGE2DMS = 256, /* IMAGE2DMS */ - YYSYMBOL_IIMAGE2DMS = 257, /* IIMAGE2DMS */ - YYSYMBOL_UIMAGE2DMS = 258, /* UIMAGE2DMS */ - YYSYMBOL_IMAGE2DMSARRAY = 259, /* IMAGE2DMSARRAY */ - YYSYMBOL_IIMAGE2DMSARRAY = 260, /* IIMAGE2DMSARRAY */ - YYSYMBOL_UIMAGE2DMSARRAY = 261, /* UIMAGE2DMSARRAY */ - YYSYMBOL_F16IMAGE1D = 262, /* F16IMAGE1D */ - YYSYMBOL_F16IMAGE2D = 263, /* F16IMAGE2D */ - YYSYMBOL_F16IMAGE3D = 264, /* F16IMAGE3D */ - YYSYMBOL_F16IMAGE2DRECT = 265, /* F16IMAGE2DRECT */ - YYSYMBOL_F16IMAGECUBE = 266, /* F16IMAGECUBE */ - YYSYMBOL_F16IMAGE1DARRAY = 267, /* F16IMAGE1DARRAY */ - YYSYMBOL_F16IMAGE2DARRAY = 268, /* F16IMAGE2DARRAY */ - YYSYMBOL_F16IMAGECUBEARRAY = 269, /* F16IMAGECUBEARRAY */ - YYSYMBOL_F16IMAGEBUFFER = 270, /* F16IMAGEBUFFER */ - YYSYMBOL_F16IMAGE2DMS = 271, /* F16IMAGE2DMS */ - YYSYMBOL_F16IMAGE2DMSARRAY = 272, /* F16IMAGE2DMSARRAY */ - YYSYMBOL_I64IMAGE1D = 273, /* I64IMAGE1D */ - YYSYMBOL_U64IMAGE1D = 274, /* U64IMAGE1D */ - YYSYMBOL_I64IMAGE2D = 275, /* I64IMAGE2D */ - YYSYMBOL_U64IMAGE2D = 276, /* U64IMAGE2D */ - YYSYMBOL_I64IMAGE3D = 277, /* I64IMAGE3D */ - YYSYMBOL_U64IMAGE3D = 278, /* U64IMAGE3D */ - YYSYMBOL_I64IMAGE2DRECT = 279, /* I64IMAGE2DRECT */ - YYSYMBOL_U64IMAGE2DRECT = 280, /* U64IMAGE2DRECT */ - YYSYMBOL_I64IMAGECUBE = 281, /* I64IMAGECUBE */ - YYSYMBOL_U64IMAGECUBE = 282, /* U64IMAGECUBE */ - YYSYMBOL_I64IMAGEBUFFER = 283, /* I64IMAGEBUFFER */ - YYSYMBOL_U64IMAGEBUFFER = 284, /* U64IMAGEBUFFER */ - YYSYMBOL_I64IMAGE1DARRAY = 285, /* I64IMAGE1DARRAY */ - YYSYMBOL_U64IMAGE1DARRAY = 286, /* U64IMAGE1DARRAY */ - YYSYMBOL_I64IMAGE2DARRAY = 287, /* I64IMAGE2DARRAY */ - YYSYMBOL_U64IMAGE2DARRAY = 288, /* U64IMAGE2DARRAY */ - YYSYMBOL_I64IMAGECUBEARRAY = 289, /* I64IMAGECUBEARRAY */ - YYSYMBOL_U64IMAGECUBEARRAY = 290, /* U64IMAGECUBEARRAY */ - YYSYMBOL_I64IMAGE2DMS = 291, /* I64IMAGE2DMS */ - YYSYMBOL_U64IMAGE2DMS = 292, /* U64IMAGE2DMS */ - YYSYMBOL_I64IMAGE2DMSARRAY = 293, /* I64IMAGE2DMSARRAY */ - YYSYMBOL_U64IMAGE2DMSARRAY = 294, /* U64IMAGE2DMSARRAY */ - YYSYMBOL_TEXTURECUBEARRAY = 295, /* TEXTURECUBEARRAY */ - YYSYMBOL_ITEXTURECUBEARRAY = 296, /* ITEXTURECUBEARRAY */ - YYSYMBOL_UTEXTURECUBEARRAY = 297, /* UTEXTURECUBEARRAY */ - YYSYMBOL_TEXTURE1D = 298, /* TEXTURE1D */ - YYSYMBOL_ITEXTURE1D = 299, /* ITEXTURE1D */ - YYSYMBOL_UTEXTURE1D = 300, /* UTEXTURE1D */ - YYSYMBOL_TEXTURE1DARRAY = 301, /* TEXTURE1DARRAY */ - YYSYMBOL_ITEXTURE1DARRAY = 302, /* ITEXTURE1DARRAY */ - YYSYMBOL_UTEXTURE1DARRAY = 303, /* UTEXTURE1DARRAY */ - YYSYMBOL_TEXTURE2DRECT = 304, /* TEXTURE2DRECT */ - YYSYMBOL_ITEXTURE2DRECT = 305, /* ITEXTURE2DRECT */ - YYSYMBOL_UTEXTURE2DRECT = 306, /* UTEXTURE2DRECT */ - YYSYMBOL_TEXTUREBUFFER = 307, /* TEXTUREBUFFER */ - YYSYMBOL_ITEXTUREBUFFER = 308, /* ITEXTUREBUFFER */ - YYSYMBOL_UTEXTUREBUFFER = 309, /* UTEXTUREBUFFER */ - YYSYMBOL_TEXTURE2DMS = 310, /* TEXTURE2DMS */ - YYSYMBOL_ITEXTURE2DMS = 311, /* ITEXTURE2DMS */ - YYSYMBOL_UTEXTURE2DMS = 312, /* UTEXTURE2DMS */ - YYSYMBOL_TEXTURE2DMSARRAY = 313, /* TEXTURE2DMSARRAY */ - YYSYMBOL_ITEXTURE2DMSARRAY = 314, /* ITEXTURE2DMSARRAY */ - YYSYMBOL_UTEXTURE2DMSARRAY = 315, /* UTEXTURE2DMSARRAY */ - YYSYMBOL_F16TEXTURE1D = 316, /* F16TEXTURE1D */ - YYSYMBOL_F16TEXTURE2D = 317, /* F16TEXTURE2D */ - YYSYMBOL_F16TEXTURE3D = 318, /* F16TEXTURE3D */ - YYSYMBOL_F16TEXTURE2DRECT = 319, /* F16TEXTURE2DRECT */ - YYSYMBOL_F16TEXTURECUBE = 320, /* F16TEXTURECUBE */ - YYSYMBOL_F16TEXTURE1DARRAY = 321, /* F16TEXTURE1DARRAY */ - YYSYMBOL_F16TEXTURE2DARRAY = 322, /* F16TEXTURE2DARRAY */ - YYSYMBOL_F16TEXTURECUBEARRAY = 323, /* F16TEXTURECUBEARRAY */ - YYSYMBOL_F16TEXTUREBUFFER = 324, /* F16TEXTUREBUFFER */ - YYSYMBOL_F16TEXTURE2DMS = 325, /* F16TEXTURE2DMS */ - YYSYMBOL_F16TEXTURE2DMSARRAY = 326, /* F16TEXTURE2DMSARRAY */ - YYSYMBOL_SUBPASSINPUT = 327, /* SUBPASSINPUT */ - YYSYMBOL_SUBPASSINPUTMS = 328, /* SUBPASSINPUTMS */ - YYSYMBOL_ISUBPASSINPUT = 329, /* ISUBPASSINPUT */ - YYSYMBOL_ISUBPASSINPUTMS = 330, /* ISUBPASSINPUTMS */ - YYSYMBOL_USUBPASSINPUT = 331, /* USUBPASSINPUT */ - YYSYMBOL_USUBPASSINPUTMS = 332, /* USUBPASSINPUTMS */ - YYSYMBOL_F16SUBPASSINPUT = 333, /* F16SUBPASSINPUT */ - YYSYMBOL_F16SUBPASSINPUTMS = 334, /* F16SUBPASSINPUTMS */ - YYSYMBOL_SPIRV_INSTRUCTION = 335, /* SPIRV_INSTRUCTION */ - YYSYMBOL_SPIRV_EXECUTION_MODE = 336, /* SPIRV_EXECUTION_MODE */ - YYSYMBOL_SPIRV_EXECUTION_MODE_ID = 337, /* SPIRV_EXECUTION_MODE_ID */ - YYSYMBOL_SPIRV_DECORATE = 338, /* SPIRV_DECORATE */ - YYSYMBOL_SPIRV_DECORATE_ID = 339, /* SPIRV_DECORATE_ID */ - YYSYMBOL_SPIRV_DECORATE_STRING = 340, /* SPIRV_DECORATE_STRING */ - YYSYMBOL_SPIRV_TYPE = 341, /* SPIRV_TYPE */ - YYSYMBOL_SPIRV_STORAGE_CLASS = 342, /* SPIRV_STORAGE_CLASS */ - YYSYMBOL_SPIRV_BY_REFERENCE = 343, /* SPIRV_BY_REFERENCE */ - YYSYMBOL_SPIRV_LITERAL = 344, /* SPIRV_LITERAL */ - YYSYMBOL_ATTACHMENTEXT = 345, /* ATTACHMENTEXT */ - YYSYMBOL_IATTACHMENTEXT = 346, /* IATTACHMENTEXT */ - YYSYMBOL_UATTACHMENTEXT = 347, /* UATTACHMENTEXT */ - YYSYMBOL_LEFT_OP = 348, /* LEFT_OP */ - YYSYMBOL_RIGHT_OP = 349, /* RIGHT_OP */ - YYSYMBOL_INC_OP = 350, /* INC_OP */ - YYSYMBOL_DEC_OP = 351, /* DEC_OP */ - YYSYMBOL_LE_OP = 352, /* LE_OP */ - YYSYMBOL_GE_OP = 353, /* GE_OP */ - YYSYMBOL_EQ_OP = 354, /* EQ_OP */ - YYSYMBOL_NE_OP = 355, /* NE_OP */ - YYSYMBOL_AND_OP = 356, /* AND_OP */ - YYSYMBOL_OR_OP = 357, /* OR_OP */ - YYSYMBOL_XOR_OP = 358, /* XOR_OP */ - YYSYMBOL_MUL_ASSIGN = 359, /* MUL_ASSIGN */ - YYSYMBOL_DIV_ASSIGN = 360, /* DIV_ASSIGN */ - YYSYMBOL_ADD_ASSIGN = 361, /* ADD_ASSIGN */ - YYSYMBOL_MOD_ASSIGN = 362, /* MOD_ASSIGN */ - YYSYMBOL_LEFT_ASSIGN = 363, /* LEFT_ASSIGN */ - YYSYMBOL_RIGHT_ASSIGN = 364, /* RIGHT_ASSIGN */ - YYSYMBOL_AND_ASSIGN = 365, /* AND_ASSIGN */ - YYSYMBOL_XOR_ASSIGN = 366, /* XOR_ASSIGN */ - YYSYMBOL_OR_ASSIGN = 367, /* OR_ASSIGN */ - YYSYMBOL_SUB_ASSIGN = 368, /* SUB_ASSIGN */ - YYSYMBOL_STRING_LITERAL = 369, /* STRING_LITERAL */ - YYSYMBOL_LEFT_PAREN = 370, /* LEFT_PAREN */ - YYSYMBOL_RIGHT_PAREN = 371, /* RIGHT_PAREN */ - YYSYMBOL_LEFT_BRACKET = 372, /* LEFT_BRACKET */ - YYSYMBOL_RIGHT_BRACKET = 373, /* RIGHT_BRACKET */ - YYSYMBOL_LEFT_BRACE = 374, /* LEFT_BRACE */ - YYSYMBOL_RIGHT_BRACE = 375, /* RIGHT_BRACE */ - YYSYMBOL_DOT = 376, /* DOT */ - YYSYMBOL_COMMA = 377, /* COMMA */ - YYSYMBOL_COLON = 378, /* COLON */ - YYSYMBOL_EQUAL = 379, /* EQUAL */ - YYSYMBOL_SEMICOLON = 380, /* SEMICOLON */ - YYSYMBOL_BANG = 381, /* BANG */ - YYSYMBOL_DASH = 382, /* DASH */ - YYSYMBOL_TILDE = 383, /* TILDE */ - YYSYMBOL_PLUS = 384, /* PLUS */ - YYSYMBOL_STAR = 385, /* STAR */ - YYSYMBOL_SLASH = 386, /* SLASH */ - YYSYMBOL_PERCENT = 387, /* PERCENT */ - YYSYMBOL_LEFT_ANGLE = 388, /* LEFT_ANGLE */ - YYSYMBOL_RIGHT_ANGLE = 389, /* RIGHT_ANGLE */ - YYSYMBOL_VERTICAL_BAR = 390, /* VERTICAL_BAR */ - YYSYMBOL_CARET = 391, /* CARET */ - YYSYMBOL_AMPERSAND = 392, /* AMPERSAND */ - YYSYMBOL_QUESTION = 393, /* QUESTION */ - YYSYMBOL_INVARIANT = 394, /* INVARIANT */ - YYSYMBOL_HIGH_PRECISION = 395, /* HIGH_PRECISION */ - YYSYMBOL_MEDIUM_PRECISION = 396, /* MEDIUM_PRECISION */ - YYSYMBOL_LOW_PRECISION = 397, /* LOW_PRECISION */ - YYSYMBOL_PRECISION = 398, /* PRECISION */ - YYSYMBOL_PACKED = 399, /* PACKED */ - YYSYMBOL_RESOURCE = 400, /* RESOURCE */ - YYSYMBOL_SUPERP = 401, /* SUPERP */ - YYSYMBOL_FLOATCONSTANT = 402, /* FLOATCONSTANT */ - YYSYMBOL_INTCONSTANT = 403, /* INTCONSTANT */ - YYSYMBOL_UINTCONSTANT = 404, /* UINTCONSTANT */ - YYSYMBOL_BOOLCONSTANT = 405, /* BOOLCONSTANT */ - YYSYMBOL_IDENTIFIER = 406, /* IDENTIFIER */ - YYSYMBOL_TYPE_NAME = 407, /* TYPE_NAME */ - YYSYMBOL_CENTROID = 408, /* CENTROID */ - YYSYMBOL_IN = 409, /* IN */ - YYSYMBOL_OUT = 410, /* OUT */ - YYSYMBOL_INOUT = 411, /* INOUT */ - YYSYMBOL_STRUCT = 412, /* STRUCT */ - YYSYMBOL_VOID = 413, /* VOID */ - YYSYMBOL_WHILE = 414, /* WHILE */ - YYSYMBOL_BREAK = 415, /* BREAK */ - YYSYMBOL_CONTINUE = 416, /* CONTINUE */ - YYSYMBOL_DO = 417, /* DO */ - YYSYMBOL_ELSE = 418, /* ELSE */ - YYSYMBOL_FOR = 419, /* FOR */ - YYSYMBOL_IF = 420, /* IF */ - YYSYMBOL_DISCARD = 421, /* DISCARD */ - YYSYMBOL_RETURN = 422, /* RETURN */ - YYSYMBOL_SWITCH = 423, /* SWITCH */ - YYSYMBOL_CASE = 424, /* CASE */ - YYSYMBOL_DEFAULT = 425, /* DEFAULT */ - YYSYMBOL_TERMINATE_INVOCATION = 426, /* TERMINATE_INVOCATION */ - YYSYMBOL_TERMINATE_RAY = 427, /* TERMINATE_RAY */ - YYSYMBOL_IGNORE_INTERSECTION = 428, /* IGNORE_INTERSECTION */ - YYSYMBOL_UNIFORM = 429, /* UNIFORM */ - YYSYMBOL_SHARED = 430, /* SHARED */ - YYSYMBOL_BUFFER = 431, /* BUFFER */ - YYSYMBOL_TILEIMAGEEXT = 432, /* TILEIMAGEEXT */ - YYSYMBOL_FLAT = 433, /* FLAT */ - YYSYMBOL_SMOOTH = 434, /* SMOOTH */ - YYSYMBOL_LAYOUT = 435, /* LAYOUT */ - YYSYMBOL_DOUBLECONSTANT = 436, /* DOUBLECONSTANT */ - YYSYMBOL_INT16CONSTANT = 437, /* INT16CONSTANT */ - YYSYMBOL_UINT16CONSTANT = 438, /* UINT16CONSTANT */ - YYSYMBOL_FLOAT16CONSTANT = 439, /* FLOAT16CONSTANT */ - YYSYMBOL_INT32CONSTANT = 440, /* INT32CONSTANT */ - YYSYMBOL_UINT32CONSTANT = 441, /* UINT32CONSTANT */ - YYSYMBOL_INT64CONSTANT = 442, /* INT64CONSTANT */ - YYSYMBOL_UINT64CONSTANT = 443, /* UINT64CONSTANT */ - YYSYMBOL_SUBROUTINE = 444, /* SUBROUTINE */ - YYSYMBOL_DEMOTE = 445, /* DEMOTE */ - YYSYMBOL_FUNCTION = 446, /* FUNCTION */ - YYSYMBOL_PAYLOADNV = 447, /* PAYLOADNV */ - YYSYMBOL_PAYLOADINNV = 448, /* PAYLOADINNV */ - YYSYMBOL_HITATTRNV = 449, /* HITATTRNV */ - YYSYMBOL_CALLDATANV = 450, /* CALLDATANV */ - YYSYMBOL_CALLDATAINNV = 451, /* CALLDATAINNV */ - YYSYMBOL_PAYLOADEXT = 452, /* PAYLOADEXT */ - YYSYMBOL_PAYLOADINEXT = 453, /* PAYLOADINEXT */ - YYSYMBOL_HITATTREXT = 454, /* HITATTREXT */ - YYSYMBOL_CALLDATAEXT = 455, /* CALLDATAEXT */ - YYSYMBOL_CALLDATAINEXT = 456, /* CALLDATAINEXT */ - YYSYMBOL_PATCH = 457, /* PATCH */ - YYSYMBOL_SAMPLE = 458, /* SAMPLE */ - YYSYMBOL_NONUNIFORM = 459, /* NONUNIFORM */ - YYSYMBOL_COHERENT = 460, /* COHERENT */ - YYSYMBOL_VOLATILE = 461, /* VOLATILE */ - YYSYMBOL_RESTRICT = 462, /* RESTRICT */ - YYSYMBOL_READONLY = 463, /* READONLY */ - YYSYMBOL_WRITEONLY = 464, /* WRITEONLY */ - YYSYMBOL_NONTEMPORAL = 465, /* NONTEMPORAL */ - YYSYMBOL_DEVICECOHERENT = 466, /* DEVICECOHERENT */ - YYSYMBOL_QUEUEFAMILYCOHERENT = 467, /* QUEUEFAMILYCOHERENT */ - YYSYMBOL_WORKGROUPCOHERENT = 468, /* WORKGROUPCOHERENT */ - YYSYMBOL_SUBGROUPCOHERENT = 469, /* SUBGROUPCOHERENT */ - YYSYMBOL_NONPRIVATE = 470, /* NONPRIVATE */ - YYSYMBOL_SHADERCALLCOHERENT = 471, /* SHADERCALLCOHERENT */ - YYSYMBOL_NOPERSPECTIVE = 472, /* NOPERSPECTIVE */ - YYSYMBOL_EXPLICITINTERPAMD = 473, /* EXPLICITINTERPAMD */ - YYSYMBOL_PERVERTEXEXT = 474, /* PERVERTEXEXT */ - YYSYMBOL_PERVERTEXNV = 475, /* PERVERTEXNV */ - YYSYMBOL_PERPRIMITIVENV = 476, /* PERPRIMITIVENV */ - YYSYMBOL_PERVIEWNV = 477, /* PERVIEWNV */ - YYSYMBOL_PERTASKNV = 478, /* PERTASKNV */ - YYSYMBOL_PERPRIMITIVEEXT = 479, /* PERPRIMITIVEEXT */ - YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 480, /* TASKPAYLOADWORKGROUPEXT */ - YYSYMBOL_PRECISE = 481, /* PRECISE */ - YYSYMBOL_YYACCEPT = 482, /* $accept */ - YYSYMBOL_variable_identifier = 483, /* variable_identifier */ - YYSYMBOL_primary_expression = 484, /* primary_expression */ - YYSYMBOL_postfix_expression = 485, /* postfix_expression */ - YYSYMBOL_integer_expression = 486, /* integer_expression */ - YYSYMBOL_function_call = 487, /* function_call */ - YYSYMBOL_function_call_or_method = 488, /* function_call_or_method */ - YYSYMBOL_function_call_generic = 489, /* function_call_generic */ - YYSYMBOL_function_call_header_no_parameters = 490, /* function_call_header_no_parameters */ - YYSYMBOL_function_call_header_with_parameters = 491, /* function_call_header_with_parameters */ - YYSYMBOL_function_call_header = 492, /* function_call_header */ - YYSYMBOL_function_identifier = 493, /* function_identifier */ - YYSYMBOL_unary_expression = 494, /* unary_expression */ - YYSYMBOL_unary_operator = 495, /* unary_operator */ - YYSYMBOL_multiplicative_expression = 496, /* multiplicative_expression */ - YYSYMBOL_additive_expression = 497, /* additive_expression */ - YYSYMBOL_shift_expression = 498, /* shift_expression */ - YYSYMBOL_relational_expression = 499, /* relational_expression */ - YYSYMBOL_equality_expression = 500, /* equality_expression */ - YYSYMBOL_and_expression = 501, /* and_expression */ - YYSYMBOL_exclusive_or_expression = 502, /* exclusive_or_expression */ - YYSYMBOL_inclusive_or_expression = 503, /* inclusive_or_expression */ - YYSYMBOL_logical_and_expression = 504, /* logical_and_expression */ - YYSYMBOL_logical_xor_expression = 505, /* logical_xor_expression */ - YYSYMBOL_logical_or_expression = 506, /* logical_or_expression */ - YYSYMBOL_conditional_expression = 507, /* conditional_expression */ - YYSYMBOL_508_1 = 508, /* $@1 */ - YYSYMBOL_assignment_expression = 509, /* assignment_expression */ - YYSYMBOL_assignment_operator = 510, /* assignment_operator */ - YYSYMBOL_expression = 511, /* expression */ - YYSYMBOL_constant_expression = 512, /* constant_expression */ - YYSYMBOL_declaration = 513, /* declaration */ - YYSYMBOL_block_structure = 514, /* block_structure */ - YYSYMBOL_515_2 = 515, /* $@2 */ - YYSYMBOL_identifier_list = 516, /* identifier_list */ - YYSYMBOL_function_prototype = 517, /* function_prototype */ - YYSYMBOL_function_declarator = 518, /* function_declarator */ - YYSYMBOL_function_header_with_parameters = 519, /* function_header_with_parameters */ - YYSYMBOL_function_header = 520, /* function_header */ - YYSYMBOL_parameter_declarator = 521, /* parameter_declarator */ - YYSYMBOL_parameter_declaration = 522, /* parameter_declaration */ - YYSYMBOL_parameter_type_specifier = 523, /* parameter_type_specifier */ - YYSYMBOL_init_declarator_list = 524, /* init_declarator_list */ - YYSYMBOL_single_declaration = 525, /* single_declaration */ - YYSYMBOL_fully_specified_type = 526, /* fully_specified_type */ - YYSYMBOL_invariant_qualifier = 527, /* invariant_qualifier */ - YYSYMBOL_interpolation_qualifier = 528, /* interpolation_qualifier */ - YYSYMBOL_layout_qualifier = 529, /* layout_qualifier */ - YYSYMBOL_layout_qualifier_id_list = 530, /* layout_qualifier_id_list */ - YYSYMBOL_layout_qualifier_id = 531, /* layout_qualifier_id */ - YYSYMBOL_precise_qualifier = 532, /* precise_qualifier */ - YYSYMBOL_type_qualifier = 533, /* type_qualifier */ - YYSYMBOL_single_type_qualifier = 534, /* single_type_qualifier */ - YYSYMBOL_storage_qualifier = 535, /* storage_qualifier */ - YYSYMBOL_non_uniform_qualifier = 536, /* non_uniform_qualifier */ - YYSYMBOL_type_name_list = 537, /* type_name_list */ - YYSYMBOL_type_specifier = 538, /* type_specifier */ - YYSYMBOL_array_specifier = 539, /* array_specifier */ - YYSYMBOL_type_parameter_specifier_opt = 540, /* type_parameter_specifier_opt */ - YYSYMBOL_type_parameter_specifier = 541, /* type_parameter_specifier */ - YYSYMBOL_type_parameter_specifier_list = 542, /* type_parameter_specifier_list */ - YYSYMBOL_type_specifier_nonarray = 543, /* type_specifier_nonarray */ - YYSYMBOL_precision_qualifier = 544, /* precision_qualifier */ - YYSYMBOL_struct_specifier = 545, /* struct_specifier */ - YYSYMBOL_546_3 = 546, /* $@3 */ - YYSYMBOL_547_4 = 547, /* $@4 */ - YYSYMBOL_struct_declaration_list = 548, /* struct_declaration_list */ - YYSYMBOL_struct_declaration = 549, /* struct_declaration */ - YYSYMBOL_struct_declarator_list = 550, /* struct_declarator_list */ - YYSYMBOL_struct_declarator = 551, /* struct_declarator */ - YYSYMBOL_initializer = 552, /* initializer */ - YYSYMBOL_initializer_list = 553, /* initializer_list */ - YYSYMBOL_declaration_statement = 554, /* declaration_statement */ - YYSYMBOL_statement = 555, /* statement */ - YYSYMBOL_simple_statement = 556, /* simple_statement */ - YYSYMBOL_demote_statement = 557, /* demote_statement */ - YYSYMBOL_compound_statement = 558, /* compound_statement */ - YYSYMBOL_559_5 = 559, /* $@5 */ - YYSYMBOL_560_6 = 560, /* $@6 */ - YYSYMBOL_statement_no_new_scope = 561, /* statement_no_new_scope */ - YYSYMBOL_statement_scoped = 562, /* statement_scoped */ - YYSYMBOL_563_7 = 563, /* $@7 */ - YYSYMBOL_564_8 = 564, /* $@8 */ - YYSYMBOL_compound_statement_no_new_scope = 565, /* compound_statement_no_new_scope */ - YYSYMBOL_statement_list = 566, /* statement_list */ - YYSYMBOL_expression_statement = 567, /* expression_statement */ - YYSYMBOL_selection_statement = 568, /* selection_statement */ - YYSYMBOL_selection_statement_nonattributed = 569, /* selection_statement_nonattributed */ - YYSYMBOL_selection_rest_statement = 570, /* selection_rest_statement */ - YYSYMBOL_condition = 571, /* condition */ - YYSYMBOL_switch_statement = 572, /* switch_statement */ - YYSYMBOL_switch_statement_nonattributed = 573, /* switch_statement_nonattributed */ + YYSYMBOL_VECTOR = 180, /* VECTOR */ + YYSYMBOL_HITOBJECTNV = 181, /* HITOBJECTNV */ + YYSYMBOL_HITOBJECTATTRNV = 182, /* HITOBJECTATTRNV */ + YYSYMBOL_HITOBJECTEXT = 183, /* HITOBJECTEXT */ + YYSYMBOL_HITOBJECTATTREXT = 184, /* HITOBJECTATTREXT */ + YYSYMBOL_TENSORLAYOUTNV = 185, /* TENSORLAYOUTNV */ + YYSYMBOL_TENSORVIEWNV = 186, /* TENSORVIEWNV */ + YYSYMBOL_TENSORARM = 187, /* TENSORARM */ + YYSYMBOL_SAMPLERCUBEARRAY = 188, /* SAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLERCUBEARRAYSHADOW = 189, /* SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_ISAMPLERCUBEARRAY = 190, /* ISAMPLERCUBEARRAY */ + YYSYMBOL_USAMPLERCUBEARRAY = 191, /* USAMPLERCUBEARRAY */ + YYSYMBOL_SAMPLER1D = 192, /* SAMPLER1D */ + YYSYMBOL_SAMPLER1DARRAY = 193, /* SAMPLER1DARRAY */ + YYSYMBOL_SAMPLER1DARRAYSHADOW = 194, /* SAMPLER1DARRAYSHADOW */ + YYSYMBOL_ISAMPLER1D = 195, /* ISAMPLER1D */ + YYSYMBOL_SAMPLER1DSHADOW = 196, /* SAMPLER1DSHADOW */ + YYSYMBOL_SAMPLER2DRECT = 197, /* SAMPLER2DRECT */ + YYSYMBOL_SAMPLER2DRECTSHADOW = 198, /* SAMPLER2DRECTSHADOW */ + YYSYMBOL_ISAMPLER2DRECT = 199, /* ISAMPLER2DRECT */ + YYSYMBOL_USAMPLER2DRECT = 200, /* USAMPLER2DRECT */ + YYSYMBOL_SAMPLERBUFFER = 201, /* SAMPLERBUFFER */ + YYSYMBOL_ISAMPLERBUFFER = 202, /* ISAMPLERBUFFER */ + YYSYMBOL_USAMPLERBUFFER = 203, /* USAMPLERBUFFER */ + YYSYMBOL_SAMPLER2DMS = 204, /* SAMPLER2DMS */ + YYSYMBOL_ISAMPLER2DMS = 205, /* ISAMPLER2DMS */ + YYSYMBOL_USAMPLER2DMS = 206, /* USAMPLER2DMS */ + YYSYMBOL_SAMPLER2DMSARRAY = 207, /* SAMPLER2DMSARRAY */ + YYSYMBOL_ISAMPLER2DMSARRAY = 208, /* ISAMPLER2DMSARRAY */ + YYSYMBOL_USAMPLER2DMSARRAY = 209, /* USAMPLER2DMSARRAY */ + YYSYMBOL_SAMPLEREXTERNALOES = 210, /* SAMPLEREXTERNALOES */ + YYSYMBOL_SAMPLEREXTERNAL2DY2YEXT = 211, /* SAMPLEREXTERNAL2DY2YEXT */ + YYSYMBOL_ISAMPLER1DARRAY = 212, /* ISAMPLER1DARRAY */ + YYSYMBOL_USAMPLER1D = 213, /* USAMPLER1D */ + YYSYMBOL_USAMPLER1DARRAY = 214, /* USAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER1D = 215, /* F16SAMPLER1D */ + YYSYMBOL_F16SAMPLER2D = 216, /* F16SAMPLER2D */ + YYSYMBOL_F16SAMPLER3D = 217, /* F16SAMPLER3D */ + YYSYMBOL_F16SAMPLER2DRECT = 218, /* F16SAMPLER2DRECT */ + YYSYMBOL_F16SAMPLERCUBE = 219, /* F16SAMPLERCUBE */ + YYSYMBOL_F16SAMPLER1DARRAY = 220, /* F16SAMPLER1DARRAY */ + YYSYMBOL_F16SAMPLER2DARRAY = 221, /* F16SAMPLER2DARRAY */ + YYSYMBOL_F16SAMPLERCUBEARRAY = 222, /* F16SAMPLERCUBEARRAY */ + YYSYMBOL_F16SAMPLERBUFFER = 223, /* F16SAMPLERBUFFER */ + YYSYMBOL_F16SAMPLER2DMS = 224, /* F16SAMPLER2DMS */ + YYSYMBOL_F16SAMPLER2DMSARRAY = 225, /* F16SAMPLER2DMSARRAY */ + YYSYMBOL_F16SAMPLER1DSHADOW = 226, /* F16SAMPLER1DSHADOW */ + YYSYMBOL_F16SAMPLER2DSHADOW = 227, /* F16SAMPLER2DSHADOW */ + YYSYMBOL_F16SAMPLER1DARRAYSHADOW = 228, /* F16SAMPLER1DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DARRAYSHADOW = 229, /* F16SAMPLER2DARRAYSHADOW */ + YYSYMBOL_F16SAMPLER2DRECTSHADOW = 230, /* F16SAMPLER2DRECTSHADOW */ + YYSYMBOL_F16SAMPLERCUBESHADOW = 231, /* F16SAMPLERCUBESHADOW */ + YYSYMBOL_F16SAMPLERCUBEARRAYSHADOW = 232, /* F16SAMPLERCUBEARRAYSHADOW */ + YYSYMBOL_IMAGE1D = 233, /* IMAGE1D */ + YYSYMBOL_IIMAGE1D = 234, /* IIMAGE1D */ + YYSYMBOL_UIMAGE1D = 235, /* UIMAGE1D */ + YYSYMBOL_IMAGE2D = 236, /* IMAGE2D */ + YYSYMBOL_IIMAGE2D = 237, /* IIMAGE2D */ + YYSYMBOL_UIMAGE2D = 238, /* UIMAGE2D */ + YYSYMBOL_IMAGE3D = 239, /* IMAGE3D */ + YYSYMBOL_IIMAGE3D = 240, /* IIMAGE3D */ + YYSYMBOL_UIMAGE3D = 241, /* UIMAGE3D */ + YYSYMBOL_IMAGE2DRECT = 242, /* IMAGE2DRECT */ + YYSYMBOL_IIMAGE2DRECT = 243, /* IIMAGE2DRECT */ + YYSYMBOL_UIMAGE2DRECT = 244, /* UIMAGE2DRECT */ + YYSYMBOL_IMAGECUBE = 245, /* IMAGECUBE */ + YYSYMBOL_IIMAGECUBE = 246, /* IIMAGECUBE */ + YYSYMBOL_UIMAGECUBE = 247, /* UIMAGECUBE */ + YYSYMBOL_IMAGEBUFFER = 248, /* IMAGEBUFFER */ + YYSYMBOL_IIMAGEBUFFER = 249, /* IIMAGEBUFFER */ + YYSYMBOL_UIMAGEBUFFER = 250, /* UIMAGEBUFFER */ + YYSYMBOL_IMAGE1DARRAY = 251, /* IMAGE1DARRAY */ + YYSYMBOL_IIMAGE1DARRAY = 252, /* IIMAGE1DARRAY */ + YYSYMBOL_UIMAGE1DARRAY = 253, /* UIMAGE1DARRAY */ + YYSYMBOL_IMAGE2DARRAY = 254, /* IMAGE2DARRAY */ + YYSYMBOL_IIMAGE2DARRAY = 255, /* IIMAGE2DARRAY */ + YYSYMBOL_UIMAGE2DARRAY = 256, /* UIMAGE2DARRAY */ + YYSYMBOL_IMAGECUBEARRAY = 257, /* IMAGECUBEARRAY */ + YYSYMBOL_IIMAGECUBEARRAY = 258, /* IIMAGECUBEARRAY */ + YYSYMBOL_UIMAGECUBEARRAY = 259, /* UIMAGECUBEARRAY */ + YYSYMBOL_IMAGE2DMS = 260, /* IMAGE2DMS */ + YYSYMBOL_IIMAGE2DMS = 261, /* IIMAGE2DMS */ + YYSYMBOL_UIMAGE2DMS = 262, /* UIMAGE2DMS */ + YYSYMBOL_IMAGE2DMSARRAY = 263, /* IMAGE2DMSARRAY */ + YYSYMBOL_IIMAGE2DMSARRAY = 264, /* IIMAGE2DMSARRAY */ + YYSYMBOL_UIMAGE2DMSARRAY = 265, /* UIMAGE2DMSARRAY */ + YYSYMBOL_F16IMAGE1D = 266, /* F16IMAGE1D */ + YYSYMBOL_F16IMAGE2D = 267, /* F16IMAGE2D */ + YYSYMBOL_F16IMAGE3D = 268, /* F16IMAGE3D */ + YYSYMBOL_F16IMAGE2DRECT = 269, /* F16IMAGE2DRECT */ + YYSYMBOL_F16IMAGECUBE = 270, /* F16IMAGECUBE */ + YYSYMBOL_F16IMAGE1DARRAY = 271, /* F16IMAGE1DARRAY */ + YYSYMBOL_F16IMAGE2DARRAY = 272, /* F16IMAGE2DARRAY */ + YYSYMBOL_F16IMAGECUBEARRAY = 273, /* F16IMAGECUBEARRAY */ + YYSYMBOL_F16IMAGEBUFFER = 274, /* F16IMAGEBUFFER */ + YYSYMBOL_F16IMAGE2DMS = 275, /* F16IMAGE2DMS */ + YYSYMBOL_F16IMAGE2DMSARRAY = 276, /* F16IMAGE2DMSARRAY */ + YYSYMBOL_I64IMAGE1D = 277, /* I64IMAGE1D */ + YYSYMBOL_U64IMAGE1D = 278, /* U64IMAGE1D */ + YYSYMBOL_I64IMAGE2D = 279, /* I64IMAGE2D */ + YYSYMBOL_U64IMAGE2D = 280, /* U64IMAGE2D */ + YYSYMBOL_I64IMAGE3D = 281, /* I64IMAGE3D */ + YYSYMBOL_U64IMAGE3D = 282, /* U64IMAGE3D */ + YYSYMBOL_I64IMAGE2DRECT = 283, /* I64IMAGE2DRECT */ + YYSYMBOL_U64IMAGE2DRECT = 284, /* U64IMAGE2DRECT */ + YYSYMBOL_I64IMAGECUBE = 285, /* I64IMAGECUBE */ + YYSYMBOL_U64IMAGECUBE = 286, /* U64IMAGECUBE */ + YYSYMBOL_I64IMAGEBUFFER = 287, /* I64IMAGEBUFFER */ + YYSYMBOL_U64IMAGEBUFFER = 288, /* U64IMAGEBUFFER */ + YYSYMBOL_I64IMAGE1DARRAY = 289, /* I64IMAGE1DARRAY */ + YYSYMBOL_U64IMAGE1DARRAY = 290, /* U64IMAGE1DARRAY */ + YYSYMBOL_I64IMAGE2DARRAY = 291, /* I64IMAGE2DARRAY */ + YYSYMBOL_U64IMAGE2DARRAY = 292, /* U64IMAGE2DARRAY */ + YYSYMBOL_I64IMAGECUBEARRAY = 293, /* I64IMAGECUBEARRAY */ + YYSYMBOL_U64IMAGECUBEARRAY = 294, /* U64IMAGECUBEARRAY */ + YYSYMBOL_I64IMAGE2DMS = 295, /* I64IMAGE2DMS */ + YYSYMBOL_U64IMAGE2DMS = 296, /* U64IMAGE2DMS */ + YYSYMBOL_I64IMAGE2DMSARRAY = 297, /* I64IMAGE2DMSARRAY */ + YYSYMBOL_U64IMAGE2DMSARRAY = 298, /* U64IMAGE2DMSARRAY */ + YYSYMBOL_TEXTURECUBEARRAY = 299, /* TEXTURECUBEARRAY */ + YYSYMBOL_ITEXTURECUBEARRAY = 300, /* ITEXTURECUBEARRAY */ + YYSYMBOL_UTEXTURECUBEARRAY = 301, /* UTEXTURECUBEARRAY */ + YYSYMBOL_TEXTURE1D = 302, /* TEXTURE1D */ + YYSYMBOL_ITEXTURE1D = 303, /* ITEXTURE1D */ + YYSYMBOL_UTEXTURE1D = 304, /* UTEXTURE1D */ + YYSYMBOL_TEXTURE1DARRAY = 305, /* TEXTURE1DARRAY */ + YYSYMBOL_ITEXTURE1DARRAY = 306, /* ITEXTURE1DARRAY */ + YYSYMBOL_UTEXTURE1DARRAY = 307, /* UTEXTURE1DARRAY */ + YYSYMBOL_TEXTURE2DRECT = 308, /* TEXTURE2DRECT */ + YYSYMBOL_ITEXTURE2DRECT = 309, /* ITEXTURE2DRECT */ + YYSYMBOL_UTEXTURE2DRECT = 310, /* UTEXTURE2DRECT */ + YYSYMBOL_TEXTUREBUFFER = 311, /* TEXTUREBUFFER */ + YYSYMBOL_ITEXTUREBUFFER = 312, /* ITEXTUREBUFFER */ + YYSYMBOL_UTEXTUREBUFFER = 313, /* UTEXTUREBUFFER */ + YYSYMBOL_TEXTURE2DMS = 314, /* TEXTURE2DMS */ + YYSYMBOL_ITEXTURE2DMS = 315, /* ITEXTURE2DMS */ + YYSYMBOL_UTEXTURE2DMS = 316, /* UTEXTURE2DMS */ + YYSYMBOL_TEXTURE2DMSARRAY = 317, /* TEXTURE2DMSARRAY */ + YYSYMBOL_ITEXTURE2DMSARRAY = 318, /* ITEXTURE2DMSARRAY */ + YYSYMBOL_UTEXTURE2DMSARRAY = 319, /* UTEXTURE2DMSARRAY */ + YYSYMBOL_F16TEXTURE1D = 320, /* F16TEXTURE1D */ + YYSYMBOL_F16TEXTURE2D = 321, /* F16TEXTURE2D */ + YYSYMBOL_F16TEXTURE3D = 322, /* F16TEXTURE3D */ + YYSYMBOL_F16TEXTURE2DRECT = 323, /* F16TEXTURE2DRECT */ + YYSYMBOL_F16TEXTURECUBE = 324, /* F16TEXTURECUBE */ + YYSYMBOL_F16TEXTURE1DARRAY = 325, /* F16TEXTURE1DARRAY */ + YYSYMBOL_F16TEXTURE2DARRAY = 326, /* F16TEXTURE2DARRAY */ + YYSYMBOL_F16TEXTURECUBEARRAY = 327, /* F16TEXTURECUBEARRAY */ + YYSYMBOL_F16TEXTUREBUFFER = 328, /* F16TEXTUREBUFFER */ + YYSYMBOL_F16TEXTURE2DMS = 329, /* F16TEXTURE2DMS */ + YYSYMBOL_F16TEXTURE2DMSARRAY = 330, /* F16TEXTURE2DMSARRAY */ + YYSYMBOL_SUBPASSINPUT = 331, /* SUBPASSINPUT */ + YYSYMBOL_SUBPASSINPUTMS = 332, /* SUBPASSINPUTMS */ + YYSYMBOL_ISUBPASSINPUT = 333, /* ISUBPASSINPUT */ + YYSYMBOL_ISUBPASSINPUTMS = 334, /* ISUBPASSINPUTMS */ + YYSYMBOL_USUBPASSINPUT = 335, /* USUBPASSINPUT */ + YYSYMBOL_USUBPASSINPUTMS = 336, /* USUBPASSINPUTMS */ + YYSYMBOL_F16SUBPASSINPUT = 337, /* F16SUBPASSINPUT */ + YYSYMBOL_F16SUBPASSINPUTMS = 338, /* F16SUBPASSINPUTMS */ + YYSYMBOL_SPIRV_INSTRUCTION = 339, /* SPIRV_INSTRUCTION */ + YYSYMBOL_SPIRV_EXECUTION_MODE = 340, /* SPIRV_EXECUTION_MODE */ + YYSYMBOL_SPIRV_EXECUTION_MODE_ID = 341, /* SPIRV_EXECUTION_MODE_ID */ + YYSYMBOL_SPIRV_DECORATE = 342, /* SPIRV_DECORATE */ + YYSYMBOL_SPIRV_DECORATE_ID = 343, /* SPIRV_DECORATE_ID */ + YYSYMBOL_SPIRV_DECORATE_STRING = 344, /* SPIRV_DECORATE_STRING */ + YYSYMBOL_SPIRV_TYPE = 345, /* SPIRV_TYPE */ + YYSYMBOL_SPIRV_STORAGE_CLASS = 346, /* SPIRV_STORAGE_CLASS */ + YYSYMBOL_SPIRV_BY_REFERENCE = 347, /* SPIRV_BY_REFERENCE */ + YYSYMBOL_SPIRV_LITERAL = 348, /* SPIRV_LITERAL */ + YYSYMBOL_ATTACHMENTEXT = 349, /* ATTACHMENTEXT */ + YYSYMBOL_IATTACHMENTEXT = 350, /* IATTACHMENTEXT */ + YYSYMBOL_UATTACHMENTEXT = 351, /* UATTACHMENTEXT */ + YYSYMBOL_LEFT_OP = 352, /* LEFT_OP */ + YYSYMBOL_RIGHT_OP = 353, /* RIGHT_OP */ + YYSYMBOL_INC_OP = 354, /* INC_OP */ + YYSYMBOL_DEC_OP = 355, /* DEC_OP */ + YYSYMBOL_LE_OP = 356, /* LE_OP */ + YYSYMBOL_GE_OP = 357, /* GE_OP */ + YYSYMBOL_EQ_OP = 358, /* EQ_OP */ + YYSYMBOL_NE_OP = 359, /* NE_OP */ + YYSYMBOL_AND_OP = 360, /* AND_OP */ + YYSYMBOL_OR_OP = 361, /* OR_OP */ + YYSYMBOL_XOR_OP = 362, /* XOR_OP */ + YYSYMBOL_MUL_ASSIGN = 363, /* MUL_ASSIGN */ + YYSYMBOL_DIV_ASSIGN = 364, /* DIV_ASSIGN */ + YYSYMBOL_ADD_ASSIGN = 365, /* ADD_ASSIGN */ + YYSYMBOL_MOD_ASSIGN = 366, /* MOD_ASSIGN */ + YYSYMBOL_LEFT_ASSIGN = 367, /* LEFT_ASSIGN */ + YYSYMBOL_RIGHT_ASSIGN = 368, /* RIGHT_ASSIGN */ + YYSYMBOL_AND_ASSIGN = 369, /* AND_ASSIGN */ + YYSYMBOL_XOR_ASSIGN = 370, /* XOR_ASSIGN */ + YYSYMBOL_OR_ASSIGN = 371, /* OR_ASSIGN */ + YYSYMBOL_SUB_ASSIGN = 372, /* SUB_ASSIGN */ + YYSYMBOL_STRING_LITERAL = 373, /* STRING_LITERAL */ + YYSYMBOL_LEFT_PAREN = 374, /* LEFT_PAREN */ + YYSYMBOL_RIGHT_PAREN = 375, /* RIGHT_PAREN */ + YYSYMBOL_LEFT_BRACKET = 376, /* LEFT_BRACKET */ + YYSYMBOL_RIGHT_BRACKET = 377, /* RIGHT_BRACKET */ + YYSYMBOL_LEFT_BRACE = 378, /* LEFT_BRACE */ + YYSYMBOL_RIGHT_BRACE = 379, /* RIGHT_BRACE */ + YYSYMBOL_DOT = 380, /* DOT */ + YYSYMBOL_COMMA = 381, /* COMMA */ + YYSYMBOL_COLON = 382, /* COLON */ + YYSYMBOL_EQUAL = 383, /* EQUAL */ + YYSYMBOL_SEMICOLON = 384, /* SEMICOLON */ + YYSYMBOL_BANG = 385, /* BANG */ + YYSYMBOL_DASH = 386, /* DASH */ + YYSYMBOL_TILDE = 387, /* TILDE */ + YYSYMBOL_PLUS = 388, /* PLUS */ + YYSYMBOL_STAR = 389, /* STAR */ + YYSYMBOL_SLASH = 390, /* SLASH */ + YYSYMBOL_PERCENT = 391, /* PERCENT */ + YYSYMBOL_LEFT_ANGLE = 392, /* LEFT_ANGLE */ + YYSYMBOL_RIGHT_ANGLE = 393, /* RIGHT_ANGLE */ + YYSYMBOL_VERTICAL_BAR = 394, /* VERTICAL_BAR */ + YYSYMBOL_CARET = 395, /* CARET */ + YYSYMBOL_AMPERSAND = 396, /* AMPERSAND */ + YYSYMBOL_QUESTION = 397, /* QUESTION */ + YYSYMBOL_INVARIANT = 398, /* INVARIANT */ + YYSYMBOL_HIGH_PRECISION = 399, /* HIGH_PRECISION */ + YYSYMBOL_MEDIUM_PRECISION = 400, /* MEDIUM_PRECISION */ + YYSYMBOL_LOW_PRECISION = 401, /* LOW_PRECISION */ + YYSYMBOL_PRECISION = 402, /* PRECISION */ + YYSYMBOL_PACKED = 403, /* PACKED */ + YYSYMBOL_RESOURCE = 404, /* RESOURCE */ + YYSYMBOL_SUPERP = 405, /* SUPERP */ + YYSYMBOL_FLOATCONSTANT = 406, /* FLOATCONSTANT */ + YYSYMBOL_INTCONSTANT = 407, /* INTCONSTANT */ + YYSYMBOL_UINTCONSTANT = 408, /* UINTCONSTANT */ + YYSYMBOL_BOOLCONSTANT = 409, /* BOOLCONSTANT */ + YYSYMBOL_IDENTIFIER = 410, /* IDENTIFIER */ + YYSYMBOL_TYPE_NAME = 411, /* TYPE_NAME */ + YYSYMBOL_CENTROID = 412, /* CENTROID */ + YYSYMBOL_IN = 413, /* IN */ + YYSYMBOL_OUT = 414, /* OUT */ + YYSYMBOL_INOUT = 415, /* INOUT */ + YYSYMBOL_STRUCT = 416, /* STRUCT */ + YYSYMBOL_VOID = 417, /* VOID */ + YYSYMBOL_WHILE = 418, /* WHILE */ + YYSYMBOL_BREAK = 419, /* BREAK */ + YYSYMBOL_CONTINUE = 420, /* CONTINUE */ + YYSYMBOL_DO = 421, /* DO */ + YYSYMBOL_ELSE = 422, /* ELSE */ + YYSYMBOL_FOR = 423, /* FOR */ + YYSYMBOL_IF = 424, /* IF */ + YYSYMBOL_DISCARD = 425, /* DISCARD */ + YYSYMBOL_RETURN = 426, /* RETURN */ + YYSYMBOL_SWITCH = 427, /* SWITCH */ + YYSYMBOL_CASE = 428, /* CASE */ + YYSYMBOL_DEFAULT = 429, /* DEFAULT */ + YYSYMBOL_TERMINATE_INVOCATION = 430, /* TERMINATE_INVOCATION */ + YYSYMBOL_TERMINATE_RAY = 431, /* TERMINATE_RAY */ + YYSYMBOL_IGNORE_INTERSECTION = 432, /* IGNORE_INTERSECTION */ + YYSYMBOL_UNIFORM = 433, /* UNIFORM */ + YYSYMBOL_SHARED = 434, /* SHARED */ + YYSYMBOL_BUFFER = 435, /* BUFFER */ + YYSYMBOL_TILEIMAGEEXT = 436, /* TILEIMAGEEXT */ + YYSYMBOL_FLAT = 437, /* FLAT */ + YYSYMBOL_SMOOTH = 438, /* SMOOTH */ + YYSYMBOL_LAYOUT = 439, /* LAYOUT */ + YYSYMBOL_DOUBLECONSTANT = 440, /* DOUBLECONSTANT */ + YYSYMBOL_INT16CONSTANT = 441, /* INT16CONSTANT */ + YYSYMBOL_UINT16CONSTANT = 442, /* UINT16CONSTANT */ + YYSYMBOL_FLOAT16CONSTANT = 443, /* FLOAT16CONSTANT */ + YYSYMBOL_INT32CONSTANT = 444, /* INT32CONSTANT */ + YYSYMBOL_UINT32CONSTANT = 445, /* UINT32CONSTANT */ + YYSYMBOL_INT64CONSTANT = 446, /* INT64CONSTANT */ + YYSYMBOL_UINT64CONSTANT = 447, /* UINT64CONSTANT */ + YYSYMBOL_SUBROUTINE = 448, /* SUBROUTINE */ + YYSYMBOL_DEMOTE = 449, /* DEMOTE */ + YYSYMBOL_FUNCTION = 450, /* FUNCTION */ + YYSYMBOL_PAYLOADNV = 451, /* PAYLOADNV */ + YYSYMBOL_PAYLOADINNV = 452, /* PAYLOADINNV */ + YYSYMBOL_HITATTRNV = 453, /* HITATTRNV */ + YYSYMBOL_CALLDATANV = 454, /* CALLDATANV */ + YYSYMBOL_CALLDATAINNV = 455, /* CALLDATAINNV */ + YYSYMBOL_PAYLOADEXT = 456, /* PAYLOADEXT */ + YYSYMBOL_PAYLOADINEXT = 457, /* PAYLOADINEXT */ + YYSYMBOL_HITATTREXT = 458, /* HITATTREXT */ + YYSYMBOL_CALLDATAEXT = 459, /* CALLDATAEXT */ + YYSYMBOL_CALLDATAINEXT = 460, /* CALLDATAINEXT */ + YYSYMBOL_PATCH = 461, /* PATCH */ + YYSYMBOL_SAMPLE = 462, /* SAMPLE */ + YYSYMBOL_NONUNIFORM = 463, /* NONUNIFORM */ + YYSYMBOL_RESOURCEHEAP = 464, /* RESOURCEHEAP */ + YYSYMBOL_SAMPLERHEAP = 465, /* SAMPLERHEAP */ + YYSYMBOL_COHERENT = 466, /* COHERENT */ + YYSYMBOL_VOLATILE = 467, /* VOLATILE */ + YYSYMBOL_RESTRICT = 468, /* RESTRICT */ + YYSYMBOL_READONLY = 469, /* READONLY */ + YYSYMBOL_WRITEONLY = 470, /* WRITEONLY */ + YYSYMBOL_NONTEMPORAL = 471, /* NONTEMPORAL */ + YYSYMBOL_DEVICECOHERENT = 472, /* DEVICECOHERENT */ + YYSYMBOL_QUEUEFAMILYCOHERENT = 473, /* QUEUEFAMILYCOHERENT */ + YYSYMBOL_WORKGROUPCOHERENT = 474, /* WORKGROUPCOHERENT */ + YYSYMBOL_SUBGROUPCOHERENT = 475, /* SUBGROUPCOHERENT */ + YYSYMBOL_NONPRIVATE = 476, /* NONPRIVATE */ + YYSYMBOL_SHADERCALLCOHERENT = 477, /* SHADERCALLCOHERENT */ + YYSYMBOL_NOPERSPECTIVE = 478, /* NOPERSPECTIVE */ + YYSYMBOL_EXPLICITINTERPAMD = 479, /* EXPLICITINTERPAMD */ + YYSYMBOL_PERVERTEXEXT = 480, /* PERVERTEXEXT */ + YYSYMBOL_PERVERTEXNV = 481, /* PERVERTEXNV */ + YYSYMBOL_PERPRIMITIVENV = 482, /* PERPRIMITIVENV */ + YYSYMBOL_PERVIEWNV = 483, /* PERVIEWNV */ + YYSYMBOL_PERTASKNV = 484, /* PERTASKNV */ + YYSYMBOL_PERPRIMITIVEEXT = 485, /* PERPRIMITIVEEXT */ + YYSYMBOL_TASKPAYLOADWORKGROUPEXT = 486, /* TASKPAYLOADWORKGROUPEXT */ + YYSYMBOL_PRECISE = 487, /* PRECISE */ + YYSYMBOL_YYACCEPT = 488, /* $accept */ + YYSYMBOL_variable_identifier = 489, /* variable_identifier */ + YYSYMBOL_primary_expression = 490, /* primary_expression */ + YYSYMBOL_postfix_expression = 491, /* postfix_expression */ + YYSYMBOL_integer_expression = 492, /* integer_expression */ + YYSYMBOL_function_call = 493, /* function_call */ + YYSYMBOL_function_call_or_method = 494, /* function_call_or_method */ + YYSYMBOL_function_call_generic = 495, /* function_call_generic */ + YYSYMBOL_function_call_header_no_parameters = 496, /* function_call_header_no_parameters */ + YYSYMBOL_function_call_header_with_parameters = 497, /* function_call_header_with_parameters */ + YYSYMBOL_function_call_header = 498, /* function_call_header */ + YYSYMBOL_function_identifier = 499, /* function_identifier */ + YYSYMBOL_unary_expression = 500, /* unary_expression */ + YYSYMBOL_unary_operator = 501, /* unary_operator */ + YYSYMBOL_multiplicative_expression = 502, /* multiplicative_expression */ + YYSYMBOL_additive_expression = 503, /* additive_expression */ + YYSYMBOL_shift_expression = 504, /* shift_expression */ + YYSYMBOL_relational_expression = 505, /* relational_expression */ + YYSYMBOL_equality_expression = 506, /* equality_expression */ + YYSYMBOL_and_expression = 507, /* and_expression */ + YYSYMBOL_exclusive_or_expression = 508, /* exclusive_or_expression */ + YYSYMBOL_inclusive_or_expression = 509, /* inclusive_or_expression */ + YYSYMBOL_logical_and_expression = 510, /* logical_and_expression */ + YYSYMBOL_logical_xor_expression = 511, /* logical_xor_expression */ + YYSYMBOL_logical_or_expression = 512, /* logical_or_expression */ + YYSYMBOL_conditional_expression = 513, /* conditional_expression */ + YYSYMBOL_514_1 = 514, /* $@1 */ + YYSYMBOL_assignment_expression = 515, /* assignment_expression */ + YYSYMBOL_assignment_operator = 516, /* assignment_operator */ + YYSYMBOL_expression = 517, /* expression */ + YYSYMBOL_constant_expression = 518, /* constant_expression */ + YYSYMBOL_declaration = 519, /* declaration */ + YYSYMBOL_block_structure = 520, /* block_structure */ + YYSYMBOL_521_2 = 521, /* $@2 */ + YYSYMBOL_identifier_list = 522, /* identifier_list */ + YYSYMBOL_function_prototype = 523, /* function_prototype */ + YYSYMBOL_function_declarator = 524, /* function_declarator */ + YYSYMBOL_function_header_with_parameters = 525, /* function_header_with_parameters */ + YYSYMBOL_function_header = 526, /* function_header */ + YYSYMBOL_parameter_declarator = 527, /* parameter_declarator */ + YYSYMBOL_parameter_declaration = 528, /* parameter_declaration */ + YYSYMBOL_parameter_type_specifier = 529, /* parameter_type_specifier */ + YYSYMBOL_init_declarator_list = 530, /* init_declarator_list */ + YYSYMBOL_single_declaration = 531, /* single_declaration */ + YYSYMBOL_fully_specified_type = 532, /* fully_specified_type */ + YYSYMBOL_invariant_qualifier = 533, /* invariant_qualifier */ + YYSYMBOL_interpolation_qualifier = 534, /* interpolation_qualifier */ + YYSYMBOL_layout_qualifier = 535, /* layout_qualifier */ + YYSYMBOL_layout_qualifier_id_list = 536, /* layout_qualifier_id_list */ + YYSYMBOL_layout_qualifier_id = 537, /* layout_qualifier_id */ + YYSYMBOL_precise_qualifier = 538, /* precise_qualifier */ + YYSYMBOL_type_qualifier = 539, /* type_qualifier */ + YYSYMBOL_single_type_qualifier = 540, /* single_type_qualifier */ + YYSYMBOL_storage_qualifier = 541, /* storage_qualifier */ + YYSYMBOL_non_uniform_qualifier = 542, /* non_uniform_qualifier */ + YYSYMBOL_type_name_list = 543, /* type_name_list */ + YYSYMBOL_type_specifier = 544, /* type_specifier */ + YYSYMBOL_array_specifier = 545, /* array_specifier */ + YYSYMBOL_type_parameter_specifier_opt = 546, /* type_parameter_specifier_opt */ + YYSYMBOL_type_parameter_specifier = 547, /* type_parameter_specifier */ + YYSYMBOL_type_parameter_specifier_list = 548, /* type_parameter_specifier_list */ + YYSYMBOL_type_specifier_nonarray = 549, /* type_specifier_nonarray */ + YYSYMBOL_precision_qualifier = 550, /* precision_qualifier */ + YYSYMBOL_struct_specifier = 551, /* struct_specifier */ + YYSYMBOL_552_3 = 552, /* $@3 */ + YYSYMBOL_553_4 = 553, /* $@4 */ + YYSYMBOL_struct_declaration_list = 554, /* struct_declaration_list */ + YYSYMBOL_struct_declaration_with_heap = 555, /* struct_declaration_with_heap */ + YYSYMBOL_block_heap_inner_structure = 556, /* block_heap_inner_structure */ + YYSYMBOL_557_5 = 557, /* $@5 */ + YYSYMBOL_struct_declaration_without_heap = 558, /* struct_declaration_without_heap */ + YYSYMBOL_struct_declaration = 559, /* struct_declaration */ + YYSYMBOL_struct_declarator_list = 560, /* struct_declarator_list */ + YYSYMBOL_struct_declarator = 561, /* struct_declarator */ + YYSYMBOL_initializer = 562, /* initializer */ + YYSYMBOL_initializer_list = 563, /* initializer_list */ + YYSYMBOL_declaration_statement = 564, /* declaration_statement */ + YYSYMBOL_statement = 565, /* statement */ + YYSYMBOL_simple_statement = 566, /* simple_statement */ + YYSYMBOL_demote_statement = 567, /* demote_statement */ + YYSYMBOL_compound_statement = 568, /* compound_statement */ + YYSYMBOL_569_6 = 569, /* $@6 */ + YYSYMBOL_570_7 = 570, /* $@7 */ + YYSYMBOL_statement_no_new_scope = 571, /* statement_no_new_scope */ + YYSYMBOL_statement_scoped = 572, /* statement_scoped */ + YYSYMBOL_573_8 = 573, /* $@8 */ YYSYMBOL_574_9 = 574, /* $@9 */ - YYSYMBOL_switch_statement_list = 575, /* switch_statement_list */ - YYSYMBOL_case_label = 576, /* case_label */ - YYSYMBOL_iteration_statement = 577, /* iteration_statement */ - YYSYMBOL_iteration_statement_nonattributed = 578, /* iteration_statement_nonattributed */ - YYSYMBOL_579_10 = 579, /* $@10 */ - YYSYMBOL_580_11 = 580, /* $@11 */ - YYSYMBOL_581_12 = 581, /* $@12 */ - YYSYMBOL_for_init_statement = 582, /* for_init_statement */ - YYSYMBOL_conditionopt = 583, /* conditionopt */ - YYSYMBOL_for_rest_statement = 584, /* for_rest_statement */ - YYSYMBOL_jump_statement = 585, /* jump_statement */ - YYSYMBOL_translation_unit = 586, /* translation_unit */ - YYSYMBOL_external_declaration = 587, /* external_declaration */ - YYSYMBOL_function_definition = 588, /* function_definition */ - YYSYMBOL_589_13 = 589, /* $@13 */ - YYSYMBOL_attribute = 590, /* attribute */ - YYSYMBOL_attribute_list = 591, /* attribute_list */ - YYSYMBOL_single_attribute = 592, /* single_attribute */ - YYSYMBOL_spirv_requirements_list = 593, /* spirv_requirements_list */ - YYSYMBOL_spirv_requirements_parameter = 594, /* spirv_requirements_parameter */ - YYSYMBOL_spirv_extension_list = 595, /* spirv_extension_list */ - YYSYMBOL_spirv_capability_list = 596, /* spirv_capability_list */ - YYSYMBOL_spirv_execution_mode_qualifier = 597, /* spirv_execution_mode_qualifier */ - YYSYMBOL_spirv_execution_mode_parameter_list = 598, /* spirv_execution_mode_parameter_list */ - YYSYMBOL_spirv_execution_mode_parameter = 599, /* spirv_execution_mode_parameter */ - YYSYMBOL_spirv_execution_mode_id_parameter_list = 600, /* spirv_execution_mode_id_parameter_list */ - YYSYMBOL_spirv_storage_class_qualifier = 601, /* spirv_storage_class_qualifier */ - YYSYMBOL_spirv_decorate_qualifier = 602, /* spirv_decorate_qualifier */ - YYSYMBOL_spirv_decorate_parameter_list = 603, /* spirv_decorate_parameter_list */ - YYSYMBOL_spirv_decorate_parameter = 604, /* spirv_decorate_parameter */ - YYSYMBOL_spirv_decorate_id_parameter_list = 605, /* spirv_decorate_id_parameter_list */ - YYSYMBOL_spirv_decorate_id_parameter = 606, /* spirv_decorate_id_parameter */ - YYSYMBOL_spirv_decorate_string_parameter_list = 607, /* spirv_decorate_string_parameter_list */ - YYSYMBOL_spirv_type_specifier = 608, /* spirv_type_specifier */ - YYSYMBOL_spirv_type_parameter_list = 609, /* spirv_type_parameter_list */ - YYSYMBOL_spirv_type_parameter = 610, /* spirv_type_parameter */ - YYSYMBOL_spirv_instruction_qualifier = 611, /* spirv_instruction_qualifier */ - YYSYMBOL_spirv_instruction_qualifier_list = 612, /* spirv_instruction_qualifier_list */ - YYSYMBOL_spirv_instruction_qualifier_id = 613 /* spirv_instruction_qualifier_id */ + YYSYMBOL_compound_statement_no_new_scope = 575, /* compound_statement_no_new_scope */ + YYSYMBOL_statement_list = 576, /* statement_list */ + YYSYMBOL_expression_statement = 577, /* expression_statement */ + YYSYMBOL_selection_statement = 578, /* selection_statement */ + YYSYMBOL_selection_statement_nonattributed = 579, /* selection_statement_nonattributed */ + YYSYMBOL_selection_rest_statement = 580, /* selection_rest_statement */ + YYSYMBOL_condition = 581, /* condition */ + YYSYMBOL_switch_statement = 582, /* switch_statement */ + YYSYMBOL_switch_statement_nonattributed = 583, /* switch_statement_nonattributed */ + YYSYMBOL_584_10 = 584, /* $@10 */ + YYSYMBOL_switch_statement_list = 585, /* switch_statement_list */ + YYSYMBOL_case_label = 586, /* case_label */ + YYSYMBOL_iteration_statement = 587, /* iteration_statement */ + YYSYMBOL_iteration_statement_nonattributed = 588, /* iteration_statement_nonattributed */ + YYSYMBOL_589_11 = 589, /* $@11 */ + YYSYMBOL_590_12 = 590, /* $@12 */ + YYSYMBOL_591_13 = 591, /* $@13 */ + YYSYMBOL_for_init_statement = 592, /* for_init_statement */ + YYSYMBOL_conditionopt = 593, /* conditionopt */ + YYSYMBOL_for_rest_statement = 594, /* for_rest_statement */ + YYSYMBOL_jump_statement = 595, /* jump_statement */ + YYSYMBOL_translation_unit = 596, /* translation_unit */ + YYSYMBOL_external_declaration = 597, /* external_declaration */ + YYSYMBOL_function_definition = 598, /* function_definition */ + YYSYMBOL_599_14 = 599, /* $@14 */ + YYSYMBOL_attribute = 600, /* attribute */ + YYSYMBOL_attribute_list = 601, /* attribute_list */ + YYSYMBOL_single_attribute = 602, /* single_attribute */ + YYSYMBOL_spirv_requirements_list = 603, /* spirv_requirements_list */ + YYSYMBOL_spirv_requirements_parameter = 604, /* spirv_requirements_parameter */ + YYSYMBOL_spirv_extension_list = 605, /* spirv_extension_list */ + YYSYMBOL_spirv_capability_list = 606, /* spirv_capability_list */ + YYSYMBOL_spirv_execution_mode_qualifier = 607, /* spirv_execution_mode_qualifier */ + YYSYMBOL_spirv_execution_mode_parameter_list = 608, /* spirv_execution_mode_parameter_list */ + YYSYMBOL_spirv_execution_mode_parameter = 609, /* spirv_execution_mode_parameter */ + YYSYMBOL_spirv_execution_mode_id_parameter_list = 610, /* spirv_execution_mode_id_parameter_list */ + YYSYMBOL_spirv_storage_class_qualifier = 611, /* spirv_storage_class_qualifier */ + YYSYMBOL_spirv_decorate_qualifier = 612, /* spirv_decorate_qualifier */ + YYSYMBOL_spirv_decorate_parameter_list = 613, /* spirv_decorate_parameter_list */ + YYSYMBOL_spirv_decorate_parameter = 614, /* spirv_decorate_parameter */ + YYSYMBOL_spirv_decorate_id_parameter_list = 615, /* spirv_decorate_id_parameter_list */ + YYSYMBOL_spirv_decorate_id_parameter = 616, /* spirv_decorate_id_parameter */ + YYSYMBOL_spirv_decorate_string_parameter_list = 617, /* spirv_decorate_string_parameter_list */ + YYSYMBOL_spirv_type_specifier = 618, /* spirv_type_specifier */ + YYSYMBOL_spirv_type_parameter_list = 619, /* spirv_type_parameter_list */ + YYSYMBOL_spirv_type_parameter = 620, /* spirv_type_parameter */ + YYSYMBOL_spirv_instruction_qualifier = 621, /* spirv_instruction_qualifier */ + YYSYMBOL_spirv_instruction_qualifier_list = 622, /* spirv_instruction_qualifier_list */ + YYSYMBOL_spirv_instruction_qualifier_id = 623 /* spirv_instruction_qualifier_id */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; @@ -749,7 +759,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t; extern int yylex(YYSTYPE*, TParseContext&); -#line 753 "MachineIndependent/glslang_tab.cpp" +#line 763 "MachineIndependent/glslang_tab.cpp" #ifdef short @@ -1071,21 +1081,21 @@ union yyalloc #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 469 +#define YYFINAL 476 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 13182 +#define YYLAST 13823 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 482 +#define YYNTOKENS 488 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 132 +#define YYNNTS 136 /* YYNRULES -- Number of rules. */ -#define YYNRULES 717 +#define YYNRULES 732 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 963 +#define YYNSTATES 986 /* YYMAXUTOK -- Last valid token kind. */ -#define YYMAXUTOK 736 +#define YYMAXUTOK 742 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM @@ -1172,85 +1182,88 @@ static const yytype_int16 yytranslate[] = 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481 + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487 }; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = { - 0, 360, 360, 366, 369, 374, 377, 380, 384, 387, - 390, 394, 398, 402, 406, 410, 414, 420, 427, 430, - 433, 436, 439, 444, 452, 459, 466, 472, 476, 483, - 486, 492, 510, 535, 543, 548, 575, 583, 589, 593, - 597, 617, 618, 619, 620, 626, 627, 632, 637, 646, - 647, 652, 660, 661, 667, 676, 677, 682, 687, 692, - 700, 701, 710, 722, 723, 732, 733, 742, 743, 752, - 753, 761, 762, 770, 771, 779, 780, 780, 798, 799, - 815, 819, 823, 827, 832, 836, 840, 844, 848, 852, - 856, 863, 866, 877, 884, 889, 896, 901, 906, 913, - 917, 921, 925, 930, 935, 944, 944, 955, 959, 966, - 971, 979, 987, 999, 1002, 1009, 1022, 1045, 1068, 1083, - 1108, 1119, 1129, 1139, 1149, 1158, 1161, 1165, 1169, 1174, - 1182, 1187, 1192, 1197, 1202, 1211, 1221, 1248, 1257, 1264, - 1271, 1278, 1285, 1293, 1301, 1311, 1321, 1328, 1338, 1344, - 1347, 1354, 1358, 1362, 1370, 1379, 1382, 1393, 1396, 1399, - 1403, 1407, 1411, 1415, 1418, 1423, 1427, 1432, 1440, 1444, - 1449, 1455, 1461, 1468, 1473, 1478, 1486, 1491, 1503, 1517, - 1523, 1528, 1536, 1544, 1552, 1560, 1568, 1576, 1584, 1592, - 1600, 1607, 1614, 1618, 1623, 1628, 1633, 1638, 1643, 1648, - 1652, 1656, 1660, 1664, 1668, 1674, 1680, 1690, 1697, 1700, - 1708, 1715, 1726, 1731, 1739, 1743, 1753, 1756, 1762, 1768, - 1774, 1782, 1792, 1796, 1800, 1804, 1809, 1813, 1818, 1823, - 1828, 1833, 1838, 1843, 1848, 1853, 1858, 1864, 1870, 1876, - 1881, 1886, 1891, 1896, 1901, 1906, 1911, 1916, 1921, 1926, - 1931, 1936, 1943, 1948, 1953, 1958, 1963, 1968, 1973, 1978, - 1983, 1988, 1993, 1998, 2003, 2008, 2013, 2021, 2029, 2037, - 2043, 2049, 2055, 2061, 2067, 2073, 2079, 2085, 2091, 2097, + 0, 365, 365, 371, 374, 379, 382, 385, 389, 392, + 395, 399, 403, 407, 411, 415, 419, 425, 432, 435, + 438, 441, 444, 449, 457, 464, 471, 477, 481, 488, + 491, 497, 515, 540, 548, 553, 580, 588, 594, 598, + 602, 618, 625, 626, 627, 628, 634, 635, 640, 645, + 654, 655, 660, 668, 669, 675, 684, 685, 690, 695, + 700, 708, 709, 718, 730, 731, 740, 741, 750, 751, + 760, 761, 769, 770, 778, 779, 787, 788, 788, 806, + 807, 823, 827, 831, 835, 840, 844, 848, 852, 856, + 860, 864, 871, 874, 885, 892, 897, 904, 909, 914, + 921, 924, 927, 930, 935, 943, 943, 955, 959, 966, + 971, 979, 987, 999, 1002, 1009, 1022, 1042, 1049, 1072, + 1087, 1106, 1117, 1128, 1138, 1148, 1158, 1167, 1170, 1175, + 1180, 1185, 1193, 1198, 1204, 1209, 1214, 1223, 1233, 1260, + 1269, 1276, 1283, 1290, 1297, 1305, 1313, 1323, 1333, 1340, + 1350, 1356, 1359, 1366, 1370, 1374, 1382, 1391, 1394, 1405, + 1408, 1411, 1415, 1419, 1423, 1427, 1430, 1435, 1439, 1444, + 1452, 1456, 1461, 1467, 1473, 1480, 1485, 1490, 1498, 1503, + 1515, 1529, 1535, 1540, 1545, 1550, 1558, 1566, 1574, 1582, + 1590, 1598, 1606, 1614, 1622, 1630, 1637, 1644, 1648, 1653, + 1658, 1663, 1668, 1673, 1678, 1682, 1686, 1690, 1694, 1698, + 1704, 1710, 1720, 1727, 1730, 1738, 1745, 1756, 1761, 1769, + 1773, 1783, 1786, 1792, 1798, 1804, 1812, 1822, 1826, 1830, + 1834, 1839, 1843, 1848, 1853, 1858, 1863, 1868, 1873, 1878, + 1883, 1888, 1894, 1900, 1906, 1911, 1916, 1921, 1926, 1931, + 1936, 1941, 1946, 1951, 1956, 1961, 1966, 1973, 1978, 1983, + 1988, 1993, 1998, 2003, 2008, 2013, 2018, 2023, 2028, 2033, + 2038, 2043, 2051, 2059, 2067, 2073, 2079, 2085, 2091, 2097, 2103, 2109, 2115, 2121, 2127, 2133, 2139, 2145, 2151, 2157, 2163, 2169, 2175, 2181, 2187, 2193, 2199, 2205, 2211, 2217, 2223, 2229, 2235, 2241, 2247, 2253, 2259, 2265, 2271, 2277, - 2283, 2289, 2297, 2305, 2313, 2321, 2329, 2337, 2345, 2353, - 2361, 2369, 2377, 2385, 2391, 2397, 2403, 2409, 2415, 2421, + 2283, 2289, 2295, 2301, 2307, 2313, 2319, 2327, 2335, 2343, + 2351, 2359, 2367, 2375, 2383, 2391, 2399, 2407, 2415, 2421, 2427, 2433, 2439, 2445, 2451, 2457, 2463, 2469, 2475, 2481, 2487, 2493, 2499, 2505, 2511, 2517, 2523, 2529, 2535, 2541, 2547, 2553, 2559, 2565, 2571, 2577, 2583, 2589, 2595, 2601, - 2605, 2609, 2613, 2618, 2623, 2628, 2633, 2638, 2643, 2648, - 2653, 2658, 2663, 2668, 2673, 2678, 2683, 2689, 2695, 2701, - 2707, 2713, 2719, 2725, 2731, 2737, 2743, 2749, 2755, 2761, - 2766, 2771, 2776, 2781, 2786, 2791, 2796, 2801, 2806, 2811, - 2816, 2821, 2826, 2831, 2836, 2841, 2846, 2851, 2856, 2861, - 2866, 2871, 2876, 2881, 2886, 2891, 2896, 2901, 2906, 2911, - 2916, 2921, 2926, 2932, 2938, 2943, 2948, 2953, 2959, 2964, - 2969, 2974, 2980, 2985, 2990, 2995, 3001, 3006, 3011, 3016, - 3022, 3028, 3034, 3040, 3045, 3051, 3057, 3063, 3068, 3073, - 3078, 3083, 3088, 3094, 3099, 3104, 3109, 3115, 3120, 3125, - 3130, 3136, 3141, 3146, 3151, 3157, 3162, 3167, 3172, 3178, - 3183, 3188, 3193, 3199, 3204, 3209, 3214, 3220, 3225, 3230, - 3235, 3241, 3246, 3251, 3256, 3262, 3267, 3272, 3277, 3283, - 3288, 3293, 3298, 3304, 3309, 3314, 3319, 3325, 3330, 3335, - 3340, 3346, 3351, 3356, 3361, 3367, 3372, 3377, 3382, 3388, - 3393, 3398, 3403, 3408, 3413, 3418, 3423, 3428, 3433, 3438, - 3443, 3448, 3453, 3458, 3463, 3468, 3473, 3478, 3483, 3488, - 3493, 3498, 3503, 3508, 3514, 3520, 3526, 3532, 3538, 3544, - 3550, 3557, 3564, 3570, 3576, 3582, 3588, 3595, 3602, 3609, - 3616, 3621, 3626, 3630, 3636, 3640, 3644, 3649, 3665, 3670, - 3675, 3683, 3683, 3700, 3700, 3710, 3713, 3726, 3748, 3775, - 3779, 3785, 3790, 3801, 3804, 3810, 3816, 3825, 3828, 3834, - 3838, 3839, 3845, 3846, 3847, 3848, 3849, 3850, 3851, 3852, - 3856, 3864, 3865, 3869, 3865, 3883, 3884, 3888, 3888, 3895, - 3895, 3909, 3912, 3922, 3930, 3941, 3942, 3946, 3949, 3956, - 3963, 3967, 3975, 3979, 3992, 3995, 4002, 4002, 4022, 4025, - 4031, 4043, 4055, 4058, 4066, 4066, 4081, 4081, 4099, 4099, - 4120, 4123, 4129, 4132, 4138, 4142, 4149, 4154, 4159, 4166, - 4169, 4173, 4177, 4181, 4190, 4194, 4203, 4206, 4209, 4217, - 4217, 4259, 4264, 4267, 4272, 4275, 4280, 4283, 4288, 4291, - 4296, 4299, 4304, 4307, 4312, 4316, 4321, 4325, 4330, 4334, - 4341, 4344, 4349, 4352, 4355, 4358, 4361, 4366, 4375, 4386, - 4391, 4399, 4403, 4408, 4412, 4417, 4421, 4426, 4430, 4437, - 4440, 4445, 4448, 4451, 4454, 4459, 4462, 4467, 4473, 4476, - 4479, 4482, 4487, 4491, 4496, 4500, 4505, 4509, 4516, 4519, - 4524, 4527, 4532, 4535, 4541, 4544, 4549, 4552 + 2607, 2613, 2619, 2625, 2631, 2635, 2639, 2643, 2648, 2653, + 2658, 2663, 2668, 2673, 2678, 2683, 2688, 2693, 2698, 2703, + 2708, 2713, 2719, 2725, 2731, 2737, 2743, 2749, 2755, 2761, + 2767, 2773, 2779, 2785, 2791, 2796, 2801, 2806, 2811, 2816, + 2821, 2826, 2831, 2836, 2841, 2846, 2851, 2856, 2861, 2866, + 2871, 2876, 2881, 2886, 2891, 2896, 2901, 2906, 2911, 2916, + 2921, 2926, 2931, 2936, 2941, 2946, 2951, 2956, 2962, 2968, + 2973, 2978, 2983, 2989, 2994, 2999, 3004, 3010, 3015, 3020, + 3025, 3031, 3036, 3041, 3046, 3052, 3058, 3064, 3070, 3075, + 3081, 3087, 3093, 3098, 3103, 3108, 3113, 3118, 3124, 3129, + 3134, 3139, 3145, 3150, 3155, 3160, 3166, 3171, 3176, 3181, + 3187, 3192, 3197, 3202, 3208, 3213, 3218, 3223, 3229, 3234, + 3239, 3244, 3250, 3255, 3260, 3265, 3271, 3276, 3281, 3286, + 3292, 3297, 3302, 3307, 3313, 3318, 3323, 3328, 3334, 3339, + 3344, 3349, 3355, 3360, 3365, 3370, 3376, 3381, 3386, 3391, + 3397, 3402, 3407, 3412, 3418, 3423, 3428, 3433, 3438, 3443, + 3448, 3453, 3458, 3463, 3468, 3473, 3478, 3483, 3488, 3493, + 3498, 3503, 3508, 3513, 3518, 3523, 3528, 3533, 3538, 3544, + 3550, 3556, 3562, 3568, 3574, 3580, 3587, 3594, 3600, 3606, + 3612, 3618, 3625, 3632, 3639, 3646, 3651, 3656, 3660, 3666, + 3672, 3678, 3682, 3686, 3690, 3695, 3711, 3716, 3721, 3729, + 3729, 3745, 3745, 3755, 3758, 3761, 3771, 3784, 3801, 3801, + 3816, 3819, 3832, 3854, 3881, 3885, 3891, 3896, 3907, 3910, + 3916, 3922, 3931, 3934, 3940, 3944, 3945, 3951, 3952, 3953, + 3954, 3955, 3956, 3957, 3958, 3962, 3970, 3971, 3975, 3971, + 3989, 3990, 3994, 3994, 4001, 4001, 4015, 4018, 4028, 4036, + 4047, 4048, 4052, 4055, 4062, 4069, 4073, 4081, 4085, 4094, + 4097, 4104, 4104, 4124, 4127, 4133, 4145, 4157, 4160, 4168, + 4168, 4187, 4187, 4209, 4209, 4230, 4233, 4239, 4242, 4248, + 4252, 4259, 4264, 4269, 4276, 4279, 4283, 4287, 4291, 4300, + 4304, 4313, 4316, 4319, 4327, 4327, 4369, 4374, 4377, 4382, + 4385, 4390, 4393, 4398, 4401, 4406, 4409, 4414, 4417, 4422, + 4426, 4431, 4435, 4440, 4444, 4451, 4454, 4459, 4462, 4465, + 4468, 4471, 4476, 4485, 4496, 4501, 4509, 4513, 4518, 4522, + 4527, 4531, 4536, 4540, 4547, 4550, 4555, 4558, 4561, 4564, + 4569, 4572, 4577, 4583, 4586, 4589, 4592, 4597, 4601, 4606, + 4610, 4615, 4619, 4626, 4629, 4634, 4637, 4642, 4645, 4651, + 4654, 4659, 4662 }; #endif @@ -1298,17 +1311,17 @@ static const char *const yytname[] = "F64MAT2X3", "F64MAT2X4", "F64MAT3X2", "F64MAT3X3", "F64MAT3X4", "F64MAT4X2", "F64MAT4X3", "F64MAT4X4", "ATOMIC_UINT", "ACCSTRUCTNV", "ACCSTRUCTEXT", "RAYQUERYEXT", "FCOOPMATNV", "ICOOPMATNV", "UCOOPMATNV", - "COOPMAT", "COOPVECNV", "HITOBJECTNV", "HITOBJECTATTRNV", - "TENSORLAYOUTNV", "TENSORVIEWNV", "SAMPLERCUBEARRAY", - "SAMPLERCUBEARRAYSHADOW", "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", - "SAMPLER1D", "SAMPLER1DARRAY", "SAMPLER1DARRAYSHADOW", "ISAMPLER1D", - "SAMPLER1DSHADOW", "SAMPLER2DRECT", "SAMPLER2DRECTSHADOW", - "ISAMPLER2DRECT", "USAMPLER2DRECT", "SAMPLERBUFFER", "ISAMPLERBUFFER", - "USAMPLERBUFFER", "SAMPLER2DMS", "ISAMPLER2DMS", "USAMPLER2DMS", - "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", "USAMPLER2DMSARRAY", - "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT", "ISAMPLER1DARRAY", - "USAMPLER1D", "USAMPLER1DARRAY", "F16SAMPLER1D", "F16SAMPLER2D", - "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", + "COOPMAT", "COOPVECNV", "VECTOR", "HITOBJECTNV", "HITOBJECTATTRNV", + "HITOBJECTEXT", "HITOBJECTATTREXT", "TENSORLAYOUTNV", "TENSORVIEWNV", + "TENSORARM", "SAMPLERCUBEARRAY", "SAMPLERCUBEARRAYSHADOW", + "ISAMPLERCUBEARRAY", "USAMPLERCUBEARRAY", "SAMPLER1D", "SAMPLER1DARRAY", + "SAMPLER1DARRAYSHADOW", "ISAMPLER1D", "SAMPLER1DSHADOW", "SAMPLER2DRECT", + "SAMPLER2DRECTSHADOW", "ISAMPLER2DRECT", "USAMPLER2DRECT", + "SAMPLERBUFFER", "ISAMPLERBUFFER", "USAMPLERBUFFER", "SAMPLER2DMS", + "ISAMPLER2DMS", "USAMPLER2DMS", "SAMPLER2DMSARRAY", "ISAMPLER2DMSARRAY", + "USAMPLER2DMSARRAY", "SAMPLEREXTERNALOES", "SAMPLEREXTERNAL2DY2YEXT", + "ISAMPLER1DARRAY", "USAMPLER1D", "USAMPLER1DARRAY", "F16SAMPLER1D", + "F16SAMPLER2D", "F16SAMPLER3D", "F16SAMPLER2DRECT", "F16SAMPLERCUBE", "F16SAMPLER1DARRAY", "F16SAMPLER2DARRAY", "F16SAMPLERCUBEARRAY", "F16SAMPLERBUFFER", "F16SAMPLER2DMS", "F16SAMPLER2DMSARRAY", "F16SAMPLER1DSHADOW", "F16SAMPLER2DSHADOW", "F16SAMPLER1DARRAYSHADOW", @@ -1366,10 +1379,10 @@ static const char *const yytname[] = "DEMOTE", "FUNCTION", "PAYLOADNV", "PAYLOADINNV", "HITATTRNV", "CALLDATANV", "CALLDATAINNV", "PAYLOADEXT", "PAYLOADINEXT", "HITATTREXT", "CALLDATAEXT", "CALLDATAINEXT", "PATCH", "SAMPLE", "NONUNIFORM", - "COHERENT", "VOLATILE", "RESTRICT", "READONLY", "WRITEONLY", - "NONTEMPORAL", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT", - "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE", - "SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD", + "RESOURCEHEAP", "SAMPLERHEAP", "COHERENT", "VOLATILE", "RESTRICT", + "READONLY", "WRITEONLY", "NONTEMPORAL", "DEVICECOHERENT", + "QUEUEFAMILYCOHERENT", "WORKGROUPCOHERENT", "SUBGROUPCOHERENT", + "NONPRIVATE", "SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD", "PERVERTEXEXT", "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", "PERTASKNV", "PERPRIMITIVEEXT", "TASKPAYLOADWORKGROUPEXT", "PRECISE", "$accept", "variable_identifier", "primary_expression", @@ -1396,20 +1409,21 @@ static const char *const yytname[] = "type_specifier", "array_specifier", "type_parameter_specifier_opt", "type_parameter_specifier", "type_parameter_specifier_list", "type_specifier_nonarray", "precision_qualifier", "struct_specifier", - "$@3", "$@4", "struct_declaration_list", "struct_declaration", - "struct_declarator_list", "struct_declarator", "initializer", - "initializer_list", "declaration_statement", "statement", - "simple_statement", "demote_statement", "compound_statement", "$@5", - "$@6", "statement_no_new_scope", "statement_scoped", "$@7", "$@8", + "$@3", "$@4", "struct_declaration_list", "struct_declaration_with_heap", + "block_heap_inner_structure", "$@5", "struct_declaration_without_heap", + "struct_declaration", "struct_declarator_list", "struct_declarator", + "initializer", "initializer_list", "declaration_statement", "statement", + "simple_statement", "demote_statement", "compound_statement", "$@6", + "$@7", "statement_no_new_scope", "statement_scoped", "$@8", "$@9", "compound_statement_no_new_scope", "statement_list", "expression_statement", "selection_statement", "selection_statement_nonattributed", "selection_rest_statement", - "condition", "switch_statement", "switch_statement_nonattributed", "$@9", - "switch_statement_list", "case_label", "iteration_statement", - "iteration_statement_nonattributed", "$@10", "$@11", "$@12", + "condition", "switch_statement", "switch_statement_nonattributed", + "$@10", "switch_statement_list", "case_label", "iteration_statement", + "iteration_statement_nonattributed", "$@11", "$@12", "$@13", "for_init_statement", "conditionopt", "for_rest_statement", "jump_statement", "translation_unit", "external_declaration", - "function_definition", "$@13", "attribute", "attribute_list", + "function_definition", "$@14", "attribute", "attribute_list", "single_attribute", "spirv_requirements_list", "spirv_requirements_parameter", "spirv_extension_list", "spirv_capability_list", "spirv_execution_mode_qualifier", @@ -1431,12 +1445,12 @@ yysymbol_name (yysymbol_kind_t yysymbol) } #endif -#define YYPACT_NINF (-894) +#define YYPACT_NINF (-849) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) -#define YYTABLE_NINF (-712) +#define YYTABLE_NINF (-727) #define yytable_value_is_error(Yyn) \ 0 @@ -1445,103 +1459,105 @@ yysymbol_name (yysymbol_kind_t yysymbol) STATE-NUM. */ static const yytype_int16 yypact[] = { - 4801, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -279, -215, -187, -167, -155, -120, -116, - -95, -894, -894, -894, -894, -894, -330, -894, -894, -894, - -894, -894, -68, -894, -894, -894, -894, -894, -336, -894, - -894, -894, -894, -894, -894, -894, -91, -85, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -327, -179, -319, -227, 8154, - -235, -894, -178, -894, -894, -894, -894, 5759, -894, -894, - -894, -894, -97, -894, -894, 969, -894, -894, 8154, -63, - -894, -894, -894, 6238, -82, -174, -164, -163, -142, -141, - -82, -140, -67, 12736, -894, -30, -373, -57, -894, -286, - -894, -24, -18, 8154, -894, -894, -894, 8154, -51, -49, - -894, -269, -894, -250, -894, -894, 11368, -16, -894, -894, - -894, -13, -47, 8154, -894, -20, -17, -14, -894, -334, - -894, -245, -15, -12, -11, -10, -243, -9, -8, -7, - -6, -5, -4, -240, 3, -2, 7, -244, -894, -19, - 8154, -894, -1, -894, -233, -894, -894, -231, 9544, -894, - -267, 1448, -894, -894, -894, -894, -894, -16, -321, -894, - 10000, -265, -894, -27, -894, -110, 11368, 11368, -894, 11368, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, -296, - -894, -894, -894, 9, -230, 11824, 11, -894, 11368, -894, - 14, -329, 13, -18, 16, -894, -322, -82, -894, -3, - -894, -341, 15, -135, 11368, -134, -894, -156, -130, -181, - -129, 19, -113, -82, -894, 12280, -894, -111, 11368, 17, - -67, -894, 8154, 1, 6717, -894, 8154, 11368, -894, -373, - -894, 4, -894, -894, -50, -220, -237, -317, -121, 8, - 10, 21, 33, 34, -325, 20, -894, 10456, -894, 23, - -894, -894, 24, 22, 25, -894, 26, 29, 32, 10912, - 36, 11368, 35, 39, 40, 42, 44, -170, -894, -894, - -61, -894, -179, 45, 14, -894, -894, -894, -894, -894, - 1927, -894, -894, -894, -894, -894, -894, -894, -894, -894, - 5280, 13, 10000, -264, 8632, -894, -894, 10000, 8154, -894, - 28, -894, -894, -894, -228, -894, -894, 11368, 30, -894, - -894, 11368, 43, -894, -894, -894, 11368, -894, -894, -894, - -338, -894, -894, -217, 37, -894, -894, -894, -894, -894, - -894, -214, -894, -212, -894, -894, -205, 49, -894, -894, - -894, -894, -204, -894, -202, -894, -894, -894, -894, -894, - -197, -894, 62, -894, -195, 64, -193, 37, -894, -288, - -192, -894, 71, 73, -894, -894, 1, -16, -59, -894, - -894, -894, 7196, -894, -894, -894, 11368, 11368, 11368, 11368, - 11368, 11368, 11368, 11368, 11368, 11368, 11368, 11368, 11368, 11368, - 11368, 11368, 11368, 11368, 11368, -894, -894, -894, 74, -894, - 2406, -894, -894, -894, 2406, -894, 11368, -894, -894, -55, - 11368, -133, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, 11368, 11368, - -894, -894, -894, -894, -894, -894, -894, 10000, -894, -894, - -37, -894, 7675, -894, -894, 75, 69, -894, -894, -894, - -894, -894, -147, -146, -894, -328, -894, -341, -894, -341, - -894, 11368, 11368, -894, -156, -894, -156, -894, -181, -181, - -894, 80, 19, -894, 12280, -894, 11368, -894, -894, -54, - 13, 1, -894, -894, -894, -894, -894, -50, -50, -220, - -220, -237, -237, -237, -237, -317, -317, -121, 8, 10, - 21, 33, 34, 11368, -894, 2406, 4322, 38, 3843, -190, - -894, -172, -894, -894, -894, -894, -894, 9088, -894, -894, - -894, 81, -894, 52, -894, -171, -894, -169, -894, -161, - -894, -160, -894, -159, -158, -894, -894, -894, -45, 83, - 69, 50, 88, 90, -894, -894, 4322, 87, -894, -894, - -894, -894, -894, -894, -894, -894, -894, -894, -894, 11368, - -894, 84, 2885, 11368, -894, 82, 93, 53, 96, 3364, - -894, 98, -894, 10000, -894, -894, -894, -157, 11368, 2885, - 87, -894, -894, 2406, -894, 94, 69, -894, -894, 2406, - 92, -894, -894 + 4869, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -289, -249, -213, + -142, -94, -76, -72, -44, -849, -849, -849, -849, -849, + -327, -849, -849, -849, -849, -849, -193, -849, -849, -849, + -849, -849, -352, -849, -849, -849, -849, -849, -849, -849, + -37, -30, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -345, -202, -139, -122, 8749, -310, -849, -117, -849, + -849, -849, -849, 5839, -849, -849, -849, -849, -127, -849, + -849, 989, -849, -849, 8749, -33, -849, -849, -849, 6324, + -63, -294, -244, -168, -150, -140, -63, -138, -51, 13373, + -849, -17, -378, -48, -849, -330, -849, -15, -12, 6809, + -849, -849, -849, 8749, -43, -40, -849, -282, -849, -13, + -144, -849, -849, 11993, -10, -849, -849, -849, -7, -39, + 8749, -849, -11, -14, -5, -849, -324, -849, -239, -9, + -4, -2, -1, -238, 1, 3, 4, 5, 8, 10, + -236, 12, 11, 14, -237, -849, -3, 8749, -849, 15, + -849, -224, -849, -849, -221, 10153, -849, -329, 1474, -849, + -849, 13, -849, -849, -849, -266, -261, -849, 10613, -257, + -849, -20, -849, 11993, 11993, -849, 11993, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, -849, -849, -268, -849, -849, -849, + 19, -217, 12453, 23, -849, 11993, -849, 25, -303, 24, + -12, 27, -849, -332, -63, -849, -8, -849, -325, 28, + -134, 11993, -133, -849, -145, -129, -162, -128, 30, -121, + -63, -849, 12913, -849, -115, 11993, 29, -51, -849, 7294, + 16, 26, 8749, 16, 8749, -849, 8749, 11993, -849, -378, + -849, 17, -849, -849, -41, -45, -254, -326, -109, 18, + 34, 31, 47, 49, -334, 32, -849, 11073, -849, 33, + -849, -849, 39, 35, 36, -849, 44, 48, 37, 11533, + 56, 11993, 54, 60, 62, 63, 67, -169, -849, -849, + -87, -849, -202, 78, 25, -849, -849, -849, -849, -849, + 1959, -849, -849, -849, -849, -849, -849, -849, -849, -849, + 5354, 74, 10613, 24, 10613, -255, 9233, -849, -849, 10613, + 8749, -849, -849, -849, -216, -323, -849, -849, 11993, 45, + -849, -849, 11993, 81, -849, -849, -849, 11993, -849, -849, + -849, -339, -849, -849, -205, 75, -849, -849, -849, -849, + -849, -849, -204, -849, -201, -849, -849, -200, 76, -849, + -849, -849, -849, -197, -849, -192, -849, -849, -849, -849, + -849, -190, -849, 80, -849, -188, 83, -171, 75, -849, + -322, -170, -849, 87, 90, -849, -849, -849, 16, -10, + -81, -849, -849, 8749, 8749, -53, -849, -849, 91, -849, + -849, -849, 11993, 11993, 11993, 11993, 11993, 11993, 11993, 11993, + 11993, 11993, 11993, 11993, 11993, 11993, 11993, 11993, 11993, 11993, + 11993, -849, -849, -849, 89, -849, 2444, -849, -849, -849, + 2444, -849, 11993, -849, -849, -52, 11993, -97, -849, -849, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -849, -849, 11993, 11993, -849, -849, -849, -849, + -849, -849, -849, -849, -849, 10613, -849, -849, -232, -849, + 7779, -849, 11993, 92, 93, -849, -849, -849, -849, -849, + -148, -146, -849, -331, -849, -325, -849, -325, -849, 11993, + 11993, -849, -145, -849, -145, -849, -162, -162, -849, 98, + 30, -849, 12913, -849, 11993, -849, -849, 8749, -42, 24, + 16, -849, -849, -849, -849, -849, -849, -41, -41, -45, + -45, -254, -254, -254, -254, -326, -326, -109, 18, 34, + 31, 47, 49, 11993, -849, 2444, 4384, 57, 3899, -166, + -849, -163, -849, -849, -849, -849, -849, 9693, -849, -849, + -849, -849, 103, -849, 70, -849, -159, -849, -158, -849, + -156, -849, -155, -849, -154, -151, -849, 8264, -849, -849, + -75, 99, 93, 69, 106, 109, -849, -849, 4384, 107, + -849, -849, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, 11993, -849, 101, 2929, 11993, -849, 102, 112, + 66, 113, 3414, -849, 114, -849, 10613, -849, -849, -849, + -147, 11993, 2929, 107, -849, -849, 2444, -849, 110, 93, + -849, -849, 2444, 111, -849, -849 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -1549,141 +1565,143 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_int16 yydefact[] = { - 0, 168, 226, 224, 225, 223, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 227, 228, 229, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 364, 365, 366, 367, 368, 369, 370, 390, 391, 392, - 393, 394, 395, 396, 405, 418, 419, 406, 407, 409, - 408, 410, 411, 412, 413, 414, 415, 416, 417, 177, - 178, 253, 254, 252, 255, 256, 251, 257, 264, 265, - 262, 263, 260, 261, 258, 259, 296, 297, 298, 308, - 309, 310, 293, 294, 295, 305, 306, 307, 290, 291, - 292, 302, 303, 304, 287, 288, 289, 299, 300, 301, - 266, 267, 268, 311, 312, 313, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 323, 324, - 325, 281, 282, 283, 335, 336, 337, 284, 285, 286, - 347, 348, 349, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 326, 327, 328, 329, 330, 331, 332, 333, - 334, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 362, - 359, 360, 361, 546, 547, 548, 549, 553, 555, 182, - 550, 551, 374, 375, 398, 401, 363, 372, 373, 389, - 371, 420, 421, 424, 425, 426, 428, 429, 430, 432, - 433, 434, 436, 437, 533, 534, 397, 399, 400, 376, - 377, 378, 422, 379, 383, 384, 387, 427, 431, 435, - 380, 381, 385, 386, 423, 382, 388, 467, 469, 470, - 471, 473, 474, 475, 477, 478, 479, 481, 482, 483, - 485, 486, 487, 489, 490, 491, 493, 494, 495, 497, - 498, 499, 501, 502, 503, 505, 506, 507, 509, 510, - 468, 472, 476, 480, 484, 492, 496, 500, 488, 504, - 508, 511, 512, 513, 514, 515, 516, 517, 518, 519, - 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 402, 403, 404, 438, 447, 449, 443, - 448, 450, 451, 453, 454, 455, 457, 458, 459, 461, - 462, 463, 465, 466, 439, 440, 441, 452, 442, 444, - 445, 446, 456, 460, 464, 538, 539, 542, 543, 544, - 545, 540, 541, 0, 0, 0, 0, 0, 0, 0, - 0, 166, 167, 535, 536, 537, 0, 648, 137, 558, - 559, 560, 0, 557, 172, 170, 171, 169, 0, 222, - 173, 175, 176, 174, 139, 138, 0, 204, 552, 184, - 186, 181, 188, 190, 185, 187, 183, 189, 191, 179, - 180, 207, 192, 199, 200, 201, 202, 203, 193, 194, - 195, 196, 197, 198, 140, 141, 143, 142, 144, 146, - 147, 145, 206, 154, 647, 0, 649, 0, 114, 113, - 0, 125, 130, 161, 160, 158, 162, 0, 155, 157, - 163, 135, 217, 159, 556, 0, 644, 646, 0, 0, - 164, 165, 554, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 563, 0, 0, 0, 99, 0, - 94, 0, 109, 0, 121, 115, 123, 0, 124, 0, - 97, 131, 102, 0, 156, 136, 0, 210, 216, 1, - 645, 0, 0, 0, 96, 0, 0, 0, 656, 0, - 714, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 654, 0, 652, 0, - 0, 561, 151, 153, 0, 149, 208, 0, 0, 100, - 0, 0, 650, 110, 116, 120, 122, 118, 126, 117, - 0, 132, 105, 0, 103, 0, 0, 0, 9, 0, - 43, 42, 44, 41, 5, 6, 7, 8, 2, 16, - 14, 15, 17, 10, 11, 12, 13, 3, 18, 37, - 20, 25, 26, 0, 0, 30, 0, 220, 0, 36, - 219, 0, 211, 111, 0, 95, 0, 0, 712, 0, - 664, 0, 0, 0, 0, 0, 681, 0, 0, 0, - 0, 0, 0, 0, 706, 0, 679, 0, 0, 0, - 0, 98, 0, 0, 0, 565, 0, 0, 148, 0, - 205, 0, 212, 45, 49, 52, 55, 60, 63, 65, - 67, 69, 71, 73, 75, 0, 34, 0, 101, 592, - 601, 605, 0, 0, 0, 626, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 45, 78, 91, - 0, 579, 0, 163, 135, 582, 603, 581, 589, 580, - 0, 583, 584, 607, 585, 614, 586, 587, 622, 588, - 0, 119, 0, 127, 0, 573, 134, 0, 0, 107, - 0, 104, 38, 39, 0, 22, 23, 0, 0, 28, - 27, 0, 222, 31, 33, 40, 0, 218, 112, 716, - 0, 717, 657, 0, 0, 715, 676, 672, 673, 674, - 675, 0, 670, 0, 93, 677, 0, 0, 691, 692, - 693, 694, 0, 689, 0, 698, 699, 700, 701, 697, - 0, 695, 0, 702, 0, 0, 0, 2, 710, 217, - 0, 708, 0, 0, 651, 653, 0, 571, 0, 569, - 564, 566, 0, 152, 150, 209, 0, 0, 0, 0, + 0, 170, 231, 229, 230, 228, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 232, 233, 234, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 369, 370, 371, 372, 373, 374, 375, 395, 396, 397, + 398, 399, 400, 401, 410, 423, 424, 411, 412, 414, + 413, 415, 416, 417, 418, 419, 420, 421, 422, 179, + 180, 258, 259, 257, 260, 261, 256, 262, 269, 270, + 267, 268, 265, 266, 263, 264, 301, 302, 303, 313, + 314, 315, 298, 299, 300, 310, 311, 312, 295, 296, + 297, 307, 308, 309, 292, 293, 294, 304, 305, 306, + 271, 272, 273, 316, 317, 318, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 328, 329, + 330, 286, 287, 288, 340, 341, 342, 289, 290, 291, + 352, 353, 354, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 367, + 364, 365, 366, 551, 552, 553, 554, 558, 560, 562, + 186, 563, 187, 555, 556, 559, 379, 380, 403, 406, + 368, 377, 378, 394, 376, 425, 426, 429, 430, 431, + 433, 434, 435, 437, 438, 439, 441, 442, 538, 539, + 402, 404, 405, 381, 382, 383, 427, 384, 388, 389, + 392, 432, 436, 440, 385, 386, 390, 391, 428, 387, + 393, 472, 474, 475, 476, 478, 479, 480, 482, 483, + 484, 486, 487, 488, 490, 491, 492, 494, 495, 496, + 498, 499, 500, 502, 503, 504, 506, 507, 508, 510, + 511, 512, 514, 515, 473, 477, 481, 485, 489, 497, + 501, 505, 493, 509, 513, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 532, 533, 534, 535, 536, 537, 407, 408, 409, + 443, 452, 454, 448, 453, 455, 456, 458, 459, 460, + 462, 463, 464, 466, 467, 468, 470, 471, 444, 445, + 446, 457, 447, 449, 450, 451, 461, 465, 469, 543, + 544, 547, 548, 549, 550, 545, 546, 0, 0, 0, + 0, 0, 0, 0, 0, 168, 169, 540, 541, 542, + 0, 663, 139, 566, 567, 568, 0, 565, 174, 172, + 173, 171, 0, 227, 175, 177, 178, 176, 141, 140, + 0, 209, 557, 189, 191, 185, 193, 195, 190, 192, + 188, 194, 196, 181, 182, 212, 183, 184, 197, 204, + 205, 206, 207, 208, 198, 199, 200, 201, 202, 203, + 142, 143, 145, 144, 146, 148, 149, 147, 211, 156, + 662, 0, 664, 0, 114, 113, 0, 127, 132, 163, + 162, 160, 164, 0, 157, 159, 165, 137, 222, 161, + 564, 0, 659, 661, 0, 0, 166, 167, 561, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 76, 213, 214, 0, 591, - 0, 624, 637, 636, 0, 628, 0, 640, 638, 0, - 0, 0, 621, 641, 642, 643, 590, 81, 82, 84, - 83, 86, 87, 88, 89, 90, 85, 80, 0, 0, - 606, 602, 604, 608, 615, 623, 129, 0, 576, 577, - 0, 133, 0, 108, 4, 0, 24, 21, 32, 221, - 660, 662, 0, 0, 713, 0, 666, 0, 665, 0, - 668, 0, 0, 683, 0, 682, 0, 685, 0, 0, - 687, 0, 0, 707, 0, 704, 0, 680, 655, 0, - 572, 0, 567, 562, 46, 47, 48, 51, 50, 53, - 54, 58, 59, 56, 57, 61, 62, 64, 66, 68, - 70, 72, 74, 0, 215, 593, 0, 0, 0, 0, - 639, 0, 620, 79, 92, 128, 574, 0, 106, 19, - 658, 0, 659, 0, 671, 0, 678, 0, 690, 0, - 696, 0, 703, 0, 0, 709, 568, 570, 0, 0, - 612, 0, 0, 0, 631, 630, 633, 599, 616, 575, - 578, 661, 663, 667, 669, 684, 686, 688, 705, 0, - 594, 0, 0, 0, 632, 0, 0, 611, 0, 0, - 609, 0, 77, 0, 596, 625, 595, 0, 634, 0, - 599, 598, 600, 618, 613, 0, 635, 629, 610, 619, - 0, 627, 617 + 571, 0, 0, 0, 100, 0, 95, 0, 109, 0, + 123, 115, 125, 0, 126, 0, 98, 133, 103, 107, + 0, 158, 138, 0, 215, 221, 1, 660, 0, 0, + 0, 97, 0, 0, 0, 671, 0, 729, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 669, 0, 667, 0, 0, 569, 153, + 155, 0, 151, 213, 0, 0, 101, 0, 0, 665, + 110, 0, 116, 122, 124, 119, 128, 118, 0, 134, + 105, 0, 104, 0, 0, 9, 0, 44, 43, 45, + 42, 5, 6, 7, 8, 2, 16, 14, 15, 17, + 10, 11, 12, 13, 3, 18, 37, 20, 25, 26, + 0, 0, 30, 0, 225, 0, 36, 224, 0, 216, + 111, 0, 96, 0, 0, 727, 0, 679, 0, 0, + 0, 0, 0, 696, 0, 0, 0, 0, 0, 0, + 0, 721, 0, 694, 0, 0, 0, 0, 99, 0, + 0, 0, 574, 0, 573, 580, 0, 0, 150, 0, + 210, 0, 217, 46, 50, 53, 56, 61, 64, 66, + 68, 70, 72, 74, 76, 0, 34, 0, 102, 607, + 616, 620, 0, 0, 0, 641, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 46, 79, 92, + 0, 594, 0, 165, 137, 597, 618, 596, 604, 595, + 0, 598, 599, 622, 600, 629, 601, 602, 637, 603, + 0, 0, 0, 120, 0, 129, 0, 588, 136, 0, + 0, 108, 38, 39, 0, 222, 22, 23, 0, 0, + 28, 27, 0, 227, 31, 33, 40, 0, 223, 112, + 731, 0, 732, 672, 0, 0, 730, 691, 687, 688, + 689, 690, 0, 685, 0, 94, 692, 0, 0, 706, + 707, 708, 709, 0, 704, 0, 713, 714, 715, 716, + 712, 0, 710, 0, 717, 0, 0, 0, 2, 725, + 222, 0, 723, 0, 0, 666, 668, 578, 0, 586, + 0, 584, 572, 0, 575, 0, 576, 581, 0, 154, + 152, 214, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 77, 218, 219, 0, 606, 0, 639, 652, 651, + 0, 643, 0, 655, 653, 0, 0, 0, 636, 656, + 657, 658, 605, 82, 83, 85, 84, 87, 88, 89, + 90, 91, 86, 81, 0, 0, 621, 617, 619, 623, + 630, 638, 117, 121, 131, 0, 591, 592, 0, 135, + 0, 4, 0, 0, 24, 21, 32, 226, 675, 677, + 0, 0, 728, 0, 681, 0, 680, 0, 683, 0, + 0, 698, 0, 697, 0, 700, 0, 0, 702, 0, + 0, 722, 0, 719, 0, 695, 670, 0, 0, 587, + 0, 582, 577, 570, 47, 48, 49, 52, 51, 54, + 55, 59, 60, 57, 58, 62, 63, 65, 67, 69, + 71, 73, 75, 0, 220, 608, 0, 0, 0, 0, + 654, 0, 635, 80, 93, 130, 589, 0, 106, 41, + 19, 673, 0, 674, 0, 686, 0, 693, 0, 705, + 0, 711, 0, 718, 0, 0, 724, 0, 583, 585, + 0, 0, 627, 0, 0, 0, 646, 645, 648, 614, + 631, 590, 593, 676, 678, 682, 684, 699, 701, 703, + 720, 579, 0, 609, 0, 0, 0, 647, 0, 0, + 626, 0, 0, 624, 0, 78, 0, 611, 640, 610, + 0, 649, 0, 614, 613, 615, 633, 628, 0, 650, + 644, 625, 634, 0, 642, 632 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -894, -557, -894, -894, -894, -894, -894, -894, -894, -894, - -894, -894, -449, -894, -403, -410, -497, -405, -284, -283, - -285, -282, -281, -280, -894, -501, -894, -511, -894, -525, - -548, 6, -894, -894, -894, 5, -407, -894, -894, 31, - 41, 46, -894, -894, -425, -894, -894, -894, -894, -118, - -894, -408, -388, -894, 12, -894, 0, -451, -894, -894, - -894, -566, 126, -894, -894, -894, -569, -571, -257, -368, - -649, -894, -392, -639, -893, -894, -448, -894, -894, -462, - -461, -894, -894, 47, -746, -386, -894, -165, -894, -423, - -894, -154, -894, -894, -894, -894, -153, -894, -894, -894, - -894, -894, -894, -894, -894, 72, -894, -894, 2, -894, - -94, -318, -485, -894, -894, -894, -324, -326, -333, -894, - -894, -332, -320, -337, -323, -316, -894, -335, -315, -894, - -406, -555 + -849, -569, -849, -849, -849, -849, -849, -849, -849, -849, + -849, -849, -454, -849, -413, -411, -517, -419, -280, -283, + -281, -279, -278, -277, -849, -504, -849, -524, -849, -521, + -545, 7, -849, -849, -849, 6, -412, -849, -849, 41, + 38, 42, -849, -849, -429, -849, -849, -849, -849, -111, + -849, -414, -420, -849, 9, -849, 0, -453, -849, -849, + -849, -528, 144, -849, -849, -849, -104, -98, -849, -849, + -584, -592, -579, -362, -639, -849, -388, -644, -848, -849, + -450, -849, -849, -460, -459, -849, -849, 58, -763, -381, + -849, -149, -849, -416, -849, -141, -849, -849, -849, -849, + -137, -849, -849, -849, -849, -849, -849, -849, -849, 88, + -849, -849, 2, -849, -77, -312, -485, -849, -849, -849, + -321, -320, -319, -849, -849, -318, -317, -316, -333, -328, + -849, -315, -336, -849, -418, -563 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - 0, 547, 548, 549, 815, 550, 551, 552, 553, 554, - 555, 556, 637, 558, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 638, 873, 639, 798, 640, - 728, 641, 405, 668, 525, 642, 407, 408, 409, 454, - 455, 456, 410, 411, 412, 413, 414, 415, 504, 505, - 416, 417, 418, 419, 559, 507, 616, 510, 467, 468, - 561, 422, 423, 424, 596, 500, 594, 595, 738, 739, - 666, 810, 645, 646, 647, 648, 649, 770, 909, 945, - 937, 938, 939, 946, 650, 651, 652, 653, 940, 912, - 654, 655, 941, 960, 656, 657, 658, 876, 774, 878, - 916, 935, 936, 659, 425, 426, 427, 451, 660, 497, - 498, 477, 478, 822, 823, 429, 701, 702, 706, 430, - 431, 712, 713, 720, 721, 724, 432, 730, 731, 433, - 479, 480 + 0, 554, 555, 556, 833, 557, 558, 559, 560, 561, + 562, 563, 647, 565, 614, 615, 616, 617, 618, 619, + 620, 621, 622, 623, 624, 648, 893, 649, 814, 650, + 739, 651, 411, 680, 470, 652, 413, 414, 415, 460, + 461, 462, 416, 417, 418, 419, 420, 421, 511, 512, + 422, 423, 424, 425, 566, 514, 626, 517, 474, 475, + 568, 428, 429, 430, 606, 507, 601, 602, 603, 867, + 604, 605, 750, 751, 678, 828, 655, 656, 657, 658, + 659, 786, 931, 968, 960, 961, 962, 969, 660, 661, + 662, 663, 963, 934, 664, 665, 964, 983, 666, 667, + 668, 896, 790, 898, 938, 958, 959, 669, 431, 432, + 433, 457, 670, 504, 505, 484, 485, 840, 841, 435, + 712, 713, 717, 436, 437, 723, 724, 731, 732, 735, + 438, 741, 742, 439, 486, 487 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -1691,104 +1709,106 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 421, 457, 428, 472, 674, 406, 404, 615, 472, 665, - 521, 802, 420, 806, 695, 809, 562, 557, 811, 729, - 473, 471, 719, 741, 875, 473, 705, 742, 696, 464, - 695, 820, 764, 502, 493, 753, 754, 568, 444, 944, - 733, 689, 442, 569, 683, 457, 952, 689, 686, 743, - 690, 508, 452, 448, 675, 676, 944, 503, 662, 603, - 687, 697, 698, 699, 700, 821, 661, 663, 765, 464, - 445, 755, 756, 704, -35, 691, 677, 672, 673, 449, - 678, 691, 692, -711, 704, 464, 508, 704, 692, -711, - 692, 434, 592, 692, 509, 692, 704, 692, 692, 812, - 466, 519, 692, 508, 779, 617, 781, 617, 617, 685, - 520, 751, 752, 618, 667, 807, 768, 483, 485, 487, - 489, 491, 492, 495, 522, 603, 570, 523, 576, 589, - 524, 584, 571, 590, 577, 877, 603, 585, 598, 603, - 600, 680, 459, 814, 599, 460, 601, 681, 603, 799, - 453, 665, 816, 665, 824, 435, 665, 826, 885, 828, - 569, 693, 749, 827, 750, 829, 830, 833, 603, 835, - 818, 741, 831, 834, 837, 836, 840, 726, 843, 845, - 838, 917, 841, 436, 844, 846, 592, 799, 592, 787, - 788, 789, 790, 791, 792, 793, 794, 795, 796, 918, - 923, 450, 924, 437, 464, 799, 827, 959, 831, 797, - 925, 926, 927, 928, 955, 438, 834, 838, 841, 846, - 799, 715, 716, 717, 718, 538, 890, 892, 461, 481, - 891, 893, 482, 757, 758, 472, 802, 819, 920, 484, - 486, 741, 482, 482, 799, 882, 708, 709, 710, 711, - 439, 879, 473, 471, 440, 881, 861, 862, 863, 864, - 592, 488, 490, 494, 482, 482, 482, 670, 703, 707, - 671, 482, 482, 714, 722, 441, 482, 482, 729, 446, - 729, 719, 719, 896, 705, 447, 850, 883, 884, 695, - 725, 466, 732, 482, 954, 482, 665, 854, 855, 856, - 603, 603, 603, 603, 603, 603, 603, 603, 603, 603, - 603, 603, 603, 603, 603, 603, 799, 474, 851, 800, - 802, 852, 799, 851, 476, 880, 906, 349, 350, 351, - 704, 704, 799, 929, 592, 746, 747, 748, 886, 496, - 887, 859, 860, 704, 501, 704, 857, 858, 908, 506, - 511, 910, 865, 866, 346, 517, 508, 518, 563, 564, - 565, 591, 566, 567, 572, 573, 574, 575, 578, 579, - 580, 581, 582, 583, 586, 587, 665, 588, 597, 669, - 679, 684, 603, 603, -34, 617, 519, 690, 723, 762, - 734, 910, 763, 766, 771, 603, 775, 603, 769, 776, - 759, 760, 772, 694, 592, 773, 780, 737, 947, 458, - 745, 761, 777, 782, -29, -36, 825, 465, 942, 783, - 784, 420, 785, 956, 786, 421, 832, 428, 421, 420, - 406, 404, 665, 421, 813, 428, 817, 420, 475, 839, - 420, 842, 847, 499, 848, 420, 799, 874, 889, 902, - 921, 911, 913, 458, 513, 922, 931, 458, 930, 932, - 933, -597, 948, 943, 949, 420, 560, 962, 473, 420, - 619, 950, 953, 465, 961, 867, 869, 868, 443, 849, - 870, 744, 871, 907, 872, 420, 914, 957, 515, 958, - 951, 911, 915, 934, 514, 803, 735, 470, 512, 897, - 593, 894, 901, 516, 899, 895, 804, 805, 473, 904, - 0, 644, 420, 0, 898, 900, 0, 0, 0, 0, - 0, 0, 0, 643, 0, 0, 903, 0, 0, 0, - 0, 905, 0, 0, 0, 0, 0, 0, 0, 0, + 427, 463, 434, 471, 677, 479, 412, 410, 685, 426, + 479, 625, 757, 706, 529, 684, 818, 730, 754, 564, + 480, 569, 478, 895, 755, 480, 450, 780, 500, 706, + 769, 770, 509, 823, 838, 824, 716, 827, 694, 454, + 829, 700, 700, 471, 701, 463, 515, 627, 707, 448, + 744, 575, 832, -726, 516, 628, 510, 576, 451, -726, + 471, 613, 759, 781, 740, 455, 771, 772, 839, 473, + 473, 465, 673, 675, 466, 702, 702, 715, 697, 682, + 683, 708, 709, 710, 711, 440, 686, 687, 715, 703, + 698, 715, 527, 599, 515, 703, 830, 703, 767, 768, + 703, 528, 703, 715, 703, 703, -35, 967, 688, 703, + 515, 696, 689, 488, 975, 515, 489, 672, 795, 627, + 797, 627, 674, 784, 967, 441, 679, 613, 825, 490, + 492, 494, 496, 498, 499, 502, 577, 583, 613, 591, + 596, 613, 578, 584, 597, 592, 897, 906, 677, 907, + 677, 608, 677, 613, 610, 677, 704, 609, 691, 831, + 611, 442, 757, 491, 692, 815, 489, 834, 836, 868, + 842, 844, 737, 613, 846, 848, 576, 845, 851, 471, + 847, 849, 456, 853, 852, 855, 905, 858, 753, 854, + 599, 856, 599, 859, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 861, 863, 353, 354, 355, 939, + 862, 864, 940, 982, 813, 815, 945, 946, 815, 947, + 948, 949, 845, 849, 950, 852, 856, 859, 978, 911, + 864, 913, 443, 912, 815, 914, 458, 531, 757, 493, + 532, 479, 489, 837, 726, 727, 728, 729, 545, 773, + 774, 818, 881, 882, 883, 884, 480, 495, 478, 459, + 489, 719, 720, 721, 722, 473, 753, 497, 942, 501, + 489, 899, 489, 714, 718, 901, 489, 489, 725, 733, + 444, 489, 489, 927, 815, 902, 736, 730, 730, 489, + 903, 904, 743, 467, 815, 489, 869, 816, 445, 706, + 870, 677, 446, 871, 917, 716, 815, 952, 874, 875, + 876, 613, 613, 613, 613, 613, 613, 613, 613, 613, + 613, 613, 613, 613, 613, 613, 613, 977, 870, 815, + 447, 872, 900, 471, 740, 757, 740, 452, 818, 870, + 753, 765, 928, 766, 453, 715, 715, 483, 762, 763, + 764, 481, 877, 878, 885, 886, 879, 880, 715, 503, + 715, 508, 513, 518, 350, 530, 515, 525, 570, 573, + 526, 571, 930, 572, 579, 932, 574, 580, 909, 581, + 582, 598, 585, 677, 586, 587, 588, 593, 595, 589, + 681, 590, 594, 671, 690, 613, 613, 695, 607, -34, + 627, 527, 705, 734, 701, 752, 745, 778, 613, 782, + 613, 779, 785, 787, 775, 464, 753, 932, 791, 788, + 789, 793, 792, 472, 426, 777, 749, 761, 965, 776, + 796, 427, 426, 434, 427, 970, 798, 412, 410, 427, + 426, 434, 677, 426, 799, 482, 800, 801, 426, 506, + 979, 802, -36, 753, 822, 835, -29, 850, 843, 464, + 520, 857, 865, 464, 860, 866, 894, 933, 426, 910, + 873, 923, 426, 567, 815, 935, 943, 944, 953, 954, + 472, 955, 480, 956, 966, -612, 971, 972, 973, 426, + 985, 629, 976, 888, 984, 887, 889, 522, 760, 890, + 449, 891, 758, 892, 523, 524, 756, 600, 929, 933, + 936, 974, 980, 753, 981, 519, 426, 937, 654, 477, + 746, 819, 957, 921, 480, 915, 916, 653, 926, 820, + 0, 918, 924, 821, 0, 919, 920, 0, 0, 0, + 0, 922, 0, 0, 0, 0, 0, 925, 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, 688, 0, 0, 0, 0, + 0, 0, 699, 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, 736, 0, 593, 0, 593, 0, 0, 0, - 0, 0, 0, 0, 420, 0, 420, 0, 420, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 748, + 0, 0, 600, 0, 600, 0, 600, 0, 426, 0, + 0, 426, 0, 426, 0, 426, 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, - 644, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 421, 0, 643, 0, 0, 0, 0, 0, 593, 0, - 0, 0, 420, 0, 0, 0, 0, 0, 0, 0, - 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 654, 0, 0, 0, 0, 0, 0, 0, 0, 653, + 427, 0, 0, 0, 0, 0, 0, 0, 0, 426, + 600, 0, 0, 0, 0, 0, 0, 0, 0, 426, 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, 593, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 644, 0, 0, 0, 644, 0, 0, 0, 0, 0, - 0, 0, 643, 0, 0, 0, 643, 0, 0, 0, + 0, 0, 0, 748, 600, 0, 0, 0, 0, 0, + 0, 0, 426, 426, 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, 593, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 420, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 654, 0, 0, 0, + 654, 0, 0, 0, 0, 653, 0, 0, 0, 653, 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, + 600, 0, 0, 0, 0, 0, 0, 0, 0, 426, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 644, 644, 0, 644, 0, - 428, 0, 0, 0, 0, 0, 0, 643, 643, 0, - 643, 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, 644, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 643, 0, - 0, 0, 644, 0, 0, 0, 0, 0, 0, 644, - 0, 0, 0, 0, 643, 0, 0, 0, 0, 644, - 0, 643, 0, 644, 0, 0, 0, 0, 0, 644, - 0, 643, 0, 0, 0, 643, 0, 0, 0, 469, - 0, 643, 1, 2, 3, 4, 5, 6, 7, 8, + 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, + 0, 0, 0, 0, 0, 0, 426, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 654, 654, 0, 654, 0, + 434, 0, 0, 0, 653, 653, 0, 653, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 600, 0, 0, + 0, 0, 0, 0, 0, 0, 426, 0, 654, 0, + 0, 0, 0, 0, 0, 0, 0, 653, 0, 0, + 0, 0, 0, 0, 0, 654, 0, 0, 0, 0, + 0, 0, 654, 0, 653, 0, 0, 0, 0, 0, + 0, 653, 654, 0, 0, 0, 654, 0, 0, 0, + 0, 653, 654, 0, 0, 653, 0, 0, 0, 476, + 0, 653, 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, @@ -1822,212 +1842,21 @@ static const yytype_int16 yytable[] = 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 0, 0, 0, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, + 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 356, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 346, 0, 0, 0, 0, 0, 0, 0, 347, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 348, 349, 350, 351, 352, 0, 0, - 0, 0, 0, 0, 0, 0, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 360, 361, - 362, 363, 364, 365, 366, 0, 0, 0, 0, 0, - 0, 0, 0, 367, 0, 368, 369, 370, 371, 372, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 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, 325, 326, 327, 328, 329, - 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 0, 0, 526, 527, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 528, 529, 0, - 346, 0, 619, 620, 0, 0, 0, 0, 621, 530, - 531, 532, 533, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 348, 349, 350, 351, 352, 0, 0, 0, - 534, 535, 536, 537, 538, 353, 354, 355, 356, 357, - 358, 359, 622, 623, 624, 625, 0, 626, 627, 628, - 629, 630, 631, 632, 633, 634, 635, 360, 361, 362, - 363, 364, 365, 366, 539, 540, 541, 542, 543, 544, - 545, 546, 367, 636, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 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, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 0, 0, 526, 527, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 528, 529, 0, 346, - 0, 619, 801, 0, 0, 0, 0, 621, 530, 531, - 532, 533, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 348, 349, 350, 351, 352, 0, 0, 0, 534, - 535, 536, 537, 538, 353, 354, 355, 356, 357, 358, - 359, 622, 623, 624, 625, 0, 626, 627, 628, 629, - 630, 631, 632, 633, 634, 635, 360, 361, 362, 363, - 364, 365, 366, 539, 540, 541, 542, 543, 544, 545, - 546, 367, 636, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 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, 325, 326, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 0, 0, 526, 527, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 528, 529, 0, 346, 0, - 619, 0, 0, 0, 0, 0, 621, 530, 531, 532, - 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 348, 349, 350, 351, 352, 0, 0, 0, 534, 535, - 536, 537, 538, 353, 354, 355, 356, 357, 358, 359, - 622, 623, 624, 625, 0, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 360, 361, 362, 363, 364, - 365, 366, 539, 540, 541, 542, 543, 544, 545, 546, - 367, 636, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 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, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 0, 0, 526, 527, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 528, 529, 0, 346, 0, 511, - 0, 0, 0, 0, 0, 621, 530, 531, 532, 533, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, - 349, 350, 351, 352, 0, 0, 0, 534, 535, 536, - 537, 538, 353, 354, 355, 356, 357, 358, 359, 622, - 623, 624, 625, 0, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 360, 361, 362, 363, 364, 365, - 366, 539, 540, 541, 542, 543, 544, 545, 546, 367, - 636, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 1, 2, 3, + 403, 404, 405, 406, 407, 408, 409, 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, @@ -2062,212 +1891,21 @@ static const yytype_int16 yytable[] = 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 0, 0, 526, 527, 0, 0, 0, 0, + 344, 345, 346, 347, 348, 349, 0, 0, 533, 534, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 529, 0, 346, 0, 0, 0, - 0, 0, 0, 0, 621, 530, 531, 532, 533, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 348, 349, - 350, 351, 352, 0, 0, 0, 534, 535, 536, 537, - 538, 353, 354, 355, 356, 357, 358, 359, 622, 623, - 624, 625, 0, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 360, 361, 362, 363, 364, 365, 366, - 539, 540, 541, 542, 543, 544, 545, 546, 367, 636, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 0, 0, 0, 0, 0, 0, 0, 535, 536, 0, + 350, 0, 629, 630, 0, 0, 0, 0, 631, 537, + 538, 539, 540, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 356, 0, 0, 0, + 541, 542, 543, 544, 545, 357, 358, 359, 360, 361, + 362, 363, 632, 633, 634, 635, 0, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 364, 365, 366, + 367, 368, 369, 370, 546, 547, 548, 549, 550, 551, + 552, 553, 371, 646, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 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, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 0, 0, 526, 527, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 528, 529, 0, 346, 0, 0, 0, 0, - 0, 0, 0, 621, 530, 531, 532, 533, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 348, 349, 350, - 351, 352, 0, 0, 0, 534, 535, 536, 537, 538, - 353, 354, 355, 356, 357, 358, 359, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 360, 361, 362, 363, 364, 365, 366, 539, - 540, 541, 542, 543, 544, 545, 546, 367, 0, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 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, 325, - 326, 327, 328, 329, 330, 331, 332, 0, 0, 0, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, - 0, 0, 526, 527, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 529, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 530, 531, 532, 533, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 348, 349, 350, 351, - 0, 0, 0, 0, 534, 535, 536, 537, 538, 353, - 354, 355, 356, 357, 358, 359, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 361, 362, 363, 364, 365, 366, 539, 540, - 541, 542, 543, 544, 545, 546, 367, 0, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 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, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 344, 345, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 346, 0, 0, 0, 0, 0, 0, - 0, 347, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 348, 349, 350, 351, 352, - 0, 0, 0, 0, 0, 0, 0, 0, 353, 354, - 355, 356, 357, 358, 359, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 360, 361, 362, 363, 364, 365, 366, 0, 0, 0, - 0, 0, 0, 0, 0, 367, 0, 368, 369, 370, - 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 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, 325, 326, 327, - 328, 329, 330, 331, 332, 0, 0, 0, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 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, 348, 349, 350, 351, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 353, 354, 355, - 356, 357, 358, 359, 622, 0, 0, 625, 0, 626, - 627, 0, 0, 630, 0, 0, 0, 0, 0, 360, - 361, 362, 363, 364, 365, 366, 0, 0, 0, 0, - 0, 0, 0, 0, 367, 0, 368, 369, 370, 371, - 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 1, 2, 3, 4, 5, 6, 7, 8, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, @@ -2300,961 +1938,22 @@ static const yytype_int16 yytable[] = 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, 327, 328, - 329, 330, 331, 332, 0, 0, 0, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 0, 0, 0, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 0, 0, 533, 534, 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, 462, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 348, 349, 350, 351, 0, 0, 0, - 0, 0, 0, 0, 0, 463, 353, 354, 355, 356, - 357, 358, 359, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 360, 361, - 362, 363, 364, 365, 366, 0, 0, 0, 0, 0, - 0, 0, 0, 367, 0, 368, 369, 370, 371, 372, + 0, 0, 535, 536, 0, 350, 0, 629, 817, 0, + 0, 0, 0, 631, 537, 538, 539, 540, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 356, 0, 0, 0, 541, 542, 543, 544, 545, + 357, 358, 359, 360, 361, 362, 363, 632, 633, 634, + 635, 0, 636, 637, 638, 639, 640, 641, 642, 643, + 644, 645, 364, 365, 366, 367, 368, 369, 370, 546, + 547, 548, 549, 550, 551, 552, 553, 371, 646, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 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, 325, 326, 327, 328, 329, - 330, 331, 332, 0, 0, 0, 336, 337, 338, 339, - 340, 341, 342, 343, 344, 345, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 346, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 348, 349, 350, 351, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 353, 354, 355, 356, 357, - 358, 359, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 360, 361, 362, - 363, 364, 365, 366, 0, 0, 0, 0, 0, 0, - 0, 0, 367, 0, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, - 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, 325, 326, 327, 328, 329, 330, - 331, 332, 0, 0, 0, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 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, 740, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 348, 349, 350, 351, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 353, 354, 355, 356, 357, 358, - 359, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 360, 361, 362, 363, - 364, 365, 366, 0, 0, 0, 0, 0, 0, 0, - 0, 367, 0, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 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, 325, 326, 327, 328, 329, 330, 331, - 332, 0, 0, 0, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 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, 853, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 348, 349, 350, 351, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 353, 354, 355, 356, 357, 358, 359, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 360, 361, 362, 363, 364, - 365, 366, 0, 0, 0, 0, 0, 0, 0, 0, - 367, 0, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 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, 325, 326, 327, 328, 329, 330, 331, 332, - 0, 0, 0, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 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, - 888, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 348, - 349, 350, 351, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 353, 354, 355, 356, 357, 358, 359, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 360, 361, 362, 363, 364, 365, - 366, 0, 0, 0, 0, 0, 0, 0, 0, 367, - 0, 368, 369, 370, 371, 372, 373, 374, 375, 376, - 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 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, 325, 326, 327, 328, 329, 330, 331, 332, 0, - 0, 0, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 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, 348, 349, - 350, 351, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 353, 354, 355, 356, 357, 358, 359, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 360, 361, 362, 363, 364, 365, 366, - 0, 0, 0, 0, 0, 0, 0, 0, 367, 0, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 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, 0, 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, 327, 328, 329, 330, 331, 332, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 0, 343, 344, 345, - 0, 0, 526, 527, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 529, 0, 0, 0, 664, 808, 0, 0, - 0, 0, 0, 530, 531, 532, 533, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 534, 535, 536, 537, 538, 353, - 0, 0, 0, 0, 358, 359, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 539, 540, - 541, 542, 543, 544, 545, 546, 0, 0, 368, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 381, 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, 0, - 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, 327, 328, 329, - 330, 331, 332, 0, 0, 0, 0, 0, 0, 339, - 0, 0, 0, 343, 344, 345, 0, 0, 526, 527, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 528, 529, 0, - 0, 0, 664, 919, 0, 0, 0, 0, 0, 530, - 531, 532, 533, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 534, 535, 536, 537, 538, 353, 0, 0, 0, 0, - 358, 359, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 539, 540, 541, 542, 543, 544, - 545, 546, 0, 0, 368, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 381, 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, 0, 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, 327, 328, 329, 330, 331, 332, 0, - 0, 0, 0, 0, 0, 339, 0, 0, 0, 343, - 344, 345, 0, 0, 526, 527, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 529, 0, 0, 602, 0, 0, - 0, 0, 0, 0, 0, 530, 531, 532, 533, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 534, 535, 536, 537, - 538, 353, 0, 0, 0, 0, 358, 359, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 539, 540, 541, 542, 543, 544, 545, 546, 0, 0, - 368, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 381, 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, 0, 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, 327, - 328, 329, 330, 331, 332, 0, 0, 0, 0, 0, - 0, 339, 0, 0, 0, 343, 344, 345, 0, 0, - 526, 527, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, - 529, 0, 0, 0, 664, 0, 0, 0, 0, 0, - 0, 530, 531, 532, 533, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 534, 535, 536, 537, 538, 353, 0, 0, - 0, 0, 358, 359, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 539, 540, 541, 542, - 543, 544, 545, 546, 0, 0, 368, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, - 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, 0, 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, 327, 328, 329, 330, 331, - 332, 0, 0, 0, 0, 0, 0, 339, 0, 0, - 0, 343, 344, 345, 0, 0, 526, 527, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 528, 529, 0, 0, 767, - 0, 0, 0, 0, 0, 0, 0, 530, 531, 532, - 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 534, 535, - 536, 537, 538, 353, 0, 0, 0, 0, 358, 359, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 539, 540, 541, 542, 543, 544, 545, 546, - 0, 0, 368, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 381, 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, 0, 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, 327, 328, 329, 330, 331, 332, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 0, 343, 344, 345, - 0, 0, 526, 527, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 529, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 778, 530, 531, 532, 533, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 534, 535, 536, 537, 538, 353, - 0, 0, 0, 0, 358, 359, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 539, 540, - 541, 542, 543, 544, 545, 546, 0, 0, 368, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 381, 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, 0, - 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, 327, 328, 329, - 330, 331, 332, 0, 0, 0, 0, 0, 0, 339, - 0, 0, 0, 343, 344, 345, 0, 0, 526, 527, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 528, 529, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 530, - 531, 532, 533, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 534, 535, 536, 537, 538, 353, 0, 0, 0, 0, - 358, 359, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 539, 540, 541, 542, 543, 544, - 545, 546, 0, 0, 368, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 381, 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, 0, 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, 327, 328, 329, 330, 331, 332, 0, - 0, 0, 0, 0, 0, 339, 0, 0, 0, 343, - 344, 345, 0, 0, 526, 527, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 529, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 530, 531, 532, 533, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 534, 535, 536, 537, - 538, 353, 0, 0, 0, 0, 358, 682, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 539, 540, 541, 542, 543, 544, 545, 546, 0, 0, - 368, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 381, 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, 0, 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, 327, - 328, 329, 330, 331, 332, 0, 0, 0, 0, 0, - 0, 339, 0, 0, 0, 343, 344, 345, 0, 0, - 526, 527, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, - 529, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 530, 531, 532, 533, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 534, 535, 536, 537, 727, 353, 0, 0, - 0, 0, 358, 359, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 539, 540, 541, 542, - 543, 544, 545, 546, 0, 0, 368, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 381, - 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, 0, 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, 327, 328, 329, 330, 331, - 332, 0, 0, 0, 0, 0, 0, 339, 0, 0, - 0, 343, 344, 345, 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, 353, 0, 0, 0, 0, 358, 359, - 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, 368 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 409, 0, 428, 529, 0, 0, 508, 433, 520, - 461, 650, 0, 662, 569, 664, 467, 466, 667, 585, - 428, 428, 579, 594, 770, 433, 574, 596, 369, 417, - 585, 369, 357, 406, 440, 352, 353, 371, 374, 932, - 588, 369, 372, 377, 555, 453, 939, 369, 377, 597, - 372, 372, 371, 380, 350, 351, 949, 430, 379, 508, - 389, 402, 403, 404, 405, 403, 517, 518, 393, 457, - 406, 388, 389, 574, 370, 403, 372, 526, 527, 406, - 376, 403, 567, 371, 585, 473, 372, 588, 573, 377, - 575, 370, 500, 578, 380, 580, 597, 582, 583, 668, - 388, 370, 587, 372, 629, 372, 631, 372, 372, 558, - 379, 348, 349, 380, 379, 379, 617, 435, 436, 437, - 438, 439, 440, 441, 374, 574, 371, 377, 371, 373, - 380, 371, 377, 377, 377, 774, 585, 377, 371, 588, - 371, 371, 377, 371, 377, 380, 377, 377, 597, 377, - 377, 662, 677, 664, 371, 370, 667, 371, 807, 371, - 377, 567, 382, 377, 384, 377, 371, 371, 617, 371, - 681, 742, 377, 377, 371, 377, 371, 583, 371, 371, - 377, 371, 377, 370, 377, 377, 594, 377, 596, 359, - 360, 361, 362, 363, 364, 365, 366, 367, 368, 371, - 371, 380, 371, 370, 592, 377, 377, 953, 377, 379, - 371, 371, 371, 371, 371, 370, 377, 377, 377, 377, - 377, 402, 403, 404, 405, 406, 373, 373, 406, 403, - 377, 377, 406, 354, 355, 660, 875, 686, 887, 403, - 403, 812, 406, 406, 377, 378, 402, 403, 404, 405, - 370, 776, 660, 660, 370, 780, 753, 754, 755, 756, - 668, 403, 403, 403, 406, 406, 406, 377, 403, 403, - 380, 406, 406, 403, 403, 370, 406, 406, 844, 370, - 846, 838, 839, 831, 832, 370, 737, 798, 799, 844, - 403, 388, 403, 406, 943, 406, 807, 746, 747, 748, - 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 377, 380, 377, 380, - 959, 380, 377, 377, 406, 380, 380, 395, 396, 397, - 831, 832, 377, 378, 742, 385, 386, 387, 375, 406, - 377, 751, 752, 844, 374, 846, 749, 750, 873, 406, - 374, 876, 757, 758, 372, 406, 372, 406, 371, 406, - 380, 380, 379, 377, 379, 377, 377, 377, 377, 377, - 377, 377, 377, 377, 371, 377, 887, 370, 379, 406, - 371, 370, 831, 832, 370, 372, 370, 372, 369, 356, - 373, 916, 358, 373, 370, 844, 370, 846, 375, 370, - 392, 391, 380, 406, 812, 380, 370, 406, 933, 409, - 406, 390, 380, 378, 371, 370, 379, 417, 929, 380, - 380, 409, 380, 948, 380, 425, 377, 425, 428, 417, - 425, 425, 943, 433, 406, 433, 406, 425, 433, 377, - 428, 377, 371, 443, 371, 433, 377, 373, 373, 369, - 369, 876, 414, 453, 452, 403, 406, 457, 375, 371, - 370, 374, 380, 379, 371, 453, 466, 375, 876, 457, - 374, 418, 374, 473, 380, 759, 761, 760, 352, 736, - 762, 599, 763, 851, 764, 473, 878, 949, 457, 950, - 938, 916, 878, 916, 453, 660, 590, 425, 451, 832, - 500, 827, 839, 457, 836, 829, 660, 660, 916, 844, - -1, 511, 500, -1, 834, 838, -1, -1, -1, -1, - -1, -1, -1, 511, -1, -1, 842, -1, -1, -1, - -1, 846, -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, 563, -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, 592, -1, 594, -1, 596, -1, -1, -1, - -1, -1, -1, -1, 592, -1, 594, -1, 596, -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, - 650, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 660, -1, 650, -1, -1, -1, -1, -1, 668, -1, - -1, -1, 660, -1, -1, -1, -1, -1, -1, -1, - 668, -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, 742, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 742, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 770, -1, -1, -1, 774, -1, -1, -1, -1, -1, - -1, -1, 770, -1, -1, -1, 774, -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, 812, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 812, -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, 875, 876, -1, 878, -1, - 878, -1, -1, -1, -1, -1, -1, 875, 876, -1, - 878, -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, 916, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 916, -1, - -1, -1, 932, -1, -1, -1, -1, -1, -1, 939, - -1, -1, -1, -1, 932, -1, -1, -1, -1, 949, - -1, 939, -1, 953, -1, -1, -1, -1, -1, 959, - -1, 949, -1, -1, -1, 953, -1, -1, -1, 0, - -1, 959, 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, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 372, -1, -1, -1, -1, -1, -1, -1, 380, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 394, 395, 396, 397, 398, -1, -1, - -1, -1, -1, -1, -1, -1, 407, 408, 409, 410, - 411, 412, 413, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 429, 430, - 431, 432, 433, 434, 435, -1, -1, -1, -1, -1, - -1, -1, -1, 444, -1, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, - 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, - 481, 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, 327, 328, 329, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 369, 370, -1, - 372, -1, 374, 375, -1, -1, -1, -1, 380, 381, - 382, 383, 384, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 394, 395, 396, 397, 398, -1, -1, -1, - 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, - 412, 413, 414, 415, 416, 417, -1, 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, 455, 456, 457, 458, 459, 460, 461, - 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 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, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, -1, -1, 350, 351, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 369, 370, -1, 372, - -1, 374, 375, -1, -1, -1, -1, 380, 381, 382, - 383, 384, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 394, 395, 396, 397, 398, -1, -1, -1, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, -1, 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, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 476, 477, 478, 479, 480, 481, 3, + 403, 404, 405, 406, 407, 408, 409, 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, @@ -3289,26 +1988,657 @@ static const yytype_int16 yycheck[] = 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, -1, -1, 350, 351, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 369, 370, -1, 372, -1, - 374, -1, -1, -1, -1, -1, 380, 381, 382, 383, - 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 394, 395, 396, 397, 398, -1, -1, -1, 402, 403, - 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, -1, 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, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 476, 477, 478, 479, 480, 481, 3, 4, + 344, 345, 346, 347, 348, 349, 0, 0, 533, 534, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 535, 536, 0, + 350, 0, 629, 0, 0, 0, 0, 0, 631, 537, + 538, 539, 540, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 356, 0, 0, 0, + 541, 542, 543, 544, 545, 357, 358, 359, 360, 361, + 362, 363, 632, 633, 634, 635, 0, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 364, 365, 366, + 367, 368, 369, 370, 546, 547, 548, 549, 550, 551, + 552, 553, 371, 646, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 0, 0, 533, 534, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 535, 536, 0, 350, 0, 518, 0, 0, + 0, 0, 0, 631, 537, 538, 539, 540, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 356, 0, 0, 0, 541, 542, 543, 544, 545, + 357, 358, 359, 360, 361, 362, 363, 632, 633, 634, + 635, 0, 636, 637, 638, 639, 640, 641, 642, 643, + 644, 645, 364, 365, 366, 367, 368, 369, 370, 546, + 547, 548, 549, 550, 551, 552, 553, 371, 646, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 0, 0, 533, 534, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 535, 536, 0, + 350, 0, 0, 0, 0, 0, 0, 0, 631, 537, + 538, 539, 540, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 356, 0, 0, 0, + 541, 542, 543, 544, 545, 357, 358, 359, 360, 361, + 362, 363, 632, 633, 634, 635, 0, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 364, 365, 366, + 367, 368, 369, 370, 546, 547, 548, 549, 550, 551, + 552, 553, 371, 646, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 0, 0, 533, 534, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 535, 536, 0, 350, 0, 0, 0, 0, + 0, 0, 0, 631, 537, 538, 539, 540, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 356, 0, 0, 0, 541, 542, 543, 544, 545, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 546, + 547, 548, 549, 550, 551, 552, 553, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 0, 0, 0, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 0, 0, 533, 534, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 535, 536, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 537, + 538, 539, 540, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 0, 0, 0, 0, + 541, 542, 543, 544, 545, 357, 358, 359, 360, 361, + 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 365, 366, + 367, 368, 369, 370, 546, 547, 548, 549, 550, 551, + 552, 553, 371, 0, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 350, 0, 0, 0, 0, + 0, 0, 0, 351, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 356, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 0, 0, 0, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 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, 352, 353, 354, 355, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 357, 358, 359, 360, 361, + 362, 363, 632, 0, 0, 635, 0, 636, 637, 0, + 0, 640, 0, 0, 0, 0, 0, 364, 365, 366, + 367, 368, 369, 370, 0, 0, 0, 0, 0, 0, + 0, 0, 371, 0, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 0, 0, + 0, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 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, 468, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 0, 0, 0, 0, 0, 0, 0, 0, 469, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 0, 0, 0, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 350, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 357, 358, 359, 360, 361, + 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 365, 366, + 367, 368, 369, 370, 0, 0, 0, 0, 0, 0, + 0, 0, 371, 0, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 0, 0, + 0, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 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, 521, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 0, 0, 0, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 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, 747, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 357, 358, 359, 360, 361, + 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 365, 366, + 367, 368, 369, 370, 0, 0, 0, 0, 0, 0, + 0, 0, 371, 0, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 0, 0, + 0, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 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, 908, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 352, 353, 354, + 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, 325, 326, 327, 328, 329, 330, 331, 332, 333, + 334, 335, 336, 0, 0, 0, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 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, 951, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 352, 353, 354, 355, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 357, 358, 359, 360, 361, + 362, 363, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 364, 365, 366, + 367, 368, 369, 370, 0, 0, 0, 0, 0, 0, + 0, 0, 371, 0, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, + 408, 409, 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, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 0, 0, + 0, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 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, 352, 353, 354, + 355, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 358, 359, 360, 361, 362, 363, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 364, 365, 366, 367, 368, 369, 370, 0, + 0, 0, 0, 0, 0, 0, 0, 371, 0, 372, + 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 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, + 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, @@ -3320,7 +2650,7 @@ static const yytype_int16 yycheck[] = 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, + 175, 176, 177, 178, 179, 0, 181, 0, 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, @@ -3336,21 +2666,584 @@ static const yytype_int16 yycheck[] = 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, -1, -1, 350, 351, -1, -1, -1, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 676, 826, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 676, 941, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 612, 0, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 676, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 783, 0, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 794, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 545, 357, 0, 0, 0, 0, 362, + 693, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 0, 0, 533, 534, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 535, 536, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 537, 538, + 539, 540, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 541, + 542, 543, 544, 738, 357, 0, 0, 0, 0, 362, + 363, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 546, 547, 548, 549, 550, 551, 552, + 553, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 385, 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, 0, 181, 0, 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, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 0, 0, 0, 0, 0, 0, 343, 0, + 0, 0, 347, 348, 349, 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, 357, 0, 0, 0, 0, 362, + 363, 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, 372 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 415, 0, 423, 528, 434, 0, 0, 536, 0, + 439, 515, 604, 576, 467, 536, 660, 586, 602, 473, + 434, 474, 434, 786, 603, 439, 378, 361, 446, 592, + 356, 357, 410, 672, 373, 674, 581, 676, 562, 384, + 679, 373, 373, 463, 376, 459, 376, 376, 373, 376, + 595, 375, 375, 375, 384, 384, 434, 381, 410, 381, + 480, 515, 607, 397, 592, 410, 392, 393, 407, 392, + 392, 381, 525, 526, 384, 407, 407, 581, 381, 533, + 534, 406, 407, 408, 409, 374, 354, 355, 592, 574, + 393, 595, 374, 507, 376, 580, 680, 582, 352, 353, + 585, 383, 587, 607, 589, 590, 374, 955, 376, 594, + 376, 565, 380, 407, 962, 376, 410, 383, 639, 376, + 641, 376, 383, 627, 972, 374, 383, 581, 383, 441, + 442, 443, 444, 445, 446, 447, 375, 375, 592, 375, + 377, 595, 381, 381, 381, 381, 790, 379, 672, 381, + 674, 375, 676, 607, 375, 679, 574, 381, 375, 375, + 381, 374, 754, 407, 381, 381, 410, 688, 692, 748, + 375, 375, 590, 627, 375, 375, 381, 381, 375, 599, + 381, 381, 384, 375, 381, 375, 825, 375, 602, 381, + 604, 381, 606, 381, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 375, 375, 399, 400, 401, 375, + 381, 381, 375, 976, 383, 381, 375, 375, 381, 375, + 375, 375, 381, 381, 375, 381, 381, 381, 375, 377, + 381, 377, 374, 381, 381, 381, 375, 381, 830, 407, + 384, 670, 410, 697, 406, 407, 408, 409, 410, 358, + 359, 895, 769, 770, 771, 772, 670, 407, 670, 381, + 410, 406, 407, 408, 409, 392, 680, 407, 907, 407, + 410, 792, 410, 407, 407, 796, 410, 410, 407, 407, + 374, 410, 410, 867, 381, 382, 407, 856, 857, 410, + 814, 815, 407, 410, 381, 410, 749, 384, 374, 862, + 381, 825, 374, 384, 849, 850, 381, 382, 762, 763, + 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, + 774, 775, 776, 777, 778, 779, 780, 966, 381, 381, + 374, 384, 384, 753, 862, 927, 864, 374, 982, 381, + 754, 386, 384, 388, 374, 849, 850, 410, 389, 390, + 391, 384, 765, 766, 773, 774, 767, 768, 862, 410, + 864, 378, 410, 378, 376, 378, 376, 410, 375, 383, + 410, 410, 893, 384, 383, 896, 381, 381, 832, 381, + 381, 384, 381, 907, 381, 381, 381, 375, 374, 381, + 410, 381, 381, 380, 375, 849, 850, 374, 383, 374, + 376, 374, 410, 373, 376, 379, 377, 360, 862, 377, + 864, 362, 379, 374, 396, 415, 830, 938, 374, 384, + 384, 384, 374, 423, 415, 394, 410, 410, 952, 395, + 374, 431, 423, 431, 434, 956, 382, 431, 431, 439, + 431, 439, 966, 434, 384, 439, 384, 384, 439, 449, + 971, 384, 374, 867, 380, 410, 375, 381, 383, 459, + 458, 381, 375, 463, 381, 375, 377, 896, 459, 377, + 379, 373, 463, 473, 381, 418, 373, 407, 379, 410, + 480, 375, 896, 374, 383, 378, 384, 375, 422, 480, + 379, 378, 378, 776, 384, 775, 777, 459, 609, 778, + 356, 779, 606, 780, 463, 463, 604, 507, 870, 938, + 898, 961, 972, 927, 973, 457, 507, 898, 518, 431, + 597, 670, 938, 856, 938, 845, 847, 518, 864, 670, + -1, 850, 860, 670, -1, 852, 854, -1, -1, -1, + -1, 857, -1, -1, -1, -1, -1, 862, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 369, 370, -1, 372, -1, 374, - -1, -1, -1, -1, -1, 380, 381, 382, 383, 384, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, - 395, 396, 397, 398, -1, -1, -1, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, -1, 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, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 3, 4, 5, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 570, -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, 599, + -1, -1, 602, -1, 604, -1, 606, -1, 599, -1, + -1, 602, -1, 604, -1, 606, -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, + 660, -1, -1, -1, -1, -1, -1, -1, -1, 660, + 670, -1, -1, -1, -1, -1, -1, -1, -1, 670, + 680, -1, -1, -1, -1, -1, -1, -1, -1, 680, + -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, 753, 754, -1, -1, -1, -1, -1, + -1, -1, 753, 754, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 786, -1, -1, -1, + 790, -1, -1, -1, -1, 786, -1, -1, -1, 790, + -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, + 830, -1, -1, -1, -1, -1, -1, -1, -1, 830, + -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, 867, -1, -1, + -1, -1, -1, -1, -1, -1, 867, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 895, 896, -1, 898, -1, + 898, -1, -1, -1, 895, 896, -1, 898, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 927, -1, -1, + -1, -1, -1, -1, -1, -1, 927, -1, 938, -1, + -1, -1, -1, -1, -1, -1, -1, 938, -1, -1, + -1, -1, -1, -1, -1, 955, -1, -1, -1, -1, + -1, -1, 962, -1, 955, -1, -1, -1, -1, -1, + -1, 962, 972, -1, -1, -1, 976, -1, -1, -1, + -1, 972, 982, -1, -1, 976, -1, -1, -1, 0, + -1, 982, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 376, -1, -1, -1, -1, + -1, -1, -1, 384, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, -1, -1, -1, -1, -1, -1, -1, -1, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, @@ -3385,212 +3278,21 @@ static const yytype_int16 yycheck[] = 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, -1, -1, 350, 351, -1, -1, -1, -1, + 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 369, 370, -1, 372, -1, -1, -1, - -1, -1, -1, -1, 380, 381, 382, 383, 384, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 394, 395, - 396, 397, 398, -1, -1, -1, 402, 403, 404, 405, + -1, -1, -1, -1, -1, -1, -1, 373, 374, -1, + 376, -1, 378, 379, -1, -1, -1, -1, 384, 385, + 386, 387, 388, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, 402, -1, -1, -1, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, - 416, 417, -1, 419, 420, 421, 422, 423, 424, 425, + 416, 417, 418, 419, 420, 421, -1, 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, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, - 476, 477, 478, 479, 480, 481, 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, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, - 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, -1, -1, 350, 351, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 369, 370, -1, 372, -1, -1, -1, -1, - -1, -1, -1, 380, 381, 382, 383, 384, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 394, 395, 396, - 397, 398, -1, -1, -1, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 429, 430, 431, 432, 433, 434, 435, 436, - 437, 438, 439, 440, 441, 442, 443, 444, -1, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, - 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 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, 327, - 328, 329, 330, 331, 332, 333, 334, -1, -1, -1, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - -1, -1, 350, 351, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 369, 370, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 381, 382, 383, 384, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 394, 395, 396, 397, - -1, -1, -1, -1, 402, 403, 404, 405, 406, 407, - 408, 409, 410, 411, 412, 413, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 429, 430, 431, 432, 433, 434, 435, 436, 437, - 438, 439, 440, 441, 442, 443, 444, -1, 446, 447, - 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, - 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 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, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 372, -1, -1, -1, -1, -1, -1, - -1, 380, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 394, 395, 396, 397, 398, - -1, -1, -1, -1, -1, -1, -1, -1, 407, 408, - 409, 410, 411, 412, 413, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 429, 430, 431, 432, 433, 434, 435, -1, -1, -1, - -1, -1, -1, -1, -1, 444, -1, 446, 447, 448, - 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 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, 327, 328, 329, - 330, 331, 332, 333, 334, -1, -1, -1, 338, 339, - 340, 341, 342, 343, 344, 345, 346, 347, -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, 394, 395, 396, 397, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 407, 408, 409, - 410, 411, 412, 413, 414, -1, -1, 417, -1, 419, - 420, -1, -1, 423, -1, -1, -1, -1, -1, 429, - 430, 431, 432, 433, 434, 435, -1, -1, -1, -1, - -1, -1, -1, -1, 444, -1, 446, 447, 448, 449, - 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, - 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, - 480, 481, 3, 4, 5, 6, 7, 8, 9, 10, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, @@ -3623,213 +3325,22 @@ static const yytype_int16 yycheck[] = 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, 327, 328, 329, 330, - 331, 332, 333, 334, -1, -1, -1, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, -1, -1, -1, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -1, -1, 354, 355, -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, 380, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 394, 395, 396, 397, -1, -1, -1, - -1, -1, -1, -1, -1, 406, 407, 408, 409, 410, - 411, 412, 413, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 429, 430, - 431, 432, 433, 434, 435, -1, -1, -1, -1, -1, - -1, -1, -1, 444, -1, 446, 447, 448, 449, 450, + -1, -1, 373, 374, -1, 376, -1, 378, 379, -1, + -1, -1, -1, 384, 385, 386, 387, 388, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, -1, -1, -1, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, -1, 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, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, - 481, 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, 327, 328, 329, 330, 331, - 332, 333, 334, -1, -1, -1, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 372, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 394, 395, 396, 397, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 407, 408, 409, 410, 411, - 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 429, 430, 431, - 432, 433, 434, 435, -1, -1, -1, -1, -1, -1, - -1, -1, 444, -1, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, - 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 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, 327, 328, 329, 330, 331, 332, - 333, 334, -1, -1, -1, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, -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, 375, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 394, 395, 396, 397, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 407, 408, 409, 410, 411, 412, - 413, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 429, 430, 431, 432, - 433, 434, 435, -1, -1, -1, -1, -1, -1, -1, - -1, 444, -1, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 476, 477, 478, 479, 480, 481, 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, 327, 328, 329, 330, 331, 332, 333, - 334, -1, -1, -1, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, -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, 375, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 394, 395, 396, 397, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 407, 408, 409, 410, 411, 412, 413, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 429, 430, 431, 432, 433, - 434, 435, -1, -1, -1, -1, -1, -1, -1, -1, - 444, -1, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 476, 477, 478, 479, 480, 481, 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, 327, 328, 329, 330, 331, 332, 333, 334, - -1, -1, -1, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, -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, - 375, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 394, - 395, 396, 397, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 407, 408, 409, 410, 411, 412, 413, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 429, 430, 431, 432, 433, 434, - 435, -1, -1, -1, -1, -1, -1, -1, -1, 444, - -1, 446, 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 3, 4, 5, + 481, 482, 483, 484, 485, 486, 487, 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, @@ -3862,119 +3373,77 @@ static const yytype_int16 yycheck[] = 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, 327, 328, 329, 330, 331, 332, 333, 334, -1, - -1, -1, 338, 339, 340, 341, 342, 343, 344, 345, - 346, 347, -1, -1, -1, -1, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, -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, 394, 395, - 396, 397, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 407, 408, 409, 410, 411, 412, 413, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 429, 430, 431, 432, 433, 434, 435, - -1, -1, -1, -1, -1, -1, -1, -1, 444, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, -1, + 376, -1, 378, -1, -1, -1, -1, -1, 384, 385, + 386, 387, 388, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, 402, -1, -1, -1, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, -1, 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, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, - 476, 477, 478, 479, 480, 481, 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, -1, 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, 327, - 328, 329, 330, 331, 332, 333, 334, -1, -1, -1, - -1, -1, -1, 341, -1, -1, -1, 345, 346, 347, - -1, -1, 350, 351, -1, -1, -1, -1, -1, -1, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 369, 370, -1, -1, -1, 374, 375, -1, -1, - -1, -1, -1, 381, 382, 383, 384, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 402, 403, 404, 405, 406, 407, - -1, -1, -1, -1, 412, 413, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 459, 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, -1, - 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, 327, 328, 329, 330, 331, - 332, 333, 334, -1, -1, -1, -1, -1, -1, 341, - -1, -1, -1, 345, 346, 347, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 369, 370, -1, - -1, -1, 374, 375, -1, -1, -1, -1, -1, 381, - 382, 383, 384, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 402, 403, 404, 405, 406, 407, -1, -1, -1, -1, - 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 459, 4, 5, + -1, -1, 373, 374, -1, 376, -1, 378, -1, -1, + -1, -1, -1, 384, 385, 386, 387, 388, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, -1, -1, -1, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, + 421, -1, 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, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, @@ -3986,7 +3455,7 @@ static const yytype_int16 yycheck[] = 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, -1, 182, 183, 184, 185, + 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, @@ -4001,208 +3470,77 @@ static const yytype_int16 yycheck[] = 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, 327, 328, 329, 330, 331, 332, 333, 334, -1, - -1, -1, -1, -1, -1, 341, -1, -1, -1, 345, - 346, 347, -1, -1, 350, 351, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 369, 370, -1, -1, 373, -1, -1, - -1, -1, -1, -1, -1, 381, 382, 383, 384, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, -1, + 376, -1, -1, -1, -1, -1, -1, -1, 384, 385, + 386, 387, 388, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, 402, -1, -1, -1, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, -1, 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, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 402, 403, 404, 405, - 406, 407, -1, -1, -1, -1, 412, 413, -1, -1, + -1, -1, 373, 374, -1, 376, -1, -1, -1, -1, + -1, -1, -1, 384, 385, 386, 387, 388, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, -1, -1, -1, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 459, 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, -1, 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, 327, 328, 329, - 330, 331, 332, 333, 334, -1, -1, -1, -1, -1, - -1, 341, -1, -1, -1, 345, 346, 347, -1, -1, - 350, 351, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, - 370, -1, -1, -1, 374, -1, -1, -1, -1, -1, - -1, 381, 382, 383, 384, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 402, 403, 404, 405, 406, 407, -1, -1, - -1, -1, 412, 413, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, - 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, -1, 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, 327, 328, 329, 330, 331, 332, 333, - 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, - -1, 345, 346, 347, -1, -1, 350, 351, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 369, 370, -1, -1, 373, - -1, -1, -1, -1, -1, -1, -1, 381, 382, 383, - 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 402, 403, - 404, 405, 406, 407, -1, -1, -1, -1, 412, 413, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 436, 437, 438, 439, 440, 441, 442, 443, - -1, -1, 446, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 459, 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, -1, 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, 327, - 328, 329, 330, 331, 332, 333, 334, -1, -1, -1, - -1, -1, -1, 341, -1, -1, -1, 345, 346, 347, - -1, -1, 350, 351, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 369, 370, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 380, 381, 382, 383, 384, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 402, 403, 404, 405, 406, 407, - -1, -1, -1, -1, 412, 413, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 436, 437, - 438, 439, 440, 441, 442, 443, -1, -1, 446, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 459, 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, -1, - 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, 327, 328, 329, 330, 331, - 332, 333, 334, -1, -1, -1, -1, -1, -1, 341, - -1, -1, -1, 345, 346, 347, -1, -1, 350, 351, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 369, 370, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 381, - 382, 383, 384, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 402, 403, 404, 405, 406, 407, -1, -1, -1, -1, - 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 436, 437, 438, 439, 440, 441, - 442, 443, -1, -1, 446, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 459, 4, 5, + -1, -1, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, @@ -4214,7 +3552,7 @@ static const yytype_int16 yycheck[] = 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, -1, 182, 183, 184, 185, + 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, @@ -4229,110 +3567,918 @@ static const yytype_int16 yycheck[] = 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, 327, 328, 329, 330, 331, 332, 333, 334, -1, - -1, -1, -1, -1, -1, 341, -1, -1, -1, 345, - 346, 347, -1, -1, 350, 351, -1, -1, -1, -1, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, -1, -1, -1, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, 354, 355, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 369, 370, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 381, 382, 383, 384, -1, + -1, -1, -1, -1, -1, -1, -1, 373, 374, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 385, + 386, 387, 388, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 433, 434, 435, + 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, -1, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -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, 402, 403, 404, 405, - 406, 407, -1, -1, -1, -1, 412, 413, -1, -1, + -1, -1, -1, -1, -1, 376, -1, -1, -1, -1, + -1, -1, -1, 384, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, 402, -1, -1, -1, -1, -1, -1, -1, -1, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, -1, -1, -1, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 436, 437, 438, 439, 440, 441, 442, 443, -1, -1, - 446, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 459, 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, -1, 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, 327, 328, 329, - 330, 331, 332, 333, 334, -1, -1, -1, -1, -1, - -1, 341, -1, -1, -1, 345, 346, 347, -1, -1, - 350, 351, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 369, - 370, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 381, 382, 383, 384, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 402, 403, 404, 405, 406, 407, -1, -1, - -1, -1, 412, 413, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 436, 437, 438, 439, - 440, 441, 442, 443, -1, -1, 446, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, - 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, -1, 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, 327, 328, 329, 330, 331, 332, 333, - 334, -1, -1, -1, -1, -1, -1, 341, -1, -1, - -1, 345, 346, 347, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 411, 412, 413, 414, 415, + 416, 417, 418, -1, -1, 421, -1, 423, 424, -1, + -1, 427, -1, -1, -1, -1, -1, 433, 434, 435, + 436, 437, 438, 439, -1, -1, -1, -1, -1, -1, + -1, -1, 448, -1, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, + -1, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -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, 384, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, -1, -1, -1, -1, -1, -1, -1, -1, 410, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, -1, -1, -1, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 376, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 411, 412, 413, 414, 415, + 416, 417, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 433, 434, 435, + 436, 437, 438, 439, -1, -1, -1, -1, -1, -1, + -1, -1, 448, -1, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, + -1, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -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, 380, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, -1, -1, -1, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -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, 378, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 411, 412, 413, 414, 415, + 416, 417, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 433, 434, 435, + 436, 437, 438, 439, -1, -1, -1, -1, -1, -1, + -1, -1, 448, -1, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, + -1, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -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, 379, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 398, 399, 400, + 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, -1, -1, -1, 342, 343, 344, 345, + 346, 347, 348, 349, 350, 351, -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, 379, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 398, 399, 400, 401, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 411, 412, 413, 414, 415, + 416, 417, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 433, 434, 435, + 436, 437, 438, 439, -1, -1, -1, -1, -1, -1, + -1, -1, 448, -1, 450, 451, 452, 453, 454, 455, + 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 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, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, -1, -1, + -1, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, -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, 398, 399, 400, + 401, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 411, 412, 413, 414, 415, 416, 417, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 433, 434, 435, 436, 437, 438, 439, -1, + -1, -1, -1, -1, -1, -1, -1, 448, -1, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, 378, 379, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, 378, 379, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + 377, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, 378, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + 377, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 384, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -1, -1, 354, 355, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 373, 374, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 385, 386, + 387, 388, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 406, + 407, 408, 409, 410, 411, -1, -1, -1, -1, 416, + 417, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 440, 441, 442, 443, 444, 445, 446, + 447, -1, -1, 450, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 463, 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, -1, 183, -1, 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, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, -1, -1, -1, -1, -1, -1, 345, -1, + -1, -1, 349, 350, 351, -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, 407, -1, -1, -1, -1, 412, 413, + -1, -1, -1, -1, 411, -1, -1, -1, -1, 416, + 417, -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, 446 + -1, -1, -1, 450 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of @@ -4373,146 +4519,150 @@ static const yytype_int16 yystos[] = 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 372, 380, 394, 395, - 396, 397, 398, 407, 408, 409, 410, 411, 412, 413, - 429, 430, 431, 432, 433, 434, 435, 444, 446, 447, - 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 376, 384, 398, 399, 400, 401, 402, 411, 412, 413, + 414, 415, 416, 417, 433, 434, 435, 436, 437, 438, + 439, 448, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 513, 514, 517, 518, 519, 520, - 524, 525, 526, 527, 528, 529, 532, 533, 534, 535, - 536, 538, 543, 544, 545, 586, 587, 588, 590, 597, - 601, 602, 608, 611, 370, 370, 370, 370, 370, 370, - 370, 370, 372, 544, 374, 406, 370, 370, 380, 406, - 380, 589, 371, 377, 521, 522, 523, 533, 538, 377, - 380, 406, 380, 406, 534, 538, 388, 540, 541, 0, - 587, 518, 526, 533, 380, 517, 406, 593, 594, 612, - 613, 403, 406, 593, 403, 593, 403, 593, 403, 593, - 403, 593, 593, 612, 403, 593, 406, 591, 592, 538, - 547, 374, 406, 430, 530, 531, 406, 537, 372, 380, - 539, 374, 565, 590, 522, 521, 523, 406, 406, 370, - 379, 539, 374, 377, 380, 516, 350, 351, 369, 370, - 381, 382, 383, 384, 402, 403, 404, 405, 406, 436, - 437, 438, 439, 440, 441, 442, 443, 483, 484, 485, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 536, - 538, 542, 539, 371, 406, 380, 379, 377, 371, 377, - 371, 377, 379, 377, 377, 377, 371, 377, 377, 377, - 377, 377, 377, 377, 371, 377, 371, 377, 370, 373, - 377, 380, 533, 538, 548, 549, 546, 379, 371, 377, - 371, 377, 373, 494, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 506, 507, 538, 372, 380, 374, - 375, 380, 414, 415, 416, 417, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 445, 494, 507, 509, - 511, 513, 517, 536, 538, 554, 555, 556, 557, 558, - 566, 567, 568, 569, 572, 573, 576, 577, 578, 585, - 590, 539, 379, 539, 374, 509, 552, 379, 515, 406, - 377, 380, 494, 494, 511, 350, 351, 372, 376, 371, - 371, 377, 413, 509, 370, 494, 377, 389, 590, 369, - 372, 403, 594, 612, 406, 613, 369, 402, 403, 404, - 405, 598, 599, 403, 507, 512, 600, 403, 402, 403, - 404, 405, 603, 604, 403, 402, 403, 404, 405, 483, - 605, 606, 403, 369, 607, 403, 612, 406, 512, 543, - 609, 610, 403, 512, 373, 592, 538, 406, 550, 551, - 375, 549, 548, 512, 531, 406, 385, 386, 387, 382, - 384, 348, 349, 352, 353, 388, 389, 354, 355, 392, - 391, 390, 356, 358, 357, 393, 373, 373, 507, 375, - 559, 370, 380, 380, 580, 370, 370, 380, 380, 511, - 370, 511, 378, 380, 380, 380, 380, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 379, 510, 377, - 380, 375, 555, 569, 573, 578, 552, 379, 375, 552, - 553, 552, 548, 406, 371, 486, 511, 406, 509, 494, - 369, 403, 595, 596, 371, 379, 371, 377, 371, 377, - 371, 377, 377, 371, 377, 371, 377, 371, 377, 377, - 371, 377, 377, 371, 377, 371, 377, 371, 371, 550, - 539, 377, 380, 375, 494, 494, 494, 496, 496, 497, - 497, 498, 498, 498, 498, 499, 499, 500, 501, 502, - 503, 504, 505, 508, 373, 566, 579, 555, 581, 511, - 380, 511, 378, 509, 509, 552, 375, 377, 375, 373, - 373, 377, 373, 377, 599, 598, 512, 600, 604, 603, - 606, 605, 369, 607, 609, 610, 380, 551, 511, 560, - 511, 526, 571, 414, 554, 567, 582, 371, 371, 375, - 552, 369, 403, 371, 371, 371, 371, 371, 371, 378, - 375, 406, 371, 370, 571, 583, 584, 562, 563, 564, - 570, 574, 509, 379, 556, 561, 565, 511, 380, 371, - 418, 558, 556, 374, 552, 371, 511, 561, 562, 566, - 575, 380, 375 + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 519, 520, 523, 524, 525, 526, 530, 531, 532, 533, + 534, 535, 538, 539, 540, 541, 542, 544, 549, 550, + 551, 596, 597, 598, 600, 607, 611, 612, 618, 621, + 374, 374, 374, 374, 374, 374, 374, 374, 376, 550, + 378, 410, 374, 374, 384, 410, 384, 599, 375, 381, + 527, 528, 529, 539, 544, 381, 384, 410, 384, 410, + 522, 540, 544, 392, 546, 547, 0, 597, 524, 532, + 539, 384, 523, 410, 603, 604, 622, 623, 407, 410, + 603, 407, 603, 407, 603, 407, 603, 407, 603, 603, + 622, 407, 603, 410, 601, 602, 544, 553, 378, 410, + 434, 536, 537, 410, 543, 376, 384, 545, 378, 575, + 600, 380, 528, 527, 529, 410, 410, 374, 383, 545, + 378, 381, 384, 354, 355, 373, 374, 385, 386, 387, + 388, 406, 407, 408, 409, 410, 440, 441, 442, 443, + 444, 445, 446, 447, 489, 490, 491, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 542, 544, 548, 545, + 375, 410, 384, 383, 381, 375, 381, 375, 381, 383, + 381, 381, 381, 375, 381, 381, 381, 381, 381, 381, + 381, 375, 381, 375, 381, 374, 377, 381, 384, 539, + 544, 554, 555, 556, 558, 559, 552, 383, 375, 381, + 375, 381, 377, 500, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 544, 376, 384, 378, + 379, 384, 418, 419, 420, 421, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 449, 500, 513, 515, + 517, 519, 523, 542, 544, 564, 565, 566, 567, 568, + 576, 577, 578, 579, 582, 583, 586, 587, 588, 595, + 600, 380, 383, 545, 383, 545, 378, 515, 562, 383, + 521, 410, 500, 500, 517, 549, 354, 355, 376, 380, + 375, 375, 381, 417, 515, 374, 500, 381, 393, 600, + 373, 376, 407, 604, 622, 410, 623, 373, 406, 407, + 408, 409, 608, 609, 407, 513, 518, 610, 407, 406, + 407, 408, 409, 613, 614, 407, 406, 407, 408, 409, + 489, 615, 616, 407, 373, 617, 407, 622, 410, 518, + 549, 619, 620, 407, 518, 377, 602, 378, 544, 410, + 560, 561, 379, 539, 558, 560, 555, 559, 554, 518, + 537, 410, 389, 390, 391, 386, 388, 352, 353, 356, + 357, 392, 393, 358, 359, 396, 395, 394, 360, 362, + 361, 397, 377, 377, 513, 379, 569, 374, 384, 384, + 590, 374, 374, 384, 384, 517, 374, 517, 382, 384, + 384, 384, 384, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 383, 516, 381, 384, 379, 565, 579, + 583, 588, 380, 562, 562, 383, 379, 562, 563, 562, + 558, 375, 375, 492, 517, 410, 515, 500, 373, 407, + 605, 606, 375, 383, 375, 381, 375, 381, 375, 381, + 381, 375, 381, 375, 381, 375, 381, 381, 375, 381, + 381, 375, 381, 375, 381, 375, 375, 557, 560, 545, + 381, 384, 384, 379, 500, 500, 500, 502, 502, 503, + 503, 504, 504, 504, 504, 505, 505, 506, 507, 508, + 509, 510, 511, 514, 377, 576, 589, 565, 591, 517, + 384, 517, 382, 515, 515, 562, 379, 381, 379, 500, + 377, 377, 381, 377, 381, 609, 608, 518, 610, 614, + 613, 616, 615, 373, 617, 619, 620, 558, 384, 561, + 517, 570, 517, 532, 581, 418, 564, 577, 592, 375, + 375, 379, 562, 373, 407, 375, 375, 375, 375, 375, + 375, 379, 382, 379, 410, 375, 374, 581, 593, 594, + 572, 573, 574, 580, 584, 515, 383, 566, 571, 575, + 517, 384, 375, 422, 568, 566, 378, 562, 375, 517, + 571, 572, 576, 585, 384, 379 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = { - 0, 482, 483, 484, 484, 484, 484, 484, 484, 484, - 484, 484, 484, 484, 484, 484, 484, 484, 485, 485, - 485, 485, 485, 485, 486, 487, 488, 489, 489, 490, - 490, 491, 491, 492, 493, 493, 493, 494, 494, 494, - 494, 495, 495, 495, 495, 496, 496, 496, 496, 497, - 497, 497, 498, 498, 498, 499, 499, 499, 499, 499, - 500, 500, 500, 501, 501, 502, 502, 503, 503, 504, - 504, 505, 505, 506, 506, 507, 508, 507, 509, 509, - 510, 510, 510, 510, 510, 510, 510, 510, 510, 510, - 510, 511, 511, 512, 513, 513, 513, 513, 513, 513, - 513, 513, 513, 513, 513, 515, 514, 516, 516, 517, - 517, 517, 517, 518, 518, 519, 519, 520, 521, 521, - 522, 522, 522, 522, 523, 524, 524, 524, 524, 524, - 525, 525, 525, 525, 525, 526, 526, 527, 528, 528, - 528, 528, 528, 528, 528, 528, 528, 528, 529, 530, - 530, 531, 531, 531, 532, 533, 533, 534, 534, 534, - 534, 534, 534, 534, 534, 534, 534, 534, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 535, 535, 535, - 535, 535, 535, 535, 535, 535, 535, 536, 537, 537, - 538, 538, 539, 539, 539, 539, 540, 540, 541, 542, - 542, 542, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 543, 543, - 543, 543, 543, 543, 543, 543, 543, 543, 544, 544, - 544, 546, 545, 547, 545, 548, 548, 549, 549, 550, - 550, 551, 551, 552, 552, 552, 552, 553, 553, 554, - 555, 555, 556, 556, 556, 556, 556, 556, 556, 556, - 557, 558, 559, 560, 558, 561, 561, 563, 562, 564, - 562, 565, 565, 566, 566, 567, 567, 568, 568, 569, - 570, 570, 571, 571, 572, 572, 574, 573, 575, 575, - 576, 576, 577, 577, 579, 578, 580, 578, 581, 578, - 582, 582, 583, 583, 584, 584, 585, 585, 585, 585, - 585, 585, 585, 585, 586, 586, 587, 587, 587, 589, - 588, 590, 591, 591, 592, 592, 593, 593, 594, 594, - 595, 595, 596, 596, 597, 597, 597, 597, 597, 597, - 598, 598, 599, 599, 599, 599, 599, 600, 600, 601, - 601, 602, 602, 602, 602, 602, 602, 602, 602, 603, - 603, 604, 604, 604, 604, 605, 605, 606, 606, 606, - 606, 606, 607, 607, 608, 608, 608, 608, 609, 609, - 610, 610, 611, 611, 612, 612, 613, 613 + 0, 488, 489, 490, 490, 490, 490, 490, 490, 490, + 490, 490, 490, 490, 490, 490, 490, 490, 491, 491, + 491, 491, 491, 491, 492, 493, 494, 495, 495, 496, + 496, 497, 497, 498, 499, 499, 499, 500, 500, 500, + 500, 500, 501, 501, 501, 501, 502, 502, 502, 502, + 503, 503, 503, 504, 504, 504, 505, 505, 505, 505, + 505, 506, 506, 506, 507, 507, 508, 508, 509, 509, + 510, 510, 511, 511, 512, 512, 513, 514, 513, 515, + 515, 516, 516, 516, 516, 516, 516, 516, 516, 516, + 516, 516, 517, 517, 518, 519, 519, 519, 519, 519, + 519, 519, 519, 519, 519, 521, 520, 522, 522, 523, + 523, 523, 523, 524, 524, 525, 525, 525, 526, 527, + 527, 527, 528, 528, 528, 528, 529, 530, 530, 530, + 530, 530, 531, 531, 531, 531, 531, 532, 532, 533, + 534, 534, 534, 534, 534, 534, 534, 534, 534, 534, + 535, 536, 536, 537, 537, 537, 538, 539, 539, 540, + 540, 540, 540, 540, 540, 540, 540, 540, 540, 540, + 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, + 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, + 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, + 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, + 541, 541, 542, 543, 543, 544, 544, 545, 545, 545, + 545, 546, 546, 547, 548, 548, 548, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 549, 549, 549, 549, + 549, 549, 549, 549, 549, 549, 550, 550, 550, 552, + 551, 553, 551, 554, 554, 554, 554, 555, 557, 556, + 558, 558, 559, 559, 560, 560, 561, 561, 562, 562, + 562, 562, 563, 563, 564, 565, 565, 566, 566, 566, + 566, 566, 566, 566, 566, 567, 568, 569, 570, 568, + 571, 571, 573, 572, 574, 572, 575, 575, 576, 576, + 577, 577, 578, 578, 579, 580, 580, 581, 581, 582, + 582, 584, 583, 585, 585, 586, 586, 587, 587, 589, + 588, 590, 588, 591, 588, 592, 592, 593, 593, 594, + 594, 595, 595, 595, 595, 595, 595, 595, 595, 596, + 596, 597, 597, 597, 599, 598, 600, 601, 601, 602, + 602, 603, 603, 604, 604, 605, 605, 606, 606, 607, + 607, 607, 607, 607, 607, 608, 608, 609, 609, 609, + 609, 609, 610, 610, 611, 611, 612, 612, 612, 612, + 612, 612, 612, 612, 613, 613, 614, 614, 614, 614, + 615, 615, 616, 616, 616, 616, 616, 617, 617, 618, + 618, 618, 618, 619, 619, 620, 620, 621, 621, 622, + 622, 623, 623 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ @@ -4522,25 +4672,25 @@ static const yytype_int8 yyr2[] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 3, 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 3, 2, 1, 1, 1, 1, 2, 2, - 2, 1, 1, 1, 1, 1, 3, 3, 3, 1, - 3, 3, 1, 3, 3, 1, 3, 3, 3, 3, - 1, 3, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 0, 6, 1, 3, + 2, 4, 1, 1, 1, 1, 1, 3, 3, 3, + 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, + 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 0, 6, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 1, 2, 3, 2, 2, 4, + 2, 3, 4, 2, 3, 0, 6, 1, 3, 2, + 3, 3, 4, 1, 1, 2, 3, 5, 3, 2, + 3, 4, 2, 1, 2, 1, 1, 1, 3, 4, + 6, 5, 1, 2, 3, 5, 4, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 1, 2, 3, 2, 2, 4, 2, - 3, 4, 2, 3, 4, 0, 6, 2, 3, 2, - 3, 3, 4, 1, 1, 2, 3, 3, 2, 3, - 2, 1, 2, 1, 1, 1, 3, 4, 6, 5, - 1, 2, 3, 5, 4, 1, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 3, 1, 3, 1, 1, 1, 2, 1, 1, 1, + 4, 1, 3, 1, 3, 1, 1, 1, 2, 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, 4, 1, 1, 1, 3, - 2, 3, 2, 3, 3, 4, 1, 0, 3, 1, - 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 4, 1, 1, 1, 3, 2, 3, 2, 3, 3, + 4, 1, 0, 3, 1, 1, 3, 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, @@ -4574,22 +4724,24 @@ static const yytype_int8 yyr2[] = 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, 0, 6, 0, 5, 1, 2, 3, 4, 1, - 3, 1, 2, 1, 3, 4, 2, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 0, 0, 5, 1, 1, 0, 2, 0, - 2, 2, 3, 1, 2, 1, 2, 1, 2, 5, - 3, 1, 1, 4, 1, 2, 0, 8, 0, 1, - 3, 2, 1, 2, 0, 6, 0, 8, 0, 7, - 1, 1, 1, 0, 2, 3, 2, 2, 2, 3, - 2, 2, 2, 2, 1, 2, 1, 1, 1, 0, - 3, 5, 1, 3, 1, 4, 1, 3, 5, 5, - 1, 3, 1, 3, 4, 6, 6, 8, 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, 1, 1, - 1, 1, 1, 3, 6, 8, 4, 6, 1, 3, - 1, 1, 4, 6, 1, 3, 3, 3 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 6, 0, 5, 1, 1, 2, 2, 3, 0, 5, + 1, 2, 3, 4, 1, 3, 1, 2, 1, 3, + 4, 2, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 0, 0, 5, + 1, 1, 0, 2, 0, 2, 2, 3, 1, 2, + 1, 2, 1, 2, 5, 3, 1, 1, 4, 1, + 2, 0, 8, 0, 1, 3, 2, 1, 2, 0, + 6, 0, 8, 0, 7, 1, 1, 1, 0, 2, + 3, 2, 2, 2, 3, 2, 2, 2, 2, 1, + 2, 1, 1, 1, 0, 3, 5, 1, 3, 1, + 4, 1, 3, 5, 5, 1, 3, 1, 3, 4, + 6, 6, 8, 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, 1, 1, 1, 1, 1, 3, 6, + 8, 4, 6, 1, 3, 1, 1, 4, 6, 1, + 3, 3, 3 }; @@ -5331,260 +5483,260 @@ yyreduce: switch (yyn) { case 2: /* variable_identifier: IDENTIFIER */ -#line 360 "MachineIndependent/glslang.y" +#line 365 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } -#line 5339 "MachineIndependent/glslang_tab.cpp" +#line 5491 "MachineIndependent/glslang_tab.cpp" break; case 3: /* primary_expression: variable_identifier */ -#line 366 "MachineIndependent/glslang.y" +#line 371 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5347 "MachineIndependent/glslang_tab.cpp" +#line 5499 "MachineIndependent/glslang_tab.cpp" break; case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */ -#line 369 "MachineIndependent/glslang.y" +#line 374 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } -#line 5357 "MachineIndependent/glslang_tab.cpp" +#line 5509 "MachineIndependent/glslang_tab.cpp" break; case 5: /* primary_expression: FLOATCONSTANT */ -#line 374 "MachineIndependent/glslang.y" +#line 379 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 5365 "MachineIndependent/glslang_tab.cpp" +#line 5517 "MachineIndependent/glslang_tab.cpp" break; case 6: /* primary_expression: INTCONSTANT */ -#line 377 "MachineIndependent/glslang.y" +#line 382 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5373 "MachineIndependent/glslang_tab.cpp" +#line 5525 "MachineIndependent/glslang_tab.cpp" break; case 7: /* primary_expression: UINTCONSTANT */ -#line 380 "MachineIndependent/glslang.y" +#line 385 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5382 "MachineIndependent/glslang_tab.cpp" +#line 5534 "MachineIndependent/glslang_tab.cpp" break; case 8: /* primary_expression: BOOLCONSTANT */ -#line 384 "MachineIndependent/glslang.y" +#line 389 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 5390 "MachineIndependent/glslang_tab.cpp" +#line 5542 "MachineIndependent/glslang_tab.cpp" break; case 9: /* primary_expression: STRING_LITERAL */ -#line 387 "MachineIndependent/glslang.y" +#line 392 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 5398 "MachineIndependent/glslang_tab.cpp" +#line 5550 "MachineIndependent/glslang_tab.cpp" break; case 10: /* primary_expression: INT32CONSTANT */ -#line 390 "MachineIndependent/glslang.y" +#line 395 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5407 "MachineIndependent/glslang_tab.cpp" +#line 5559 "MachineIndependent/glslang_tab.cpp" break; case 11: /* primary_expression: UINT32CONSTANT */ -#line 394 "MachineIndependent/glslang.y" +#line 399 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5416 "MachineIndependent/glslang_tab.cpp" +#line 5568 "MachineIndependent/glslang_tab.cpp" break; case 12: /* primary_expression: INT64CONSTANT */ -#line 398 "MachineIndependent/glslang.y" +#line 403 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } -#line 5425 "MachineIndependent/glslang_tab.cpp" +#line 5577 "MachineIndependent/glslang_tab.cpp" break; case 13: /* primary_expression: UINT64CONSTANT */ -#line 402 "MachineIndependent/glslang.y" +#line 407 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } -#line 5434 "MachineIndependent/glslang_tab.cpp" +#line 5586 "MachineIndependent/glslang_tab.cpp" break; case 14: /* primary_expression: INT16CONSTANT */ -#line 406 "MachineIndependent/glslang.y" +#line 411 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((short)(yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 5443 "MachineIndependent/glslang_tab.cpp" +#line 5595 "MachineIndependent/glslang_tab.cpp" break; case 15: /* primary_expression: UINT16CONSTANT */ -#line 410 "MachineIndependent/glslang.y" +#line 415 "MachineIndependent/glslang.y" { parseContext.explicitInt16Check((yyvsp[0].lex).loc, "16-bit unsigned integer literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((unsigned short)(yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 5452 "MachineIndependent/glslang_tab.cpp" +#line 5604 "MachineIndependent/glslang_tab.cpp" break; case 16: /* primary_expression: DOUBLECONSTANT */ -#line 414 "MachineIndependent/glslang.y" +#line 419 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double literal"); if (! parseContext.symbolTable.atBuiltInLevel()) parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } -#line 5463 "MachineIndependent/glslang_tab.cpp" +#line 5615 "MachineIndependent/glslang_tab.cpp" break; case 17: /* primary_expression: FLOAT16CONSTANT */ -#line 420 "MachineIndependent/glslang.y" +#line 425 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float literal"); (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat16, (yyvsp[0].lex).loc, true); } -#line 5472 "MachineIndependent/glslang_tab.cpp" +#line 5624 "MachineIndependent/glslang_tab.cpp" break; case 18: /* postfix_expression: primary_expression */ -#line 427 "MachineIndependent/glslang.y" +#line 432 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5480 "MachineIndependent/glslang_tab.cpp" +#line 5632 "MachineIndependent/glslang_tab.cpp" break; case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */ -#line 430 "MachineIndependent/glslang.y" +#line 435 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } -#line 5488 "MachineIndependent/glslang_tab.cpp" +#line 5640 "MachineIndependent/glslang_tab.cpp" break; case 20: /* postfix_expression: function_call */ -#line 433 "MachineIndependent/glslang.y" +#line 438 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5496 "MachineIndependent/glslang_tab.cpp" +#line 5648 "MachineIndependent/glslang_tab.cpp" break; case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */ -#line 436 "MachineIndependent/glslang.y" +#line 441 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } -#line 5504 "MachineIndependent/glslang_tab.cpp" +#line 5656 "MachineIndependent/glslang_tab.cpp" break; case 22: /* postfix_expression: postfix_expression INC_OP */ -#line 439 "MachineIndependent/glslang.y" +#line 444 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5514 "MachineIndependent/glslang_tab.cpp" +#line 5666 "MachineIndependent/glslang_tab.cpp" break; case 23: /* postfix_expression: postfix_expression DEC_OP */ -#line 444 "MachineIndependent/glslang.y" +#line 449 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } -#line 5524 "MachineIndependent/glslang_tab.cpp" +#line 5676 "MachineIndependent/glslang_tab.cpp" break; case 24: /* integer_expression: expression */ -#line 452 "MachineIndependent/glslang.y" +#line 457 "MachineIndependent/glslang.y" { - parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); + parseContext.arrayIndexCheck((yyvsp[0].interm.intermTypedNode), "[]"); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5533 "MachineIndependent/glslang_tab.cpp" +#line 5685 "MachineIndependent/glslang_tab.cpp" break; case 25: /* function_call: function_call_or_method */ -#line 459 "MachineIndependent/glslang.y" +#line 464 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); delete (yyvsp[0].interm).function; } -#line 5542 "MachineIndependent/glslang_tab.cpp" +#line 5694 "MachineIndependent/glslang_tab.cpp" break; case 26: /* function_call_or_method: function_call_generic */ -#line 466 "MachineIndependent/glslang.y" +#line 471 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5550 "MachineIndependent/glslang_tab.cpp" +#line 5702 "MachineIndependent/glslang_tab.cpp" break; case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */ -#line 472 "MachineIndependent/glslang.y" +#line 477 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5559 "MachineIndependent/glslang_tab.cpp" +#line 5711 "MachineIndependent/glslang_tab.cpp" break; case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */ -#line 476 "MachineIndependent/glslang.y" +#line 481 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 5568 "MachineIndependent/glslang_tab.cpp" +#line 5720 "MachineIndependent/glslang_tab.cpp" break; case 29: /* function_call_header_no_parameters: function_call_header VOID */ -#line 483 "MachineIndependent/glslang.y" +#line 488 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5576 "MachineIndependent/glslang_tab.cpp" +#line 5728 "MachineIndependent/glslang_tab.cpp" break; case 30: /* function_call_header_no_parameters: function_call_header */ -#line 486 "MachineIndependent/glslang.y" +#line 491 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 5584 "MachineIndependent/glslang_tab.cpp" +#line 5736 "MachineIndependent/glslang_tab.cpp" break; case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */ -#line 492 "MachineIndependent/glslang.y" +#line 497 "MachineIndependent/glslang.y" { if (parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed @@ -5603,11 +5755,11 @@ yyreduce: (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } } -#line 5607 "MachineIndependent/glslang_tab.cpp" +#line 5759 "MachineIndependent/glslang_tab.cpp" break; case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */ -#line 510 "MachineIndependent/glslang.y" +#line 515 "MachineIndependent/glslang.y" { if (parseContext.spvVersion.vulkan > 0 && parseContext.spvVersion.vulkanRelaxed @@ -5630,29 +5782,29 @@ yyreduce: (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } } -#line 5634 "MachineIndependent/glslang_tab.cpp" +#line 5786 "MachineIndependent/glslang_tab.cpp" break; case 33: /* function_call_header: function_identifier LEFT_PAREN */ -#line 535 "MachineIndependent/glslang.y" +#line 540 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-1].interm); } -#line 5642 "MachineIndependent/glslang_tab.cpp" +#line 5794 "MachineIndependent/glslang_tab.cpp" break; case 34: /* function_identifier: type_specifier */ -#line 543 "MachineIndependent/glslang.y" +#line 548 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5652 "MachineIndependent/glslang_tab.cpp" +#line 5804 "MachineIndependent/glslang_tab.cpp" break; case 35: /* function_identifier: postfix_expression */ -#line 548 "MachineIndependent/glslang.y" +#line 553 "MachineIndependent/glslang.y" { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -5662,7 +5814,7 @@ yyreduce: TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); if (method) { - (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); + (yyval.interm).function = new TFunction(&method->getMethodName(), method->getType(), EOpArrayLength); (yyval.interm).intermNode = method->getObject(); } else { TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); @@ -5680,50 +5832,50 @@ yyreduce: (yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull); } } -#line 5684 "MachineIndependent/glslang_tab.cpp" +#line 5836 "MachineIndependent/glslang_tab.cpp" break; case 36: /* function_identifier: non_uniform_qualifier */ -#line 575 "MachineIndependent/glslang.y" +#line 580 "MachineIndependent/glslang.y" { // Constructor (yyval.interm).intermNode = 0; (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 5694 "MachineIndependent/glslang_tab.cpp" +#line 5846 "MachineIndependent/glslang_tab.cpp" break; case 37: /* unary_expression: postfix_expression */ -#line 583 "MachineIndependent/glslang.y" +#line 588 "MachineIndependent/glslang.y" { parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } -#line 5705 "MachineIndependent/glslang_tab.cpp" +#line 5857 "MachineIndependent/glslang_tab.cpp" break; case 38: /* unary_expression: INC_OP unary_expression */ -#line 589 "MachineIndependent/glslang.y" +#line 594 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5714 "MachineIndependent/glslang_tab.cpp" +#line 5866 "MachineIndependent/glslang_tab.cpp" break; case 39: /* unary_expression: DEC_OP unary_expression */ -#line 593 "MachineIndependent/glslang.y" +#line 598 "MachineIndependent/glslang.y" { parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); } -#line 5723 "MachineIndependent/glslang_tab.cpp" +#line 5875 "MachineIndependent/glslang_tab.cpp" break; case 40: /* unary_expression: unary_operator unary_expression */ -#line 597 "MachineIndependent/glslang.y" +#line 602 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; @@ -5740,179 +5892,187 @@ yyreduce: (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } -#line 5744 "MachineIndependent/glslang_tab.cpp" +#line 5896 "MachineIndependent/glslang_tab.cpp" break; - case 41: /* unary_operator: PLUS */ -#line 617 "MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } -#line 5750 "MachineIndependent/glslang_tab.cpp" - break; - - case 42: /* unary_operator: DASH */ + case 41: /* unary_expression: LEFT_PAREN type_specifier_nonarray RIGHT_PAREN unary_expression */ #line 618 "MachineIndependent/glslang.y" + { + (yyval.interm.intermTypedNode) = parseContext.handleTypeCast((yyvsp[-3].lex).loc, new TType((yyvsp[-2].interm.type)), (yyvsp[0].interm.intermTypedNode)); + } +#line 5904 "MachineIndependent/glslang_tab.cpp" + break; + + case 42: /* unary_operator: PLUS */ +#line 625 "MachineIndependent/glslang.y" + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 5910 "MachineIndependent/glslang_tab.cpp" + break; + + case 43: /* unary_operator: DASH */ +#line 626 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } -#line 5756 "MachineIndependent/glslang_tab.cpp" +#line 5916 "MachineIndependent/glslang_tab.cpp" break; - case 43: /* unary_operator: BANG */ -#line 619 "MachineIndependent/glslang.y" + case 44: /* unary_operator: BANG */ +#line 627 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } -#line 5762 "MachineIndependent/glslang_tab.cpp" +#line 5922 "MachineIndependent/glslang_tab.cpp" break; - case 44: /* unary_operator: TILDE */ -#line 620 "MachineIndependent/glslang.y" + case 45: /* unary_operator: TILDE */ +#line 628 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } -#line 5769 "MachineIndependent/glslang_tab.cpp" +#line 5929 "MachineIndependent/glslang_tab.cpp" break; - case 45: /* multiplicative_expression: unary_expression */ -#line 626 "MachineIndependent/glslang.y" + case 46: /* multiplicative_expression: unary_expression */ +#line 634 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5775 "MachineIndependent/glslang_tab.cpp" +#line 5935 "MachineIndependent/glslang_tab.cpp" break; - case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ -#line 627 "MachineIndependent/glslang.y" + case 47: /* multiplicative_expression: multiplicative_expression STAR unary_expression */ +#line 635 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5785 "MachineIndependent/glslang_tab.cpp" +#line 5945 "MachineIndependent/glslang_tab.cpp" break; - case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ -#line 632 "MachineIndependent/glslang.y" + case 48: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */ +#line 640 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5795 "MachineIndependent/glslang_tab.cpp" +#line 5955 "MachineIndependent/glslang_tab.cpp" break; - case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ -#line 637 "MachineIndependent/glslang.y" + case 49: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */ +#line 645 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5806 "MachineIndependent/glslang_tab.cpp" +#line 5966 "MachineIndependent/glslang_tab.cpp" break; - case 49: /* additive_expression: multiplicative_expression */ -#line 646 "MachineIndependent/glslang.y" + case 50: /* additive_expression: multiplicative_expression */ +#line 654 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5812 "MachineIndependent/glslang_tab.cpp" +#line 5972 "MachineIndependent/glslang_tab.cpp" break; - case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */ -#line 647 "MachineIndependent/glslang.y" + case 51: /* additive_expression: additive_expression PLUS multiplicative_expression */ +#line 655 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5822 "MachineIndependent/glslang_tab.cpp" +#line 5982 "MachineIndependent/glslang_tab.cpp" break; - case 51: /* additive_expression: additive_expression DASH multiplicative_expression */ -#line 652 "MachineIndependent/glslang.y" + case 52: /* additive_expression: additive_expression DASH multiplicative_expression */ +#line 660 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5832 "MachineIndependent/glslang_tab.cpp" +#line 5992 "MachineIndependent/glslang_tab.cpp" break; - case 52: /* shift_expression: additive_expression */ -#line 660 "MachineIndependent/glslang.y" + case 53: /* shift_expression: additive_expression */ +#line 668 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5838 "MachineIndependent/glslang_tab.cpp" +#line 5998 "MachineIndependent/glslang_tab.cpp" break; - case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */ -#line 661 "MachineIndependent/glslang.y" + case 54: /* shift_expression: shift_expression LEFT_OP additive_expression */ +#line 669 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5849 "MachineIndependent/glslang_tab.cpp" +#line 6009 "MachineIndependent/glslang_tab.cpp" break; - case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */ -#line 667 "MachineIndependent/glslang.y" + case 55: /* shift_expression: shift_expression RIGHT_OP additive_expression */ +#line 675 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5860 "MachineIndependent/glslang_tab.cpp" +#line 6020 "MachineIndependent/glslang_tab.cpp" break; - case 55: /* relational_expression: shift_expression */ -#line 676 "MachineIndependent/glslang.y" + case 56: /* relational_expression: shift_expression */ +#line 684 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5866 "MachineIndependent/glslang_tab.cpp" +#line 6026 "MachineIndependent/glslang_tab.cpp" break; - case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ -#line 677 "MachineIndependent/glslang.y" + case 57: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */ +#line 685 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5876 "MachineIndependent/glslang_tab.cpp" +#line 6036 "MachineIndependent/glslang_tab.cpp" break; - case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ -#line 682 "MachineIndependent/glslang.y" + case 58: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */ +#line 690 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5886 "MachineIndependent/glslang_tab.cpp" +#line 6046 "MachineIndependent/glslang_tab.cpp" break; - case 58: /* relational_expression: relational_expression LE_OP shift_expression */ -#line 687 "MachineIndependent/glslang.y" + case 59: /* relational_expression: relational_expression LE_OP shift_expression */ +#line 695 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5896 "MachineIndependent/glslang_tab.cpp" +#line 6056 "MachineIndependent/glslang_tab.cpp" break; - case 59: /* relational_expression: relational_expression GE_OP shift_expression */ -#line 692 "MachineIndependent/glslang.y" + case 60: /* relational_expression: relational_expression GE_OP shift_expression */ +#line 700 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5906 "MachineIndependent/glslang_tab.cpp" +#line 6066 "MachineIndependent/glslang_tab.cpp" break; - case 60: /* equality_expression: relational_expression */ -#line 700 "MachineIndependent/glslang.y" + case 61: /* equality_expression: relational_expression */ +#line 708 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5912 "MachineIndependent/glslang_tab.cpp" +#line 6072 "MachineIndependent/glslang_tab.cpp" break; - case 61: /* equality_expression: equality_expression EQ_OP relational_expression */ -#line 701 "MachineIndependent/glslang.y" + case 62: /* equality_expression: equality_expression EQ_OP relational_expression */ +#line 709 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); @@ -5922,11 +6082,11 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5926 "MachineIndependent/glslang_tab.cpp" +#line 6086 "MachineIndependent/glslang_tab.cpp" break; - case 62: /* equality_expression: equality_expression NE_OP relational_expression */ -#line 710 "MachineIndependent/glslang.y" + case 63: /* equality_expression: equality_expression NE_OP relational_expression */ +#line 718 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); @@ -5936,124 +6096,124 @@ yyreduce: if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 5940 "MachineIndependent/glslang_tab.cpp" +#line 6100 "MachineIndependent/glslang_tab.cpp" break; - case 63: /* and_expression: equality_expression */ -#line 722 "MachineIndependent/glslang.y" + case 64: /* and_expression: equality_expression */ +#line 730 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5946 "MachineIndependent/glslang_tab.cpp" +#line 6106 "MachineIndependent/glslang_tab.cpp" break; - case 64: /* and_expression: and_expression AMPERSAND equality_expression */ -#line 723 "MachineIndependent/glslang.y" + case 65: /* and_expression: and_expression AMPERSAND equality_expression */ +#line 731 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5957 "MachineIndependent/glslang_tab.cpp" +#line 6117 "MachineIndependent/glslang_tab.cpp" break; - case 65: /* exclusive_or_expression: and_expression */ -#line 732 "MachineIndependent/glslang.y" + case 66: /* exclusive_or_expression: and_expression */ +#line 740 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5963 "MachineIndependent/glslang_tab.cpp" +#line 6123 "MachineIndependent/glslang_tab.cpp" break; - case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ -#line 733 "MachineIndependent/glslang.y" + case 67: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */ +#line 741 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5974 "MachineIndependent/glslang_tab.cpp" +#line 6134 "MachineIndependent/glslang_tab.cpp" break; - case 67: /* inclusive_or_expression: exclusive_or_expression */ -#line 742 "MachineIndependent/glslang.y" + case 68: /* inclusive_or_expression: exclusive_or_expression */ +#line 750 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5980 "MachineIndependent/glslang_tab.cpp" +#line 6140 "MachineIndependent/glslang_tab.cpp" break; - case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ -#line 743 "MachineIndependent/glslang.y" + case 69: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */ +#line 751 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 5991 "MachineIndependent/glslang_tab.cpp" +#line 6151 "MachineIndependent/glslang_tab.cpp" break; - case 69: /* logical_and_expression: inclusive_or_expression */ -#line 752 "MachineIndependent/glslang.y" + case 70: /* logical_and_expression: inclusive_or_expression */ +#line 760 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 5997 "MachineIndependent/glslang_tab.cpp" +#line 6157 "MachineIndependent/glslang_tab.cpp" break; - case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ -#line 753 "MachineIndependent/glslang.y" + case 71: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */ +#line 761 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 6007 "MachineIndependent/glslang_tab.cpp" +#line 6167 "MachineIndependent/glslang_tab.cpp" break; - case 71: /* logical_xor_expression: logical_and_expression */ -#line 761 "MachineIndependent/glslang.y" + case 72: /* logical_xor_expression: logical_and_expression */ +#line 769 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6013 "MachineIndependent/glslang_tab.cpp" +#line 6173 "MachineIndependent/glslang_tab.cpp" break; - case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ -#line 762 "MachineIndependent/glslang.y" + case 73: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */ +#line 770 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 6023 "MachineIndependent/glslang_tab.cpp" +#line 6183 "MachineIndependent/glslang_tab.cpp" break; - case 73: /* logical_or_expression: logical_xor_expression */ -#line 770 "MachineIndependent/glslang.y" + case 74: /* logical_or_expression: logical_xor_expression */ +#line 778 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6029 "MachineIndependent/glslang_tab.cpp" +#line 6189 "MachineIndependent/glslang_tab.cpp" break; - case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ -#line 771 "MachineIndependent/glslang.y" + case 75: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */ +#line 779 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } -#line 6039 "MachineIndependent/glslang_tab.cpp" +#line 6199 "MachineIndependent/glslang_tab.cpp" break; - case 75: /* conditional_expression: logical_or_expression */ -#line 779 "MachineIndependent/glslang.y" + case 76: /* conditional_expression: logical_or_expression */ +#line 787 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6045 "MachineIndependent/glslang_tab.cpp" +#line 6205 "MachineIndependent/glslang_tab.cpp" break; - case 76: /* $@1: %empty */ -#line 780 "MachineIndependent/glslang.y" + case 77: /* $@1: %empty */ +#line 788 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 6053 "MachineIndependent/glslang_tab.cpp" +#line 6213 "MachineIndependent/glslang_tab.cpp" break; - case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ -#line 783 "MachineIndependent/glslang.y" + case 78: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */ +#line 791 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); @@ -6066,17 +6226,17 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6070 "MachineIndependent/glslang_tab.cpp" +#line 6230 "MachineIndependent/glslang_tab.cpp" break; - case 78: /* assignment_expression: conditional_expression */ -#line 798 "MachineIndependent/glslang.y" + case 79: /* assignment_expression: conditional_expression */ +#line 806 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6076 "MachineIndependent/glslang_tab.cpp" +#line 6236 "MachineIndependent/glslang_tab.cpp" break; - case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */ -#line 799 "MachineIndependent/glslang.y" + case 80: /* assignment_expression: unary_expression assignment_operator assignment_expression */ +#line 807 "MachineIndependent/glslang.y" { parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); @@ -6090,119 +6250,119 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } } -#line 6094 "MachineIndependent/glslang_tab.cpp" +#line 6254 "MachineIndependent/glslang_tab.cpp" break; - case 80: /* assignment_operator: EQUAL */ -#line 815 "MachineIndependent/glslang.y" + case 81: /* assignment_operator: EQUAL */ +#line 823 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAssign; } -#line 6103 "MachineIndependent/glslang_tab.cpp" +#line 6263 "MachineIndependent/glslang_tab.cpp" break; - case 81: /* assignment_operator: MUL_ASSIGN */ -#line 819 "MachineIndependent/glslang.y" + case 82: /* assignment_operator: MUL_ASSIGN */ +#line 827 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpMulAssign; } -#line 6112 "MachineIndependent/glslang_tab.cpp" +#line 6272 "MachineIndependent/glslang_tab.cpp" break; - case 82: /* assignment_operator: DIV_ASSIGN */ -#line 823 "MachineIndependent/glslang.y" + case 83: /* assignment_operator: DIV_ASSIGN */ +#line 831 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpDivAssign; } -#line 6121 "MachineIndependent/glslang_tab.cpp" +#line 6281 "MachineIndependent/glslang_tab.cpp" break; - case 83: /* assignment_operator: MOD_ASSIGN */ -#line 827 "MachineIndependent/glslang.y" + case 84: /* assignment_operator: MOD_ASSIGN */ +#line 835 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpModAssign; } -#line 6131 "MachineIndependent/glslang_tab.cpp" +#line 6291 "MachineIndependent/glslang_tab.cpp" break; - case 84: /* assignment_operator: ADD_ASSIGN */ -#line 832 "MachineIndependent/glslang.y" + case 85: /* assignment_operator: ADD_ASSIGN */ +#line 840 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAddAssign; } -#line 6140 "MachineIndependent/glslang_tab.cpp" +#line 6300 "MachineIndependent/glslang_tab.cpp" break; - case 85: /* assignment_operator: SUB_ASSIGN */ -#line 836 "MachineIndependent/glslang.y" + case 86: /* assignment_operator: SUB_ASSIGN */ +#line 844 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpSubAssign; } -#line 6149 "MachineIndependent/glslang_tab.cpp" +#line 6309 "MachineIndependent/glslang_tab.cpp" break; - case 86: /* assignment_operator: LEFT_ASSIGN */ -#line 840 "MachineIndependent/glslang.y" + case 87: /* assignment_operator: LEFT_ASSIGN */ +#line 848 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } -#line 6158 "MachineIndependent/glslang_tab.cpp" +#line 6318 "MachineIndependent/glslang_tab.cpp" break; - case 87: /* assignment_operator: RIGHT_ASSIGN */ -#line 844 "MachineIndependent/glslang.y" + case 88: /* assignment_operator: RIGHT_ASSIGN */ +#line 852 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } -#line 6167 "MachineIndependent/glslang_tab.cpp" +#line 6327 "MachineIndependent/glslang_tab.cpp" break; - case 88: /* assignment_operator: AND_ASSIGN */ -#line 848 "MachineIndependent/glslang.y" + case 89: /* assignment_operator: AND_ASSIGN */ +#line 856 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } -#line 6176 "MachineIndependent/glslang_tab.cpp" +#line 6336 "MachineIndependent/glslang_tab.cpp" break; - case 89: /* assignment_operator: XOR_ASSIGN */ -#line 852 "MachineIndependent/glslang.y" + case 90: /* assignment_operator: XOR_ASSIGN */ +#line 860 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } -#line 6185 "MachineIndependent/glslang_tab.cpp" +#line 6345 "MachineIndependent/glslang_tab.cpp" break; - case 90: /* assignment_operator: OR_ASSIGN */ -#line 856 "MachineIndependent/glslang.y" + case 91: /* assignment_operator: OR_ASSIGN */ +#line 864 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } -#line 6194 "MachineIndependent/glslang_tab.cpp" +#line 6354 "MachineIndependent/glslang_tab.cpp" break; - case 91: /* expression: assignment_expression */ -#line 863 "MachineIndependent/glslang.y" + case 92: /* expression: assignment_expression */ +#line 871 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6202 "MachineIndependent/glslang_tab.cpp" +#line 6362 "MachineIndependent/glslang_tab.cpp" break; - case 92: /* expression: expression COMMA assignment_expression */ -#line 866 "MachineIndependent/glslang.y" + case 93: /* expression: expression COMMA assignment_expression */ +#line 874 "MachineIndependent/glslang.y" { parseContext.samplerConstructorLocationCheck((yyvsp[-1].lex).loc, ",", (yyvsp[0].interm.intermTypedNode)); (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); @@ -6211,30 +6371,30 @@ yyreduce: (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } -#line 6215 "MachineIndependent/glslang_tab.cpp" +#line 6375 "MachineIndependent/glslang_tab.cpp" break; - case 93: /* constant_expression: conditional_expression */ -#line 877 "MachineIndependent/glslang.y" + case 94: /* constant_expression: conditional_expression */ +#line 885 "MachineIndependent/glslang.y" { parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 6224 "MachineIndependent/glslang_tab.cpp" +#line 6384 "MachineIndependent/glslang_tab.cpp" break; - case 94: /* declaration: function_prototype SEMICOLON */ -#line 884 "MachineIndependent/glslang.y" + case 95: /* declaration: function_prototype SEMICOLON */ +#line 892 "MachineIndependent/glslang.y" { parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6234 "MachineIndependent/glslang_tab.cpp" +#line 6394 "MachineIndependent/glslang_tab.cpp" break; - case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ -#line 889 "MachineIndependent/glslang.y" + case 96: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */ +#line 897 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[-1].interm).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier"); (yyvsp[-1].interm).function->setSpirvInstruction(*(yyvsp[-2].interm.spirvInst)); // Attach SPIR-V intruction qualifier @@ -6242,31 +6402,31 @@ yyreduce: (yyval.interm.intermNode) = 0; // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } -#line 6246 "MachineIndependent/glslang_tab.cpp" +#line 6406 "MachineIndependent/glslang_tab.cpp" break; - case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ -#line 896 "MachineIndependent/glslang.y" + case 97: /* declaration: spirv_execution_mode_qualifier SEMICOLON */ +#line 904 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "SPIR-V execution mode qualifier"); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier"); (yyval.interm.intermNode) = 0; } -#line 6256 "MachineIndependent/glslang_tab.cpp" +#line 6416 "MachineIndependent/glslang_tab.cpp" break; - case 97: /* declaration: init_declarator_list SEMICOLON */ -#line 901 "MachineIndependent/glslang.y" + case 98: /* declaration: init_declarator_list SEMICOLON */ +#line 909 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } -#line 6266 "MachineIndependent/glslang_tab.cpp" +#line 6426 "MachineIndependent/glslang_tab.cpp" break; - case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ -#line 906 "MachineIndependent/glslang.y" + case 99: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */ +#line 914 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope @@ -6274,76 +6434,62 @@ yyreduce: parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } -#line 6278 "MachineIndependent/glslang_tab.cpp" +#line 6438 "MachineIndependent/glslang_tab.cpp" break; - case 99: /* declaration: block_structure SEMICOLON */ -#line 913 "MachineIndependent/glslang.y" - { - parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); - (yyval.interm.intermNode) = 0; - } -#line 6287 "MachineIndependent/glslang_tab.cpp" - break; - - case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */ -#line 917 "MachineIndependent/glslang.y" - { - parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; - } -#line 6296 "MachineIndependent/glslang_tab.cpp" - break; - - case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ + case 100: /* declaration: block_structure SEMICOLON */ #line 921 "MachineIndependent/glslang.y" - { - parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); - (yyval.interm.intermNode) = 0; + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); } -#line 6305 "MachineIndependent/glslang_tab.cpp" +#line 6446 "MachineIndependent/glslang_tab.cpp" break; - case 102: /* declaration: type_qualifier SEMICOLON */ -#line 925 "MachineIndependent/glslang.y" + case 101: /* declaration: block_structure IDENTIFIER SEMICOLON */ +#line 924 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); + } +#line 6454 "MachineIndependent/glslang_tab.cpp" + break; + + case 102: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */ +#line 927 "MachineIndependent/glslang.y" + { + (yyval.interm.intermNode) = parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); + } +#line 6462 "MachineIndependent/glslang_tab.cpp" + break; + + case 103: /* declaration: type_qualifier SEMICOLON */ +#line 930 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } -#line 6315 "MachineIndependent/glslang_tab.cpp" +#line 6472 "MachineIndependent/glslang_tab.cpp" break; - case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */ -#line 930 "MachineIndependent/glslang.y" - { - parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); - parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); - (yyval.interm.intermNode) = 0; - } -#line 6325 "MachineIndependent/glslang_tab.cpp" - break; - - case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */ + case 104: /* declaration: type_qualifier identifier_list SEMICOLON */ #line 935 "MachineIndependent/glslang.y" - { - parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); - (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); - parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + { + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); (yyval.interm.intermNode) = 0; } -#line 6336 "MachineIndependent/glslang_tab.cpp" +#line 6482 "MachineIndependent/glslang_tab.cpp" break; case 105: /* $@2: %empty */ -#line 944 "MachineIndependent/glslang.y" +#line 943 "MachineIndependent/glslang.y" { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } -#line 6342 "MachineIndependent/glslang_tab.cpp" +#line 6488 "MachineIndependent/glslang_tab.cpp" break; - case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */ -#line 944 "MachineIndependent/glslang.y" - { + case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_without_heap RIGHT_BRACE */ +#line 943 "MachineIndependent/glslang.y" + { --parseContext.blockNestingLevel; parseContext.blockName = (yyvsp[-4].lex).string; parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); @@ -6352,16 +6498,16 @@ yyreduce: (yyval.interm).loc = (yyvsp[-5].interm.type).loc; (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } -#line 6356 "MachineIndependent/glslang_tab.cpp" +#line 6502 "MachineIndependent/glslang_tab.cpp" break; - case 107: /* identifier_list: COMMA IDENTIFIER */ + case 107: /* identifier_list: IDENTIFIER */ #line 955 "MachineIndependent/glslang.y" - { + { (yyval.interm.identifierList) = new TIdentifierList; (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6365 "MachineIndependent/glslang_tab.cpp" +#line 6511 "MachineIndependent/glslang_tab.cpp" break; case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */ @@ -6370,7 +6516,7 @@ yyreduce: (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } -#line 6374 "MachineIndependent/glslang_tab.cpp" +#line 6520 "MachineIndependent/glslang_tab.cpp" break; case 109: /* function_prototype: function_declarator RIGHT_PAREN */ @@ -6380,7 +6526,7 @@ yyreduce: if (parseContext.compileOnly) (yyval.interm).function->setExport(); (yyval.interm).loc = (yyvsp[0].lex).loc; } -#line 6384 "MachineIndependent/glslang_tab.cpp" +#line 6530 "MachineIndependent/glslang_tab.cpp" break; case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */ @@ -6393,7 +6539,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[-1].lex).loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6397 "MachineIndependent/glslang_tab.cpp" +#line 6543 "MachineIndependent/glslang_tab.cpp" break; case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */ @@ -6406,7 +6552,7 @@ yyreduce: parseContext.requireExtensions((yyvsp[0].lex).loc, 2, extensions, "attribute"); parseContext.handleFunctionAttributes((yyvsp[0].lex).loc, *(yyvsp[-2].interm.attributes)); } -#line 6410 "MachineIndependent/glslang_tab.cpp" +#line 6556 "MachineIndependent/glslang_tab.cpp" break; case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */ @@ -6420,7 +6566,7 @@ yyreduce: parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes)); parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes)); } -#line 6424 "MachineIndependent/glslang_tab.cpp" +#line 6570 "MachineIndependent/glslang_tab.cpp" break; case 113: /* function_declarator: function_header */ @@ -6428,7 +6574,7 @@ yyreduce: { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6432 "MachineIndependent/glslang_tab.cpp" +#line 6578 "MachineIndependent/glslang_tab.cpp" break; case 114: /* function_declarator: function_header_with_parameters */ @@ -6436,7 +6582,7 @@ yyreduce: { (yyval.interm.function) = (yyvsp[0].interm.function); } -#line 6440 "MachineIndependent/glslang_tab.cpp" +#line 6586 "MachineIndependent/glslang_tab.cpp" break; case 115: /* function_header_with_parameters: function_header parameter_declaration */ @@ -6454,7 +6600,7 @@ yyreduce: else delete (yyvsp[0].interm).param.type; } -#line 6458 "MachineIndependent/glslang_tab.cpp" +#line 6604 "MachineIndependent/glslang_tab.cpp" break; case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */ @@ -6479,11 +6625,20 @@ yyreduce: parseContext.vkRelaxedRemapFunctionParameter((yyvsp[-2].interm.function), (yyvsp[0].interm).param); } } -#line 6483 "MachineIndependent/glslang_tab.cpp" +#line 6629 "MachineIndependent/glslang_tab.cpp" break; - case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ -#line 1045 "MachineIndependent/glslang.y" + case 117: /* function_header_with_parameters: function_header_with_parameters COMMA DOT DOT DOT */ +#line 1042 "MachineIndependent/glslang.y" + { + (yyval.interm.function) = (yyvsp[-4].interm.function); + parseContext.makeVariadic((yyvsp[-4].interm.function), (yyvsp[-2].lex).loc); + } +#line 6638 "MachineIndependent/glslang_tab.cpp" + break; + + case 118: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */ +#line 1049 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", @@ -6503,11 +6658,11 @@ yyreduce: function = new TFunction((yyvsp[-1].lex).string, type); (yyval.interm.function) = function; } -#line 6507 "MachineIndependent/glslang_tab.cpp" +#line 6662 "MachineIndependent/glslang_tab.cpp" break; - case 118: /* parameter_declarator: type_specifier IDENTIFIER */ -#line 1068 "MachineIndependent/glslang.y" + case 119: /* parameter_declarator: type_specifier IDENTIFIER */ +#line 1072 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6523,11 +6678,11 @@ yyreduce: (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).param = param; } -#line 6527 "MachineIndependent/glslang_tab.cpp" +#line 6682 "MachineIndependent/glslang_tab.cpp" break; - case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ -#line 1083 "MachineIndependent/glslang.y" + case 120: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */ +#line 1087 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -6547,173 +6702,186 @@ yyreduce: (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).param = param; } -#line 6551 "MachineIndependent/glslang_tab.cpp" +#line 6706 "MachineIndependent/glslang_tab.cpp" break; - case 120: /* parameter_declaration: type_qualifier parameter_declarator */ -#line 1108 "MachineIndependent/glslang.y" + case 121: /* parameter_declarator: type_specifier IDENTIFIER EQUAL initializer */ +#line 1106 "MachineIndependent/glslang.y" + { + TParameter param = parseContext.getParamWithDefault((yyvsp[-3].interm.type), (yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).param = param; + } +#line 6716 "MachineIndependent/glslang_tab.cpp" + break; + + case 122: /* parameter_declaration: type_qualifier parameter_declarator */ +#line 1117 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMatOrVec()); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6567 "MachineIndependent/glslang_tab.cpp" +#line 6732 "MachineIndependent/glslang_tab.cpp" break; - case 121: /* parameter_declaration: parameter_declarator */ -#line 1119 "MachineIndependent/glslang.y" + case 123: /* parameter_declaration: parameter_declarator */ +#line 1128 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMatOrVec()); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); } -#line 6579 "MachineIndependent/glslang_tab.cpp" +#line 6744 "MachineIndependent/glslang_tab.cpp" break; - case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */ -#line 1129 "MachineIndependent/glslang.y" + case 124: /* parameter_declaration: type_qualifier parameter_type_specifier */ +#line 1138 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMatOrVec()); + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } -#line 6594 "MachineIndependent/glslang_tab.cpp" +#line 6759 "MachineIndependent/glslang_tab.cpp" break; - case 123: /* parameter_declaration: parameter_type_specifier */ -#line 1139 "MachineIndependent/glslang.y" + case 125: /* parameter_declaration: parameter_type_specifier */ +#line 1148 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); parseContext.paramCheckFixStorage((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->isCoopMatOrVec()); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier(), (yyval.interm).param.type->hasTypeParameter()); } -#line 6606 "MachineIndependent/glslang_tab.cpp" +#line 6771 "MachineIndependent/glslang_tab.cpp" break; - case 124: /* parameter_type_specifier: type_specifier */ -#line 1149 "MachineIndependent/glslang.y" + case 126: /* parameter_type_specifier: type_specifier */ +#line 1158 "MachineIndependent/glslang.y" { TParameter param = { 0, new TType((yyvsp[0].interm.type)), {} }; (yyval.interm).param = param; if ((yyvsp[0].interm.type).arraySizes) parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } -#line 6617 "MachineIndependent/glslang_tab.cpp" +#line 6782 "MachineIndependent/glslang_tab.cpp" break; - case 125: /* init_declarator_list: single_declaration */ -#line 1158 "MachineIndependent/glslang.y" + case 127: /* init_declarator_list: single_declaration */ +#line 1167 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[0].interm); } -#line 6625 "MachineIndependent/glslang_tab.cpp" +#line 6790 "MachineIndependent/glslang_tab.cpp" break; - case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ -#line 1161 "MachineIndependent/glslang.y" + case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */ +#line 1170 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, declNode, (yyvsp[0].lex).loc); } -#line 6634 "MachineIndependent/glslang_tab.cpp" +#line 6800 "MachineIndependent/glslang_tab.cpp" break; - case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ -#line 1165 "MachineIndependent/glslang.y" + case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */ +#line 1175 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-3].interm).intermNode, declNode, (yyvsp[-1].lex).loc); } -#line 6643 "MachineIndependent/glslang_tab.cpp" +#line 6810 "MachineIndependent/glslang_tab.cpp" break; - case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ -#line 1169 "MachineIndependent/glslang.y" + case 130: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */ +#line 1180 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-5].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, declNode, (yyvsp[-1].lex).loc); } -#line 6653 "MachineIndependent/glslang_tab.cpp" +#line 6820 "MachineIndependent/glslang_tab.cpp" break; - case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ -#line 1174 "MachineIndependent/glslang.y" + case 131: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */ +#line 1185 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, declNode, (yyvsp[-1].lex).loc); } -#line 6663 "MachineIndependent/glslang_tab.cpp" +#line 6830 "MachineIndependent/glslang_tab.cpp" break; - case 130: /* single_declaration: fully_specified_type */ -#line 1182 "MachineIndependent/glslang.y" + case 132: /* single_declaration: fully_specified_type */ +#line 1193 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } -#line 6673 "MachineIndependent/glslang_tab.cpp" +#line 6840 "MachineIndependent/glslang_tab.cpp" break; - case 131: /* single_declaration: fully_specified_type IDENTIFIER */ -#line 1187 "MachineIndependent/glslang.y" + case 133: /* single_declaration: fully_specified_type IDENTIFIER */ +#line 1198 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-1].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[0].lex).loc); + } -#line 6683 "MachineIndependent/glslang_tab.cpp" +#line 6851 "MachineIndependent/glslang_tab.cpp" break; - case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ -#line 1192 "MachineIndependent/glslang.y" + case 134: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */ +#line 1204 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-2].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-1].lex).loc); } -#line 6693 "MachineIndependent/glslang_tab.cpp" +#line 6861 "MachineIndependent/glslang_tab.cpp" break; - case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ -#line 1197 "MachineIndependent/glslang.y" + case 135: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */ +#line 1209 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-4].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-3].lex).loc); } -#line 6703 "MachineIndependent/glslang_tab.cpp" +#line 6871 "MachineIndependent/glslang_tab.cpp" break; - case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 1202 "MachineIndependent/glslang.y" + case 136: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 1214 "MachineIndependent/glslang.y" { (yyval.interm).type = (yyvsp[-3].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + TIntermNode* declNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(nullptr, declNode, (yyvsp[-2].lex).loc); } -#line 6713 "MachineIndependent/glslang_tab.cpp" +#line 6881 "MachineIndependent/glslang_tab.cpp" break; - case 135: /* fully_specified_type: type_specifier */ -#line 1211 "MachineIndependent/glslang.y" + case 137: /* fully_specified_type: type_specifier */ +#line 1223 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6722,13 +6890,13 @@ yyreduce: parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); } - parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier, (yyval.interm.type).isCoopmatOrvec()); + parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier, (yyval.interm.type).hasTypeParameter()); } -#line 6728 "MachineIndependent/glslang_tab.cpp" +#line 6896 "MachineIndependent/glslang_tab.cpp" break; - case 136: /* fully_specified_type: type_qualifier type_specifier */ -#line 1221 "MachineIndependent/glslang.y" + case 138: /* fully_specified_type: type_qualifier type_specifier */ +#line 1233 "MachineIndependent/glslang.y" { parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, false, &(yyvsp[0].interm.type)); parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); @@ -6744,7 +6912,7 @@ yyreduce: parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier, (yyvsp[0].interm.type).isCoopmatOrvec()); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier, (yyvsp[0].interm.type).hasTypeParameter()); (yyval.interm.type) = (yyvsp[0].interm.type); @@ -6753,22 +6921,22 @@ yyreduce: (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } -#line 6757 "MachineIndependent/glslang_tab.cpp" +#line 6925 "MachineIndependent/glslang_tab.cpp" break; - case 137: /* invariant_qualifier: INVARIANT */ -#line 1248 "MachineIndependent/glslang.y" + case 139: /* invariant_qualifier: INVARIANT */ +#line 1260 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.invariant = true; } -#line 6768 "MachineIndependent/glslang_tab.cpp" +#line 6936 "MachineIndependent/glslang_tab.cpp" break; - case 138: /* interpolation_qualifier: SMOOTH */ -#line 1257 "MachineIndependent/glslang.y" + case 140: /* interpolation_qualifier: SMOOTH */ +#line 1269 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); @@ -6776,11 +6944,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.smooth = true; } -#line 6780 "MachineIndependent/glslang_tab.cpp" +#line 6948 "MachineIndependent/glslang_tab.cpp" break; - case 139: /* interpolation_qualifier: FLAT */ -#line 1264 "MachineIndependent/glslang.y" + case 141: /* interpolation_qualifier: FLAT */ +#line 1276 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); @@ -6788,11 +6956,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.flat = true; } -#line 6792 "MachineIndependent/glslang_tab.cpp" +#line 6960 "MachineIndependent/glslang_tab.cpp" break; - case 140: /* interpolation_qualifier: NOPERSPECTIVE */ -#line 1271 "MachineIndependent/glslang.y" + case 142: /* interpolation_qualifier: NOPERSPECTIVE */ +#line 1283 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective"); @@ -6800,11 +6968,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nopersp = true; } -#line 6804 "MachineIndependent/glslang_tab.cpp" +#line 6972 "MachineIndependent/glslang_tab.cpp" break; - case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */ -#line 1278 "MachineIndependent/glslang.y" + case 143: /* interpolation_qualifier: EXPLICITINTERPAMD */ +#line 1290 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "__explicitInterpAMD"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation"); @@ -6812,11 +6980,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.explicitInterp = true; } -#line 6816 "MachineIndependent/glslang_tab.cpp" +#line 6984 "MachineIndependent/glslang_tab.cpp" break; - case 142: /* interpolation_qualifier: PERVERTEXNV */ -#line 1285 "MachineIndependent/glslang.y" + case 144: /* interpolation_qualifier: PERVERTEXNV */ +#line 1297 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6825,11 +6993,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexNV = true; } -#line 6829 "MachineIndependent/glslang_tab.cpp" +#line 6997 "MachineIndependent/glslang_tab.cpp" break; - case 143: /* interpolation_qualifier: PERVERTEXEXT */ -#line 1293 "MachineIndependent/glslang.y" + case 145: /* interpolation_qualifier: PERVERTEXEXT */ +#line 1305 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "pervertexEXT"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric"); @@ -6838,11 +7006,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.pervertexEXT = true; } -#line 6842 "MachineIndependent/glslang_tab.cpp" +#line 7010 "MachineIndependent/glslang_tab.cpp" break; - case 144: /* interpolation_qualifier: PERPRIMITIVENV */ -#line 1301 "MachineIndependent/glslang.y" + case 146: /* interpolation_qualifier: PERPRIMITIVENV */ +#line 1313 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV"); @@ -6853,11 +7021,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6857 "MachineIndependent/glslang_tab.cpp" +#line 7025 "MachineIndependent/glslang_tab.cpp" break; - case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */ -#line 1311 "MachineIndependent/glslang.y" + case 147: /* interpolation_qualifier: PERPRIMITIVEEXT */ +#line 1323 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT"); @@ -6868,11 +7036,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perPrimitiveNV = true; } -#line 6872 "MachineIndependent/glslang_tab.cpp" +#line 7040 "MachineIndependent/glslang_tab.cpp" break; - case 146: /* interpolation_qualifier: PERVIEWNV */ -#line 1321 "MachineIndependent/glslang.y" + case 148: /* interpolation_qualifier: PERVIEWNV */ +#line 1333 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV"); @@ -6880,11 +7048,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perViewNV = true; } -#line 6884 "MachineIndependent/glslang_tab.cpp" +#line 7052 "MachineIndependent/glslang_tab.cpp" break; - case 147: /* interpolation_qualifier: PERTASKNV */ -#line 1328 "MachineIndependent/glslang.y" + case 149: /* interpolation_qualifier: PERTASKNV */ +#line 1340 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV"); @@ -6892,84 +7060,84 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.perTaskNV = true; } -#line 6896 "MachineIndependent/glslang_tab.cpp" +#line 7064 "MachineIndependent/glslang_tab.cpp" break; - case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ -#line 1338 "MachineIndependent/glslang.y" + case 150: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */ +#line 1350 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); } -#line 6904 "MachineIndependent/glslang_tab.cpp" +#line 7072 "MachineIndependent/glslang_tab.cpp" break; - case 149: /* layout_qualifier_id_list: layout_qualifier_id */ -#line 1344 "MachineIndependent/glslang.y" + case 151: /* layout_qualifier_id_list: layout_qualifier_id */ +#line 1356 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6912 "MachineIndependent/glslang_tab.cpp" +#line 7080 "MachineIndependent/glslang_tab.cpp" break; - case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ -#line 1347 "MachineIndependent/glslang.y" + case 152: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */ +#line 1359 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-2].interm.type); (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6922 "MachineIndependent/glslang_tab.cpp" +#line 7090 "MachineIndependent/glslang_tab.cpp" break; - case 151: /* layout_qualifier_id: IDENTIFIER */ -#line 1354 "MachineIndependent/glslang.y" + case 153: /* layout_qualifier_id: IDENTIFIER */ +#line 1366 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } -#line 6931 "MachineIndependent/glslang_tab.cpp" +#line 7099 "MachineIndependent/glslang_tab.cpp" break; - case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ -#line 1358 "MachineIndependent/glslang.y" + case 154: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */ +#line 1370 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-2].lex).loc); parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } -#line 6940 "MachineIndependent/glslang_tab.cpp" +#line 7108 "MachineIndependent/glslang_tab.cpp" break; - case 153: /* layout_qualifier_id: SHARED */ -#line 1362 "MachineIndependent/glslang.y" + case 155: /* layout_qualifier_id: SHARED */ +#line 1374 "MachineIndependent/glslang.y" { // because "shared" is both an identifier and a keyword (yyval.interm.type).init((yyvsp[0].lex).loc); TString strShared("shared"); parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } -#line 6950 "MachineIndependent/glslang_tab.cpp" +#line 7118 "MachineIndependent/glslang_tab.cpp" break; - case 154: /* precise_qualifier: PRECISE */ -#line 1370 "MachineIndependent/glslang.y" + case 156: /* precise_qualifier: PRECISE */ +#line 1382 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.noContraction = true; } -#line 6961 "MachineIndependent/glslang_tab.cpp" +#line 7129 "MachineIndependent/glslang_tab.cpp" break; - case 155: /* type_qualifier: single_type_qualifier */ -#line 1379 "MachineIndependent/glslang.y" + case 157: /* type_qualifier: single_type_qualifier */ +#line 1391 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6969 "MachineIndependent/glslang_tab.cpp" +#line 7137 "MachineIndependent/glslang_tab.cpp" break; - case 156: /* type_qualifier: type_qualifier single_type_qualifier */ -#line 1382 "MachineIndependent/glslang.y" + case 158: /* type_qualifier: type_qualifier single_type_qualifier */ +#line 1394 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); if ((yyval.interm.type).basicType == EbtVoid) @@ -6978,151 +7146,151 @@ yyreduce: (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } -#line 6982 "MachineIndependent/glslang_tab.cpp" +#line 7150 "MachineIndependent/glslang_tab.cpp" break; - case 157: /* single_type_qualifier: storage_qualifier */ -#line 1393 "MachineIndependent/glslang.y" + case 159: /* single_type_qualifier: storage_qualifier */ +#line 1405 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6990 "MachineIndependent/glslang_tab.cpp" +#line 7158 "MachineIndependent/glslang_tab.cpp" break; - case 158: /* single_type_qualifier: layout_qualifier */ -#line 1396 "MachineIndependent/glslang.y" + case 160: /* single_type_qualifier: layout_qualifier */ +#line 1408 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 6998 "MachineIndependent/glslang_tab.cpp" +#line 7166 "MachineIndependent/glslang_tab.cpp" break; - case 159: /* single_type_qualifier: precision_qualifier */ -#line 1399 "MachineIndependent/glslang.y" + case 161: /* single_type_qualifier: precision_qualifier */ +#line 1411 "MachineIndependent/glslang.y" { parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7007 "MachineIndependent/glslang_tab.cpp" +#line 7175 "MachineIndependent/glslang_tab.cpp" break; - case 160: /* single_type_qualifier: interpolation_qualifier */ -#line 1403 "MachineIndependent/glslang.y" + case 162: /* single_type_qualifier: interpolation_qualifier */ +#line 1415 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7016 "MachineIndependent/glslang_tab.cpp" +#line 7184 "MachineIndependent/glslang_tab.cpp" break; - case 161: /* single_type_qualifier: invariant_qualifier */ -#line 1407 "MachineIndependent/glslang.y" + case 163: /* single_type_qualifier: invariant_qualifier */ +#line 1419 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7025 "MachineIndependent/glslang_tab.cpp" +#line 7193 "MachineIndependent/glslang_tab.cpp" break; - case 162: /* single_type_qualifier: precise_qualifier */ -#line 1411 "MachineIndependent/glslang.y" + case 164: /* single_type_qualifier: precise_qualifier */ +#line 1423 "MachineIndependent/glslang.y" { // allow inheritance of storage qualifier from block declaration (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7034 "MachineIndependent/glslang_tab.cpp" +#line 7202 "MachineIndependent/glslang_tab.cpp" break; - case 163: /* single_type_qualifier: non_uniform_qualifier */ -#line 1415 "MachineIndependent/glslang.y" + case 165: /* single_type_qualifier: non_uniform_qualifier */ +#line 1427 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7042 "MachineIndependent/glslang_tab.cpp" +#line 7210 "MachineIndependent/glslang_tab.cpp" break; - case 164: /* single_type_qualifier: spirv_storage_class_qualifier */ -#line 1418 "MachineIndependent/glslang.y" + case 166: /* single_type_qualifier: spirv_storage_class_qualifier */ +#line 1430 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].interm.type).loc, "spirv_storage_class"); parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7052 "MachineIndependent/glslang_tab.cpp" +#line 7220 "MachineIndependent/glslang_tab.cpp" break; - case 165: /* single_type_qualifier: spirv_decorate_qualifier */ -#line 1423 "MachineIndependent/glslang.y" + case 167: /* single_type_qualifier: spirv_decorate_qualifier */ +#line 1435 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 7061 "MachineIndependent/glslang_tab.cpp" +#line 7229 "MachineIndependent/glslang_tab.cpp" break; - case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */ -#line 1427 "MachineIndependent/glslang.y" + case 168: /* single_type_qualifier: SPIRV_BY_REFERENCE */ +#line 1439 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvByReference(); } -#line 7071 "MachineIndependent/glslang_tab.cpp" +#line 7239 "MachineIndependent/glslang_tab.cpp" break; - case 167: /* single_type_qualifier: SPIRV_LITERAL */ -#line 1432 "MachineIndependent/glslang.y" + case 169: /* single_type_qualifier: SPIRV_LITERAL */ +#line 1444 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.setSpirvLiteral(); } -#line 7081 "MachineIndependent/glslang_tab.cpp" +#line 7249 "MachineIndependent/glslang_tab.cpp" break; - case 168: /* storage_qualifier: CONST */ -#line 1440 "MachineIndependent/glslang.y" + case 170: /* storage_qualifier: CONST */ +#line 1452 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant } -#line 7090 "MachineIndependent/glslang_tab.cpp" +#line 7258 "MachineIndependent/glslang_tab.cpp" break; - case 169: /* storage_qualifier: INOUT */ -#line 1444 "MachineIndependent/glslang.y" + case 171: /* storage_qualifier: INOUT */ +#line 1456 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqInOut; } -#line 7100 "MachineIndependent/glslang_tab.cpp" +#line 7268 "MachineIndependent/glslang_tab.cpp" break; - case 170: /* storage_qualifier: IN */ -#line 1449 "MachineIndependent/glslang.y" + case 172: /* storage_qualifier: IN */ +#line 1461 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "in"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqIn; } -#line 7111 "MachineIndependent/glslang_tab.cpp" +#line 7279 "MachineIndependent/glslang_tab.cpp" break; - case 171: /* storage_qualifier: OUT */ -#line 1455 "MachineIndependent/glslang.y" + case 173: /* storage_qualifier: OUT */ +#line 1467 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "out"); (yyval.interm.type).init((yyvsp[0].lex).loc); // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later (yyval.interm.type).qualifier.storage = EvqOut; } -#line 7122 "MachineIndependent/glslang_tab.cpp" +#line 7290 "MachineIndependent/glslang_tab.cpp" break; - case 172: /* storage_qualifier: CENTROID */ -#line 1461 "MachineIndependent/glslang.y" + case 174: /* storage_qualifier: CENTROID */ +#line 1473 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); @@ -7130,31 +7298,31 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.centroid = true; } -#line 7134 "MachineIndependent/glslang_tab.cpp" +#line 7302 "MachineIndependent/glslang_tab.cpp" break; - case 173: /* storage_qualifier: UNIFORM */ -#line 1468 "MachineIndependent/glslang.y" + case 175: /* storage_qualifier: UNIFORM */ +#line 1480 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; } -#line 7144 "MachineIndependent/glslang_tab.cpp" +#line 7312 "MachineIndependent/glslang_tab.cpp" break; - case 174: /* storage_qualifier: TILEIMAGEEXT */ -#line 1473 "MachineIndependent/glslang.y" + case 176: /* storage_qualifier: TILEIMAGEEXT */ +#line 1485 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "tileImageEXT"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqTileImageEXT; } -#line 7154 "MachineIndependent/glslang_tab.cpp" +#line 7322 "MachineIndependent/glslang_tab.cpp" break; - case 175: /* storage_qualifier: SHARED */ -#line 1478 "MachineIndependent/glslang.y" + case 177: /* storage_qualifier: SHARED */ +#line 1490 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "shared"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); @@ -7163,21 +7331,21 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqShared; } -#line 7167 "MachineIndependent/glslang_tab.cpp" +#line 7335 "MachineIndependent/glslang_tab.cpp" break; - case 176: /* storage_qualifier: BUFFER */ -#line 1486 "MachineIndependent/glslang.y" + case 178: /* storage_qualifier: BUFFER */ +#line 1498 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqBuffer; } -#line 7177 "MachineIndependent/glslang_tab.cpp" +#line 7345 "MachineIndependent/glslang_tab.cpp" break; - case 177: /* storage_qualifier: ATTRIBUTE */ -#line 1491 "MachineIndependent/glslang.y" + case 179: /* storage_qualifier: ATTRIBUTE */ +#line 1503 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); @@ -7190,11 +7358,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7194 "MachineIndependent/glslang_tab.cpp" +#line 7362 "MachineIndependent/glslang_tab.cpp" break; - case 178: /* storage_qualifier: VARYING */ -#line 1503 "MachineIndependent/glslang.y" + case 180: /* storage_qualifier: VARYING */ +#line 1515 "MachineIndependent/glslang.y" { parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); @@ -7209,32 +7377,52 @@ yyreduce: else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } -#line 7213 "MachineIndependent/glslang_tab.cpp" +#line 7381 "MachineIndependent/glslang_tab.cpp" break; - case 179: /* storage_qualifier: PATCH */ -#line 1517 "MachineIndependent/glslang.y" + case 181: /* storage_qualifier: PATCH */ +#line 1529 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.patch = true; } -#line 7224 "MachineIndependent/glslang_tab.cpp" +#line 7392 "MachineIndependent/glslang_tab.cpp" break; - case 180: /* storage_qualifier: SAMPLE */ -#line 1523 "MachineIndependent/glslang.y" + case 182: /* storage_qualifier: SAMPLE */ +#line 1535 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.sample = true; } -#line 7234 "MachineIndependent/glslang_tab.cpp" +#line 7402 "MachineIndependent/glslang_tab.cpp" break; - case 181: /* storage_qualifier: HITATTRNV */ -#line 1528 "MachineIndependent/glslang.y" + case 183: /* storage_qualifier: RESOURCEHEAP */ +#line 1540 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "resourceHeap"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqResourceHeap; + } +#line 7412 "MachineIndependent/glslang_tab.cpp" + break; + + case 184: /* storage_qualifier: SAMPLERHEAP */ +#line 1545 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "samplerHeap"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqSamplerHeap; + } +#line 7422 "MachineIndependent/glslang_tab.cpp" + break; + + case 185: /* storage_qualifier: HITATTRNV */ +#line 1550 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7243,24 +7431,37 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7247 "MachineIndependent/glslang_tab.cpp" +#line 7435 "MachineIndependent/glslang_tab.cpp" break; - case 182: /* storage_qualifier: HITOBJECTATTRNV */ -#line 1536 "MachineIndependent/glslang.y" - { + case 186: /* storage_qualifier: HITOBJECTATTRNV */ +#line 1558 "MachineIndependent/glslang.y" + { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | EShLangMissMask), "hitObjectAttributeNV"); parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV"); (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitObjectAttrNV; - } -#line 7260 "MachineIndependent/glslang_tab.cpp" + } +#line 7448 "MachineIndependent/glslang_tab.cpp" break; - case 183: /* storage_qualifier: HITATTREXT */ -#line 1544 "MachineIndependent/glslang.y" + case 187: /* storage_qualifier: HITOBJECTATTREXT */ +#line 1566 "MachineIndependent/glslang.y" + { + parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask + | EShLangMissMask), "hitObjectAttributeEXT"); + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile, 460, E_GL_EXT_shader_invocation_reorder, "hitObjectAttributeEXT"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqHitObjectAttrEXT; + } +#line 7461 "MachineIndependent/glslang_tab.cpp" + break; + + case 188: /* storage_qualifier: HITATTREXT */ +#line 1574 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask @@ -7269,11 +7470,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqHitAttr; } -#line 7273 "MachineIndependent/glslang_tab.cpp" +#line 7474 "MachineIndependent/glslang_tab.cpp" break; - case 184: /* storage_qualifier: PAYLOADNV */ -#line 1552 "MachineIndependent/glslang.y" + case 189: /* storage_qualifier: PAYLOADNV */ +#line 1582 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7282,11 +7483,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7286 "MachineIndependent/glslang_tab.cpp" +#line 7487 "MachineIndependent/glslang_tab.cpp" break; - case 185: /* storage_qualifier: PAYLOADEXT */ -#line 1560 "MachineIndependent/glslang.y" + case 190: /* storage_qualifier: PAYLOADEXT */ +#line 1590 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask | @@ -7295,11 +7496,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayload; } -#line 7299 "MachineIndependent/glslang_tab.cpp" +#line 7500 "MachineIndependent/glslang_tab.cpp" break; - case 186: /* storage_qualifier: PAYLOADINNV */ -#line 1568 "MachineIndependent/glslang.y" + case 191: /* storage_qualifier: PAYLOADINNV */ +#line 1598 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7308,11 +7509,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7312 "MachineIndependent/glslang_tab.cpp" +#line 7513 "MachineIndependent/glslang_tab.cpp" break; - case 187: /* storage_qualifier: PAYLOADINEXT */ -#line 1576 "MachineIndependent/glslang.y" + case 192: /* storage_qualifier: PAYLOADINEXT */ +#line 1606 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask | @@ -7321,11 +7522,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqPayloadIn; } -#line 7325 "MachineIndependent/glslang_tab.cpp" +#line 7526 "MachineIndependent/glslang_tab.cpp" break; - case 188: /* storage_qualifier: CALLDATANV */ -#line 1584 "MachineIndependent/glslang.y" + case 193: /* storage_qualifier: CALLDATANV */ +#line 1614 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7334,11 +7535,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7338 "MachineIndependent/glslang_tab.cpp" +#line 7539 "MachineIndependent/glslang_tab.cpp" break; - case 189: /* storage_qualifier: CALLDATAEXT */ -#line 1592 "MachineIndependent/glslang.y" + case 194: /* storage_qualifier: CALLDATAEXT */ +#line 1622 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | @@ -7347,11 +7548,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableData; } -#line 7351 "MachineIndependent/glslang_tab.cpp" +#line 7552 "MachineIndependent/glslang_tab.cpp" break; - case 190: /* storage_qualifier: CALLDATAINNV */ -#line 1600 "MachineIndependent/glslang.y" + case 195: /* storage_qualifier: CALLDATAINNV */ +#line 1630 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV"); @@ -7359,11 +7560,11 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7363 "MachineIndependent/glslang_tab.cpp" +#line 7564 "MachineIndependent/glslang_tab.cpp" break; - case 191: /* storage_qualifier: CALLDATAINEXT */ -#line 1607 "MachineIndependent/glslang.y" + case 196: /* storage_qualifier: CALLDATAINEXT */ +#line 1637 "MachineIndependent/glslang.y" { parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT"); parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT"); @@ -7371,147 +7572,147 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqCallableDataIn; } -#line 7375 "MachineIndependent/glslang_tab.cpp" +#line 7576 "MachineIndependent/glslang_tab.cpp" break; - case 192: /* storage_qualifier: COHERENT */ -#line 1614 "MachineIndependent/glslang.y" + case 197: /* storage_qualifier: COHERENT */ +#line 1644 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.coherent = true; } -#line 7384 "MachineIndependent/glslang_tab.cpp" +#line 7585 "MachineIndependent/glslang_tab.cpp" break; - case 193: /* storage_qualifier: DEVICECOHERENT */ -#line 1618 "MachineIndependent/glslang.y" + case 198: /* storage_qualifier: DEVICECOHERENT */ +#line 1648 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent"); (yyval.interm.type).qualifier.devicecoherent = true; } -#line 7394 "MachineIndependent/glslang_tab.cpp" +#line 7595 "MachineIndependent/glslang_tab.cpp" break; - case 194: /* storage_qualifier: QUEUEFAMILYCOHERENT */ -#line 1623 "MachineIndependent/glslang.y" + case 199: /* storage_qualifier: QUEUEFAMILYCOHERENT */ +#line 1653 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent"); (yyval.interm.type).qualifier.queuefamilycoherent = true; } -#line 7404 "MachineIndependent/glslang_tab.cpp" +#line 7605 "MachineIndependent/glslang_tab.cpp" break; - case 195: /* storage_qualifier: WORKGROUPCOHERENT */ -#line 1628 "MachineIndependent/glslang.y" + case 200: /* storage_qualifier: WORKGROUPCOHERENT */ +#line 1658 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent"); (yyval.interm.type).qualifier.workgroupcoherent = true; } -#line 7414 "MachineIndependent/glslang_tab.cpp" +#line 7615 "MachineIndependent/glslang_tab.cpp" break; - case 196: /* storage_qualifier: SUBGROUPCOHERENT */ -#line 1633 "MachineIndependent/glslang.y" + case 201: /* storage_qualifier: SUBGROUPCOHERENT */ +#line 1663 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent"); (yyval.interm.type).qualifier.subgroupcoherent = true; } -#line 7424 "MachineIndependent/glslang_tab.cpp" +#line 7625 "MachineIndependent/glslang_tab.cpp" break; - case 197: /* storage_qualifier: NONPRIVATE */ -#line 1638 "MachineIndependent/glslang.y" + case 202: /* storage_qualifier: NONPRIVATE */ +#line 1668 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate"); (yyval.interm.type).qualifier.nonprivate = true; } -#line 7434 "MachineIndependent/glslang_tab.cpp" +#line 7635 "MachineIndependent/glslang_tab.cpp" break; - case 198: /* storage_qualifier: SHADERCALLCOHERENT */ -#line 1643 "MachineIndependent/glslang.y" + case 203: /* storage_qualifier: SHADERCALLCOHERENT */ +#line 1673 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent"); (yyval.interm.type).qualifier.shadercallcoherent = true; } -#line 7444 "MachineIndependent/glslang_tab.cpp" +#line 7645 "MachineIndependent/glslang_tab.cpp" break; - case 199: /* storage_qualifier: VOLATILE */ -#line 1648 "MachineIndependent/glslang.y" + case 204: /* storage_qualifier: VOLATILE */ +#line 1678 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.volatil = true; } -#line 7453 "MachineIndependent/glslang_tab.cpp" +#line 7654 "MachineIndependent/glslang_tab.cpp" break; - case 200: /* storage_qualifier: RESTRICT */ -#line 1652 "MachineIndependent/glslang.y" + case 205: /* storage_qualifier: RESTRICT */ +#line 1682 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.restrict = true; } -#line 7462 "MachineIndependent/glslang_tab.cpp" +#line 7663 "MachineIndependent/glslang_tab.cpp" break; - case 201: /* storage_qualifier: READONLY */ -#line 1656 "MachineIndependent/glslang.y" + case 206: /* storage_qualifier: READONLY */ +#line 1686 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.readonly = true; } -#line 7471 "MachineIndependent/glslang_tab.cpp" +#line 7672 "MachineIndependent/glslang_tab.cpp" break; - case 202: /* storage_qualifier: WRITEONLY */ -#line 1660 "MachineIndependent/glslang.y" + case 207: /* storage_qualifier: WRITEONLY */ +#line 1690 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.writeonly = true; } -#line 7480 "MachineIndependent/glslang_tab.cpp" +#line 7681 "MachineIndependent/glslang_tab.cpp" break; - case 203: /* storage_qualifier: NONTEMPORAL */ -#line 1664 "MachineIndependent/glslang.y" + case 208: /* storage_qualifier: NONTEMPORAL */ +#line 1694 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nontemporal = true; } -#line 7489 "MachineIndependent/glslang_tab.cpp" +#line 7690 "MachineIndependent/glslang_tab.cpp" break; - case 204: /* storage_qualifier: SUBROUTINE */ -#line 1668 "MachineIndependent/glslang.y" + case 209: /* storage_qualifier: SUBROUTINE */ +#line 1698 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[0].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[0].lex).loc); } -#line 7500 "MachineIndependent/glslang_tab.cpp" +#line 7701 "MachineIndependent/glslang_tab.cpp" break; - case 205: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ -#line 1674 "MachineIndependent/glslang.y" + case 210: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */ +#line 1704 "MachineIndependent/glslang.y" { parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); parseContext.unimplemented((yyvsp[-3].lex).loc, "subroutine"); (yyval.interm.type).init((yyvsp[-3].lex).loc); } -#line 7511 "MachineIndependent/glslang_tab.cpp" +#line 7712 "MachineIndependent/glslang_tab.cpp" break; - case 206: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ -#line 1680 "MachineIndependent/glslang.y" + case 211: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */ +#line 1710 "MachineIndependent/glslang.y" { // No need for profile version or extension check. Shader stage already checks both. parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT"); @@ -7519,38 +7720,38 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT; } -#line 7523 "MachineIndependent/glslang_tab.cpp" +#line 7724 "MachineIndependent/glslang_tab.cpp" break; - case 207: /* non_uniform_qualifier: NONUNIFORM */ -#line 1690 "MachineIndependent/glslang.y" + case 212: /* non_uniform_qualifier: NONUNIFORM */ +#line 1720 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).qualifier.nonUniform = true; } -#line 7532 "MachineIndependent/glslang_tab.cpp" +#line 7733 "MachineIndependent/glslang_tab.cpp" break; - case 208: /* type_name_list: IDENTIFIER */ -#line 1697 "MachineIndependent/glslang.y" + case 213: /* type_name_list: IDENTIFIER */ +#line 1727 "MachineIndependent/glslang.y" { // TODO } -#line 7540 "MachineIndependent/glslang_tab.cpp" +#line 7741 "MachineIndependent/glslang_tab.cpp" break; - case 209: /* type_name_list: type_name_list COMMA IDENTIFIER */ -#line 1700 "MachineIndependent/glslang.y" + case 214: /* type_name_list: type_name_list COMMA IDENTIFIER */ +#line 1730 "MachineIndependent/glslang.y" { // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } -#line 7550 "MachineIndependent/glslang_tab.cpp" +#line 7751 "MachineIndependent/glslang_tab.cpp" break; - case 210: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ -#line 1708 "MachineIndependent/glslang.y" + case 215: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */ +#line 1738 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[-1].interm.type); (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); @@ -7558,11 +7759,11 @@ yyreduce: parseContext.typeParametersCheck((yyvsp[-1].interm.type).loc, (yyval.interm.type)); } -#line 7562 "MachineIndependent/glslang_tab.cpp" +#line 7763 "MachineIndependent/glslang_tab.cpp" break; - case 211: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ -#line 1715 "MachineIndependent/glslang.y" + case 216: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */ +#line 1745 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes); (yyval.interm.type) = (yyvsp[-2].interm.type); @@ -7571,21 +7772,21 @@ yyreduce: (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; parseContext.typeParametersCheck((yyvsp[-2].interm.type).loc, (yyval.interm.type)); } -#line 7575 "MachineIndependent/glslang_tab.cpp" +#line 7776 "MachineIndependent/glslang_tab.cpp" break; - case 212: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ -#line 1726 "MachineIndependent/glslang.y" + case 217: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */ +#line 1756 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-1].lex).loc; (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } -#line 7585 "MachineIndependent/glslang_tab.cpp" +#line 7786 "MachineIndependent/glslang_tab.cpp" break; - case 213: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1731 "MachineIndependent/glslang.y" + case 218: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1761 "MachineIndependent/glslang.y" { (yyval.interm).loc = (yyvsp[-2].lex).loc; (yyval.interm).arraySizes = new TArraySizes; @@ -7594,20 +7795,20 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7598 "MachineIndependent/glslang_tab.cpp" +#line 7799 "MachineIndependent/glslang_tab.cpp" break; - case 214: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ -#line 1739 "MachineIndependent/glslang.y" + case 219: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */ +#line 1769 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-2].interm); (yyval.interm).arraySizes->addInnerSize(); } -#line 7607 "MachineIndependent/glslang_tab.cpp" +#line 7808 "MachineIndependent/glslang_tab.cpp" break; - case 215: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ -#line 1743 "MachineIndependent/glslang.y" + case 220: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */ +#line 1773 "MachineIndependent/glslang.y" { (yyval.interm) = (yyvsp[-3].interm); @@ -7615,46 +7816,46 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size"); (yyval.interm).arraySizes->addInnerSize(size); } -#line 7619 "MachineIndependent/glslang_tab.cpp" +#line 7820 "MachineIndependent/glslang_tab.cpp" break; - case 216: /* type_parameter_specifier_opt: type_parameter_specifier */ -#line 1753 "MachineIndependent/glslang.y" + case 221: /* type_parameter_specifier_opt: type_parameter_specifier */ +#line 1783 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters); } -#line 7627 "MachineIndependent/glslang_tab.cpp" +#line 7828 "MachineIndependent/glslang_tab.cpp" break; - case 217: /* type_parameter_specifier_opt: %empty */ -#line 1756 "MachineIndependent/glslang.y" + case 222: /* type_parameter_specifier_opt: %empty */ +#line 1786 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = 0; } -#line 7635 "MachineIndependent/glslang_tab.cpp" +#line 7836 "MachineIndependent/glslang_tab.cpp" break; - case 218: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ -#line 1762 "MachineIndependent/glslang.y" + case 223: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */ +#line 1792 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters); } -#line 7643 "MachineIndependent/glslang_tab.cpp" +#line 7844 "MachineIndependent/glslang_tab.cpp" break; - case 219: /* type_parameter_specifier_list: type_specifier */ -#line 1768 "MachineIndependent/glslang.y" + case 224: /* type_parameter_specifier_list: type_specifier */ +#line 1798 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; (yyval.interm.typeParameters)->spirvType = (yyvsp[0].interm.type).spirvType; (yyval.interm.typeParameters)->basicType = (yyvsp[0].interm.type).basicType; } -#line 7654 "MachineIndependent/glslang_tab.cpp" +#line 7855 "MachineIndependent/glslang_tab.cpp" break; - case 220: /* type_parameter_specifier_list: unary_expression */ -#line 1774 "MachineIndependent/glslang.y" + case 225: /* type_parameter_specifier_list: unary_expression */ +#line 1804 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = new TTypeParameters; (yyval.interm.typeParameters)->arraySizes = new TArraySizes; @@ -7663,11 +7864,11 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7667 "MachineIndependent/glslang_tab.cpp" +#line 7868 "MachineIndependent/glslang_tab.cpp" break; - case 221: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ -#line 1782 "MachineIndependent/glslang.y" + case 226: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */ +#line 1812 "MachineIndependent/glslang.y" { (yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters); @@ -7675,300 +7876,300 @@ yyreduce: parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter", true); (yyval.interm.typeParameters)->arraySizes->addInnerSize(size); } -#line 7679 "MachineIndependent/glslang_tab.cpp" +#line 7880 "MachineIndependent/glslang_tab.cpp" break; - case 222: /* type_specifier_nonarray: VOID */ -#line 1792 "MachineIndependent/glslang.y" + case 227: /* type_specifier_nonarray: VOID */ +#line 1822 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtVoid; } -#line 7688 "MachineIndependent/glslang_tab.cpp" +#line 7889 "MachineIndependent/glslang_tab.cpp" break; - case 223: /* type_specifier_nonarray: FLOAT */ -#line 1796 "MachineIndependent/glslang.y" + case 228: /* type_specifier_nonarray: FLOAT */ +#line 1826 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 7697 "MachineIndependent/glslang_tab.cpp" +#line 7898 "MachineIndependent/glslang_tab.cpp" break; - case 224: /* type_specifier_nonarray: INT */ -#line 1800 "MachineIndependent/glslang.y" + case 229: /* type_specifier_nonarray: INT */ +#line 1830 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 7706 "MachineIndependent/glslang_tab.cpp" +#line 7907 "MachineIndependent/glslang_tab.cpp" break; - case 225: /* type_specifier_nonarray: UINT */ -#line 1804 "MachineIndependent/glslang.y" + case 230: /* type_specifier_nonarray: UINT */ +#line 1834 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 7716 "MachineIndependent/glslang_tab.cpp" +#line 7917 "MachineIndependent/glslang_tab.cpp" break; - case 226: /* type_specifier_nonarray: BOOL */ -#line 1809 "MachineIndependent/glslang.y" + case 231: /* type_specifier_nonarray: BOOL */ +#line 1839 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBool; } -#line 7725 "MachineIndependent/glslang_tab.cpp" +#line 7926 "MachineIndependent/glslang_tab.cpp" break; - case 227: /* type_specifier_nonarray: VEC2 */ -#line 1813 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 7735 "MachineIndependent/glslang_tab.cpp" - break; - - case 228: /* type_specifier_nonarray: VEC3 */ -#line 1818 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); - } -#line 7745 "MachineIndependent/glslang_tab.cpp" - break; - - case 229: /* type_specifier_nonarray: VEC4 */ -#line 1823 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); - } -#line 7755 "MachineIndependent/glslang_tab.cpp" - break; - - case 230: /* type_specifier_nonarray: BVEC2 */ -#line 1828 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); - } -#line 7765 "MachineIndependent/glslang_tab.cpp" - break; - - case 231: /* type_specifier_nonarray: BVEC3 */ -#line 1833 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); - } -#line 7775 "MachineIndependent/glslang_tab.cpp" - break; - - case 232: /* type_specifier_nonarray: BVEC4 */ -#line 1838 "MachineIndependent/glslang.y" - { - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); - } -#line 7785 "MachineIndependent/glslang_tab.cpp" - break; - - case 233: /* type_specifier_nonarray: IVEC2 */ + case 232: /* type_specifier_nonarray: VEC2 */ #line 1843 "MachineIndependent/glslang.y" - { + { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(2); } -#line 7795 "MachineIndependent/glslang_tab.cpp" +#line 7936 "MachineIndependent/glslang_tab.cpp" break; - case 234: /* type_specifier_nonarray: IVEC3 */ + case 233: /* type_specifier_nonarray: VEC3 */ #line 1848 "MachineIndependent/glslang.y" - { + { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(3); } -#line 7805 "MachineIndependent/glslang_tab.cpp" +#line 7946 "MachineIndependent/glslang_tab.cpp" break; - case 235: /* type_specifier_nonarray: IVEC4 */ + case 234: /* type_specifier_nonarray: VEC4 */ #line 1853 "MachineIndependent/glslang.y" - { + { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 7815 "MachineIndependent/glslang_tab.cpp" +#line 7956 "MachineIndependent/glslang_tab.cpp" break; - case 236: /* type_specifier_nonarray: UVEC2 */ + case 235: /* type_specifier_nonarray: BVEC2 */ #line 1858 "MachineIndependent/glslang.y" { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); + } +#line 7966 "MachineIndependent/glslang_tab.cpp" + break; + + case 236: /* type_specifier_nonarray: BVEC3 */ +#line 1863 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); + } +#line 7976 "MachineIndependent/glslang_tab.cpp" + break; + + case 237: /* type_specifier_nonarray: BVEC4 */ +#line 1868 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); + } +#line 7986 "MachineIndependent/glslang_tab.cpp" + break; + + case 238: /* type_specifier_nonarray: IVEC2 */ +#line 1873 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } +#line 7996 "MachineIndependent/glslang_tab.cpp" + break; + + case 239: /* type_specifier_nonarray: IVEC3 */ +#line 1878 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 8006 "MachineIndependent/glslang_tab.cpp" + break; + + case 240: /* type_specifier_nonarray: IVEC4 */ +#line 1883 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); + } +#line 8016 "MachineIndependent/glslang_tab.cpp" + break; + + case 241: /* type_specifier_nonarray: UVEC2 */ +#line 1888 "MachineIndependent/glslang.y" + { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(2); } -#line 7826 "MachineIndependent/glslang_tab.cpp" +#line 8027 "MachineIndependent/glslang_tab.cpp" break; - case 237: /* type_specifier_nonarray: UVEC3 */ -#line 1864 "MachineIndependent/glslang.y" + case 242: /* type_specifier_nonarray: UVEC3 */ +#line 1894 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(3); } -#line 7837 "MachineIndependent/glslang_tab.cpp" +#line 8038 "MachineIndependent/glslang_tab.cpp" break; - case 238: /* type_specifier_nonarray: UVEC4 */ -#line 1870 "MachineIndependent/glslang.y" + case 243: /* type_specifier_nonarray: UVEC4 */ +#line 1900 "MachineIndependent/glslang.y" { parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 7848 "MachineIndependent/glslang_tab.cpp" +#line 8049 "MachineIndependent/glslang_tab.cpp" break; - case 239: /* type_specifier_nonarray: MAT2 */ -#line 1876 "MachineIndependent/glslang.y" + case 244: /* type_specifier_nonarray: MAT2 */ +#line 1906 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7858 "MachineIndependent/glslang_tab.cpp" +#line 8059 "MachineIndependent/glslang_tab.cpp" break; - case 240: /* type_specifier_nonarray: MAT3 */ -#line 1881 "MachineIndependent/glslang.y" + case 245: /* type_specifier_nonarray: MAT3 */ +#line 1911 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7868 "MachineIndependent/glslang_tab.cpp" +#line 8069 "MachineIndependent/glslang_tab.cpp" break; - case 241: /* type_specifier_nonarray: MAT4 */ -#line 1886 "MachineIndependent/glslang.y" + case 246: /* type_specifier_nonarray: MAT4 */ +#line 1916 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7878 "MachineIndependent/glslang_tab.cpp" +#line 8079 "MachineIndependent/glslang_tab.cpp" break; - case 242: /* type_specifier_nonarray: MAT2X2 */ -#line 1891 "MachineIndependent/glslang.y" + case 247: /* type_specifier_nonarray: MAT2X2 */ +#line 1921 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 7888 "MachineIndependent/glslang_tab.cpp" +#line 8089 "MachineIndependent/glslang_tab.cpp" break; - case 243: /* type_specifier_nonarray: MAT2X3 */ -#line 1896 "MachineIndependent/glslang.y" + case 248: /* type_specifier_nonarray: MAT2X3 */ +#line 1926 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 3); } -#line 7898 "MachineIndependent/glslang_tab.cpp" +#line 8099 "MachineIndependent/glslang_tab.cpp" break; - case 244: /* type_specifier_nonarray: MAT2X4 */ -#line 1901 "MachineIndependent/glslang.y" + case 249: /* type_specifier_nonarray: MAT2X4 */ +#line 1931 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 4); } -#line 7908 "MachineIndependent/glslang_tab.cpp" +#line 8109 "MachineIndependent/glslang_tab.cpp" break; - case 245: /* type_specifier_nonarray: MAT3X2 */ -#line 1906 "MachineIndependent/glslang.y" + case 250: /* type_specifier_nonarray: MAT3X2 */ +#line 1936 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 2); } -#line 7918 "MachineIndependent/glslang_tab.cpp" +#line 8119 "MachineIndependent/glslang_tab.cpp" break; - case 246: /* type_specifier_nonarray: MAT3X3 */ -#line 1911 "MachineIndependent/glslang.y" + case 251: /* type_specifier_nonarray: MAT3X3 */ +#line 1941 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 7928 "MachineIndependent/glslang_tab.cpp" +#line 8129 "MachineIndependent/glslang_tab.cpp" break; - case 247: /* type_specifier_nonarray: MAT3X4 */ -#line 1916 "MachineIndependent/glslang.y" + case 252: /* type_specifier_nonarray: MAT3X4 */ +#line 1946 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 4); } -#line 7938 "MachineIndependent/glslang_tab.cpp" +#line 8139 "MachineIndependent/glslang_tab.cpp" break; - case 248: /* type_specifier_nonarray: MAT4X2 */ -#line 1921 "MachineIndependent/glslang.y" + case 253: /* type_specifier_nonarray: MAT4X2 */ +#line 1951 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 7948 "MachineIndependent/glslang_tab.cpp" +#line 8149 "MachineIndependent/glslang_tab.cpp" break; - case 249: /* type_specifier_nonarray: MAT4X3 */ -#line 1926 "MachineIndependent/glslang.y" + case 254: /* type_specifier_nonarray: MAT4X3 */ +#line 1956 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 7958 "MachineIndependent/glslang_tab.cpp" +#line 8159 "MachineIndependent/glslang_tab.cpp" break; - case 250: /* type_specifier_nonarray: MAT4X4 */ -#line 1931 "MachineIndependent/glslang.y" + case 255: /* type_specifier_nonarray: MAT4X4 */ +#line 1961 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 7968 "MachineIndependent/glslang_tab.cpp" +#line 8169 "MachineIndependent/glslang_tab.cpp" break; - case 251: /* type_specifier_nonarray: DOUBLE */ -#line 1936 "MachineIndependent/glslang.y" + case 256: /* type_specifier_nonarray: DOUBLE */ +#line 1966 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -7976,652 +8177,652 @@ yyreduce: (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 7980 "MachineIndependent/glslang_tab.cpp" +#line 8181 "MachineIndependent/glslang_tab.cpp" break; - case 252: /* type_specifier_nonarray: BFLOAT16_T */ -#line 1943 "MachineIndependent/glslang.y" + case 257: /* type_specifier_nonarray: BFLOAT16_T */ +#line 1973 "MachineIndependent/glslang.y" { parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "bfloat16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtBFloat16; } -#line 7990 "MachineIndependent/glslang_tab.cpp" +#line 8191 "MachineIndependent/glslang_tab.cpp" break; - case 253: /* type_specifier_nonarray: FLOATE5M2_T */ -#line 1948 "MachineIndependent/glslang.y" + case 258: /* type_specifier_nonarray: FLOATE5M2_T */ +#line 1978 "MachineIndependent/glslang.y" { parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "floate5m2_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloatE5M2; } -#line 8000 "MachineIndependent/glslang_tab.cpp" +#line 8201 "MachineIndependent/glslang_tab.cpp" break; - case 254: /* type_specifier_nonarray: FLOATE4M3_T */ -#line 1953 "MachineIndependent/glslang.y" + case 259: /* type_specifier_nonarray: FLOATE4M3_T */ +#line 1983 "MachineIndependent/glslang.y" { parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "floate4m3_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloatE4M3; } -#line 8010 "MachineIndependent/glslang_tab.cpp" +#line 8211 "MachineIndependent/glslang_tab.cpp" break; - case 255: /* type_specifier_nonarray: FLOAT16_T */ -#line 1958 "MachineIndependent/glslang.y" + case 260: /* type_specifier_nonarray: FLOAT16_T */ +#line 1988 "MachineIndependent/glslang.y" { parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "float16_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; } -#line 8020 "MachineIndependent/glslang_tab.cpp" +#line 8221 "MachineIndependent/glslang_tab.cpp" break; - case 256: /* type_specifier_nonarray: FLOAT32_T */ -#line 1963 "MachineIndependent/glslang.y" + case 261: /* type_specifier_nonarray: FLOAT32_T */ +#line 1993 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; } -#line 8030 "MachineIndependent/glslang_tab.cpp" +#line 8231 "MachineIndependent/glslang_tab.cpp" break; - case 257: /* type_specifier_nonarray: FLOAT64_T */ -#line 1968 "MachineIndependent/glslang.y" + case 262: /* type_specifier_nonarray: FLOAT64_T */ +#line 1998 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; } -#line 8040 "MachineIndependent/glslang_tab.cpp" +#line 8241 "MachineIndependent/glslang_tab.cpp" break; - case 258: /* type_specifier_nonarray: INT8_T */ -#line 1973 "MachineIndependent/glslang.y" + case 263: /* type_specifier_nonarray: INT8_T */ +#line 2003 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt8; } -#line 8050 "MachineIndependent/glslang_tab.cpp" +#line 8251 "MachineIndependent/glslang_tab.cpp" break; - case 259: /* type_specifier_nonarray: UINT8_T */ -#line 1978 "MachineIndependent/glslang.y" + case 264: /* type_specifier_nonarray: UINT8_T */ +#line 2008 "MachineIndependent/glslang.y" { parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint8; } -#line 8060 "MachineIndependent/glslang_tab.cpp" +#line 8261 "MachineIndependent/glslang_tab.cpp" break; - case 260: /* type_specifier_nonarray: INT16_T */ -#line 1983 "MachineIndependent/glslang.y" + case 265: /* type_specifier_nonarray: INT16_T */ +#line 2013 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt16; } -#line 8070 "MachineIndependent/glslang_tab.cpp" +#line 8271 "MachineIndependent/glslang_tab.cpp" break; - case 261: /* type_specifier_nonarray: UINT16_T */ -#line 1988 "MachineIndependent/glslang.y" + case 266: /* type_specifier_nonarray: UINT16_T */ +#line 2018 "MachineIndependent/glslang.y" { parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint16; } -#line 8080 "MachineIndependent/glslang_tab.cpp" +#line 8281 "MachineIndependent/glslang_tab.cpp" break; - case 262: /* type_specifier_nonarray: INT32_T */ -#line 1993 "MachineIndependent/glslang.y" + case 267: /* type_specifier_nonarray: INT32_T */ +#line 2023 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; } -#line 8090 "MachineIndependent/glslang_tab.cpp" +#line 8291 "MachineIndependent/glslang_tab.cpp" break; - case 263: /* type_specifier_nonarray: UINT32_T */ -#line 1998 "MachineIndependent/glslang.y" + case 268: /* type_specifier_nonarray: UINT32_T */ +#line 2028 "MachineIndependent/glslang.y" { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; } -#line 8100 "MachineIndependent/glslang_tab.cpp" +#line 8301 "MachineIndependent/glslang_tab.cpp" break; - case 264: /* type_specifier_nonarray: INT64_T */ -#line 2003 "MachineIndependent/glslang.y" + case 269: /* type_specifier_nonarray: INT64_T */ +#line 2033 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt64; } -#line 8110 "MachineIndependent/glslang_tab.cpp" +#line 8311 "MachineIndependent/glslang_tab.cpp" break; - case 265: /* type_specifier_nonarray: UINT64_T */ -#line 2008 "MachineIndependent/glslang.y" + case 270: /* type_specifier_nonarray: UINT64_T */ +#line 2038 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; } -#line 8120 "MachineIndependent/glslang_tab.cpp" +#line 8321 "MachineIndependent/glslang_tab.cpp" break; - case 266: /* type_specifier_nonarray: DVEC2 */ -#line 2013 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); - } -#line 8133 "MachineIndependent/glslang_tab.cpp" - break; - - case 267: /* type_specifier_nonarray: DVEC3 */ -#line 2021 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); - } -#line 8146 "MachineIndependent/glslang_tab.cpp" - break; - - case 268: /* type_specifier_nonarray: DVEC4 */ -#line 2029 "MachineIndependent/glslang.y" - { - parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); - if (! parseContext.symbolTable.atBuiltInLevel()) - parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); - } -#line 8159 "MachineIndependent/glslang_tab.cpp" - break; - - case 269: /* type_specifier_nonarray: BF16VEC2 */ -#line 2037 "MachineIndependent/glslang.y" - { - parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBFloat16; - (yyval.interm.type).setVector(2); - } -#line 8170 "MachineIndependent/glslang_tab.cpp" - break; - - case 270: /* type_specifier_nonarray: BF16VEC3 */ + case 271: /* type_specifier_nonarray: DVEC2 */ #line 2043 "MachineIndependent/glslang.y" - { - parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBFloat16; - (yyval.interm.type).setVector(3); - } -#line 8181 "MachineIndependent/glslang_tab.cpp" - break; - - case 271: /* type_specifier_nonarray: BF16VEC4 */ -#line 2049 "MachineIndependent/glslang.y" - { - parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBFloat16; - (yyval.interm.type).setVector(4); - } -#line 8192 "MachineIndependent/glslang_tab.cpp" - break; - - case 272: /* type_specifier_nonarray: FE5M2VEC2 */ -#line 2055 "MachineIndependent/glslang.y" - { - parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(2); } -#line 8203 "MachineIndependent/glslang_tab.cpp" +#line 8334 "MachineIndependent/glslang_tab.cpp" break; - case 273: /* type_specifier_nonarray: FE5M2VEC3 */ -#line 2061 "MachineIndependent/glslang.y" - { - parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + case 272: /* type_specifier_nonarray: DVEC3 */ +#line 2051 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(3); } -#line 8214 "MachineIndependent/glslang_tab.cpp" +#line 8347 "MachineIndependent/glslang_tab.cpp" break; - case 274: /* type_specifier_nonarray: FE5M2VEC4 */ + case 273: /* type_specifier_nonarray: DVEC4 */ +#line 2059 "MachineIndependent/glslang.y" + { + parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector"); + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); + } +#line 8360 "MachineIndependent/glslang_tab.cpp" + break; + + case 274: /* type_specifier_nonarray: BF16VEC2 */ #line 2067 "MachineIndependent/glslang.y" - { - parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloatE5M2; - (yyval.interm.type).setVector(4); - } -#line 8225 "MachineIndependent/glslang_tab.cpp" - break; - - case 275: /* type_specifier_nonarray: FE4M3VEC2 */ -#line 2073 "MachineIndependent/glslang.y" - { - parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).basicType = EbtBFloat16; (yyval.interm.type).setVector(2); } -#line 8236 "MachineIndependent/glslang_tab.cpp" +#line 8371 "MachineIndependent/glslang_tab.cpp" break; - case 276: /* type_specifier_nonarray: FE4M3VEC3 */ -#line 2079 "MachineIndependent/glslang.y" - { - parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + case 275: /* type_specifier_nonarray: BF16VEC3 */ +#line 2073 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).basicType = EbtBFloat16; (yyval.interm.type).setVector(3); } -#line 8247 "MachineIndependent/glslang_tab.cpp" +#line 8382 "MachineIndependent/glslang_tab.cpp" break; - case 277: /* type_specifier_nonarray: FE4M3VEC4 */ + case 276: /* type_specifier_nonarray: BF16VEC4 */ +#line 2079 "MachineIndependent/glslang.y" + { + parseContext.bfloat16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBFloat16; + (yyval.interm.type).setVector(4); + } +#line 8393 "MachineIndependent/glslang_tab.cpp" + break; + + case 277: /* type_specifier_nonarray: FE5M2VEC2 */ #line 2085 "MachineIndependent/glslang.y" { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(2); + } +#line 8404 "MachineIndependent/glslang_tab.cpp" + break; + + case 278: /* type_specifier_nonarray: FE5M2VEC3 */ +#line 2091 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(3); + } +#line 8415 "MachineIndependent/glslang_tab.cpp" + break; + + case 279: /* type_specifier_nonarray: FE5M2VEC4 */ +#line 2097 "MachineIndependent/glslang.y" + { + parseContext.floate5m2ScalarVectorCheck((yyvsp[0].lex).loc, "fe5m2 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE5M2; + (yyval.interm.type).setVector(4); + } +#line 8426 "MachineIndependent/glslang_tab.cpp" + break; + + case 280: /* type_specifier_nonarray: FE4M3VEC2 */ +#line 2103 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).setVector(2); + } +#line 8437 "MachineIndependent/glslang_tab.cpp" + break; + + case 281: /* type_specifier_nonarray: FE4M3VEC3 */ +#line 2109 "MachineIndependent/glslang.y" + { + parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloatE4M3; + (yyval.interm.type).setVector(3); + } +#line 8448 "MachineIndependent/glslang_tab.cpp" + break; + + case 282: /* type_specifier_nonarray: FE4M3VEC4 */ +#line 2115 "MachineIndependent/glslang.y" + { parseContext.floate4m3ScalarVectorCheck((yyvsp[0].lex).loc, "fe4m3 vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloatE4M3; (yyval.interm.type).setVector(4); } -#line 8258 "MachineIndependent/glslang_tab.cpp" +#line 8459 "MachineIndependent/glslang_tab.cpp" break; - case 278: /* type_specifier_nonarray: F16VEC2 */ -#line 2091 "MachineIndependent/glslang.y" - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(2); - } -#line 8269 "MachineIndependent/glslang_tab.cpp" - break; - - case 279: /* type_specifier_nonarray: F16VEC3 */ -#line 2097 "MachineIndependent/glslang.y" - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(3); - } -#line 8280 "MachineIndependent/glslang_tab.cpp" - break; - - case 280: /* type_specifier_nonarray: F16VEC4 */ -#line 2103 "MachineIndependent/glslang.y" - { - parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setVector(4); - } -#line 8291 "MachineIndependent/glslang_tab.cpp" - break; - - case 281: /* type_specifier_nonarray: F32VEC2 */ -#line 2109 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); - } -#line 8302 "MachineIndependent/glslang_tab.cpp" - break; - - case 282: /* type_specifier_nonarray: F32VEC3 */ -#line 2115 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); - } -#line 8313 "MachineIndependent/glslang_tab.cpp" - break; - - case 283: /* type_specifier_nonarray: F32VEC4 */ + case 283: /* type_specifier_nonarray: F16VEC2 */ #line 2121 "MachineIndependent/glslang.y" { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(2); + } +#line 8470 "MachineIndependent/glslang_tab.cpp" + break; + + case 284: /* type_specifier_nonarray: F16VEC3 */ +#line 2127 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(3); + } +#line 8481 "MachineIndependent/glslang_tab.cpp" + break; + + case 285: /* type_specifier_nonarray: F16VEC4 */ +#line 2133 "MachineIndependent/glslang.y" + { + parseContext.float16ScalarVectorCheck((yyvsp[0].lex).loc, "half float vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setVector(4); + } +#line 8492 "MachineIndependent/glslang_tab.cpp" + break; + + case 286: /* type_specifier_nonarray: F32VEC2 */ +#line 2139 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); + } +#line 8503 "MachineIndependent/glslang_tab.cpp" + break; + + case 287: /* type_specifier_nonarray: F32VEC3 */ +#line 2145 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); + } +#line 8514 "MachineIndependent/glslang_tab.cpp" + break; + + case 288: /* type_specifier_nonarray: F32VEC4 */ +#line 2151 "MachineIndependent/glslang.y" + { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setVector(4); } -#line 8324 "MachineIndependent/glslang_tab.cpp" +#line 8525 "MachineIndependent/glslang_tab.cpp" break; - case 284: /* type_specifier_nonarray: F64VEC2 */ -#line 2127 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); - } -#line 8335 "MachineIndependent/glslang_tab.cpp" - break; - - case 285: /* type_specifier_nonarray: F64VEC3 */ -#line 2133 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); - } -#line 8346 "MachineIndependent/glslang_tab.cpp" - break; - - case 286: /* type_specifier_nonarray: F64VEC4 */ -#line 2139 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); - } -#line 8357 "MachineIndependent/glslang_tab.cpp" - break; - - case 287: /* type_specifier_nonarray: I8VEC2 */ -#line 2145 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(2); - } -#line 8368 "MachineIndependent/glslang_tab.cpp" - break; - - case 288: /* type_specifier_nonarray: I8VEC3 */ -#line 2151 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(3); - } -#line 8379 "MachineIndependent/glslang_tab.cpp" - break; - - case 289: /* type_specifier_nonarray: I8VEC4 */ + case 289: /* type_specifier_nonarray: F64VEC2 */ #line 2157 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + { + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt8; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } -#line 8390 "MachineIndependent/glslang_tab.cpp" +#line 8536 "MachineIndependent/glslang_tab.cpp" break; - case 290: /* type_specifier_nonarray: I16VEC2 */ + case 290: /* type_specifier_nonarray: F64VEC3 */ #line 2163 "MachineIndependent/glslang.y" { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } -#line 8401 "MachineIndependent/glslang_tab.cpp" +#line 8547 "MachineIndependent/glslang_tab.cpp" break; - case 291: /* type_specifier_nonarray: I16VEC3 */ + case 291: /* type_specifier_nonarray: F64VEC4 */ #line 2169 "MachineIndependent/glslang.y" { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; - (yyval.interm.type).setVector(3); - } -#line 8412 "MachineIndependent/glslang_tab.cpp" - break; - - case 292: /* type_specifier_nonarray: I16VEC4 */ -#line 2175 "MachineIndependent/glslang.y" - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setVector(4); } -#line 8423 "MachineIndependent/glslang_tab.cpp" +#line 8558 "MachineIndependent/glslang_tab.cpp" break; - case 293: /* type_specifier_nonarray: I32VEC2 */ -#line 2181 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + case 292: /* type_specifier_nonarray: I8VEC2 */ +#line 2175 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(2); } -#line 8434 "MachineIndependent/glslang_tab.cpp" +#line 8569 "MachineIndependent/glslang_tab.cpp" break; - case 294: /* type_specifier_nonarray: I32VEC3 */ -#line 2187 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + case 293: /* type_specifier_nonarray: I8VEC3 */ +#line 2181 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).basicType = EbtInt8; (yyval.interm.type).setVector(3); } -#line 8445 "MachineIndependent/glslang_tab.cpp" +#line 8580 "MachineIndependent/glslang_tab.cpp" break; - case 295: /* type_specifier_nonarray: I32VEC4 */ + case 294: /* type_specifier_nonarray: I8VEC4 */ +#line 2187 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt8; + (yyval.interm.type).setVector(4); + } +#line 8591 "MachineIndependent/glslang_tab.cpp" + break; + + case 295: /* type_specifier_nonarray: I16VEC2 */ #line 2193 "MachineIndependent/glslang.y" { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(2); + } +#line 8602 "MachineIndependent/glslang_tab.cpp" + break; + + case 296: /* type_specifier_nonarray: I16VEC3 */ +#line 2199 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(3); + } +#line 8613 "MachineIndependent/glslang_tab.cpp" + break; + + case 297: /* type_specifier_nonarray: I16VEC4 */ +#line 2205 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt16; + (yyval.interm.type).setVector(4); + } +#line 8624 "MachineIndependent/glslang_tab.cpp" + break; + + case 298: /* type_specifier_nonarray: I32VEC2 */ +#line 2211 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); + } +#line 8635 "MachineIndependent/glslang_tab.cpp" + break; + + case 299: /* type_specifier_nonarray: I32VEC3 */ +#line 2217 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); + } +#line 8646 "MachineIndependent/glslang_tab.cpp" + break; + + case 300: /* type_specifier_nonarray: I32VEC4 */ +#line 2223 "MachineIndependent/glslang.y" + { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtInt; (yyval.interm.type).setVector(4); } -#line 8456 "MachineIndependent/glslang_tab.cpp" +#line 8657 "MachineIndependent/glslang_tab.cpp" break; - case 296: /* type_specifier_nonarray: I64VEC2 */ -#line 2199 "MachineIndependent/glslang.y" - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(2); - } -#line 8467 "MachineIndependent/glslang_tab.cpp" - break; - - case 297: /* type_specifier_nonarray: I64VEC3 */ -#line 2205 "MachineIndependent/glslang.y" - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(3); - } -#line 8478 "MachineIndependent/glslang_tab.cpp" - break; - - case 298: /* type_specifier_nonarray: I64VEC4 */ -#line 2211 "MachineIndependent/glslang.y" - { - parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt64; - (yyval.interm.type).setVector(4); - } -#line 8489 "MachineIndependent/glslang_tab.cpp" - break; - - case 299: /* type_specifier_nonarray: U8VEC2 */ -#line 2217 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(2); - } -#line 8500 "MachineIndependent/glslang_tab.cpp" - break; - - case 300: /* type_specifier_nonarray: U8VEC3 */ -#line 2223 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(3); - } -#line 8511 "MachineIndependent/glslang_tab.cpp" - break; - - case 301: /* type_specifier_nonarray: U8VEC4 */ + case 301: /* type_specifier_nonarray: I64VEC2 */ #line 2229 "MachineIndependent/glslang.y" - { - parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + { + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint8; - (yyval.interm.type).setVector(4); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); } -#line 8522 "MachineIndependent/glslang_tab.cpp" +#line 8668 "MachineIndependent/glslang_tab.cpp" break; - case 302: /* type_specifier_nonarray: U16VEC2 */ + case 302: /* type_specifier_nonarray: I64VEC3 */ #line 2235 "MachineIndependent/glslang.y" { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(2); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); } -#line 8533 "MachineIndependent/glslang_tab.cpp" +#line 8679 "MachineIndependent/glslang_tab.cpp" break; - case 303: /* type_specifier_nonarray: U16VEC3 */ + case 303: /* type_specifier_nonarray: I64VEC4 */ #line 2241 "MachineIndependent/glslang.y" { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; - (yyval.interm.type).setVector(3); - } -#line 8544 "MachineIndependent/glslang_tab.cpp" - break; - - case 304: /* type_specifier_nonarray: U16VEC4 */ -#line 2247 "MachineIndependent/glslang.y" - { - parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).basicType = EbtInt64; (yyval.interm.type).setVector(4); } -#line 8555 "MachineIndependent/glslang_tab.cpp" +#line 8690 "MachineIndependent/glslang_tab.cpp" break; - case 305: /* type_specifier_nonarray: U32VEC2 */ -#line 2253 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + case 304: /* type_specifier_nonarray: U8VEC2 */ +#line 2247 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(2); } -#line 8566 "MachineIndependent/glslang_tab.cpp" +#line 8701 "MachineIndependent/glslang_tab.cpp" break; - case 306: /* type_specifier_nonarray: U32VEC3 */ -#line 2259 "MachineIndependent/glslang.y" - { - parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + case 305: /* type_specifier_nonarray: U8VEC3 */ +#line 2253 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).basicType = EbtUint8; (yyval.interm.type).setVector(3); } -#line 8577 "MachineIndependent/glslang_tab.cpp" +#line 8712 "MachineIndependent/glslang_tab.cpp" break; - case 307: /* type_specifier_nonarray: U32VEC4 */ + case 306: /* type_specifier_nonarray: U8VEC4 */ +#line 2259 "MachineIndependent/glslang.y" + { + parseContext.int8ScalarVectorCheck((yyvsp[0].lex).loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint8; + (yyval.interm.type).setVector(4); + } +#line 8723 "MachineIndependent/glslang_tab.cpp" + break; + + case 307: /* type_specifier_nonarray: U16VEC2 */ #line 2265 "MachineIndependent/glslang.y" { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(2); + } +#line 8734 "MachineIndependent/glslang_tab.cpp" + break; + + case 308: /* type_specifier_nonarray: U16VEC3 */ +#line 2271 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(3); + } +#line 8745 "MachineIndependent/glslang_tab.cpp" + break; + + case 309: /* type_specifier_nonarray: U16VEC4 */ +#line 2277 "MachineIndependent/glslang.y" + { + parseContext.int16ScalarVectorCheck((yyvsp[0].lex).loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint16; + (yyval.interm.type).setVector(4); + } +#line 8756 "MachineIndependent/glslang_tab.cpp" + break; + + case 310: /* type_specifier_nonarray: U32VEC2 */ +#line 2283 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); + } +#line 8767 "MachineIndependent/glslang_tab.cpp" + break; + + case 311: /* type_specifier_nonarray: U32VEC3 */ +#line 2289 "MachineIndependent/glslang.y" + { + parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); + } +#line 8778 "MachineIndependent/glslang_tab.cpp" + break; + + case 312: /* type_specifier_nonarray: U32VEC4 */ +#line 2295 "MachineIndependent/glslang.y" + { parseContext.explicitInt32Check((yyvsp[0].lex).loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint; (yyval.interm.type).setVector(4); } -#line 8588 "MachineIndependent/glslang_tab.cpp" +#line 8789 "MachineIndependent/glslang_tab.cpp" break; - case 308: /* type_specifier_nonarray: U64VEC2 */ -#line 2271 "MachineIndependent/glslang.y" + case 313: /* type_specifier_nonarray: U64VEC2 */ +#line 2301 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(2); } -#line 8599 "MachineIndependent/glslang_tab.cpp" +#line 8800 "MachineIndependent/glslang_tab.cpp" break; - case 309: /* type_specifier_nonarray: U64VEC3 */ -#line 2277 "MachineIndependent/glslang.y" + case 314: /* type_specifier_nonarray: U64VEC3 */ +#line 2307 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(3); } -#line 8610 "MachineIndependent/glslang_tab.cpp" +#line 8811 "MachineIndependent/glslang_tab.cpp" break; - case 310: /* type_specifier_nonarray: U64VEC4 */ -#line 2283 "MachineIndependent/glslang.y" + case 315: /* type_specifier_nonarray: U64VEC4 */ +#line 2313 "MachineIndependent/glslang.y" { parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtUint64; (yyval.interm.type).setVector(4); } -#line 8621 "MachineIndependent/glslang_tab.cpp" +#line 8822 "MachineIndependent/glslang_tab.cpp" break; - case 311: /* type_specifier_nonarray: DMAT2 */ -#line 2289 "MachineIndependent/glslang.y" + case 316: /* type_specifier_nonarray: DMAT2 */ +#line 2319 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8630,11 +8831,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8634 "MachineIndependent/glslang_tab.cpp" +#line 8835 "MachineIndependent/glslang_tab.cpp" break; - case 312: /* type_specifier_nonarray: DMAT3 */ -#line 2297 "MachineIndependent/glslang.y" + case 317: /* type_specifier_nonarray: DMAT3 */ +#line 2327 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8643,11 +8844,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8647 "MachineIndependent/glslang_tab.cpp" +#line 8848 "MachineIndependent/glslang_tab.cpp" break; - case 313: /* type_specifier_nonarray: DMAT4 */ -#line 2305 "MachineIndependent/glslang.y" + case 318: /* type_specifier_nonarray: DMAT4 */ +#line 2335 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8656,11 +8857,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8660 "MachineIndependent/glslang_tab.cpp" +#line 8861 "MachineIndependent/glslang_tab.cpp" break; - case 314: /* type_specifier_nonarray: DMAT2X2 */ -#line 2313 "MachineIndependent/glslang.y" + case 319: /* type_specifier_nonarray: DMAT2X2 */ +#line 2343 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8669,11 +8870,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 8673 "MachineIndependent/glslang_tab.cpp" +#line 8874 "MachineIndependent/glslang_tab.cpp" break; - case 315: /* type_specifier_nonarray: DMAT2X3 */ -#line 2321 "MachineIndependent/glslang.y" + case 320: /* type_specifier_nonarray: DMAT2X3 */ +#line 2351 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8682,11 +8883,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 8686 "MachineIndependent/glslang_tab.cpp" +#line 8887 "MachineIndependent/glslang_tab.cpp" break; - case 316: /* type_specifier_nonarray: DMAT2X4 */ -#line 2329 "MachineIndependent/glslang.y" + case 321: /* type_specifier_nonarray: DMAT2X4 */ +#line 2359 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8695,11 +8896,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 8699 "MachineIndependent/glslang_tab.cpp" +#line 8900 "MachineIndependent/glslang_tab.cpp" break; - case 317: /* type_specifier_nonarray: DMAT3X2 */ -#line 2337 "MachineIndependent/glslang.y" + case 322: /* type_specifier_nonarray: DMAT3X2 */ +#line 2367 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8708,11 +8909,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 8712 "MachineIndependent/glslang_tab.cpp" +#line 8913 "MachineIndependent/glslang_tab.cpp" break; - case 318: /* type_specifier_nonarray: DMAT3X3 */ -#line 2345 "MachineIndependent/glslang.y" + case 323: /* type_specifier_nonarray: DMAT3X3 */ +#line 2375 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8721,11 +8922,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 8725 "MachineIndependent/glslang_tab.cpp" +#line 8926 "MachineIndependent/glslang_tab.cpp" break; - case 319: /* type_specifier_nonarray: DMAT3X4 */ -#line 2353 "MachineIndependent/glslang.y" + case 324: /* type_specifier_nonarray: DMAT3X4 */ +#line 2383 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8734,11 +8935,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 8738 "MachineIndependent/glslang_tab.cpp" +#line 8939 "MachineIndependent/glslang_tab.cpp" break; - case 320: /* type_specifier_nonarray: DMAT4X2 */ -#line 2361 "MachineIndependent/glslang.y" + case 325: /* type_specifier_nonarray: DMAT4X2 */ +#line 2391 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8747,11 +8948,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 8751 "MachineIndependent/glslang_tab.cpp" +#line 8952 "MachineIndependent/glslang_tab.cpp" break; - case 321: /* type_specifier_nonarray: DMAT4X3 */ -#line 2369 "MachineIndependent/glslang.y" + case 326: /* type_specifier_nonarray: DMAT4X3 */ +#line 2399 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8760,11 +8961,11 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 8764 "MachineIndependent/glslang_tab.cpp" +#line 8965 "MachineIndependent/glslang_tab.cpp" break; - case 322: /* type_specifier_nonarray: DMAT4X4 */ -#line 2377 "MachineIndependent/glslang.y" + case 327: /* type_specifier_nonarray: DMAT4X4 */ +#line 2407 "MachineIndependent/glslang.y" { parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix"); if (! parseContext.symbolTable.atBuiltInLevel()) @@ -8773,2261 +8974,2261 @@ yyreduce: (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 8777 "MachineIndependent/glslang_tab.cpp" +#line 8978 "MachineIndependent/glslang_tab.cpp" break; - case 323: /* type_specifier_nonarray: F16MAT2 */ -#line 2385 "MachineIndependent/glslang.y" + case 328: /* type_specifier_nonarray: F16MAT2 */ +#line 2415 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(2, 2); } -#line 8788 "MachineIndependent/glslang_tab.cpp" +#line 8989 "MachineIndependent/glslang_tab.cpp" break; - case 324: /* type_specifier_nonarray: F16MAT3 */ -#line 2391 "MachineIndependent/glslang.y" + case 329: /* type_specifier_nonarray: F16MAT3 */ +#line 2421 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(3, 3); } -#line 8799 "MachineIndependent/glslang_tab.cpp" +#line 9000 "MachineIndependent/glslang_tab.cpp" break; - case 325: /* type_specifier_nonarray: F16MAT4 */ -#line 2397 "MachineIndependent/glslang.y" + case 330: /* type_specifier_nonarray: F16MAT4 */ +#line 2427 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8810 "MachineIndependent/glslang_tab.cpp" +#line 9011 "MachineIndependent/glslang_tab.cpp" break; - case 326: /* type_specifier_nonarray: F16MAT2X2 */ -#line 2403 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 2); - } -#line 8821 "MachineIndependent/glslang_tab.cpp" - break; - - case 327: /* type_specifier_nonarray: F16MAT2X3 */ -#line 2409 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 3); - } -#line 8832 "MachineIndependent/glslang_tab.cpp" - break; - - case 328: /* type_specifier_nonarray: F16MAT2X4 */ -#line 2415 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(2, 4); - } -#line 8843 "MachineIndependent/glslang_tab.cpp" - break; - - case 329: /* type_specifier_nonarray: F16MAT3X2 */ -#line 2421 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 2); - } -#line 8854 "MachineIndependent/glslang_tab.cpp" - break; - - case 330: /* type_specifier_nonarray: F16MAT3X3 */ -#line 2427 "MachineIndependent/glslang.y" - { - parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 3); - } -#line 8865 "MachineIndependent/glslang_tab.cpp" - break; - - case 331: /* type_specifier_nonarray: F16MAT3X4 */ + case 331: /* type_specifier_nonarray: F16MAT2X2 */ #line 2433 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).setMatrix(2, 2); } -#line 8876 "MachineIndependent/glslang_tab.cpp" +#line 9022 "MachineIndependent/glslang_tab.cpp" break; - case 332: /* type_specifier_nonarray: F16MAT4X2 */ + case 332: /* type_specifier_nonarray: F16MAT2X3 */ #line 2439 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).setMatrix(2, 3); } -#line 8887 "MachineIndependent/glslang_tab.cpp" +#line 9033 "MachineIndependent/glslang_tab.cpp" break; - case 333: /* type_specifier_nonarray: F16MAT4X3 */ + case 333: /* type_specifier_nonarray: F16MAT2X4 */ #line 2445 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 4); } -#line 8898 "MachineIndependent/glslang_tab.cpp" +#line 9044 "MachineIndependent/glslang_tab.cpp" break; - case 334: /* type_specifier_nonarray: F16MAT4X4 */ + case 334: /* type_specifier_nonarray: F16MAT3X2 */ #line 2451 "MachineIndependent/glslang.y" { parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 2); + } +#line 9055 "MachineIndependent/glslang_tab.cpp" + break; + + case 335: /* type_specifier_nonarray: F16MAT3X3 */ +#line 2457 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9066 "MachineIndependent/glslang_tab.cpp" + break; + + case 336: /* type_specifier_nonarray: F16MAT3X4 */ +#line 2463 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(3, 4); + } +#line 9077 "MachineIndependent/glslang_tab.cpp" + break; + + case 337: /* type_specifier_nonarray: F16MAT4X2 */ +#line 2469 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 2); + } +#line 9088 "MachineIndependent/glslang_tab.cpp" + break; + + case 338: /* type_specifier_nonarray: F16MAT4X3 */ +#line 2475 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; + (yyval.interm.type).setMatrix(4, 3); + } +#line 9099 "MachineIndependent/glslang_tab.cpp" + break; + + case 339: /* type_specifier_nonarray: F16MAT4X4 */ +#line 2481 "MachineIndependent/glslang.y" + { + parseContext.float16Check((yyvsp[0].lex).loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat16; (yyval.interm.type).setMatrix(4, 4); } -#line 8909 "MachineIndependent/glslang_tab.cpp" +#line 9110 "MachineIndependent/glslang_tab.cpp" break; - case 335: /* type_specifier_nonarray: F32MAT2 */ -#line 2457 "MachineIndependent/glslang.y" + case 340: /* type_specifier_nonarray: F32MAT2 */ +#line 2487 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(2, 2); } -#line 8920 "MachineIndependent/glslang_tab.cpp" +#line 9121 "MachineIndependent/glslang_tab.cpp" break; - case 336: /* type_specifier_nonarray: F32MAT3 */ -#line 2463 "MachineIndependent/glslang.y" + case 341: /* type_specifier_nonarray: F32MAT3 */ +#line 2493 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(3, 3); } -#line 8931 "MachineIndependent/glslang_tab.cpp" +#line 9132 "MachineIndependent/glslang_tab.cpp" break; - case 337: /* type_specifier_nonarray: F32MAT4 */ -#line 2469 "MachineIndependent/glslang.y" + case 342: /* type_specifier_nonarray: F32MAT4 */ +#line 2499 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 8942 "MachineIndependent/glslang_tab.cpp" +#line 9143 "MachineIndependent/glslang_tab.cpp" break; - case 338: /* type_specifier_nonarray: F32MAT2X2 */ -#line 2475 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); - } -#line 8953 "MachineIndependent/glslang_tab.cpp" - break; - - case 339: /* type_specifier_nonarray: F32MAT2X3 */ -#line 2481 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); - } -#line 8964 "MachineIndependent/glslang_tab.cpp" - break; - - case 340: /* type_specifier_nonarray: F32MAT2X4 */ -#line 2487 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); - } -#line 8975 "MachineIndependent/glslang_tab.cpp" - break; - - case 341: /* type_specifier_nonarray: F32MAT3X2 */ -#line 2493 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 2); - } -#line 8986 "MachineIndependent/glslang_tab.cpp" - break; - - case 342: /* type_specifier_nonarray: F32MAT3X3 */ -#line 2499 "MachineIndependent/glslang.y" - { - parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); - (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); - } -#line 8997 "MachineIndependent/glslang_tab.cpp" - break; - - case 343: /* type_specifier_nonarray: F32MAT3X4 */ + case 343: /* type_specifier_nonarray: F32MAT2X2 */ #line 2505 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).setMatrix(2, 2); } -#line 9008 "MachineIndependent/glslang_tab.cpp" +#line 9154 "MachineIndependent/glslang_tab.cpp" break; - case 344: /* type_specifier_nonarray: F32MAT4X2 */ + case 344: /* type_specifier_nonarray: F32MAT2X3 */ #line 2511 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); + } +#line 9165 "MachineIndependent/glslang_tab.cpp" + break; + + case 345: /* type_specifier_nonarray: F32MAT2X4 */ +#line 2517 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); + } +#line 9176 "MachineIndependent/glslang_tab.cpp" + break; + + case 346: /* type_specifier_nonarray: F32MAT3X2 */ +#line 2523 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); + } +#line 9187 "MachineIndependent/glslang_tab.cpp" + break; + + case 347: /* type_specifier_nonarray: F32MAT3X3 */ +#line 2529 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); + } +#line 9198 "MachineIndependent/glslang_tab.cpp" + break; + + case 348: /* type_specifier_nonarray: F32MAT3X4 */ +#line 2535 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); + } +#line 9209 "MachineIndependent/glslang_tab.cpp" + break; + + case 349: /* type_specifier_nonarray: F32MAT4X2 */ +#line 2541 "MachineIndependent/glslang.y" + { + parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 2); } -#line 9019 "MachineIndependent/glslang_tab.cpp" +#line 9220 "MachineIndependent/glslang_tab.cpp" break; - case 345: /* type_specifier_nonarray: F32MAT4X3 */ -#line 2517 "MachineIndependent/glslang.y" + case 350: /* type_specifier_nonarray: F32MAT4X3 */ +#line 2547 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 3); } -#line 9030 "MachineIndependent/glslang_tab.cpp" +#line 9231 "MachineIndependent/glslang_tab.cpp" break; - case 346: /* type_specifier_nonarray: F32MAT4X4 */ -#line 2523 "MachineIndependent/glslang.y" + case 351: /* type_specifier_nonarray: F32MAT4X4 */ +#line 2553 "MachineIndependent/glslang.y" { parseContext.explicitFloat32Check((yyvsp[0].lex).loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; (yyval.interm.type).setMatrix(4, 4); } -#line 9041 "MachineIndependent/glslang_tab.cpp" +#line 9242 "MachineIndependent/glslang_tab.cpp" break; - case 347: /* type_specifier_nonarray: F64MAT2 */ -#line 2529 "MachineIndependent/glslang.y" + case 352: /* type_specifier_nonarray: F64MAT2 */ +#line 2559 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 9052 "MachineIndependent/glslang_tab.cpp" +#line 9253 "MachineIndependent/glslang_tab.cpp" break; - case 348: /* type_specifier_nonarray: F64MAT3 */ -#line 2535 "MachineIndependent/glslang.y" + case 353: /* type_specifier_nonarray: F64MAT3 */ +#line 2565 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 9063 "MachineIndependent/glslang_tab.cpp" +#line 9264 "MachineIndependent/glslang_tab.cpp" break; - case 349: /* type_specifier_nonarray: F64MAT4 */ -#line 2541 "MachineIndependent/glslang.y" + case 354: /* type_specifier_nonarray: F64MAT4 */ +#line 2571 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 9074 "MachineIndependent/glslang_tab.cpp" +#line 9275 "MachineIndependent/glslang_tab.cpp" break; - case 350: /* type_specifier_nonarray: F64MAT2X2 */ -#line 2547 "MachineIndependent/glslang.y" + case 355: /* type_specifier_nonarray: F64MAT2X2 */ +#line 2577 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 2); } -#line 9085 "MachineIndependent/glslang_tab.cpp" +#line 9286 "MachineIndependent/glslang_tab.cpp" break; - case 351: /* type_specifier_nonarray: F64MAT2X3 */ -#line 2553 "MachineIndependent/glslang.y" + case 356: /* type_specifier_nonarray: F64MAT2X3 */ +#line 2583 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 3); } -#line 9096 "MachineIndependent/glslang_tab.cpp" +#line 9297 "MachineIndependent/glslang_tab.cpp" break; - case 352: /* type_specifier_nonarray: F64MAT2X4 */ -#line 2559 "MachineIndependent/glslang.y" + case 357: /* type_specifier_nonarray: F64MAT2X4 */ +#line 2589 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(2, 4); } -#line 9107 "MachineIndependent/glslang_tab.cpp" +#line 9308 "MachineIndependent/glslang_tab.cpp" break; - case 353: /* type_specifier_nonarray: F64MAT3X2 */ -#line 2565 "MachineIndependent/glslang.y" + case 358: /* type_specifier_nonarray: F64MAT3X2 */ +#line 2595 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 2); } -#line 9118 "MachineIndependent/glslang_tab.cpp" +#line 9319 "MachineIndependent/glslang_tab.cpp" break; - case 354: /* type_specifier_nonarray: F64MAT3X3 */ -#line 2571 "MachineIndependent/glslang.y" + case 359: /* type_specifier_nonarray: F64MAT3X3 */ +#line 2601 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 3); } -#line 9129 "MachineIndependent/glslang_tab.cpp" +#line 9330 "MachineIndependent/glslang_tab.cpp" break; - case 355: /* type_specifier_nonarray: F64MAT3X4 */ -#line 2577 "MachineIndependent/glslang.y" + case 360: /* type_specifier_nonarray: F64MAT3X4 */ +#line 2607 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(3, 4); } -#line 9140 "MachineIndependent/glslang_tab.cpp" +#line 9341 "MachineIndependent/glslang_tab.cpp" break; - case 356: /* type_specifier_nonarray: F64MAT4X2 */ -#line 2583 "MachineIndependent/glslang.y" + case 361: /* type_specifier_nonarray: F64MAT4X2 */ +#line 2613 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 2); } -#line 9151 "MachineIndependent/glslang_tab.cpp" +#line 9352 "MachineIndependent/glslang_tab.cpp" break; - case 357: /* type_specifier_nonarray: F64MAT4X3 */ -#line 2589 "MachineIndependent/glslang.y" + case 362: /* type_specifier_nonarray: F64MAT4X3 */ +#line 2619 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 3); } -#line 9162 "MachineIndependent/glslang_tab.cpp" +#line 9363 "MachineIndependent/glslang_tab.cpp" break; - case 358: /* type_specifier_nonarray: F64MAT4X4 */ -#line 2595 "MachineIndependent/glslang.y" + case 363: /* type_specifier_nonarray: F64MAT4X4 */ +#line 2625 "MachineIndependent/glslang.y" { parseContext.explicitFloat64Check((yyvsp[0].lex).loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; (yyval.interm.type).setMatrix(4, 4); } -#line 9173 "MachineIndependent/glslang_tab.cpp" +#line 9374 "MachineIndependent/glslang_tab.cpp" break; - case 359: /* type_specifier_nonarray: ACCSTRUCTNV */ -#line 2601 "MachineIndependent/glslang.y" + case 364: /* type_specifier_nonarray: ACCSTRUCTNV */ +#line 2631 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 9182 "MachineIndependent/glslang_tab.cpp" +#line 9383 "MachineIndependent/glslang_tab.cpp" break; - case 360: /* type_specifier_nonarray: ACCSTRUCTEXT */ -#line 2605 "MachineIndependent/glslang.y" + case 365: /* type_specifier_nonarray: ACCSTRUCTEXT */ +#line 2635 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAccStruct; } -#line 9191 "MachineIndependent/glslang_tab.cpp" +#line 9392 "MachineIndependent/glslang_tab.cpp" break; - case 361: /* type_specifier_nonarray: RAYQUERYEXT */ -#line 2609 "MachineIndependent/glslang.y" + case 366: /* type_specifier_nonarray: RAYQUERYEXT */ +#line 2639 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtRayQuery; } -#line 9200 "MachineIndependent/glslang_tab.cpp" +#line 9401 "MachineIndependent/glslang_tab.cpp" break; - case 362: /* type_specifier_nonarray: ATOMIC_UINT */ -#line 2613 "MachineIndependent/glslang.y" + case 367: /* type_specifier_nonarray: ATOMIC_UINT */ +#line 2643 "MachineIndependent/glslang.y" { parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtAtomicUint; } -#line 9210 "MachineIndependent/glslang_tab.cpp" +#line 9411 "MachineIndependent/glslang_tab.cpp" break; - case 363: /* type_specifier_nonarray: SAMPLER1D */ -#line 2618 "MachineIndependent/glslang.y" + case 368: /* type_specifier_nonarray: SAMPLER1D */ +#line 2648 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } -#line 9220 "MachineIndependent/glslang_tab.cpp" +#line 9421 "MachineIndependent/glslang_tab.cpp" break; - case 364: /* type_specifier_nonarray: SAMPLER2D */ -#line 2623 "MachineIndependent/glslang.y" + case 369: /* type_specifier_nonarray: SAMPLER2D */ +#line 2653 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } -#line 9230 "MachineIndependent/glslang_tab.cpp" +#line 9431 "MachineIndependent/glslang_tab.cpp" break; - case 365: /* type_specifier_nonarray: SAMPLER3D */ -#line 2628 "MachineIndependent/glslang.y" + case 370: /* type_specifier_nonarray: SAMPLER3D */ +#line 2658 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } -#line 9240 "MachineIndependent/glslang_tab.cpp" +#line 9441 "MachineIndependent/glslang_tab.cpp" break; - case 366: /* type_specifier_nonarray: SAMPLERCUBE */ -#line 2633 "MachineIndependent/glslang.y" + case 371: /* type_specifier_nonarray: SAMPLERCUBE */ +#line 2663 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } -#line 9250 "MachineIndependent/glslang_tab.cpp" +#line 9451 "MachineIndependent/glslang_tab.cpp" break; - case 367: /* type_specifier_nonarray: SAMPLER2DSHADOW */ -#line 2638 "MachineIndependent/glslang.y" + case 372: /* type_specifier_nonarray: SAMPLER2DSHADOW */ +#line 2668 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } -#line 9260 "MachineIndependent/glslang_tab.cpp" +#line 9461 "MachineIndependent/glslang_tab.cpp" break; - case 368: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ -#line 2643 "MachineIndependent/glslang.y" + case 373: /* type_specifier_nonarray: SAMPLERCUBESHADOW */ +#line 2673 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } -#line 9270 "MachineIndependent/glslang_tab.cpp" +#line 9471 "MachineIndependent/glslang_tab.cpp" break; - case 369: /* type_specifier_nonarray: SAMPLER2DARRAY */ -#line 2648 "MachineIndependent/glslang.y" + case 374: /* type_specifier_nonarray: SAMPLER2DARRAY */ +#line 2678 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } -#line 9280 "MachineIndependent/glslang_tab.cpp" +#line 9481 "MachineIndependent/glslang_tab.cpp" break; - case 370: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ -#line 2653 "MachineIndependent/glslang.y" + case 375: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */ +#line 2683 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } -#line 9290 "MachineIndependent/glslang_tab.cpp" +#line 9491 "MachineIndependent/glslang_tab.cpp" break; - case 371: /* type_specifier_nonarray: SAMPLER1DSHADOW */ -#line 2658 "MachineIndependent/glslang.y" + case 376: /* type_specifier_nonarray: SAMPLER1DSHADOW */ +#line 2688 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } -#line 9300 "MachineIndependent/glslang_tab.cpp" +#line 9501 "MachineIndependent/glslang_tab.cpp" break; - case 372: /* type_specifier_nonarray: SAMPLER1DARRAY */ -#line 2663 "MachineIndependent/glslang.y" + case 377: /* type_specifier_nonarray: SAMPLER1DARRAY */ +#line 2693 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } -#line 9310 "MachineIndependent/glslang_tab.cpp" +#line 9511 "MachineIndependent/glslang_tab.cpp" break; - case 373: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ -#line 2668 "MachineIndependent/glslang.y" + case 378: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */ +#line 2698 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } -#line 9320 "MachineIndependent/glslang_tab.cpp" +#line 9521 "MachineIndependent/glslang_tab.cpp" break; - case 374: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ -#line 2673 "MachineIndependent/glslang.y" + case 379: /* type_specifier_nonarray: SAMPLERCUBEARRAY */ +#line 2703 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } -#line 9330 "MachineIndependent/glslang_tab.cpp" +#line 9531 "MachineIndependent/glslang_tab.cpp" break; - case 375: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ -#line 2678 "MachineIndependent/glslang.y" + case 380: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */ +#line 2708 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } -#line 9340 "MachineIndependent/glslang_tab.cpp" +#line 9541 "MachineIndependent/glslang_tab.cpp" break; - case 376: /* type_specifier_nonarray: F16SAMPLER1D */ -#line 2683 "MachineIndependent/glslang.y" + case 381: /* type_specifier_nonarray: F16SAMPLER1D */ +#line 2713 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D); } -#line 9351 "MachineIndependent/glslang_tab.cpp" +#line 9552 "MachineIndependent/glslang_tab.cpp" break; - case 377: /* type_specifier_nonarray: F16SAMPLER2D */ -#line 2689 "MachineIndependent/glslang.y" + case 382: /* type_specifier_nonarray: F16SAMPLER2D */ +#line 2719 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D); } -#line 9362 "MachineIndependent/glslang_tab.cpp" +#line 9563 "MachineIndependent/glslang_tab.cpp" break; - case 378: /* type_specifier_nonarray: F16SAMPLER3D */ -#line 2695 "MachineIndependent/glslang.y" + case 383: /* type_specifier_nonarray: F16SAMPLER3D */ +#line 2725 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd3D); } -#line 9373 "MachineIndependent/glslang_tab.cpp" +#line 9574 "MachineIndependent/glslang_tab.cpp" break; - case 379: /* type_specifier_nonarray: F16SAMPLERCUBE */ -#line 2701 "MachineIndependent/glslang.y" + case 384: /* type_specifier_nonarray: F16SAMPLERCUBE */ +#line 2731 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube); } -#line 9384 "MachineIndependent/glslang_tab.cpp" +#line 9585 "MachineIndependent/glslang_tab.cpp" break; - case 380: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ -#line 2707 "MachineIndependent/glslang.y" + case 385: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */ +#line 2737 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, false, true); } -#line 9395 "MachineIndependent/glslang_tab.cpp" +#line 9596 "MachineIndependent/glslang_tab.cpp" break; - case 381: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ -#line 2713 "MachineIndependent/glslang.y" + case 386: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */ +#line 2743 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, true); } -#line 9406 "MachineIndependent/glslang_tab.cpp" +#line 9607 "MachineIndependent/glslang_tab.cpp" break; - case 382: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ -#line 2719 "MachineIndependent/glslang.y" + case 387: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */ +#line 2749 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, false, true); } -#line 9417 "MachineIndependent/glslang_tab.cpp" +#line 9618 "MachineIndependent/glslang_tab.cpp" break; - case 383: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ -#line 2725 "MachineIndependent/glslang.y" + case 388: /* type_specifier_nonarray: F16SAMPLER1DARRAY */ +#line 2755 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true); } -#line 9428 "MachineIndependent/glslang_tab.cpp" +#line 9629 "MachineIndependent/glslang_tab.cpp" break; - case 384: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ -#line 2731 "MachineIndependent/glslang.y" + case 389: /* type_specifier_nonarray: F16SAMPLER2DARRAY */ +#line 2761 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true); } -#line 9439 "MachineIndependent/glslang_tab.cpp" +#line 9640 "MachineIndependent/glslang_tab.cpp" break; - case 385: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ -#line 2737 "MachineIndependent/glslang.y" + case 390: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */ +#line 2767 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd1D, true, true); } -#line 9450 "MachineIndependent/glslang_tab.cpp" +#line 9651 "MachineIndependent/glslang_tab.cpp" break; - case 386: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ -#line 2743 "MachineIndependent/glslang.y" + case 391: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */ +#line 2773 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, true); } -#line 9461 "MachineIndependent/glslang_tab.cpp" +#line 9662 "MachineIndependent/glslang_tab.cpp" break; - case 387: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ -#line 2749 "MachineIndependent/glslang.y" + case 392: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */ +#line 2779 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true); } -#line 9472 "MachineIndependent/glslang_tab.cpp" +#line 9673 "MachineIndependent/glslang_tab.cpp" break; - case 388: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ -#line 2755 "MachineIndependent/glslang.y" + case 393: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */ +#line 2785 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdCube, true, true); } -#line 9483 "MachineIndependent/glslang_tab.cpp" +#line 9684 "MachineIndependent/glslang_tab.cpp" break; - case 389: /* type_specifier_nonarray: ISAMPLER1D */ -#line 2761 "MachineIndependent/glslang.y" + case 394: /* type_specifier_nonarray: ISAMPLER1D */ +#line 2791 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D); } -#line 9493 "MachineIndependent/glslang_tab.cpp" +#line 9694 "MachineIndependent/glslang_tab.cpp" break; - case 390: /* type_specifier_nonarray: ISAMPLER2D */ -#line 2766 "MachineIndependent/glslang.y" + case 395: /* type_specifier_nonarray: ISAMPLER2D */ +#line 2796 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D); } -#line 9503 "MachineIndependent/glslang_tab.cpp" +#line 9704 "MachineIndependent/glslang_tab.cpp" break; - case 391: /* type_specifier_nonarray: ISAMPLER3D */ -#line 2771 "MachineIndependent/glslang.y" + case 396: /* type_specifier_nonarray: ISAMPLER3D */ +#line 2801 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd3D); } -#line 9513 "MachineIndependent/glslang_tab.cpp" +#line 9714 "MachineIndependent/glslang_tab.cpp" break; - case 392: /* type_specifier_nonarray: ISAMPLERCUBE */ -#line 2776 "MachineIndependent/glslang.y" + case 397: /* type_specifier_nonarray: ISAMPLERCUBE */ +#line 2806 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube); } -#line 9523 "MachineIndependent/glslang_tab.cpp" +#line 9724 "MachineIndependent/glslang_tab.cpp" break; - case 393: /* type_specifier_nonarray: ISAMPLER2DARRAY */ -#line 2781 "MachineIndependent/glslang.y" + case 398: /* type_specifier_nonarray: ISAMPLER2DARRAY */ +#line 2811 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } -#line 9533 "MachineIndependent/glslang_tab.cpp" +#line 9734 "MachineIndependent/glslang_tab.cpp" break; - case 394: /* type_specifier_nonarray: USAMPLER2D */ -#line 2786 "MachineIndependent/glslang.y" + case 399: /* type_specifier_nonarray: USAMPLER2D */ +#line 2816 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D); } -#line 9543 "MachineIndependent/glslang_tab.cpp" +#line 9744 "MachineIndependent/glslang_tab.cpp" break; - case 395: /* type_specifier_nonarray: USAMPLER3D */ -#line 2791 "MachineIndependent/glslang.y" + case 400: /* type_specifier_nonarray: USAMPLER3D */ +#line 2821 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd3D); } -#line 9553 "MachineIndependent/glslang_tab.cpp" +#line 9754 "MachineIndependent/glslang_tab.cpp" break; - case 396: /* type_specifier_nonarray: USAMPLERCUBE */ -#line 2796 "MachineIndependent/glslang.y" + case 401: /* type_specifier_nonarray: USAMPLERCUBE */ +#line 2826 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube); } -#line 9563 "MachineIndependent/glslang_tab.cpp" +#line 9764 "MachineIndependent/glslang_tab.cpp" break; - case 397: /* type_specifier_nonarray: ISAMPLER1DARRAY */ -#line 2801 "MachineIndependent/glslang.y" + case 402: /* type_specifier_nonarray: ISAMPLER1DARRAY */ +#line 2831 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } -#line 9573 "MachineIndependent/glslang_tab.cpp" +#line 9774 "MachineIndependent/glslang_tab.cpp" break; - case 398: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ -#line 2806 "MachineIndependent/glslang.y" + case 403: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */ +#line 2836 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } -#line 9583 "MachineIndependent/glslang_tab.cpp" +#line 9784 "MachineIndependent/glslang_tab.cpp" break; - case 399: /* type_specifier_nonarray: USAMPLER1D */ -#line 2811 "MachineIndependent/glslang.y" + case 404: /* type_specifier_nonarray: USAMPLER1D */ +#line 2841 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D); } -#line 9593 "MachineIndependent/glslang_tab.cpp" +#line 9794 "MachineIndependent/glslang_tab.cpp" break; - case 400: /* type_specifier_nonarray: USAMPLER1DARRAY */ -#line 2816 "MachineIndependent/glslang.y" + case 405: /* type_specifier_nonarray: USAMPLER1DARRAY */ +#line 2846 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } -#line 9603 "MachineIndependent/glslang_tab.cpp" +#line 9804 "MachineIndependent/glslang_tab.cpp" break; - case 401: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ -#line 2821 "MachineIndependent/glslang.y" + case 406: /* type_specifier_nonarray: USAMPLERCUBEARRAY */ +#line 2851 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } -#line 9613 "MachineIndependent/glslang_tab.cpp" +#line 9814 "MachineIndependent/glslang_tab.cpp" break; - case 402: /* type_specifier_nonarray: TEXTURECUBEARRAY */ -#line 2826 "MachineIndependent/glslang.y" + case 407: /* type_specifier_nonarray: TEXTURECUBEARRAY */ +#line 2856 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } -#line 9623 "MachineIndependent/glslang_tab.cpp" +#line 9824 "MachineIndependent/glslang_tab.cpp" break; - case 403: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ -#line 2831 "MachineIndependent/glslang.y" + case 408: /* type_specifier_nonarray: ITEXTURECUBEARRAY */ +#line 2861 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } -#line 9633 "MachineIndependent/glslang_tab.cpp" +#line 9834 "MachineIndependent/glslang_tab.cpp" break; - case 404: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ -#line 2836 "MachineIndependent/glslang.y" + case 409: /* type_specifier_nonarray: UTEXTURECUBEARRAY */ +#line 2866 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } -#line 9643 "MachineIndependent/glslang_tab.cpp" +#line 9844 "MachineIndependent/glslang_tab.cpp" break; - case 405: /* type_specifier_nonarray: USAMPLER2DARRAY */ -#line 2841 "MachineIndependent/glslang.y" + case 410: /* type_specifier_nonarray: USAMPLER2DARRAY */ +#line 2871 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } -#line 9653 "MachineIndependent/glslang_tab.cpp" +#line 9854 "MachineIndependent/glslang_tab.cpp" break; - case 406: /* type_specifier_nonarray: TEXTURE2D */ -#line 2846 "MachineIndependent/glslang.y" + case 411: /* type_specifier_nonarray: TEXTURE2D */ +#line 2876 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } -#line 9663 "MachineIndependent/glslang_tab.cpp" +#line 9864 "MachineIndependent/glslang_tab.cpp" break; - case 407: /* type_specifier_nonarray: TEXTURE3D */ -#line 2851 "MachineIndependent/glslang.y" + case 412: /* type_specifier_nonarray: TEXTURE3D */ +#line 2881 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } -#line 9673 "MachineIndependent/glslang_tab.cpp" +#line 9874 "MachineIndependent/glslang_tab.cpp" break; - case 408: /* type_specifier_nonarray: TEXTURE2DARRAY */ -#line 2856 "MachineIndependent/glslang.y" + case 413: /* type_specifier_nonarray: TEXTURE2DARRAY */ +#line 2886 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } -#line 9683 "MachineIndependent/glslang_tab.cpp" +#line 9884 "MachineIndependent/glslang_tab.cpp" break; - case 409: /* type_specifier_nonarray: TEXTURECUBE */ -#line 2861 "MachineIndependent/glslang.y" + case 414: /* type_specifier_nonarray: TEXTURECUBE */ +#line 2891 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } -#line 9693 "MachineIndependent/glslang_tab.cpp" +#line 9894 "MachineIndependent/glslang_tab.cpp" break; - case 410: /* type_specifier_nonarray: ITEXTURE2D */ -#line 2866 "MachineIndependent/glslang.y" + case 415: /* type_specifier_nonarray: ITEXTURE2D */ +#line 2896 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } -#line 9703 "MachineIndependent/glslang_tab.cpp" +#line 9904 "MachineIndependent/glslang_tab.cpp" break; - case 411: /* type_specifier_nonarray: ITEXTURE3D */ -#line 2871 "MachineIndependent/glslang.y" + case 416: /* type_specifier_nonarray: ITEXTURE3D */ +#line 2901 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } -#line 9713 "MachineIndependent/glslang_tab.cpp" +#line 9914 "MachineIndependent/glslang_tab.cpp" break; - case 412: /* type_specifier_nonarray: ITEXTURECUBE */ -#line 2876 "MachineIndependent/glslang.y" + case 417: /* type_specifier_nonarray: ITEXTURECUBE */ +#line 2906 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } -#line 9723 "MachineIndependent/glslang_tab.cpp" +#line 9924 "MachineIndependent/glslang_tab.cpp" break; - case 413: /* type_specifier_nonarray: ITEXTURE2DARRAY */ -#line 2881 "MachineIndependent/glslang.y" + case 418: /* type_specifier_nonarray: ITEXTURE2DARRAY */ +#line 2911 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } -#line 9733 "MachineIndependent/glslang_tab.cpp" +#line 9934 "MachineIndependent/glslang_tab.cpp" break; - case 414: /* type_specifier_nonarray: UTEXTURE2D */ -#line 2886 "MachineIndependent/glslang.y" + case 419: /* type_specifier_nonarray: UTEXTURE2D */ +#line 2916 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } -#line 9743 "MachineIndependent/glslang_tab.cpp" +#line 9944 "MachineIndependent/glslang_tab.cpp" break; - case 415: /* type_specifier_nonarray: UTEXTURE3D */ -#line 2891 "MachineIndependent/glslang.y" + case 420: /* type_specifier_nonarray: UTEXTURE3D */ +#line 2921 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } -#line 9753 "MachineIndependent/glslang_tab.cpp" +#line 9954 "MachineIndependent/glslang_tab.cpp" break; - case 416: /* type_specifier_nonarray: UTEXTURECUBE */ -#line 2896 "MachineIndependent/glslang.y" + case 421: /* type_specifier_nonarray: UTEXTURECUBE */ +#line 2926 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } -#line 9763 "MachineIndependent/glslang_tab.cpp" +#line 9964 "MachineIndependent/glslang_tab.cpp" break; - case 417: /* type_specifier_nonarray: UTEXTURE2DARRAY */ -#line 2901 "MachineIndependent/glslang.y" + case 422: /* type_specifier_nonarray: UTEXTURE2DARRAY */ +#line 2931 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } -#line 9773 "MachineIndependent/glslang_tab.cpp" +#line 9974 "MachineIndependent/glslang_tab.cpp" break; - case 418: /* type_specifier_nonarray: SAMPLER */ -#line 2906 "MachineIndependent/glslang.y" + case 423: /* type_specifier_nonarray: SAMPLER */ +#line 2936 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(false); } -#line 9783 "MachineIndependent/glslang_tab.cpp" +#line 9984 "MachineIndependent/glslang_tab.cpp" break; - case 419: /* type_specifier_nonarray: SAMPLERSHADOW */ -#line 2911 "MachineIndependent/glslang.y" + case 424: /* type_specifier_nonarray: SAMPLERSHADOW */ +#line 2941 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setPureSampler(true); } -#line 9793 "MachineIndependent/glslang_tab.cpp" +#line 9994 "MachineIndependent/glslang_tab.cpp" break; - case 420: /* type_specifier_nonarray: SAMPLER2DRECT */ -#line 2916 "MachineIndependent/glslang.y" + case 425: /* type_specifier_nonarray: SAMPLER2DRECT */ +#line 2946 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } -#line 9803 "MachineIndependent/glslang_tab.cpp" +#line 10004 "MachineIndependent/glslang_tab.cpp" break; - case 421: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ -#line 2921 "MachineIndependent/glslang.y" + case 426: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */ +#line 2951 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } -#line 9813 "MachineIndependent/glslang_tab.cpp" +#line 10014 "MachineIndependent/glslang_tab.cpp" break; - case 422: /* type_specifier_nonarray: F16SAMPLER2DRECT */ -#line 2926 "MachineIndependent/glslang.y" + case 427: /* type_specifier_nonarray: F16SAMPLER2DRECT */ +#line 2956 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect); } -#line 9824 "MachineIndependent/glslang_tab.cpp" +#line 10025 "MachineIndependent/glslang_tab.cpp" break; - case 423: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ -#line 2932 "MachineIndependent/glslang.y" + case 428: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */ +#line 2962 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdRect, false, true); } -#line 9835 "MachineIndependent/glslang_tab.cpp" +#line 10036 "MachineIndependent/glslang_tab.cpp" break; - case 424: /* type_specifier_nonarray: ISAMPLER2DRECT */ -#line 2938 "MachineIndependent/glslang.y" + case 429: /* type_specifier_nonarray: ISAMPLER2DRECT */ +#line 2968 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdRect); } -#line 9845 "MachineIndependent/glslang_tab.cpp" +#line 10046 "MachineIndependent/glslang_tab.cpp" break; - case 425: /* type_specifier_nonarray: USAMPLER2DRECT */ -#line 2943 "MachineIndependent/glslang.y" + case 430: /* type_specifier_nonarray: USAMPLER2DRECT */ +#line 2973 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdRect); } -#line 9855 "MachineIndependent/glslang_tab.cpp" +#line 10056 "MachineIndependent/glslang_tab.cpp" break; - case 426: /* type_specifier_nonarray: SAMPLERBUFFER */ -#line 2948 "MachineIndependent/glslang.y" + case 431: /* type_specifier_nonarray: SAMPLERBUFFER */ +#line 2978 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } -#line 9865 "MachineIndependent/glslang_tab.cpp" +#line 10066 "MachineIndependent/glslang_tab.cpp" break; - case 427: /* type_specifier_nonarray: F16SAMPLERBUFFER */ -#line 2953 "MachineIndependent/glslang.y" + case 432: /* type_specifier_nonarray: F16SAMPLERBUFFER */ +#line 2983 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, EsdBuffer); } -#line 9876 "MachineIndependent/glslang_tab.cpp" +#line 10077 "MachineIndependent/glslang_tab.cpp" break; - case 428: /* type_specifier_nonarray: ISAMPLERBUFFER */ -#line 2959 "MachineIndependent/glslang.y" + case 433: /* type_specifier_nonarray: ISAMPLERBUFFER */ +#line 2989 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } -#line 9886 "MachineIndependent/glslang_tab.cpp" +#line 10087 "MachineIndependent/glslang_tab.cpp" break; - case 429: /* type_specifier_nonarray: USAMPLERBUFFER */ -#line 2964 "MachineIndependent/glslang.y" + case 434: /* type_specifier_nonarray: USAMPLERBUFFER */ +#line 2994 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } -#line 9896 "MachineIndependent/glslang_tab.cpp" +#line 10097 "MachineIndependent/glslang_tab.cpp" break; - case 430: /* type_specifier_nonarray: SAMPLER2DMS */ -#line 2969 "MachineIndependent/glslang.y" + case 435: /* type_specifier_nonarray: SAMPLER2DMS */ +#line 2999 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } -#line 9906 "MachineIndependent/glslang_tab.cpp" +#line 10107 "MachineIndependent/glslang_tab.cpp" break; - case 431: /* type_specifier_nonarray: F16SAMPLER2DMS */ -#line 2974 "MachineIndependent/glslang.y" + case 436: /* type_specifier_nonarray: F16SAMPLER2DMS */ +#line 3004 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, false, false, true); } -#line 9917 "MachineIndependent/glslang_tab.cpp" +#line 10118 "MachineIndependent/glslang_tab.cpp" break; - case 432: /* type_specifier_nonarray: ISAMPLER2DMS */ -#line 2980 "MachineIndependent/glslang.y" + case 437: /* type_specifier_nonarray: ISAMPLER2DMS */ +#line 3010 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } -#line 9927 "MachineIndependent/glslang_tab.cpp" +#line 10128 "MachineIndependent/glslang_tab.cpp" break; - case 433: /* type_specifier_nonarray: USAMPLER2DMS */ -#line 2985 "MachineIndependent/glslang.y" + case 438: /* type_specifier_nonarray: USAMPLER2DMS */ +#line 3015 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } -#line 9937 "MachineIndependent/glslang_tab.cpp" +#line 10138 "MachineIndependent/glslang_tab.cpp" break; - case 434: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ -#line 2990 "MachineIndependent/glslang.y" + case 439: /* type_specifier_nonarray: SAMPLER2DMSARRAY */ +#line 3020 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } -#line 9947 "MachineIndependent/glslang_tab.cpp" +#line 10148 "MachineIndependent/glslang_tab.cpp" break; - case 435: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ -#line 2995 "MachineIndependent/glslang.y" + case 440: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */ +#line 3025 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat16, Esd2D, true, false, true); } -#line 9958 "MachineIndependent/glslang_tab.cpp" +#line 10159 "MachineIndependent/glslang_tab.cpp" break; - case 436: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ -#line 3001 "MachineIndependent/glslang.y" + case 441: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */ +#line 3031 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } -#line 9968 "MachineIndependent/glslang_tab.cpp" +#line 10169 "MachineIndependent/glslang_tab.cpp" break; - case 437: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ -#line 3006 "MachineIndependent/glslang.y" + case 442: /* type_specifier_nonarray: USAMPLER2DMSARRAY */ +#line 3036 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } -#line 9978 "MachineIndependent/glslang_tab.cpp" +#line 10179 "MachineIndependent/glslang_tab.cpp" break; - case 438: /* type_specifier_nonarray: TEXTURE1D */ -#line 3011 "MachineIndependent/glslang.y" + case 443: /* type_specifier_nonarray: TEXTURE1D */ +#line 3041 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } -#line 9988 "MachineIndependent/glslang_tab.cpp" +#line 10189 "MachineIndependent/glslang_tab.cpp" break; - case 439: /* type_specifier_nonarray: F16TEXTURE1D */ -#line 3016 "MachineIndependent/glslang.y" + case 444: /* type_specifier_nonarray: F16TEXTURE1D */ +#line 3046 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D); } -#line 9999 "MachineIndependent/glslang_tab.cpp" +#line 10200 "MachineIndependent/glslang_tab.cpp" break; - case 440: /* type_specifier_nonarray: F16TEXTURE2D */ -#line 3022 "MachineIndependent/glslang.y" + case 445: /* type_specifier_nonarray: F16TEXTURE2D */ +#line 3052 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D); } -#line 10010 "MachineIndependent/glslang_tab.cpp" +#line 10211 "MachineIndependent/glslang_tab.cpp" break; - case 441: /* type_specifier_nonarray: F16TEXTURE3D */ -#line 3028 "MachineIndependent/glslang.y" + case 446: /* type_specifier_nonarray: F16TEXTURE3D */ +#line 3058 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd3D); } -#line 10021 "MachineIndependent/glslang_tab.cpp" +#line 10222 "MachineIndependent/glslang_tab.cpp" break; - case 442: /* type_specifier_nonarray: F16TEXTURECUBE */ -#line 3034 "MachineIndependent/glslang.y" + case 447: /* type_specifier_nonarray: F16TEXTURECUBE */ +#line 3064 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube); } -#line 10032 "MachineIndependent/glslang_tab.cpp" +#line 10233 "MachineIndependent/glslang_tab.cpp" break; - case 443: /* type_specifier_nonarray: TEXTURE1DARRAY */ -#line 3040 "MachineIndependent/glslang.y" + case 448: /* type_specifier_nonarray: TEXTURE1DARRAY */ +#line 3070 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } -#line 10042 "MachineIndependent/glslang_tab.cpp" +#line 10243 "MachineIndependent/glslang_tab.cpp" break; - case 444: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ -#line 3045 "MachineIndependent/glslang.y" + case 449: /* type_specifier_nonarray: F16TEXTURE1DARRAY */ +#line 3075 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd1D, true); } -#line 10053 "MachineIndependent/glslang_tab.cpp" +#line 10254 "MachineIndependent/glslang_tab.cpp" break; - case 445: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ -#line 3051 "MachineIndependent/glslang.y" + case 450: /* type_specifier_nonarray: F16TEXTURE2DARRAY */ +#line 3081 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true); } -#line 10064 "MachineIndependent/glslang_tab.cpp" +#line 10265 "MachineIndependent/glslang_tab.cpp" break; - case 446: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ -#line 3057 "MachineIndependent/glslang.y" + case 451: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */ +#line 3087 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdCube, true); } -#line 10075 "MachineIndependent/glslang_tab.cpp" +#line 10276 "MachineIndependent/glslang_tab.cpp" break; - case 447: /* type_specifier_nonarray: ITEXTURE1D */ -#line 3063 "MachineIndependent/glslang.y" + case 452: /* type_specifier_nonarray: ITEXTURE1D */ +#line 3093 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } -#line 10085 "MachineIndependent/glslang_tab.cpp" +#line 10286 "MachineIndependent/glslang_tab.cpp" break; - case 448: /* type_specifier_nonarray: ITEXTURE1DARRAY */ -#line 3068 "MachineIndependent/glslang.y" + case 453: /* type_specifier_nonarray: ITEXTURE1DARRAY */ +#line 3098 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } -#line 10095 "MachineIndependent/glslang_tab.cpp" +#line 10296 "MachineIndependent/glslang_tab.cpp" break; - case 449: /* type_specifier_nonarray: UTEXTURE1D */ -#line 3073 "MachineIndependent/glslang.y" + case 454: /* type_specifier_nonarray: UTEXTURE1D */ +#line 3103 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } -#line 10105 "MachineIndependent/glslang_tab.cpp" +#line 10306 "MachineIndependent/glslang_tab.cpp" break; - case 450: /* type_specifier_nonarray: UTEXTURE1DARRAY */ -#line 3078 "MachineIndependent/glslang.y" + case 455: /* type_specifier_nonarray: UTEXTURE1DARRAY */ +#line 3108 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } -#line 10115 "MachineIndependent/glslang_tab.cpp" +#line 10316 "MachineIndependent/glslang_tab.cpp" break; - case 451: /* type_specifier_nonarray: TEXTURE2DRECT */ -#line 3083 "MachineIndependent/glslang.y" + case 456: /* type_specifier_nonarray: TEXTURE2DRECT */ +#line 3113 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } -#line 10125 "MachineIndependent/glslang_tab.cpp" +#line 10326 "MachineIndependent/glslang_tab.cpp" break; - case 452: /* type_specifier_nonarray: F16TEXTURE2DRECT */ -#line 3088 "MachineIndependent/glslang.y" + case 457: /* type_specifier_nonarray: F16TEXTURE2DRECT */ +#line 3118 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdRect); } -#line 10136 "MachineIndependent/glslang_tab.cpp" +#line 10337 "MachineIndependent/glslang_tab.cpp" break; - case 453: /* type_specifier_nonarray: ITEXTURE2DRECT */ -#line 3094 "MachineIndependent/glslang.y" + case 458: /* type_specifier_nonarray: ITEXTURE2DRECT */ +#line 3124 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } -#line 10146 "MachineIndependent/glslang_tab.cpp" +#line 10347 "MachineIndependent/glslang_tab.cpp" break; - case 454: /* type_specifier_nonarray: UTEXTURE2DRECT */ -#line 3099 "MachineIndependent/glslang.y" + case 459: /* type_specifier_nonarray: UTEXTURE2DRECT */ +#line 3129 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } -#line 10156 "MachineIndependent/glslang_tab.cpp" +#line 10357 "MachineIndependent/glslang_tab.cpp" break; - case 455: /* type_specifier_nonarray: TEXTUREBUFFER */ -#line 3104 "MachineIndependent/glslang.y" + case 460: /* type_specifier_nonarray: TEXTUREBUFFER */ +#line 3134 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } -#line 10166 "MachineIndependent/glslang_tab.cpp" +#line 10367 "MachineIndependent/glslang_tab.cpp" break; - case 456: /* type_specifier_nonarray: F16TEXTUREBUFFER */ -#line 3109 "MachineIndependent/glslang.y" + case 461: /* type_specifier_nonarray: F16TEXTUREBUFFER */ +#line 3139 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, EsdBuffer); } -#line 10177 "MachineIndependent/glslang_tab.cpp" +#line 10378 "MachineIndependent/glslang_tab.cpp" break; - case 457: /* type_specifier_nonarray: ITEXTUREBUFFER */ -#line 3115 "MachineIndependent/glslang.y" + case 462: /* type_specifier_nonarray: ITEXTUREBUFFER */ +#line 3145 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } -#line 10187 "MachineIndependent/glslang_tab.cpp" +#line 10388 "MachineIndependent/glslang_tab.cpp" break; - case 458: /* type_specifier_nonarray: UTEXTUREBUFFER */ -#line 3120 "MachineIndependent/glslang.y" + case 463: /* type_specifier_nonarray: UTEXTUREBUFFER */ +#line 3150 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } -#line 10197 "MachineIndependent/glslang_tab.cpp" +#line 10398 "MachineIndependent/glslang_tab.cpp" break; - case 459: /* type_specifier_nonarray: TEXTURE2DMS */ -#line 3125 "MachineIndependent/glslang.y" + case 464: /* type_specifier_nonarray: TEXTURE2DMS */ +#line 3155 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } -#line 10207 "MachineIndependent/glslang_tab.cpp" +#line 10408 "MachineIndependent/glslang_tab.cpp" break; - case 460: /* type_specifier_nonarray: F16TEXTURE2DMS */ -#line 3130 "MachineIndependent/glslang.y" + case 465: /* type_specifier_nonarray: F16TEXTURE2DMS */ +#line 3160 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, false, false, true); } -#line 10218 "MachineIndependent/glslang_tab.cpp" +#line 10419 "MachineIndependent/glslang_tab.cpp" break; - case 461: /* type_specifier_nonarray: ITEXTURE2DMS */ -#line 3136 "MachineIndependent/glslang.y" + case 466: /* type_specifier_nonarray: ITEXTURE2DMS */ +#line 3166 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } -#line 10228 "MachineIndependent/glslang_tab.cpp" +#line 10429 "MachineIndependent/glslang_tab.cpp" break; - case 462: /* type_specifier_nonarray: UTEXTURE2DMS */ -#line 3141 "MachineIndependent/glslang.y" + case 467: /* type_specifier_nonarray: UTEXTURE2DMS */ +#line 3171 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } -#line 10238 "MachineIndependent/glslang_tab.cpp" +#line 10439 "MachineIndependent/glslang_tab.cpp" break; - case 463: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ -#line 3146 "MachineIndependent/glslang.y" + case 468: /* type_specifier_nonarray: TEXTURE2DMSARRAY */ +#line 3176 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } -#line 10248 "MachineIndependent/glslang_tab.cpp" +#line 10449 "MachineIndependent/glslang_tab.cpp" break; - case 464: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ -#line 3151 "MachineIndependent/glslang.y" + case 469: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */ +#line 3181 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float texture", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtFloat16, Esd2D, true, false, true); } -#line 10259 "MachineIndependent/glslang_tab.cpp" +#line 10460 "MachineIndependent/glslang_tab.cpp" break; - case 465: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ -#line 3157 "MachineIndependent/glslang.y" + case 470: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */ +#line 3187 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } -#line 10269 "MachineIndependent/glslang_tab.cpp" +#line 10470 "MachineIndependent/glslang_tab.cpp" break; - case 466: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ -#line 3162 "MachineIndependent/glslang.y" + case 471: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */ +#line 3192 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } -#line 10279 "MachineIndependent/glslang_tab.cpp" +#line 10480 "MachineIndependent/glslang_tab.cpp" break; - case 467: /* type_specifier_nonarray: IMAGE1D */ -#line 3167 "MachineIndependent/glslang.y" + case 472: /* type_specifier_nonarray: IMAGE1D */ +#line 3197 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } -#line 10289 "MachineIndependent/glslang_tab.cpp" +#line 10490 "MachineIndependent/glslang_tab.cpp" break; - case 468: /* type_specifier_nonarray: F16IMAGE1D */ -#line 3172 "MachineIndependent/glslang.y" + case 473: /* type_specifier_nonarray: F16IMAGE1D */ +#line 3202 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D); } -#line 10300 "MachineIndependent/glslang_tab.cpp" +#line 10501 "MachineIndependent/glslang_tab.cpp" break; - case 469: /* type_specifier_nonarray: IIMAGE1D */ -#line 3178 "MachineIndependent/glslang.y" + case 474: /* type_specifier_nonarray: IIMAGE1D */ +#line 3208 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } -#line 10310 "MachineIndependent/glslang_tab.cpp" +#line 10511 "MachineIndependent/glslang_tab.cpp" break; - case 470: /* type_specifier_nonarray: UIMAGE1D */ -#line 3183 "MachineIndependent/glslang.y" + case 475: /* type_specifier_nonarray: UIMAGE1D */ +#line 3213 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } -#line 10320 "MachineIndependent/glslang_tab.cpp" +#line 10521 "MachineIndependent/glslang_tab.cpp" break; - case 471: /* type_specifier_nonarray: IMAGE2D */ -#line 3188 "MachineIndependent/glslang.y" + case 476: /* type_specifier_nonarray: IMAGE2D */ +#line 3218 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } -#line 10330 "MachineIndependent/glslang_tab.cpp" +#line 10531 "MachineIndependent/glslang_tab.cpp" break; - case 472: /* type_specifier_nonarray: F16IMAGE2D */ -#line 3193 "MachineIndependent/glslang.y" + case 477: /* type_specifier_nonarray: F16IMAGE2D */ +#line 3223 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D); } -#line 10341 "MachineIndependent/glslang_tab.cpp" +#line 10542 "MachineIndependent/glslang_tab.cpp" break; - case 473: /* type_specifier_nonarray: IIMAGE2D */ -#line 3199 "MachineIndependent/glslang.y" + case 478: /* type_specifier_nonarray: IIMAGE2D */ +#line 3229 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } -#line 10351 "MachineIndependent/glslang_tab.cpp" +#line 10552 "MachineIndependent/glslang_tab.cpp" break; - case 474: /* type_specifier_nonarray: UIMAGE2D */ -#line 3204 "MachineIndependent/glslang.y" + case 479: /* type_specifier_nonarray: UIMAGE2D */ +#line 3234 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } -#line 10361 "MachineIndependent/glslang_tab.cpp" +#line 10562 "MachineIndependent/glslang_tab.cpp" break; - case 475: /* type_specifier_nonarray: IMAGE3D */ -#line 3209 "MachineIndependent/glslang.y" + case 480: /* type_specifier_nonarray: IMAGE3D */ +#line 3239 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } -#line 10371 "MachineIndependent/glslang_tab.cpp" +#line 10572 "MachineIndependent/glslang_tab.cpp" break; - case 476: /* type_specifier_nonarray: F16IMAGE3D */ -#line 3214 "MachineIndependent/glslang.y" + case 481: /* type_specifier_nonarray: F16IMAGE3D */ +#line 3244 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd3D); } -#line 10382 "MachineIndependent/glslang_tab.cpp" +#line 10583 "MachineIndependent/glslang_tab.cpp" break; - case 477: /* type_specifier_nonarray: IIMAGE3D */ -#line 3220 "MachineIndependent/glslang.y" + case 482: /* type_specifier_nonarray: IIMAGE3D */ +#line 3250 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } -#line 10392 "MachineIndependent/glslang_tab.cpp" +#line 10593 "MachineIndependent/glslang_tab.cpp" break; - case 478: /* type_specifier_nonarray: UIMAGE3D */ -#line 3225 "MachineIndependent/glslang.y" + case 483: /* type_specifier_nonarray: UIMAGE3D */ +#line 3255 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } -#line 10402 "MachineIndependent/glslang_tab.cpp" +#line 10603 "MachineIndependent/glslang_tab.cpp" break; - case 479: /* type_specifier_nonarray: IMAGE2DRECT */ -#line 3230 "MachineIndependent/glslang.y" + case 484: /* type_specifier_nonarray: IMAGE2DRECT */ +#line 3260 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } -#line 10412 "MachineIndependent/glslang_tab.cpp" +#line 10613 "MachineIndependent/glslang_tab.cpp" break; - case 480: /* type_specifier_nonarray: F16IMAGE2DRECT */ -#line 3235 "MachineIndependent/glslang.y" + case 485: /* type_specifier_nonarray: F16IMAGE2DRECT */ +#line 3265 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdRect); } -#line 10423 "MachineIndependent/glslang_tab.cpp" +#line 10624 "MachineIndependent/glslang_tab.cpp" break; - case 481: /* type_specifier_nonarray: IIMAGE2DRECT */ -#line 3241 "MachineIndependent/glslang.y" + case 486: /* type_specifier_nonarray: IIMAGE2DRECT */ +#line 3271 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } -#line 10433 "MachineIndependent/glslang_tab.cpp" +#line 10634 "MachineIndependent/glslang_tab.cpp" break; - case 482: /* type_specifier_nonarray: UIMAGE2DRECT */ -#line 3246 "MachineIndependent/glslang.y" + case 487: /* type_specifier_nonarray: UIMAGE2DRECT */ +#line 3276 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } -#line 10443 "MachineIndependent/glslang_tab.cpp" +#line 10644 "MachineIndependent/glslang_tab.cpp" break; - case 483: /* type_specifier_nonarray: IMAGECUBE */ -#line 3251 "MachineIndependent/glslang.y" + case 488: /* type_specifier_nonarray: IMAGECUBE */ +#line 3281 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } -#line 10453 "MachineIndependent/glslang_tab.cpp" +#line 10654 "MachineIndependent/glslang_tab.cpp" break; - case 484: /* type_specifier_nonarray: F16IMAGECUBE */ -#line 3256 "MachineIndependent/glslang.y" + case 489: /* type_specifier_nonarray: F16IMAGECUBE */ +#line 3286 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube); } -#line 10464 "MachineIndependent/glslang_tab.cpp" +#line 10665 "MachineIndependent/glslang_tab.cpp" break; - case 485: /* type_specifier_nonarray: IIMAGECUBE */ -#line 3262 "MachineIndependent/glslang.y" + case 490: /* type_specifier_nonarray: IIMAGECUBE */ +#line 3292 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } -#line 10474 "MachineIndependent/glslang_tab.cpp" +#line 10675 "MachineIndependent/glslang_tab.cpp" break; - case 486: /* type_specifier_nonarray: UIMAGECUBE */ -#line 3267 "MachineIndependent/glslang.y" + case 491: /* type_specifier_nonarray: UIMAGECUBE */ +#line 3297 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } -#line 10484 "MachineIndependent/glslang_tab.cpp" +#line 10685 "MachineIndependent/glslang_tab.cpp" break; - case 487: /* type_specifier_nonarray: IMAGEBUFFER */ -#line 3272 "MachineIndependent/glslang.y" + case 492: /* type_specifier_nonarray: IMAGEBUFFER */ +#line 3302 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } -#line 10494 "MachineIndependent/glslang_tab.cpp" +#line 10695 "MachineIndependent/glslang_tab.cpp" break; - case 488: /* type_specifier_nonarray: F16IMAGEBUFFER */ -#line 3277 "MachineIndependent/glslang.y" + case 493: /* type_specifier_nonarray: F16IMAGEBUFFER */ +#line 3307 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdBuffer); } -#line 10505 "MachineIndependent/glslang_tab.cpp" +#line 10706 "MachineIndependent/glslang_tab.cpp" break; - case 489: /* type_specifier_nonarray: IIMAGEBUFFER */ -#line 3283 "MachineIndependent/glslang.y" + case 494: /* type_specifier_nonarray: IIMAGEBUFFER */ +#line 3313 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } -#line 10515 "MachineIndependent/glslang_tab.cpp" +#line 10716 "MachineIndependent/glslang_tab.cpp" break; - case 490: /* type_specifier_nonarray: UIMAGEBUFFER */ -#line 3288 "MachineIndependent/glslang.y" + case 495: /* type_specifier_nonarray: UIMAGEBUFFER */ +#line 3318 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } -#line 10525 "MachineIndependent/glslang_tab.cpp" +#line 10726 "MachineIndependent/glslang_tab.cpp" break; - case 491: /* type_specifier_nonarray: IMAGE1DARRAY */ -#line 3293 "MachineIndependent/glslang.y" + case 496: /* type_specifier_nonarray: IMAGE1DARRAY */ +#line 3323 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } -#line 10535 "MachineIndependent/glslang_tab.cpp" +#line 10736 "MachineIndependent/glslang_tab.cpp" break; - case 492: /* type_specifier_nonarray: F16IMAGE1DARRAY */ -#line 3298 "MachineIndependent/glslang.y" + case 497: /* type_specifier_nonarray: F16IMAGE1DARRAY */ +#line 3328 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd1D, true); } -#line 10546 "MachineIndependent/glslang_tab.cpp" +#line 10747 "MachineIndependent/glslang_tab.cpp" break; - case 493: /* type_specifier_nonarray: IIMAGE1DARRAY */ -#line 3304 "MachineIndependent/glslang.y" + case 498: /* type_specifier_nonarray: IIMAGE1DARRAY */ +#line 3334 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } -#line 10556 "MachineIndependent/glslang_tab.cpp" +#line 10757 "MachineIndependent/glslang_tab.cpp" break; - case 494: /* type_specifier_nonarray: UIMAGE1DARRAY */ -#line 3309 "MachineIndependent/glslang.y" + case 499: /* type_specifier_nonarray: UIMAGE1DARRAY */ +#line 3339 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } -#line 10566 "MachineIndependent/glslang_tab.cpp" +#line 10767 "MachineIndependent/glslang_tab.cpp" break; - case 495: /* type_specifier_nonarray: IMAGE2DARRAY */ -#line 3314 "MachineIndependent/glslang.y" + case 500: /* type_specifier_nonarray: IMAGE2DARRAY */ +#line 3344 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } -#line 10576 "MachineIndependent/glslang_tab.cpp" +#line 10777 "MachineIndependent/glslang_tab.cpp" break; - case 496: /* type_specifier_nonarray: F16IMAGE2DARRAY */ -#line 3319 "MachineIndependent/glslang.y" + case 501: /* type_specifier_nonarray: F16IMAGE2DARRAY */ +#line 3349 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true); } -#line 10587 "MachineIndependent/glslang_tab.cpp" +#line 10788 "MachineIndependent/glslang_tab.cpp" break; - case 497: /* type_specifier_nonarray: IIMAGE2DARRAY */ -#line 3325 "MachineIndependent/glslang.y" + case 502: /* type_specifier_nonarray: IIMAGE2DARRAY */ +#line 3355 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } -#line 10597 "MachineIndependent/glslang_tab.cpp" +#line 10798 "MachineIndependent/glslang_tab.cpp" break; - case 498: /* type_specifier_nonarray: UIMAGE2DARRAY */ -#line 3330 "MachineIndependent/glslang.y" + case 503: /* type_specifier_nonarray: UIMAGE2DARRAY */ +#line 3360 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); } -#line 10607 "MachineIndependent/glslang_tab.cpp" +#line 10808 "MachineIndependent/glslang_tab.cpp" break; - case 499: /* type_specifier_nonarray: IMAGECUBEARRAY */ -#line 3335 "MachineIndependent/glslang.y" + case 504: /* type_specifier_nonarray: IMAGECUBEARRAY */ +#line 3365 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); } -#line 10617 "MachineIndependent/glslang_tab.cpp" +#line 10818 "MachineIndependent/glslang_tab.cpp" break; - case 500: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ -#line 3340 "MachineIndependent/glslang.y" + case 505: /* type_specifier_nonarray: F16IMAGECUBEARRAY */ +#line 3370 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, EsdCube, true); } -#line 10628 "MachineIndependent/glslang_tab.cpp" +#line 10829 "MachineIndependent/glslang_tab.cpp" break; - case 501: /* type_specifier_nonarray: IIMAGECUBEARRAY */ -#line 3346 "MachineIndependent/glslang.y" + case 506: /* type_specifier_nonarray: IIMAGECUBEARRAY */ +#line 3376 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); } -#line 10638 "MachineIndependent/glslang_tab.cpp" +#line 10839 "MachineIndependent/glslang_tab.cpp" break; - case 502: /* type_specifier_nonarray: UIMAGECUBEARRAY */ -#line 3351 "MachineIndependent/glslang.y" + case 507: /* type_specifier_nonarray: UIMAGECUBEARRAY */ +#line 3381 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); } -#line 10648 "MachineIndependent/glslang_tab.cpp" +#line 10849 "MachineIndependent/glslang_tab.cpp" break; - case 503: /* type_specifier_nonarray: IMAGE2DMS */ -#line 3356 "MachineIndependent/glslang.y" + case 508: /* type_specifier_nonarray: IMAGE2DMS */ +#line 3386 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); } -#line 10658 "MachineIndependent/glslang_tab.cpp" +#line 10859 "MachineIndependent/glslang_tab.cpp" break; - case 504: /* type_specifier_nonarray: F16IMAGE2DMS */ -#line 3361 "MachineIndependent/glslang.y" + case 509: /* type_specifier_nonarray: F16IMAGE2DMS */ +#line 3391 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, false, false, true); } -#line 10669 "MachineIndependent/glslang_tab.cpp" +#line 10870 "MachineIndependent/glslang_tab.cpp" break; - case 505: /* type_specifier_nonarray: IIMAGE2DMS */ -#line 3367 "MachineIndependent/glslang.y" + case 510: /* type_specifier_nonarray: IIMAGE2DMS */ +#line 3397 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); } -#line 10679 "MachineIndependent/glslang_tab.cpp" +#line 10880 "MachineIndependent/glslang_tab.cpp" break; - case 506: /* type_specifier_nonarray: UIMAGE2DMS */ -#line 3372 "MachineIndependent/glslang.y" + case 511: /* type_specifier_nonarray: UIMAGE2DMS */ +#line 3402 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); } -#line 10689 "MachineIndependent/glslang_tab.cpp" +#line 10890 "MachineIndependent/glslang_tab.cpp" break; - case 507: /* type_specifier_nonarray: IMAGE2DMSARRAY */ -#line 3377 "MachineIndependent/glslang.y" + case 512: /* type_specifier_nonarray: IMAGE2DMSARRAY */ +#line 3407 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); } -#line 10699 "MachineIndependent/glslang_tab.cpp" +#line 10900 "MachineIndependent/glslang_tab.cpp" break; - case 508: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ -#line 3382 "MachineIndependent/glslang.y" + case 513: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */ +#line 3412 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float image", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtFloat16, Esd2D, true, false, true); } -#line 10710 "MachineIndependent/glslang_tab.cpp" +#line 10911 "MachineIndependent/glslang_tab.cpp" break; - case 509: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ -#line 3388 "MachineIndependent/glslang.y" + case 514: /* type_specifier_nonarray: IIMAGE2DMSARRAY */ +#line 3418 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); } -#line 10720 "MachineIndependent/glslang_tab.cpp" +#line 10921 "MachineIndependent/glslang_tab.cpp" break; - case 510: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ -#line 3393 "MachineIndependent/glslang.y" + case 515: /* type_specifier_nonarray: UIMAGE2DMSARRAY */ +#line 3423 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); } -#line 10730 "MachineIndependent/glslang_tab.cpp" +#line 10931 "MachineIndependent/glslang_tab.cpp" break; - case 511: /* type_specifier_nonarray: I64IMAGE1D */ -#line 3398 "MachineIndependent/glslang.y" + case 516: /* type_specifier_nonarray: I64IMAGE1D */ +#line 3428 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D); } -#line 10740 "MachineIndependent/glslang_tab.cpp" +#line 10941 "MachineIndependent/glslang_tab.cpp" break; - case 512: /* type_specifier_nonarray: U64IMAGE1D */ -#line 3403 "MachineIndependent/glslang.y" + case 517: /* type_specifier_nonarray: U64IMAGE1D */ +#line 3433 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D); } -#line 10750 "MachineIndependent/glslang_tab.cpp" +#line 10951 "MachineIndependent/glslang_tab.cpp" break; - case 513: /* type_specifier_nonarray: I64IMAGE2D */ -#line 3408 "MachineIndependent/glslang.y" + case 518: /* type_specifier_nonarray: I64IMAGE2D */ +#line 3438 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D); } -#line 10760 "MachineIndependent/glslang_tab.cpp" +#line 10961 "MachineIndependent/glslang_tab.cpp" break; - case 514: /* type_specifier_nonarray: U64IMAGE2D */ -#line 3413 "MachineIndependent/glslang.y" + case 519: /* type_specifier_nonarray: U64IMAGE2D */ +#line 3443 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D); } -#line 10770 "MachineIndependent/glslang_tab.cpp" +#line 10971 "MachineIndependent/glslang_tab.cpp" break; - case 515: /* type_specifier_nonarray: I64IMAGE3D */ -#line 3418 "MachineIndependent/glslang.y" + case 520: /* type_specifier_nonarray: I64IMAGE3D */ +#line 3448 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd3D); } -#line 10780 "MachineIndependent/glslang_tab.cpp" +#line 10981 "MachineIndependent/glslang_tab.cpp" break; - case 516: /* type_specifier_nonarray: U64IMAGE3D */ -#line 3423 "MachineIndependent/glslang.y" + case 521: /* type_specifier_nonarray: U64IMAGE3D */ +#line 3453 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd3D); } -#line 10790 "MachineIndependent/glslang_tab.cpp" +#line 10991 "MachineIndependent/glslang_tab.cpp" break; - case 517: /* type_specifier_nonarray: I64IMAGE2DRECT */ -#line 3428 "MachineIndependent/glslang.y" + case 522: /* type_specifier_nonarray: I64IMAGE2DRECT */ +#line 3458 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdRect); } -#line 10800 "MachineIndependent/glslang_tab.cpp" +#line 11001 "MachineIndependent/glslang_tab.cpp" break; - case 518: /* type_specifier_nonarray: U64IMAGE2DRECT */ -#line 3433 "MachineIndependent/glslang.y" + case 523: /* type_specifier_nonarray: U64IMAGE2DRECT */ +#line 3463 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdRect); } -#line 10810 "MachineIndependent/glslang_tab.cpp" +#line 11011 "MachineIndependent/glslang_tab.cpp" break; - case 519: /* type_specifier_nonarray: I64IMAGECUBE */ -#line 3438 "MachineIndependent/glslang.y" + case 524: /* type_specifier_nonarray: I64IMAGECUBE */ +#line 3468 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube); } -#line 10820 "MachineIndependent/glslang_tab.cpp" +#line 11021 "MachineIndependent/glslang_tab.cpp" break; - case 520: /* type_specifier_nonarray: U64IMAGECUBE */ -#line 3443 "MachineIndependent/glslang.y" + case 525: /* type_specifier_nonarray: U64IMAGECUBE */ +#line 3473 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube); } -#line 10830 "MachineIndependent/glslang_tab.cpp" +#line 11031 "MachineIndependent/glslang_tab.cpp" break; - case 521: /* type_specifier_nonarray: I64IMAGEBUFFER */ -#line 3448 "MachineIndependent/glslang.y" + case 526: /* type_specifier_nonarray: I64IMAGEBUFFER */ +#line 3478 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdBuffer); } -#line 10840 "MachineIndependent/glslang_tab.cpp" +#line 11041 "MachineIndependent/glslang_tab.cpp" break; - case 522: /* type_specifier_nonarray: U64IMAGEBUFFER */ -#line 3453 "MachineIndependent/glslang.y" + case 527: /* type_specifier_nonarray: U64IMAGEBUFFER */ +#line 3483 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdBuffer); } -#line 10850 "MachineIndependent/glslang_tab.cpp" +#line 11051 "MachineIndependent/glslang_tab.cpp" break; - case 523: /* type_specifier_nonarray: I64IMAGE1DARRAY */ -#line 3458 "MachineIndependent/glslang.y" + case 528: /* type_specifier_nonarray: I64IMAGE1DARRAY */ +#line 3488 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd1D, true); } -#line 10860 "MachineIndependent/glslang_tab.cpp" +#line 11061 "MachineIndependent/glslang_tab.cpp" break; - case 524: /* type_specifier_nonarray: U64IMAGE1DARRAY */ -#line 3463 "MachineIndependent/glslang.y" + case 529: /* type_specifier_nonarray: U64IMAGE1DARRAY */ +#line 3493 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd1D, true); } -#line 10870 "MachineIndependent/glslang_tab.cpp" +#line 11071 "MachineIndependent/glslang_tab.cpp" break; - case 525: /* type_specifier_nonarray: I64IMAGE2DARRAY */ -#line 3468 "MachineIndependent/glslang.y" + case 530: /* type_specifier_nonarray: I64IMAGE2DARRAY */ +#line 3498 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true); } -#line 10880 "MachineIndependent/glslang_tab.cpp" +#line 11081 "MachineIndependent/glslang_tab.cpp" break; - case 526: /* type_specifier_nonarray: U64IMAGE2DARRAY */ -#line 3473 "MachineIndependent/glslang.y" + case 531: /* type_specifier_nonarray: U64IMAGE2DARRAY */ +#line 3503 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true); } -#line 10890 "MachineIndependent/glslang_tab.cpp" +#line 11091 "MachineIndependent/glslang_tab.cpp" break; - case 527: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ -#line 3478 "MachineIndependent/glslang.y" + case 532: /* type_specifier_nonarray: I64IMAGECUBEARRAY */ +#line 3508 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, EsdCube, true); } -#line 10900 "MachineIndependent/glslang_tab.cpp" +#line 11101 "MachineIndependent/glslang_tab.cpp" break; - case 528: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ -#line 3483 "MachineIndependent/glslang.y" + case 533: /* type_specifier_nonarray: U64IMAGECUBEARRAY */ +#line 3513 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, EsdCube, true); } -#line 10910 "MachineIndependent/glslang_tab.cpp" +#line 11111 "MachineIndependent/glslang_tab.cpp" break; - case 529: /* type_specifier_nonarray: I64IMAGE2DMS */ -#line 3488 "MachineIndependent/glslang.y" + case 534: /* type_specifier_nonarray: I64IMAGE2DMS */ +#line 3518 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, false, false, true); } -#line 10920 "MachineIndependent/glslang_tab.cpp" +#line 11121 "MachineIndependent/glslang_tab.cpp" break; - case 530: /* type_specifier_nonarray: U64IMAGE2DMS */ -#line 3493 "MachineIndependent/glslang.y" + case 535: /* type_specifier_nonarray: U64IMAGE2DMS */ +#line 3523 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, false, false, true); } -#line 10930 "MachineIndependent/glslang_tab.cpp" +#line 11131 "MachineIndependent/glslang_tab.cpp" break; - case 531: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ -#line 3498 "MachineIndependent/glslang.y" + case 536: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */ +#line 3528 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtInt64, Esd2D, true, false, true); } -#line 10940 "MachineIndependent/glslang_tab.cpp" +#line 11141 "MachineIndependent/glslang_tab.cpp" break; - case 532: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ -#line 3503 "MachineIndependent/glslang.y" + case 537: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */ +#line 3533 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setImage(EbtUint64, Esd2D, true, false, true); } -#line 10950 "MachineIndependent/glslang_tab.cpp" +#line 11151 "MachineIndependent/glslang_tab.cpp" break; - case 533: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ -#line 3508 "MachineIndependent/glslang.y" + case 538: /* type_specifier_nonarray: SAMPLEREXTERNALOES */ +#line 3538 "MachineIndependent/glslang.y" { // GL_OES_EGL_image_external (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } -#line 10961 "MachineIndependent/glslang_tab.cpp" +#line 11162 "MachineIndependent/glslang_tab.cpp" break; - case 534: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ -#line 3514 "MachineIndependent/glslang.y" + case 539: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */ +#line 3544 "MachineIndependent/glslang.y" { // GL_EXT_YUV_target (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.yuv = true; } -#line 10972 "MachineIndependent/glslang_tab.cpp" +#line 11173 "MachineIndependent/glslang_tab.cpp" break; - case 535: /* type_specifier_nonarray: ATTACHMENTEXT */ -#line 3520 "MachineIndependent/glslang.y" + case 540: /* type_specifier_nonarray: ATTACHMENTEXT */ +#line 3550 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtFloat); } -#line 10983 "MachineIndependent/glslang_tab.cpp" +#line 11184 "MachineIndependent/glslang_tab.cpp" break; - case 536: /* type_specifier_nonarray: IATTACHMENTEXT */ -#line 3526 "MachineIndependent/glslang.y" + case 541: /* type_specifier_nonarray: IATTACHMENTEXT */ +#line 3556 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtInt); } -#line 10994 "MachineIndependent/glslang_tab.cpp" +#line 11195 "MachineIndependent/glslang_tab.cpp" break; - case 537: /* type_specifier_nonarray: UATTACHMENTEXT */ -#line 3532 "MachineIndependent/glslang.y" + case 542: /* type_specifier_nonarray: UATTACHMENTEXT */ +#line 3562 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "attachmentEXT input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setAttachmentEXT(EbtUint); } -#line 11005 "MachineIndependent/glslang_tab.cpp" +#line 11206 "MachineIndependent/glslang_tab.cpp" break; - case 538: /* type_specifier_nonarray: SUBPASSINPUT */ -#line 3538 "MachineIndependent/glslang.y" + case 543: /* type_specifier_nonarray: SUBPASSINPUT */ +#line 3568 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } -#line 11016 "MachineIndependent/glslang_tab.cpp" +#line 11217 "MachineIndependent/glslang_tab.cpp" break; - case 539: /* type_specifier_nonarray: SUBPASSINPUTMS */ -#line 3544 "MachineIndependent/glslang.y" + case 544: /* type_specifier_nonarray: SUBPASSINPUTMS */ +#line 3574 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } -#line 11027 "MachineIndependent/glslang_tab.cpp" +#line 11228 "MachineIndependent/glslang_tab.cpp" break; - case 540: /* type_specifier_nonarray: F16SUBPASSINPUT */ -#line 3550 "MachineIndependent/glslang.y" + case 545: /* type_specifier_nonarray: F16SUBPASSINPUT */ +#line 3580 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -11035,11 +11236,11 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16); } -#line 11039 "MachineIndependent/glslang_tab.cpp" +#line 11240 "MachineIndependent/glslang_tab.cpp" break; - case 541: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ -#line 3557 "MachineIndependent/glslang.y" + case 546: /* type_specifier_nonarray: F16SUBPASSINPUTMS */ +#line 3587 "MachineIndependent/glslang.y" { parseContext.float16OpaqueCheck((yyvsp[0].lex).loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel()); parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); @@ -11047,55 +11248,55 @@ yyreduce: (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat16, true); } -#line 11051 "MachineIndependent/glslang_tab.cpp" +#line 11252 "MachineIndependent/glslang_tab.cpp" break; - case 542: /* type_specifier_nonarray: ISUBPASSINPUT */ -#line 3564 "MachineIndependent/glslang.y" + case 547: /* type_specifier_nonarray: ISUBPASSINPUT */ +#line 3594 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } -#line 11062 "MachineIndependent/glslang_tab.cpp" +#line 11263 "MachineIndependent/glslang_tab.cpp" break; - case 543: /* type_specifier_nonarray: ISUBPASSINPUTMS */ -#line 3570 "MachineIndependent/glslang.y" + case 548: /* type_specifier_nonarray: ISUBPASSINPUTMS */ +#line 3600 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } -#line 11073 "MachineIndependent/glslang_tab.cpp" +#line 11274 "MachineIndependent/glslang_tab.cpp" break; - case 544: /* type_specifier_nonarray: USUBPASSINPUT */ -#line 3576 "MachineIndependent/glslang.y" + case 549: /* type_specifier_nonarray: USUBPASSINPUT */ +#line 3606 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } -#line 11084 "MachineIndependent/glslang_tab.cpp" +#line 11285 "MachineIndependent/glslang_tab.cpp" break; - case 545: /* type_specifier_nonarray: USUBPASSINPUTMS */ -#line 3582 "MachineIndependent/glslang.y" + case 550: /* type_specifier_nonarray: USUBPASSINPUTMS */ +#line 3612 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } -#line 11095 "MachineIndependent/glslang_tab.cpp" +#line 11296 "MachineIndependent/glslang_tab.cpp" break; - case 546: /* type_specifier_nonarray: FCOOPMATNV */ -#line 3588 "MachineIndependent/glslang.y" + case 551: /* type_specifier_nonarray: FCOOPMATNV */ +#line 3618 "MachineIndependent/glslang.y" { parseContext.fcoopmatCheckNV((yyvsp[0].lex).loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -11103,11 +11304,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 11107 "MachineIndependent/glslang_tab.cpp" +#line 11308 "MachineIndependent/glslang_tab.cpp" break; - case 547: /* type_specifier_nonarray: ICOOPMATNV */ -#line 3595 "MachineIndependent/glslang.y" + case 552: /* type_specifier_nonarray: ICOOPMATNV */ +#line 3625 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -11115,11 +11316,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 11119 "MachineIndependent/glslang_tab.cpp" +#line 11320 "MachineIndependent/glslang_tab.cpp" break; - case 548: /* type_specifier_nonarray: UCOOPMATNV */ -#line 3602 "MachineIndependent/glslang.y" + case 553: /* type_specifier_nonarray: UCOOPMATNV */ +#line 3632 "MachineIndependent/glslang.y" { parseContext.intcoopmatCheckNV((yyvsp[0].lex).loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -11127,11 +11328,11 @@ yyreduce: (yyval.interm.type).coopmatNV = true; (yyval.interm.type).coopmatKHR = false; } -#line 11131 "MachineIndependent/glslang_tab.cpp" +#line 11332 "MachineIndependent/glslang_tab.cpp" break; - case 549: /* type_specifier_nonarray: COOPMAT */ -#line 3609 "MachineIndependent/glslang.y" + case 554: /* type_specifier_nonarray: COOPMAT */ +#line 3639 "MachineIndependent/glslang.y" { parseContext.coopmatCheck((yyvsp[0].lex).loc, "coopmat", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); @@ -11139,79 +11340,110 @@ yyreduce: (yyval.interm.type).coopmatNV = false; (yyval.interm.type).coopmatKHR = true; } -#line 11143 "MachineIndependent/glslang_tab.cpp" +#line 11344 "MachineIndependent/glslang_tab.cpp" break; - case 550: /* type_specifier_nonarray: TENSORLAYOUTNV */ -#line 3616 "MachineIndependent/glslang.y" + case 555: /* type_specifier_nonarray: TENSORLAYOUTNV */ +#line 3646 "MachineIndependent/glslang.y" { parseContext.tensorLayoutViewCheck((yyvsp[0].lex).loc, "tensorLayoutNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtTensorLayoutNV; } -#line 11153 "MachineIndependent/glslang_tab.cpp" +#line 11354 "MachineIndependent/glslang_tab.cpp" break; - case 551: /* type_specifier_nonarray: TENSORVIEWNV */ -#line 3621 "MachineIndependent/glslang.y" + case 556: /* type_specifier_nonarray: TENSORVIEWNV */ +#line 3651 "MachineIndependent/glslang.y" { parseContext.tensorLayoutViewCheck((yyvsp[0].lex).loc, "tensorViewNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtTensorViewNV; } -#line 11163 "MachineIndependent/glslang_tab.cpp" +#line 11364 "MachineIndependent/glslang_tab.cpp" break; - case 552: /* type_specifier_nonarray: FUNCTION */ -#line 3626 "MachineIndependent/glslang.y" + case 557: /* type_specifier_nonarray: FUNCTION */ +#line 3656 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[0].lex).loc); (yyval.interm.type).basicType = EbtFunction; } -#line 11172 "MachineIndependent/glslang_tab.cpp" +#line 11373 "MachineIndependent/glslang_tab.cpp" break; - case 553: /* type_specifier_nonarray: COOPVECNV */ -#line 3630 "MachineIndependent/glslang.y" + case 558: /* type_specifier_nonarray: COOPVECNV */ +#line 3660 "MachineIndependent/glslang.y" { parseContext.coopvecCheck((yyvsp[0].lex).loc, "coopvecNV", parseContext.symbolTable.atBuiltInLevel()); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtCoopvecNV; (yyval.interm.type).coopvecNV = true; } -#line 11183 "MachineIndependent/glslang_tab.cpp" +#line 11384 "MachineIndependent/glslang_tab.cpp" break; - case 554: /* type_specifier_nonarray: spirv_type_specifier */ -#line 3636 "MachineIndependent/glslang.y" + case 559: /* type_specifier_nonarray: TENSORARM */ +#line 3666 "MachineIndependent/glslang.y" + { + parseContext.tensorCheckARM((yyvsp[0].lex).loc, "tensorARM", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).tensorRankARM = 1; // placeholder value + (yyval.interm.type).basicType = EbtTensorARM; + } +#line 11395 "MachineIndependent/glslang_tab.cpp" + break; + + case 560: /* type_specifier_nonarray: VECTOR */ +#line 3672 "MachineIndependent/glslang.y" + { + parseContext.longVectorCheck((yyvsp[0].lex).loc, "vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtLongVector; + (yyval.interm.type).longVector = true; + } +#line 11406 "MachineIndependent/glslang_tab.cpp" + break; + + case 561: /* type_specifier_nonarray: spirv_type_specifier */ +#line 3678 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.type).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier"); (yyval.interm.type) = (yyvsp[0].interm.type); } -#line 11192 "MachineIndependent/glslang_tab.cpp" +#line 11415 "MachineIndependent/glslang_tab.cpp" break; - case 555: /* type_specifier_nonarray: HITOBJECTNV */ -#line 3640 "MachineIndependent/glslang.y" - { + case 562: /* type_specifier_nonarray: HITOBJECTNV */ +#line 3682 "MachineIndependent/glslang.y" + { (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtHitObjectNV; - } -#line 11201 "MachineIndependent/glslang_tab.cpp" + } +#line 11424 "MachineIndependent/glslang_tab.cpp" break; - case 556: /* type_specifier_nonarray: struct_specifier */ -#line 3644 "MachineIndependent/glslang.y" + case 563: /* type_specifier_nonarray: HITOBJECTEXT */ +#line 3686 "MachineIndependent/glslang.y" + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtHitObjectEXT; + } +#line 11433 "MachineIndependent/glslang_tab.cpp" + break; + + case 564: /* type_specifier_nonarray: struct_specifier */ +#line 3690 "MachineIndependent/glslang.y" { (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } -#line 11211 "MachineIndependent/glslang_tab.cpp" +#line 11443 "MachineIndependent/glslang_tab.cpp" break; - case 557: /* type_specifier_nonarray: TYPE_NAME */ -#line 3649 "MachineIndependent/glslang.y" + case 565: /* type_specifier_nonarray: TYPE_NAME */ +#line 3695 "MachineIndependent/glslang.y" { // // This is for user defined type names. The lexical phase looked up the @@ -11225,49 +11457,48 @@ yyreduce: } else parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } -#line 11229 "MachineIndependent/glslang_tab.cpp" +#line 11461 "MachineIndependent/glslang_tab.cpp" break; - case 558: /* precision_qualifier: HIGH_PRECISION */ -#line 3665 "MachineIndependent/glslang.y" + case 566: /* precision_qualifier: HIGH_PRECISION */ +#line 3711 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqHigh); } -#line 11239 "MachineIndependent/glslang_tab.cpp" +#line 11471 "MachineIndependent/glslang_tab.cpp" break; - case 559: /* precision_qualifier: MEDIUM_PRECISION */ -#line 3670 "MachineIndependent/glslang.y" + case 567: /* precision_qualifier: MEDIUM_PRECISION */ +#line 3716 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqMedium); } -#line 11249 "MachineIndependent/glslang_tab.cpp" +#line 11481 "MachineIndependent/glslang_tab.cpp" break; - case 560: /* precision_qualifier: LOW_PRECISION */ -#line 3675 "MachineIndependent/glslang.y" + case 568: /* precision_qualifier: LOW_PRECISION */ +#line 3721 "MachineIndependent/glslang.y" { parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); parseContext.handlePrecisionQualifier((yyvsp[0].lex).loc, (yyval.interm.type).qualifier, EpqLow); } -#line 11259 "MachineIndependent/glslang_tab.cpp" +#line 11491 "MachineIndependent/glslang_tab.cpp" break; - case 561: /* $@3: %empty */ -#line 3683 "MachineIndependent/glslang.y" + case 569: /* $@3: %empty */ +#line 3729 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } -#line 11265 "MachineIndependent/glslang_tab.cpp" +#line 11497 "MachineIndependent/glslang_tab.cpp" break; - case 562: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ -#line 3683 "MachineIndependent/glslang.y" + case 570: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */ +#line 3729 "MachineIndependent/glslang.y" { - TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); @@ -11283,17 +11514,17 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 11287 "MachineIndependent/glslang_tab.cpp" +#line 11518 "MachineIndependent/glslang_tab.cpp" break; - case 563: /* $@4: %empty */ -#line 3700 "MachineIndependent/glslang.y" + case 571: /* $@4: %empty */ +#line 3745 "MachineIndependent/glslang.y" { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } -#line 11293 "MachineIndependent/glslang_tab.cpp" +#line 11524 "MachineIndependent/glslang_tab.cpp" break; - case 564: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ -#line 3700 "MachineIndependent/glslang.y" + case 572: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */ +#line 3745 "MachineIndependent/glslang.y" { TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); (yyval.interm.type).init((yyvsp[-4].lex).loc); @@ -11301,20 +11532,28 @@ yyreduce: (yyval.interm.type).userDef = structure; --parseContext.structNestingLevel; } -#line 11305 "MachineIndependent/glslang_tab.cpp" +#line 11536 "MachineIndependent/glslang_tab.cpp" break; - case 565: /* struct_declaration_list: struct_declaration */ -#line 3710 "MachineIndependent/glslang.y" - { + case 573: /* struct_declaration_list: struct_declaration_without_heap */ +#line 3755 "MachineIndependent/glslang.y" + { (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } -#line 11313 "MachineIndependent/glslang_tab.cpp" +#line 11544 "MachineIndependent/glslang_tab.cpp" break; - case 566: /* struct_declaration_list: struct_declaration_list struct_declaration */ -#line 3713 "MachineIndependent/glslang.y" - { + case 574: /* struct_declaration_list: struct_declaration_with_heap */ +#line 3758 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[0].interm.typeList); + } +#line 11552 "MachineIndependent/glslang_tab.cpp" + break; + + case 575: /* struct_declaration_list: struct_declaration_with_heap struct_declaration_without_heap */ +#line 3761 "MachineIndependent/glslang.y" + { (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { @@ -11324,11 +11563,91 @@ yyreduce: (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); } } -#line 11328 "MachineIndependent/glslang_tab.cpp" +#line 11567 "MachineIndependent/glslang_tab.cpp" break; - case 567: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ -#line 3726 "MachineIndependent/glslang.y" + case 576: /* struct_declaration_list: struct_declaration_without_heap struct_declaration_with_heap */ +#line 3771 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[0].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[0].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[0].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); + } + } +#line 11582 "MachineIndependent/glslang_tab.cpp" + break; + + case 577: /* struct_declaration_with_heap: block_heap_inner_structure struct_declarator_list SEMICOLON */ +#line 3784 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).hasTypeParameter()); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + TType type((yyvsp[-2].interm.type)); + type.setFieldName((*(yyval.interm.typeList))[i].type->getFieldName()); + type.transferArraySizes((*(yyval.interm.typeList))[i].type->getArraySizes()); + type.copyArrayInnerSizes((yyvsp[-2].interm.type).arraySizes); + parseContext.arrayOfArrayVersionCheck((*(yyval.interm.typeList))[i].loc, type.getArraySizes()); + (*(yyval.interm.typeList))[i].type->shallowCopy(type); + } + } +#line 11601 "MachineIndependent/glslang_tab.cpp" + break; + + case 578: /* $@5: %empty */ +#line 3801 "MachineIndependent/glslang.y" + { parseContext.nestedBlockCheck((yyvsp[-1].interm.type).loc, true); } +#line 11607 "MachineIndependent/glslang_tab.cpp" + break; + + case 579: /* block_heap_inner_structure: type_qualifier LEFT_BRACE $@5 struct_declaration_without_heap RIGHT_BRACE */ +#line 3801 "MachineIndependent/glslang.y" + { + --parseContext.blockNestingLevel; + parseContext.globalQualifierFixCheck((yyvsp[-4].interm.type).loc, (yyvsp[-4].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-4].interm.type).loc, (yyvsp[-4].interm.type).shaderQualifiers); + (yyval.interm.type).init((yyvsp[-4].interm.type).loc); + TType* innerStructure = new TType((yyvsp[-1].interm.typeList), TString("")); + (yyval.interm.type).basicType = EbtBlock; + (yyval.interm.type).userDef = innerStructure; + (yyval.interm.type).qualifier = (yyvsp[-4].interm.type).qualifier; + (yyval.interm.type).qualifier.layoutDescriptorHeap = true; + (yyval.interm.type).qualifier.layoutDescriptorInnerBlock = true; + } +#line 11624 "MachineIndependent/glslang_tab.cpp" + break; + + case 580: /* struct_declaration_without_heap: struct_declaration */ +#line 3816 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[0].interm.typeList); + } +#line 11632 "MachineIndependent/glslang_tab.cpp" + break; + + case 581: /* struct_declaration_without_heap: struct_declaration_without_heap struct_declaration */ +#line 3819 "MachineIndependent/glslang.y" + { + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[0].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[0].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[0].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); + } + } +#line 11647 "MachineIndependent/glslang_tab.cpp" + break; + + case 582: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */ +#line 3832 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11340,7 +11659,7 @@ yyreduce: (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); - parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).isCoopmatOrvec()); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).hasTypeParameter()); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { TType type((yyvsp[-2].interm.type)); @@ -11351,11 +11670,11 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11355 "MachineIndependent/glslang_tab.cpp" +#line 11674 "MachineIndependent/glslang_tab.cpp" break; - case 568: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ -#line 3748 "MachineIndependent/glslang.y" + case 583: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */ +#line 3854 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.type).arraySizes) { parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); @@ -11369,7 +11688,7 @@ yyreduce: parseContext.memberQualifierCheck((yyvsp[-3].interm.type)); parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).isCoopmatOrvec()); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier, (yyvsp[-2].interm.type).hasTypeParameter()); for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { TType type((yyvsp[-2].interm.type)); @@ -11380,38 +11699,38 @@ yyreduce: (*(yyval.interm.typeList))[i].type->shallowCopy(type); } } -#line 11384 "MachineIndependent/glslang_tab.cpp" +#line 11703 "MachineIndependent/glslang_tab.cpp" break; - case 569: /* struct_declarator_list: struct_declarator */ -#line 3775 "MachineIndependent/glslang.y" + case 584: /* struct_declarator_list: struct_declarator */ +#line 3881 "MachineIndependent/glslang.y" { (yyval.interm.typeList) = new TTypeList; (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11393 "MachineIndependent/glslang_tab.cpp" +#line 11712 "MachineIndependent/glslang_tab.cpp" break; - case 570: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ -#line 3779 "MachineIndependent/glslang.y" + case 585: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */ +#line 3885 "MachineIndependent/glslang.y" { (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); } -#line 11401 "MachineIndependent/glslang_tab.cpp" +#line 11720 "MachineIndependent/glslang_tab.cpp" break; - case 571: /* struct_declarator: IDENTIFIER */ -#line 3785 "MachineIndependent/glslang.y" + case 586: /* struct_declarator: IDENTIFIER */ +#line 3891 "MachineIndependent/glslang.y" { (yyval.interm.typeLine).type = new TType(EbtVoid); (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); } -#line 11411 "MachineIndependent/glslang_tab.cpp" +#line 11730 "MachineIndependent/glslang_tab.cpp" break; - case 572: /* struct_declarator: IDENTIFIER array_specifier */ -#line 3790 "MachineIndependent/glslang.y" + case 587: /* struct_declarator: IDENTIFIER array_specifier */ +#line 3896 "MachineIndependent/glslang.y" { parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes); @@ -11420,168 +11739,168 @@ yyreduce: (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); (yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes); } -#line 11424 "MachineIndependent/glslang_tab.cpp" +#line 11743 "MachineIndependent/glslang_tab.cpp" break; - case 573: /* initializer: assignment_expression */ -#line 3801 "MachineIndependent/glslang.y" + case 588: /* initializer: assignment_expression */ +#line 3907 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } -#line 11432 "MachineIndependent/glslang_tab.cpp" +#line 11751 "MachineIndependent/glslang_tab.cpp" break; - case 574: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ -#line 3804 "MachineIndependent/glslang.y" + case 589: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */ +#line 3910 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); } -#line 11443 "MachineIndependent/glslang_tab.cpp" +#line 11762 "MachineIndependent/glslang_tab.cpp" break; - case 575: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ -#line 3810 "MachineIndependent/glslang.y" + case 590: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */ +#line 3916 "MachineIndependent/glslang.y" { const char* initFeature = "{ } style initializers"; parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } -#line 11454 "MachineIndependent/glslang_tab.cpp" +#line 11773 "MachineIndependent/glslang_tab.cpp" break; - case 576: /* initializer: LEFT_BRACE RIGHT_BRACE */ -#line 3816 "MachineIndependent/glslang.y" + case 591: /* initializer: LEFT_BRACE RIGHT_BRACE */ +#line 3922 "MachineIndependent/glslang.y" { const char* initFeature = "empty { } initializer"; parseContext.profileRequires((yyvsp[-1].lex).loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); parseContext.profileRequires((yyvsp[-1].lex).loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature); (yyval.interm.intermTypedNode) = parseContext.intermediate.makeAggregate((yyvsp[-1].lex).loc); } -#line 11465 "MachineIndependent/glslang_tab.cpp" +#line 11784 "MachineIndependent/glslang_tab.cpp" break; - case 577: /* initializer_list: initializer */ -#line 3825 "MachineIndependent/glslang.y" + case 592: /* initializer_list: initializer */ +#line 3931 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); } -#line 11473 "MachineIndependent/glslang_tab.cpp" +#line 11792 "MachineIndependent/glslang_tab.cpp" break; - case 578: /* initializer_list: initializer_list COMMA initializer */ -#line 3828 "MachineIndependent/glslang.y" + case 593: /* initializer_list: initializer_list COMMA initializer */ +#line 3934 "MachineIndependent/glslang.y" { (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); } -#line 11481 "MachineIndependent/glslang_tab.cpp" +#line 11800 "MachineIndependent/glslang_tab.cpp" break; - case 579: /* declaration_statement: declaration */ -#line 3834 "MachineIndependent/glslang.y" + case 594: /* declaration_statement: declaration */ +#line 3940 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11487 "MachineIndependent/glslang_tab.cpp" +#line 11806 "MachineIndependent/glslang_tab.cpp" break; - case 580: /* statement: compound_statement */ -#line 3838 "MachineIndependent/glslang.y" + case 595: /* statement: compound_statement */ +#line 3944 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11493 "MachineIndependent/glslang_tab.cpp" +#line 11812 "MachineIndependent/glslang_tab.cpp" break; - case 581: /* statement: simple_statement */ -#line 3839 "MachineIndependent/glslang.y" + case 596: /* statement: simple_statement */ +#line 3945 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11499 "MachineIndependent/glslang_tab.cpp" +#line 11818 "MachineIndependent/glslang_tab.cpp" break; - case 582: /* simple_statement: declaration_statement */ -#line 3845 "MachineIndependent/glslang.y" + case 597: /* simple_statement: declaration_statement */ +#line 3951 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11505 "MachineIndependent/glslang_tab.cpp" +#line 11824 "MachineIndependent/glslang_tab.cpp" break; - case 583: /* simple_statement: expression_statement */ -#line 3846 "MachineIndependent/glslang.y" + case 598: /* simple_statement: expression_statement */ +#line 3952 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11511 "MachineIndependent/glslang_tab.cpp" +#line 11830 "MachineIndependent/glslang_tab.cpp" break; - case 584: /* simple_statement: selection_statement */ -#line 3847 "MachineIndependent/glslang.y" + case 599: /* simple_statement: selection_statement */ +#line 3953 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11517 "MachineIndependent/glslang_tab.cpp" +#line 11836 "MachineIndependent/glslang_tab.cpp" break; - case 585: /* simple_statement: switch_statement */ -#line 3848 "MachineIndependent/glslang.y" + case 600: /* simple_statement: switch_statement */ +#line 3954 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11523 "MachineIndependent/glslang_tab.cpp" +#line 11842 "MachineIndependent/glslang_tab.cpp" break; - case 586: /* simple_statement: case_label */ -#line 3849 "MachineIndependent/glslang.y" + case 601: /* simple_statement: case_label */ +#line 3955 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11529 "MachineIndependent/glslang_tab.cpp" +#line 11848 "MachineIndependent/glslang_tab.cpp" break; - case 587: /* simple_statement: iteration_statement */ -#line 3850 "MachineIndependent/glslang.y" + case 602: /* simple_statement: iteration_statement */ +#line 3956 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11535 "MachineIndependent/glslang_tab.cpp" +#line 11854 "MachineIndependent/glslang_tab.cpp" break; - case 588: /* simple_statement: jump_statement */ -#line 3851 "MachineIndependent/glslang.y" + case 603: /* simple_statement: jump_statement */ +#line 3957 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11541 "MachineIndependent/glslang_tab.cpp" +#line 11860 "MachineIndependent/glslang_tab.cpp" break; - case 589: /* simple_statement: demote_statement */ -#line 3852 "MachineIndependent/glslang.y" + case 604: /* simple_statement: demote_statement */ +#line 3958 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11547 "MachineIndependent/glslang_tab.cpp" +#line 11866 "MachineIndependent/glslang_tab.cpp" break; - case 590: /* demote_statement: DEMOTE SEMICOLON */ -#line 3856 "MachineIndependent/glslang.y" + case 605: /* demote_statement: DEMOTE SEMICOLON */ +#line 3962 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "demote"); parseContext.requireExtensions((yyvsp[-1].lex).loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDemote, (yyvsp[-1].lex).loc); } -#line 11557 "MachineIndependent/glslang_tab.cpp" +#line 11876 "MachineIndependent/glslang_tab.cpp" break; - case 591: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ -#line 3864 "MachineIndependent/glslang.y" + case 606: /* compound_statement: LEFT_BRACE RIGHT_BRACE */ +#line 3970 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11563 "MachineIndependent/glslang_tab.cpp" +#line 11882 "MachineIndependent/glslang_tab.cpp" break; - case 592: /* $@5: %empty */ -#line 3865 "MachineIndependent/glslang.y" + case 607: /* $@6: %empty */ +#line 3971 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; } -#line 11572 "MachineIndependent/glslang_tab.cpp" +#line 11891 "MachineIndependent/glslang_tab.cpp" break; - case 593: /* $@6: %empty */ -#line 3869 "MachineIndependent/glslang.y" + case 608: /* $@7: %empty */ +#line 3975 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } -#line 11581 "MachineIndependent/glslang_tab.cpp" +#line 11900 "MachineIndependent/glslang_tab.cpp" break; - case 594: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */ -#line 3873 "MachineIndependent/glslang.y" + case 609: /* compound_statement: LEFT_BRACE $@6 statement_list $@7 RIGHT_BRACE */ +#line 3979 "MachineIndependent/glslang.y" { if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) { (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); @@ -11589,69 +11908,69 @@ yyreduce: } (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } -#line 11593 "MachineIndependent/glslang_tab.cpp" +#line 11912 "MachineIndependent/glslang_tab.cpp" break; - case 595: /* statement_no_new_scope: compound_statement_no_new_scope */ -#line 3883 "MachineIndependent/glslang.y" + case 610: /* statement_no_new_scope: compound_statement_no_new_scope */ +#line 3989 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11599 "MachineIndependent/glslang_tab.cpp" +#line 11918 "MachineIndependent/glslang_tab.cpp" break; - case 596: /* statement_no_new_scope: simple_statement */ -#line 3884 "MachineIndependent/glslang.y" + case 611: /* statement_no_new_scope: simple_statement */ +#line 3990 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11605 "MachineIndependent/glslang_tab.cpp" +#line 11924 "MachineIndependent/glslang_tab.cpp" break; - case 597: /* $@7: %empty */ -#line 3888 "MachineIndependent/glslang.y" + case 612: /* $@8: %empty */ +#line 3994 "MachineIndependent/glslang.y" { ++parseContext.controlFlowNestingLevel; } -#line 11613 "MachineIndependent/glslang_tab.cpp" +#line 11932 "MachineIndependent/glslang_tab.cpp" break; - case 598: /* statement_scoped: $@7 compound_statement */ -#line 3891 "MachineIndependent/glslang.y" + case 613: /* statement_scoped: $@8 compound_statement */ +#line 3997 "MachineIndependent/glslang.y" { --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11622 "MachineIndependent/glslang_tab.cpp" +#line 11941 "MachineIndependent/glslang_tab.cpp" break; - case 599: /* $@8: %empty */ -#line 3895 "MachineIndependent/glslang.y" + case 614: /* $@9: %empty */ +#line 4001 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11632 "MachineIndependent/glslang_tab.cpp" +#line 11951 "MachineIndependent/glslang_tab.cpp" break; - case 600: /* statement_scoped: $@8 simple_statement */ -#line 3900 "MachineIndependent/glslang.y" + case 615: /* statement_scoped: $@9 simple_statement */ +#line 4006 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11643 "MachineIndependent/glslang_tab.cpp" +#line 11962 "MachineIndependent/glslang_tab.cpp" break; - case 601: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ -#line 3909 "MachineIndependent/glslang.y" + case 616: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */ +#line 4015 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11651 "MachineIndependent/glslang_tab.cpp" +#line 11970 "MachineIndependent/glslang_tab.cpp" break; - case 602: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ -#line 3912 "MachineIndependent/glslang.y" + case 617: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */ +#line 4018 "MachineIndependent/glslang.y" { if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) { (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); @@ -11659,11 +11978,11 @@ yyreduce: } (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); } -#line 11663 "MachineIndependent/glslang_tab.cpp" +#line 11982 "MachineIndependent/glslang_tab.cpp" break; - case 603: /* statement_list: statement */ -#line 3922 "MachineIndependent/glslang.y" + case 618: /* statement_list: statement */ +#line 4028 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || @@ -11672,11 +11991,11 @@ yyreduce: (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case } } -#line 11676 "MachineIndependent/glslang_tab.cpp" +#line 11995 "MachineIndependent/glslang_tab.cpp" break; - case 604: /* statement_list: statement_list statement */ -#line 3930 "MachineIndependent/glslang.y" + case 619: /* statement_list: statement_list statement */ +#line 4036 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { @@ -11685,110 +12004,106 @@ yyreduce: } else (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 11689 "MachineIndependent/glslang_tab.cpp" +#line 12008 "MachineIndependent/glslang_tab.cpp" break; - case 605: /* expression_statement: SEMICOLON */ -#line 3941 "MachineIndependent/glslang.y" + case 620: /* expression_statement: SEMICOLON */ +#line 4047 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11695 "MachineIndependent/glslang_tab.cpp" +#line 12014 "MachineIndependent/glslang_tab.cpp" break; - case 606: /* expression_statement: expression SEMICOLON */ -#line 3942 "MachineIndependent/glslang.y" + case 621: /* expression_statement: expression SEMICOLON */ +#line 4048 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } -#line 11701 "MachineIndependent/glslang_tab.cpp" +#line 12020 "MachineIndependent/glslang_tab.cpp" break; - case 607: /* selection_statement: selection_statement_nonattributed */ -#line 3946 "MachineIndependent/glslang.y" + case 622: /* selection_statement: selection_statement_nonattributed */ +#line 4052 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11709 "MachineIndependent/glslang_tab.cpp" +#line 12028 "MachineIndependent/glslang_tab.cpp" break; - case 608: /* selection_statement: attribute selection_statement_nonattributed */ -#line 3949 "MachineIndependent/glslang.y" + case 623: /* selection_statement: attribute selection_statement_nonattributed */ +#line 4055 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSelectionAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11719 "MachineIndependent/glslang_tab.cpp" +#line 12038 "MachineIndependent/glslang_tab.cpp" break; - case 609: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ -#line 3956 "MachineIndependent/glslang.y" + case 624: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */ +#line 4062 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); } -#line 11728 "MachineIndependent/glslang_tab.cpp" +#line 12047 "MachineIndependent/glslang_tab.cpp" break; - case 610: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ -#line 3963 "MachineIndependent/glslang.y" + case 625: /* selection_rest_statement: statement_scoped ELSE statement_scoped */ +#line 4069 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); } -#line 11737 "MachineIndependent/glslang_tab.cpp" +#line 12056 "MachineIndependent/glslang_tab.cpp" break; - case 611: /* selection_rest_statement: statement_scoped */ -#line 3967 "MachineIndependent/glslang.y" + case 626: /* selection_rest_statement: statement_scoped */ +#line 4073 "MachineIndependent/glslang.y" { (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 11746 "MachineIndependent/glslang_tab.cpp" +#line 12065 "MachineIndependent/glslang_tab.cpp" break; - case 612: /* condition: expression */ -#line 3975 "MachineIndependent/glslang.y" + case 627: /* condition: expression */ +#line 4081 "MachineIndependent/glslang.y" { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); } -#line 11755 "MachineIndependent/glslang_tab.cpp" +#line 12074 "MachineIndependent/glslang_tab.cpp" break; - case 613: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ -#line 3979 "MachineIndependent/glslang.y" + case 628: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */ +#line 4085 "MachineIndependent/glslang.y" { parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); TType type((yyvsp[-3].interm.type)); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); - if (initNode) - (yyval.interm.intermTypedNode) = initNode->getAsTyped(); - else - (yyval.interm.intermTypedNode) = 0; + (yyval.interm.intermNode) = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); } -#line 11770 "MachineIndependent/glslang_tab.cpp" +#line 12085 "MachineIndependent/glslang_tab.cpp" break; - case 614: /* switch_statement: switch_statement_nonattributed */ -#line 3992 "MachineIndependent/glslang.y" + case 629: /* switch_statement: switch_statement_nonattributed */ +#line 4094 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11778 "MachineIndependent/glslang_tab.cpp" +#line 12093 "MachineIndependent/glslang_tab.cpp" break; - case 615: /* switch_statement: attribute switch_statement_nonattributed */ -#line 3995 "MachineIndependent/glslang.y" + case 630: /* switch_statement: attribute switch_statement_nonattributed */ +#line 4097 "MachineIndependent/glslang.y" { parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute"); parseContext.handleSwitchAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11788 "MachineIndependent/glslang_tab.cpp" +#line 12103 "MachineIndependent/glslang_tab.cpp" break; - case 616: /* $@9: %empty */ -#line 4002 "MachineIndependent/glslang.y" + case 631: /* $@10: %empty */ +#line 4104 "MachineIndependent/glslang.y" { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -11797,11 +12112,11 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } -#line 11801 "MachineIndependent/glslang_tab.cpp" +#line 12116 "MachineIndependent/glslang_tab.cpp" break; - case 617: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */ -#line 4010 "MachineIndependent/glslang.y" + case 632: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@10 LEFT_BRACE switch_statement_list RIGHT_BRACE */ +#line 4112 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); @@ -11811,27 +12126,27 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11815 "MachineIndependent/glslang_tab.cpp" +#line 12130 "MachineIndependent/glslang_tab.cpp" break; - case 618: /* switch_statement_list: %empty */ -#line 4022 "MachineIndependent/glslang.y" + case 633: /* switch_statement_list: %empty */ +#line 4124 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; } -#line 11823 "MachineIndependent/glslang_tab.cpp" +#line 12138 "MachineIndependent/glslang_tab.cpp" break; - case 619: /* switch_statement_list: statement_list */ -#line 4025 "MachineIndependent/glslang.y" + case 634: /* switch_statement_list: statement_list */ +#line 4127 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11831 "MachineIndependent/glslang_tab.cpp" +#line 12146 "MachineIndependent/glslang_tab.cpp" break; - case 620: /* case_label: CASE expression COLON */ -#line 4031 "MachineIndependent/glslang.y" + case 635: /* case_label: CASE expression COLON */ +#line 4133 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11844,11 +12159,11 @@ yyreduce: (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } -#line 11848 "MachineIndependent/glslang_tab.cpp" +#line 12163 "MachineIndependent/glslang_tab.cpp" break; - case 621: /* case_label: DEFAULT COLON */ -#line 4043 "MachineIndependent/glslang.y" + case 636: /* case_label: DEFAULT COLON */ +#line 4145 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) @@ -11858,30 +12173,30 @@ yyreduce: else (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } -#line 11862 "MachineIndependent/glslang_tab.cpp" +#line 12177 "MachineIndependent/glslang_tab.cpp" break; - case 622: /* iteration_statement: iteration_statement_nonattributed */ -#line 4055 "MachineIndependent/glslang.y" + case 637: /* iteration_statement: iteration_statement_nonattributed */ +#line 4157 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11870 "MachineIndependent/glslang_tab.cpp" +#line 12185 "MachineIndependent/glslang_tab.cpp" break; - case 623: /* iteration_statement: attribute iteration_statement_nonattributed */ -#line 4058 "MachineIndependent/glslang.y" + case 638: /* iteration_statement: attribute iteration_statement_nonattributed */ +#line 4160 "MachineIndependent/glslang.y" { const char * extensions[2] = { E_GL_EXT_control_flow_attributes, E_GL_EXT_control_flow_attributes2 }; parseContext.requireExtensions((yyvsp[0].interm.intermNode)->getLoc(), 2, extensions, "attribute"); parseContext.handleLoopAttributes(*(yyvsp[-1].interm.attributes), (yyvsp[0].interm.intermNode)); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11881 "MachineIndependent/glslang_tab.cpp" +#line 12196 "MachineIndependent/glslang_tab.cpp" break; - case 624: /* $@10: %empty */ -#line 4066 "MachineIndependent/glslang.y" + case 639: /* $@11: %empty */ +#line 4168 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); @@ -11890,34 +12205,38 @@ yyreduce: ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11894 "MachineIndependent/glslang_tab.cpp" +#line 12209 "MachineIndependent/glslang_tab.cpp" break; - case 625: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */ -#line 4074 "MachineIndependent/glslang.y" + case 640: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@11 condition RIGHT_PAREN statement_no_new_scope */ +#line 4176 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); - (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermNode), 0, true, (yyvsp[-5].lex).loc); + if (parseContext.intermediate.getDebugInfo()) { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyval.interm.intermNode), (yyvsp[-5].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpScope); + } --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11906 "MachineIndependent/glslang_tab.cpp" +#line 12225 "MachineIndependent/glslang_tab.cpp" break; - case 626: /* $@11: %empty */ -#line 4081 "MachineIndependent/glslang.y" + case 641: /* $@12: %empty */ +#line 4187 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11917 "MachineIndependent/glslang_tab.cpp" +#line 12236 "MachineIndependent/glslang_tab.cpp" break; - case 627: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ -#line 4087 "MachineIndependent/glslang.y" + case 642: /* iteration_statement_nonattributed: DO $@12 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */ +#line 4193 "MachineIndependent/glslang.y" { if (! parseContext.limits.whileLoops) parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); @@ -11925,27 +12244,31 @@ 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); + if (parseContext.intermediate.getDebugInfo()) { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyval.interm.intermNode), (yyvsp[-4].lex).loc); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpScope); + } parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11934 "MachineIndependent/glslang_tab.cpp" +#line 12257 "MachineIndependent/glslang_tab.cpp" break; - case 628: /* $@12: %empty */ -#line 4099 "MachineIndependent/glslang.y" + case 643: /* $@13: %empty */ +#line 4209 "MachineIndependent/glslang.y" { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } -#line 11945 "MachineIndependent/glslang_tab.cpp" +#line 12268 "MachineIndependent/glslang_tab.cpp" break; - case 629: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ -#line 4105 "MachineIndependent/glslang.y" + case 644: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@13 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */ +#line 4215 "MachineIndependent/glslang.y" { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); @@ -11953,86 +12276,86 @@ yyreduce: if (! parseContext.limits.nonInductiveForLoops) parseContext.inductiveLoopCheck((yyvsp[-6].lex).loc, (yyvsp[-3].interm.intermNode), forLoop); (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[-6].lex).loc); - (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } -#line 11962 "MachineIndependent/glslang_tab.cpp" +#line 12285 "MachineIndependent/glslang_tab.cpp" break; - case 630: /* for_init_statement: expression_statement */ -#line 4120 "MachineIndependent/glslang.y" + case 645: /* for_init_statement: expression_statement */ +#line 4230 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11970 "MachineIndependent/glslang_tab.cpp" +#line 12293 "MachineIndependent/glslang_tab.cpp" break; - case 631: /* for_init_statement: declaration_statement */ -#line 4123 "MachineIndependent/glslang.y" + case 646: /* for_init_statement: declaration_statement */ +#line 4233 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11978 "MachineIndependent/glslang_tab.cpp" +#line 12301 "MachineIndependent/glslang_tab.cpp" break; - case 632: /* conditionopt: condition */ -#line 4129 "MachineIndependent/glslang.y" + case 647: /* conditionopt: condition */ +#line 4239 "MachineIndependent/glslang.y" { - (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 11986 "MachineIndependent/glslang_tab.cpp" +#line 12309 "MachineIndependent/glslang_tab.cpp" break; - case 633: /* conditionopt: %empty */ -#line 4132 "MachineIndependent/glslang.y" + case 648: /* conditionopt: %empty */ +#line 4242 "MachineIndependent/glslang.y" { - (yyval.interm.intermTypedNode) = 0; + (yyval.interm.intermNode) = 0; } -#line 11994 "MachineIndependent/glslang_tab.cpp" +#line 12317 "MachineIndependent/glslang_tab.cpp" break; - case 634: /* for_rest_statement: conditionopt SEMICOLON */ -#line 4138 "MachineIndependent/glslang.y" + case 649: /* for_rest_statement: conditionopt SEMICOLON */ +#line 4248 "MachineIndependent/glslang.y" { - (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); + (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermNode); (yyval.interm.nodePair).node2 = 0; } -#line 12003 "MachineIndependent/glslang_tab.cpp" +#line 12326 "MachineIndependent/glslang_tab.cpp" break; - case 635: /* for_rest_statement: conditionopt SEMICOLON expression */ -#line 4142 "MachineIndependent/glslang.y" + case 650: /* for_rest_statement: conditionopt SEMICOLON expression */ +#line 4252 "MachineIndependent/glslang.y" { - (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } -#line 12012 "MachineIndependent/glslang_tab.cpp" +#line 12335 "MachineIndependent/glslang_tab.cpp" break; - case 636: /* jump_statement: CONTINUE SEMICOLON */ -#line 4149 "MachineIndependent/glslang.y" + case 651: /* jump_statement: CONTINUE SEMICOLON */ +#line 4259 "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 12022 "MachineIndependent/glslang_tab.cpp" +#line 12345 "MachineIndependent/glslang_tab.cpp" break; - case 637: /* jump_statement: BREAK SEMICOLON */ -#line 4154 "MachineIndependent/glslang.y" + case 652: /* jump_statement: BREAK SEMICOLON */ +#line 4264 "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 12032 "MachineIndependent/glslang_tab.cpp" +#line 12355 "MachineIndependent/glslang_tab.cpp" break; - case 638: /* jump_statement: RETURN SEMICOLON */ -#line 4159 "MachineIndependent/glslang.y" + case 653: /* jump_statement: RETURN SEMICOLON */ +#line 4269 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); if (parseContext.currentFunctionType->getBasicType() != EbtVoid) @@ -12040,101 +12363,101 @@ yyreduce: if (parseContext.inMain) parseContext.postEntryPointReturn = true; } -#line 12044 "MachineIndependent/glslang_tab.cpp" +#line 12367 "MachineIndependent/glslang_tab.cpp" break; - case 639: /* jump_statement: RETURN expression SEMICOLON */ -#line 4166 "MachineIndependent/glslang.y" + case 654: /* jump_statement: RETURN expression SEMICOLON */ +#line 4276 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode)); } -#line 12052 "MachineIndependent/glslang_tab.cpp" +#line 12375 "MachineIndependent/glslang_tab.cpp" break; - case 640: /* jump_statement: DISCARD SEMICOLON */ -#line 4169 "MachineIndependent/glslang.y" + case 655: /* jump_statement: DISCARD SEMICOLON */ +#line 4279 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); } -#line 12061 "MachineIndependent/glslang_tab.cpp" +#line 12384 "MachineIndependent/glslang_tab.cpp" break; - case 641: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ -#line 4173 "MachineIndependent/glslang.y" + case 656: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */ +#line 4283 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc); } -#line 12070 "MachineIndependent/glslang_tab.cpp" +#line 12393 "MachineIndependent/glslang_tab.cpp" break; - case 642: /* jump_statement: TERMINATE_RAY SEMICOLON */ -#line 4177 "MachineIndependent/glslang.y" + case 657: /* jump_statement: TERMINATE_RAY SEMICOLON */ +#line 4287 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc); } -#line 12079 "MachineIndependent/glslang_tab.cpp" +#line 12402 "MachineIndependent/glslang_tab.cpp" break; - case 643: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ -#line 4181 "MachineIndependent/glslang.y" + case 658: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */ +#line 4291 "MachineIndependent/glslang.y" { parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT"); (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc); } -#line 12088 "MachineIndependent/glslang_tab.cpp" +#line 12411 "MachineIndependent/glslang_tab.cpp" break; - case 644: /* translation_unit: external_declaration */ -#line 4190 "MachineIndependent/glslang.y" + case 659: /* translation_unit: external_declaration */ +#line 4300 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); } -#line 12097 "MachineIndependent/glslang_tab.cpp" +#line 12420 "MachineIndependent/glslang_tab.cpp" break; - case 645: /* translation_unit: translation_unit external_declaration */ -#line 4194 "MachineIndependent/glslang.y" + case 660: /* translation_unit: translation_unit external_declaration */ +#line 4304 "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 12108 "MachineIndependent/glslang_tab.cpp" +#line 12431 "MachineIndependent/glslang_tab.cpp" break; - case 646: /* external_declaration: function_definition */ -#line 4203 "MachineIndependent/glslang.y" + case 661: /* external_declaration: function_definition */ +#line 4313 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 12116 "MachineIndependent/glslang_tab.cpp" +#line 12439 "MachineIndependent/glslang_tab.cpp" break; - case 647: /* external_declaration: declaration */ -#line 4206 "MachineIndependent/glslang.y" + case 662: /* external_declaration: declaration */ +#line 4316 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } -#line 12124 "MachineIndependent/glslang_tab.cpp" +#line 12447 "MachineIndependent/glslang_tab.cpp" break; - case 648: /* external_declaration: SEMICOLON */ -#line 4209 "MachineIndependent/glslang.y" + case 663: /* external_declaration: SEMICOLON */ +#line 4319 "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 12134 "MachineIndependent/glslang_tab.cpp" +#line 12457 "MachineIndependent/glslang_tab.cpp" break; - case 649: /* $@13: %empty */ -#line 4217 "MachineIndependent/glslang.y" + case 664: /* $@14: %empty */ +#line 4327 "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); @@ -12147,11 +12470,11 @@ yyreduce: ++parseContext.statementNestingLevel; } } -#line 12151 "MachineIndependent/glslang_tab.cpp" +#line 12474 "MachineIndependent/glslang_tab.cpp" break; - case 650: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */ -#line 4229 "MachineIndependent/glslang.y" + case 665: /* function_definition: function_prototype $@14 compound_statement_no_new_scope */ +#line 4339 "MachineIndependent/glslang.y" { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) @@ -12179,228 +12502,228 @@ yyreduce: --parseContext.statementNestingLevel; } } -#line 12183 "MachineIndependent/glslang_tab.cpp" +#line 12506 "MachineIndependent/glslang_tab.cpp" break; - case 651: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ -#line 4259 "MachineIndependent/glslang.y" + case 666: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */ +#line 4369 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[-2].interm.attributes); } -#line 12191 "MachineIndependent/glslang_tab.cpp" +#line 12514 "MachineIndependent/glslang_tab.cpp" break; - case 652: /* attribute_list: single_attribute */ -#line 4264 "MachineIndependent/glslang.y" + case 667: /* attribute_list: single_attribute */ +#line 4374 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = (yyvsp[0].interm.attributes); } -#line 12199 "MachineIndependent/glslang_tab.cpp" +#line 12522 "MachineIndependent/glslang_tab.cpp" break; - case 653: /* attribute_list: attribute_list COMMA single_attribute */ -#line 4267 "MachineIndependent/glslang.y" + case 668: /* attribute_list: attribute_list COMMA single_attribute */ +#line 4377 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes)); } -#line 12207 "MachineIndependent/glslang_tab.cpp" +#line 12530 "MachineIndependent/glslang_tab.cpp" break; - case 654: /* single_attribute: IDENTIFIER */ -#line 4272 "MachineIndependent/glslang.y" + case 669: /* single_attribute: IDENTIFIER */ +#line 4382 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string); } -#line 12215 "MachineIndependent/glslang_tab.cpp" +#line 12538 "MachineIndependent/glslang_tab.cpp" break; - case 655: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ -#line 4275 "MachineIndependent/glslang.y" + case 670: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */ +#line 4385 "MachineIndependent/glslang.y" { (yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode)); } -#line 12223 "MachineIndependent/glslang_tab.cpp" +#line 12546 "MachineIndependent/glslang_tab.cpp" break; - case 656: /* spirv_requirements_list: spirv_requirements_parameter */ -#line 4280 "MachineIndependent/glslang.y" + case 671: /* spirv_requirements_list: spirv_requirements_parameter */ +#line 4390 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq); } -#line 12231 "MachineIndependent/glslang_tab.cpp" +#line 12554 "MachineIndependent/glslang_tab.cpp" break; - case 657: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ -#line 4283 "MachineIndependent/glslang.y" + case 672: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */ +#line 4393 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq)); } -#line 12239 "MachineIndependent/glslang_tab.cpp" +#line 12562 "MachineIndependent/glslang_tab.cpp" break; - case 658: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ -#line 4288 "MachineIndependent/glslang.y" + case 673: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */ +#line 4398 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr); } -#line 12247 "MachineIndependent/glslang_tab.cpp" +#line 12570 "MachineIndependent/glslang_tab.cpp" break; - case 659: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ -#line 4291 "MachineIndependent/glslang.y" + case 674: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */ +#line 4401 "MachineIndependent/glslang.y" { (yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate()); } -#line 12255 "MachineIndependent/glslang_tab.cpp" +#line 12578 "MachineIndependent/glslang_tab.cpp" break; - case 660: /* spirv_extension_list: STRING_LITERAL */ -#line 4296 "MachineIndependent/glslang.y" + case 675: /* spirv_extension_list: STRING_LITERAL */ +#line 4406 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12263 "MachineIndependent/glslang_tab.cpp" +#line 12586 "MachineIndependent/glslang_tab.cpp" break; - case 661: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ -#line 4299 "MachineIndependent/glslang.y" + case 676: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */ +#line 4409 "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 12271 "MachineIndependent/glslang_tab.cpp" +#line 12594 "MachineIndependent/glslang_tab.cpp" break; - case 662: /* spirv_capability_list: INTCONSTANT */ -#line 4304 "MachineIndependent/glslang.y" + case 677: /* spirv_capability_list: INTCONSTANT */ +#line 4414 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true)); } -#line 12279 "MachineIndependent/glslang_tab.cpp" +#line 12602 "MachineIndependent/glslang_tab.cpp" break; - case 663: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ -#line 4307 "MachineIndependent/glslang.y" + case 678: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */ +#line 4417 "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 12287 "MachineIndependent/glslang_tab.cpp" +#line 12610 "MachineIndependent/glslang_tab.cpp" break; - case 664: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4312 "MachineIndependent/glslang.y" + case 679: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4422 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 12296 "MachineIndependent/glslang_tab.cpp" +#line 12619 "MachineIndependent/glslang_tab.cpp" break; - case 665: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4316 "MachineIndependent/glslang.y" + case 680: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4426 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i); (yyval.interm.intermNode) = 0; } -#line 12306 "MachineIndependent/glslang_tab.cpp" +#line 12629 "MachineIndependent/glslang_tab.cpp" break; - case 666: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4321 "MachineIndependent/glslang.y" + case 681: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4431 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 12315 "MachineIndependent/glslang_tab.cpp" +#line 12638 "MachineIndependent/glslang_tab.cpp" break; - case 667: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ -#line 4325 "MachineIndependent/glslang.y" + case 682: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */ +#line 4435 "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 12325 "MachineIndependent/glslang_tab.cpp" +#line 12648 "MachineIndependent/glslang_tab.cpp" break; - case 668: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ -#line 4330 "MachineIndependent/glslang.y" + case 683: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */ +#line 4440 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate()); (yyval.interm.intermNode) = 0; } -#line 12334 "MachineIndependent/glslang_tab.cpp" +#line 12657 "MachineIndependent/glslang_tab.cpp" break; - case 669: /* 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 4334 "MachineIndependent/glslang.y" + case 684: /* 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 4444 "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 12344 "MachineIndependent/glslang_tab.cpp" +#line 12667 "MachineIndependent/glslang_tab.cpp" break; - case 670: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ -#line 4341 "MachineIndependent/glslang.y" + case 685: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */ +#line 4451 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12352 "MachineIndependent/glslang_tab.cpp" +#line 12675 "MachineIndependent/glslang_tab.cpp" break; - case 671: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ -#line 4344 "MachineIndependent/glslang.y" + case 686: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */ +#line 4454 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12360 "MachineIndependent/glslang_tab.cpp" +#line 12683 "MachineIndependent/glslang_tab.cpp" break; - case 672: /* spirv_execution_mode_parameter: FLOATCONSTANT */ -#line 4349 "MachineIndependent/glslang.y" + case 687: /* spirv_execution_mode_parameter: FLOATCONSTANT */ +#line 4459 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12368 "MachineIndependent/glslang_tab.cpp" +#line 12691 "MachineIndependent/glslang_tab.cpp" break; - case 673: /* spirv_execution_mode_parameter: INTCONSTANT */ -#line 4352 "MachineIndependent/glslang.y" + case 688: /* spirv_execution_mode_parameter: INTCONSTANT */ +#line 4462 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12376 "MachineIndependent/glslang_tab.cpp" +#line 12699 "MachineIndependent/glslang_tab.cpp" break; - case 674: /* spirv_execution_mode_parameter: UINTCONSTANT */ -#line 4355 "MachineIndependent/glslang.y" + case 689: /* spirv_execution_mode_parameter: UINTCONSTANT */ +#line 4465 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12384 "MachineIndependent/glslang_tab.cpp" +#line 12707 "MachineIndependent/glslang_tab.cpp" break; - case 675: /* spirv_execution_mode_parameter: BOOLCONSTANT */ -#line 4358 "MachineIndependent/glslang.y" + case 690: /* spirv_execution_mode_parameter: BOOLCONSTANT */ +#line 4468 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12392 "MachineIndependent/glslang_tab.cpp" +#line 12715 "MachineIndependent/glslang_tab.cpp" break; - case 676: /* spirv_execution_mode_parameter: STRING_LITERAL */ -#line 4361 "MachineIndependent/glslang.y" + case 691: /* spirv_execution_mode_parameter: STRING_LITERAL */ +#line 4471 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true); } -#line 12400 "MachineIndependent/glslang_tab.cpp" +#line 12723 "MachineIndependent/glslang_tab.cpp" break; - case 677: /* spirv_execution_mode_id_parameter_list: constant_expression */ -#line 4366 "MachineIndependent/glslang.y" + case 692: /* spirv_execution_mode_id_parameter_list: constant_expression */ +#line 4476 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12410,11 +12733,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 12414 "MachineIndependent/glslang_tab.cpp" +#line 12737 "MachineIndependent/glslang_tab.cpp" break; - case 678: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ -#line 4375 "MachineIndependent/glslang.y" + case 693: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */ +#line 4485 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat && (yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt && @@ -12424,351 +12747,351 @@ 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 12428 "MachineIndependent/glslang_tab.cpp" +#line 12751 "MachineIndependent/glslang_tab.cpp" break; - case 679: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4386 "MachineIndependent/glslang.y" + case 694: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4496 "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 12438 "MachineIndependent/glslang_tab.cpp" +#line 12761 "MachineIndependent/glslang_tab.cpp" break; - case 680: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4391 "MachineIndependent/glslang.y" + case 695: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4501 "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 12449 "MachineIndependent/glslang_tab.cpp" +#line 12772 "MachineIndependent/glslang_tab.cpp" break; - case 681: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ -#line 4399 "MachineIndependent/glslang.y" + case 696: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */ +#line 4509 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i); } -#line 12458 "MachineIndependent/glslang_tab.cpp" +#line 12781 "MachineIndependent/glslang_tab.cpp" break; - case 682: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ -#line 4403 "MachineIndependent/glslang.y" + case 697: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */ +#line 4513 "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 12468 "MachineIndependent/glslang_tab.cpp" +#line 12791 "MachineIndependent/glslang_tab.cpp" break; - case 683: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4408 "MachineIndependent/glslang.y" + case 698: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4518 "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 12477 "MachineIndependent/glslang_tab.cpp" +#line 12800 "MachineIndependent/glslang_tab.cpp" break; - case 684: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ -#line 4412 "MachineIndependent/glslang.y" + case 699: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */ +#line 4522 "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 12487 "MachineIndependent/glslang_tab.cpp" +#line 12810 "MachineIndependent/glslang_tab.cpp" break; - case 685: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4417 "MachineIndependent/glslang.y" + case 700: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4527 "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 12496 "MachineIndependent/glslang_tab.cpp" +#line 12819 "MachineIndependent/glslang_tab.cpp" break; - case 686: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ -#line 4421 "MachineIndependent/glslang.y" + case 701: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */ +#line 4531 "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 12506 "MachineIndependent/glslang_tab.cpp" +#line 12829 "MachineIndependent/glslang_tab.cpp" break; - case 687: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4426 "MachineIndependent/glslang.y" + case 702: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4536 "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 12515 "MachineIndependent/glslang_tab.cpp" +#line 12838 "MachineIndependent/glslang_tab.cpp" break; - case 688: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ -#line 4430 "MachineIndependent/glslang.y" + case 703: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */ +#line 4540 "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 12525 "MachineIndependent/glslang_tab.cpp" +#line 12848 "MachineIndependent/glslang_tab.cpp" break; - case 689: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ -#line 4437 "MachineIndependent/glslang.y" + case 704: /* spirv_decorate_parameter_list: spirv_decorate_parameter */ +#line 4547 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12533 "MachineIndependent/glslang_tab.cpp" +#line 12856 "MachineIndependent/glslang_tab.cpp" break; - case 690: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ -#line 4440 "MachineIndependent/glslang.y" + case 705: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */ +#line 4550 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12541 "MachineIndependent/glslang_tab.cpp" +#line 12864 "MachineIndependent/glslang_tab.cpp" break; - case 691: /* spirv_decorate_parameter: FLOATCONSTANT */ -#line 4445 "MachineIndependent/glslang.y" + case 706: /* spirv_decorate_parameter: FLOATCONSTANT */ +#line 4555 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12549 "MachineIndependent/glslang_tab.cpp" +#line 12872 "MachineIndependent/glslang_tab.cpp" break; - case 692: /* spirv_decorate_parameter: INTCONSTANT */ -#line 4448 "MachineIndependent/glslang.y" + case 707: /* spirv_decorate_parameter: INTCONSTANT */ +#line 4558 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12557 "MachineIndependent/glslang_tab.cpp" +#line 12880 "MachineIndependent/glslang_tab.cpp" break; - case 693: /* spirv_decorate_parameter: UINTCONSTANT */ -#line 4451 "MachineIndependent/glslang.y" + case 708: /* spirv_decorate_parameter: UINTCONSTANT */ +#line 4561 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12565 "MachineIndependent/glslang_tab.cpp" +#line 12888 "MachineIndependent/glslang_tab.cpp" break; - case 694: /* spirv_decorate_parameter: BOOLCONSTANT */ -#line 4454 "MachineIndependent/glslang.y" + case 709: /* spirv_decorate_parameter: BOOLCONSTANT */ +#line 4564 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12573 "MachineIndependent/glslang_tab.cpp" +#line 12896 "MachineIndependent/glslang_tab.cpp" break; - case 695: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ -#line 4459 "MachineIndependent/glslang.y" + case 710: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter */ +#line 4569 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); } -#line 12581 "MachineIndependent/glslang_tab.cpp" +#line 12904 "MachineIndependent/glslang_tab.cpp" break; - case 696: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ -#line 4462 "MachineIndependent/glslang.y" + case 711: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter */ +#line 4572 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode)); } -#line 12589 "MachineIndependent/glslang_tab.cpp" +#line 12912 "MachineIndependent/glslang_tab.cpp" break; - case 697: /* spirv_decorate_id_parameter: variable_identifier */ -#line 4467 "MachineIndependent/glslang.y" + case 712: /* spirv_decorate_id_parameter: variable_identifier */ +#line 4577 "MachineIndependent/glslang.y" { if ((yyvsp[0].interm.intermTypedNode)->getAsConstantUnion() || (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode()) (yyval.interm.intermNode) = (yyvsp[0].interm.intermTypedNode); else parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "only allow constants or variables which are not elements of a composite", "", ""); } -#line 12600 "MachineIndependent/glslang_tab.cpp" +#line 12923 "MachineIndependent/glslang_tab.cpp" break; - case 698: /* spirv_decorate_id_parameter: FLOATCONSTANT */ -#line 4473 "MachineIndependent/glslang.y" + case 713: /* spirv_decorate_id_parameter: FLOATCONSTANT */ +#line 4583 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } -#line 12608 "MachineIndependent/glslang_tab.cpp" +#line 12931 "MachineIndependent/glslang_tab.cpp" break; - case 699: /* spirv_decorate_id_parameter: INTCONSTANT */ -#line 4476 "MachineIndependent/glslang.y" + case 714: /* spirv_decorate_id_parameter: INTCONSTANT */ +#line 4586 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } -#line 12616 "MachineIndependent/glslang_tab.cpp" +#line 12939 "MachineIndependent/glslang_tab.cpp" break; - case 700: /* spirv_decorate_id_parameter: UINTCONSTANT */ -#line 4479 "MachineIndependent/glslang.y" + case 715: /* spirv_decorate_id_parameter: UINTCONSTANT */ +#line 4589 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } -#line 12624 "MachineIndependent/glslang_tab.cpp" +#line 12947 "MachineIndependent/glslang_tab.cpp" break; - case 701: /* spirv_decorate_id_parameter: BOOLCONSTANT */ -#line 4482 "MachineIndependent/glslang.y" + case 716: /* spirv_decorate_id_parameter: BOOLCONSTANT */ +#line 4592 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } -#line 12632 "MachineIndependent/glslang_tab.cpp" +#line 12955 "MachineIndependent/glslang_tab.cpp" break; - case 702: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ -#line 4487 "MachineIndependent/glslang.y" + case 717: /* spirv_decorate_string_parameter_list: STRING_LITERAL */ +#line 4597 "MachineIndependent/glslang.y" { (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate( parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true)); } -#line 12641 "MachineIndependent/glslang_tab.cpp" +#line 12964 "MachineIndependent/glslang_tab.cpp" break; - case 703: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ -#line 4491 "MachineIndependent/glslang.y" + case 718: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */ +#line 4601 "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 12649 "MachineIndependent/glslang_tab.cpp" +#line 12972 "MachineIndependent/glslang_tab.cpp" break; - case 704: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4496 "MachineIndependent/glslang.y" + case 719: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4606 "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 12658 "MachineIndependent/glslang_tab.cpp" +#line 12981 "MachineIndependent/glslang_tab.cpp" break; - case 705: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ -#line 4500 "MachineIndependent/glslang.y" + case 720: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */ +#line 4610 "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 12668 "MachineIndependent/glslang_tab.cpp" +#line 12991 "MachineIndependent/glslang_tab.cpp" break; - case 706: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4505 "MachineIndependent/glslang.y" + case 721: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4615 "MachineIndependent/glslang.y" { (yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst)); } -#line 12677 "MachineIndependent/glslang_tab.cpp" +#line 13000 "MachineIndependent/glslang_tab.cpp" break; - case 707: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4509 "MachineIndependent/glslang.y" + case 722: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4619 "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 12687 "MachineIndependent/glslang_tab.cpp" +#line 13010 "MachineIndependent/glslang_tab.cpp" break; - case 708: /* spirv_type_parameter_list: spirv_type_parameter */ -#line 4516 "MachineIndependent/glslang.y" + case 723: /* spirv_type_parameter_list: spirv_type_parameter */ +#line 4626 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams); } -#line 12695 "MachineIndependent/glslang_tab.cpp" +#line 13018 "MachineIndependent/glslang_tab.cpp" break; - case 709: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ -#line 4519 "MachineIndependent/glslang.y" + case 724: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */ +#line 4629 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams)); } -#line 12703 "MachineIndependent/glslang_tab.cpp" +#line 13026 "MachineIndependent/glslang_tab.cpp" break; - case 710: /* spirv_type_parameter: constant_expression */ -#line 4524 "MachineIndependent/glslang.y" + case 725: /* spirv_type_parameter: constant_expression */ +#line 4634 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion()); } -#line 12711 "MachineIndependent/glslang_tab.cpp" +#line 13034 "MachineIndependent/glslang_tab.cpp" break; - case 711: /* spirv_type_parameter: type_specifier_nonarray */ -#line 4527 "MachineIndependent/glslang.y" + case 726: /* spirv_type_parameter: type_specifier_nonarray */ +#line 4637 "MachineIndependent/glslang.y" { (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); } -#line 12719 "MachineIndependent/glslang_tab.cpp" +#line 13042 "MachineIndependent/glslang_tab.cpp" break; - case 712: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4532 "MachineIndependent/glslang.y" + case 727: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4642 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12727 "MachineIndependent/glslang_tab.cpp" +#line 13050 "MachineIndependent/glslang_tab.cpp" break; - case 713: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ -#line 4535 "MachineIndependent/glslang.y" + case 728: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */ +#line 4645 "MachineIndependent/glslang.y" { parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq)); (yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst); } -#line 12736 "MachineIndependent/glslang_tab.cpp" +#line 13059 "MachineIndependent/glslang_tab.cpp" break; - case 714: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ -#line 4541 "MachineIndependent/glslang.y" + case 729: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */ +#line 4651 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst); } -#line 12744 "MachineIndependent/glslang_tab.cpp" +#line 13067 "MachineIndependent/glslang_tab.cpp" break; - case 715: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ -#line 4544 "MachineIndependent/glslang.y" + case 730: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */ +#line 4654 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst)); } -#line 12752 "MachineIndependent/glslang_tab.cpp" +#line 13075 "MachineIndependent/glslang_tab.cpp" break; - case 716: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ -#line 4549 "MachineIndependent/glslang.y" + case 731: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */ +#line 4659 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string); } -#line 12760 "MachineIndependent/glslang_tab.cpp" +#line 13083 "MachineIndependent/glslang_tab.cpp" break; - case 717: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ -#line 4552 "MachineIndependent/glslang.y" + case 732: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */ +#line 4662 "MachineIndependent/glslang.y" { (yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i); } -#line 12768 "MachineIndependent/glslang_tab.cpp" +#line 13091 "MachineIndependent/glslang_tab.cpp" break; -#line 12772 "MachineIndependent/glslang_tab.cpp" +#line 13095 "MachineIndependent/glslang_tab.cpp" default: break; } @@ -12992,5 +13315,5 @@ yyreturnlab: return yyresult; } -#line 4556 "MachineIndependent/glslang.y" +#line 4666 "MachineIndependent/glslang.y" diff --git a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h index cd248f19d..11932ead0 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h @@ -231,308 +231,314 @@ extern int yydebug; UCOOPMATNV = 432, /* UCOOPMATNV */ COOPMAT = 433, /* COOPMAT */ COOPVECNV = 434, /* COOPVECNV */ - HITOBJECTNV = 435, /* HITOBJECTNV */ - HITOBJECTATTRNV = 436, /* HITOBJECTATTRNV */ - TENSORLAYOUTNV = 437, /* TENSORLAYOUTNV */ - TENSORVIEWNV = 438, /* TENSORVIEWNV */ - SAMPLERCUBEARRAY = 439, /* SAMPLERCUBEARRAY */ - SAMPLERCUBEARRAYSHADOW = 440, /* SAMPLERCUBEARRAYSHADOW */ - ISAMPLERCUBEARRAY = 441, /* ISAMPLERCUBEARRAY */ - USAMPLERCUBEARRAY = 442, /* USAMPLERCUBEARRAY */ - SAMPLER1D = 443, /* SAMPLER1D */ - SAMPLER1DARRAY = 444, /* SAMPLER1DARRAY */ - SAMPLER1DARRAYSHADOW = 445, /* SAMPLER1DARRAYSHADOW */ - ISAMPLER1D = 446, /* ISAMPLER1D */ - SAMPLER1DSHADOW = 447, /* SAMPLER1DSHADOW */ - SAMPLER2DRECT = 448, /* SAMPLER2DRECT */ - SAMPLER2DRECTSHADOW = 449, /* SAMPLER2DRECTSHADOW */ - ISAMPLER2DRECT = 450, /* ISAMPLER2DRECT */ - USAMPLER2DRECT = 451, /* USAMPLER2DRECT */ - SAMPLERBUFFER = 452, /* SAMPLERBUFFER */ - ISAMPLERBUFFER = 453, /* ISAMPLERBUFFER */ - USAMPLERBUFFER = 454, /* USAMPLERBUFFER */ - SAMPLER2DMS = 455, /* SAMPLER2DMS */ - ISAMPLER2DMS = 456, /* ISAMPLER2DMS */ - USAMPLER2DMS = 457, /* USAMPLER2DMS */ - SAMPLER2DMSARRAY = 458, /* SAMPLER2DMSARRAY */ - ISAMPLER2DMSARRAY = 459, /* ISAMPLER2DMSARRAY */ - USAMPLER2DMSARRAY = 460, /* USAMPLER2DMSARRAY */ - SAMPLEREXTERNALOES = 461, /* SAMPLEREXTERNALOES */ - SAMPLEREXTERNAL2DY2YEXT = 462, /* SAMPLEREXTERNAL2DY2YEXT */ - ISAMPLER1DARRAY = 463, /* ISAMPLER1DARRAY */ - USAMPLER1D = 464, /* USAMPLER1D */ - USAMPLER1DARRAY = 465, /* USAMPLER1DARRAY */ - F16SAMPLER1D = 466, /* F16SAMPLER1D */ - F16SAMPLER2D = 467, /* F16SAMPLER2D */ - F16SAMPLER3D = 468, /* F16SAMPLER3D */ - F16SAMPLER2DRECT = 469, /* F16SAMPLER2DRECT */ - F16SAMPLERCUBE = 470, /* F16SAMPLERCUBE */ - F16SAMPLER1DARRAY = 471, /* F16SAMPLER1DARRAY */ - F16SAMPLER2DARRAY = 472, /* F16SAMPLER2DARRAY */ - F16SAMPLERCUBEARRAY = 473, /* F16SAMPLERCUBEARRAY */ - F16SAMPLERBUFFER = 474, /* F16SAMPLERBUFFER */ - F16SAMPLER2DMS = 475, /* F16SAMPLER2DMS */ - F16SAMPLER2DMSARRAY = 476, /* F16SAMPLER2DMSARRAY */ - F16SAMPLER1DSHADOW = 477, /* F16SAMPLER1DSHADOW */ - F16SAMPLER2DSHADOW = 478, /* F16SAMPLER2DSHADOW */ - F16SAMPLER1DARRAYSHADOW = 479, /* F16SAMPLER1DARRAYSHADOW */ - F16SAMPLER2DARRAYSHADOW = 480, /* F16SAMPLER2DARRAYSHADOW */ - F16SAMPLER2DRECTSHADOW = 481, /* F16SAMPLER2DRECTSHADOW */ - F16SAMPLERCUBESHADOW = 482, /* F16SAMPLERCUBESHADOW */ - F16SAMPLERCUBEARRAYSHADOW = 483, /* F16SAMPLERCUBEARRAYSHADOW */ - IMAGE1D = 484, /* IMAGE1D */ - IIMAGE1D = 485, /* IIMAGE1D */ - UIMAGE1D = 486, /* UIMAGE1D */ - IMAGE2D = 487, /* IMAGE2D */ - IIMAGE2D = 488, /* IIMAGE2D */ - UIMAGE2D = 489, /* UIMAGE2D */ - IMAGE3D = 490, /* IMAGE3D */ - IIMAGE3D = 491, /* IIMAGE3D */ - UIMAGE3D = 492, /* UIMAGE3D */ - IMAGE2DRECT = 493, /* IMAGE2DRECT */ - IIMAGE2DRECT = 494, /* IIMAGE2DRECT */ - UIMAGE2DRECT = 495, /* UIMAGE2DRECT */ - IMAGECUBE = 496, /* IMAGECUBE */ - IIMAGECUBE = 497, /* IIMAGECUBE */ - UIMAGECUBE = 498, /* UIMAGECUBE */ - IMAGEBUFFER = 499, /* IMAGEBUFFER */ - IIMAGEBUFFER = 500, /* IIMAGEBUFFER */ - UIMAGEBUFFER = 501, /* UIMAGEBUFFER */ - IMAGE1DARRAY = 502, /* IMAGE1DARRAY */ - IIMAGE1DARRAY = 503, /* IIMAGE1DARRAY */ - UIMAGE1DARRAY = 504, /* UIMAGE1DARRAY */ - IMAGE2DARRAY = 505, /* IMAGE2DARRAY */ - IIMAGE2DARRAY = 506, /* IIMAGE2DARRAY */ - UIMAGE2DARRAY = 507, /* UIMAGE2DARRAY */ - IMAGECUBEARRAY = 508, /* IMAGECUBEARRAY */ - IIMAGECUBEARRAY = 509, /* IIMAGECUBEARRAY */ - UIMAGECUBEARRAY = 510, /* UIMAGECUBEARRAY */ - IMAGE2DMS = 511, /* IMAGE2DMS */ - IIMAGE2DMS = 512, /* IIMAGE2DMS */ - UIMAGE2DMS = 513, /* UIMAGE2DMS */ - IMAGE2DMSARRAY = 514, /* IMAGE2DMSARRAY */ - IIMAGE2DMSARRAY = 515, /* IIMAGE2DMSARRAY */ - UIMAGE2DMSARRAY = 516, /* UIMAGE2DMSARRAY */ - F16IMAGE1D = 517, /* F16IMAGE1D */ - F16IMAGE2D = 518, /* F16IMAGE2D */ - F16IMAGE3D = 519, /* F16IMAGE3D */ - F16IMAGE2DRECT = 520, /* F16IMAGE2DRECT */ - F16IMAGECUBE = 521, /* F16IMAGECUBE */ - F16IMAGE1DARRAY = 522, /* F16IMAGE1DARRAY */ - F16IMAGE2DARRAY = 523, /* F16IMAGE2DARRAY */ - F16IMAGECUBEARRAY = 524, /* F16IMAGECUBEARRAY */ - F16IMAGEBUFFER = 525, /* F16IMAGEBUFFER */ - F16IMAGE2DMS = 526, /* F16IMAGE2DMS */ - F16IMAGE2DMSARRAY = 527, /* F16IMAGE2DMSARRAY */ - I64IMAGE1D = 528, /* I64IMAGE1D */ - U64IMAGE1D = 529, /* U64IMAGE1D */ - I64IMAGE2D = 530, /* I64IMAGE2D */ - U64IMAGE2D = 531, /* U64IMAGE2D */ - I64IMAGE3D = 532, /* I64IMAGE3D */ - U64IMAGE3D = 533, /* U64IMAGE3D */ - I64IMAGE2DRECT = 534, /* I64IMAGE2DRECT */ - U64IMAGE2DRECT = 535, /* U64IMAGE2DRECT */ - I64IMAGECUBE = 536, /* I64IMAGECUBE */ - U64IMAGECUBE = 537, /* U64IMAGECUBE */ - I64IMAGEBUFFER = 538, /* I64IMAGEBUFFER */ - U64IMAGEBUFFER = 539, /* U64IMAGEBUFFER */ - I64IMAGE1DARRAY = 540, /* I64IMAGE1DARRAY */ - U64IMAGE1DARRAY = 541, /* U64IMAGE1DARRAY */ - I64IMAGE2DARRAY = 542, /* I64IMAGE2DARRAY */ - U64IMAGE2DARRAY = 543, /* U64IMAGE2DARRAY */ - I64IMAGECUBEARRAY = 544, /* I64IMAGECUBEARRAY */ - U64IMAGECUBEARRAY = 545, /* U64IMAGECUBEARRAY */ - I64IMAGE2DMS = 546, /* I64IMAGE2DMS */ - U64IMAGE2DMS = 547, /* U64IMAGE2DMS */ - I64IMAGE2DMSARRAY = 548, /* I64IMAGE2DMSARRAY */ - U64IMAGE2DMSARRAY = 549, /* U64IMAGE2DMSARRAY */ - TEXTURECUBEARRAY = 550, /* TEXTURECUBEARRAY */ - ITEXTURECUBEARRAY = 551, /* ITEXTURECUBEARRAY */ - UTEXTURECUBEARRAY = 552, /* UTEXTURECUBEARRAY */ - TEXTURE1D = 553, /* TEXTURE1D */ - ITEXTURE1D = 554, /* ITEXTURE1D */ - UTEXTURE1D = 555, /* UTEXTURE1D */ - TEXTURE1DARRAY = 556, /* TEXTURE1DARRAY */ - ITEXTURE1DARRAY = 557, /* ITEXTURE1DARRAY */ - UTEXTURE1DARRAY = 558, /* UTEXTURE1DARRAY */ - TEXTURE2DRECT = 559, /* TEXTURE2DRECT */ - ITEXTURE2DRECT = 560, /* ITEXTURE2DRECT */ - UTEXTURE2DRECT = 561, /* UTEXTURE2DRECT */ - TEXTUREBUFFER = 562, /* TEXTUREBUFFER */ - ITEXTUREBUFFER = 563, /* ITEXTUREBUFFER */ - UTEXTUREBUFFER = 564, /* UTEXTUREBUFFER */ - TEXTURE2DMS = 565, /* TEXTURE2DMS */ - ITEXTURE2DMS = 566, /* ITEXTURE2DMS */ - UTEXTURE2DMS = 567, /* UTEXTURE2DMS */ - TEXTURE2DMSARRAY = 568, /* TEXTURE2DMSARRAY */ - ITEXTURE2DMSARRAY = 569, /* ITEXTURE2DMSARRAY */ - UTEXTURE2DMSARRAY = 570, /* UTEXTURE2DMSARRAY */ - F16TEXTURE1D = 571, /* F16TEXTURE1D */ - F16TEXTURE2D = 572, /* F16TEXTURE2D */ - F16TEXTURE3D = 573, /* F16TEXTURE3D */ - F16TEXTURE2DRECT = 574, /* F16TEXTURE2DRECT */ - F16TEXTURECUBE = 575, /* F16TEXTURECUBE */ - F16TEXTURE1DARRAY = 576, /* F16TEXTURE1DARRAY */ - F16TEXTURE2DARRAY = 577, /* F16TEXTURE2DARRAY */ - F16TEXTURECUBEARRAY = 578, /* F16TEXTURECUBEARRAY */ - F16TEXTUREBUFFER = 579, /* F16TEXTUREBUFFER */ - F16TEXTURE2DMS = 580, /* F16TEXTURE2DMS */ - F16TEXTURE2DMSARRAY = 581, /* F16TEXTURE2DMSARRAY */ - SUBPASSINPUT = 582, /* SUBPASSINPUT */ - SUBPASSINPUTMS = 583, /* SUBPASSINPUTMS */ - ISUBPASSINPUT = 584, /* ISUBPASSINPUT */ - ISUBPASSINPUTMS = 585, /* ISUBPASSINPUTMS */ - USUBPASSINPUT = 586, /* USUBPASSINPUT */ - USUBPASSINPUTMS = 587, /* USUBPASSINPUTMS */ - F16SUBPASSINPUT = 588, /* F16SUBPASSINPUT */ - F16SUBPASSINPUTMS = 589, /* F16SUBPASSINPUTMS */ - SPIRV_INSTRUCTION = 590, /* SPIRV_INSTRUCTION */ - SPIRV_EXECUTION_MODE = 591, /* SPIRV_EXECUTION_MODE */ - SPIRV_EXECUTION_MODE_ID = 592, /* SPIRV_EXECUTION_MODE_ID */ - SPIRV_DECORATE = 593, /* SPIRV_DECORATE */ - SPIRV_DECORATE_ID = 594, /* SPIRV_DECORATE_ID */ - SPIRV_DECORATE_STRING = 595, /* SPIRV_DECORATE_STRING */ - SPIRV_TYPE = 596, /* SPIRV_TYPE */ - SPIRV_STORAGE_CLASS = 597, /* SPIRV_STORAGE_CLASS */ - SPIRV_BY_REFERENCE = 598, /* SPIRV_BY_REFERENCE */ - SPIRV_LITERAL = 599, /* SPIRV_LITERAL */ - ATTACHMENTEXT = 600, /* ATTACHMENTEXT */ - IATTACHMENTEXT = 601, /* IATTACHMENTEXT */ - UATTACHMENTEXT = 602, /* UATTACHMENTEXT */ - LEFT_OP = 603, /* LEFT_OP */ - RIGHT_OP = 604, /* RIGHT_OP */ - INC_OP = 605, /* INC_OP */ - DEC_OP = 606, /* DEC_OP */ - LE_OP = 607, /* LE_OP */ - GE_OP = 608, /* GE_OP */ - EQ_OP = 609, /* EQ_OP */ - NE_OP = 610, /* NE_OP */ - AND_OP = 611, /* AND_OP */ - OR_OP = 612, /* OR_OP */ - XOR_OP = 613, /* XOR_OP */ - MUL_ASSIGN = 614, /* MUL_ASSIGN */ - DIV_ASSIGN = 615, /* DIV_ASSIGN */ - ADD_ASSIGN = 616, /* ADD_ASSIGN */ - MOD_ASSIGN = 617, /* MOD_ASSIGN */ - LEFT_ASSIGN = 618, /* LEFT_ASSIGN */ - RIGHT_ASSIGN = 619, /* RIGHT_ASSIGN */ - AND_ASSIGN = 620, /* AND_ASSIGN */ - XOR_ASSIGN = 621, /* XOR_ASSIGN */ - OR_ASSIGN = 622, /* OR_ASSIGN */ - SUB_ASSIGN = 623, /* SUB_ASSIGN */ - STRING_LITERAL = 624, /* STRING_LITERAL */ - LEFT_PAREN = 625, /* LEFT_PAREN */ - RIGHT_PAREN = 626, /* RIGHT_PAREN */ - LEFT_BRACKET = 627, /* LEFT_BRACKET */ - RIGHT_BRACKET = 628, /* RIGHT_BRACKET */ - LEFT_BRACE = 629, /* LEFT_BRACE */ - RIGHT_BRACE = 630, /* RIGHT_BRACE */ - DOT = 631, /* DOT */ - COMMA = 632, /* COMMA */ - COLON = 633, /* COLON */ - EQUAL = 634, /* EQUAL */ - SEMICOLON = 635, /* SEMICOLON */ - BANG = 636, /* BANG */ - DASH = 637, /* DASH */ - TILDE = 638, /* TILDE */ - PLUS = 639, /* PLUS */ - STAR = 640, /* STAR */ - SLASH = 641, /* SLASH */ - PERCENT = 642, /* PERCENT */ - LEFT_ANGLE = 643, /* LEFT_ANGLE */ - RIGHT_ANGLE = 644, /* RIGHT_ANGLE */ - VERTICAL_BAR = 645, /* VERTICAL_BAR */ - CARET = 646, /* CARET */ - AMPERSAND = 647, /* AMPERSAND */ - QUESTION = 648, /* QUESTION */ - INVARIANT = 649, /* INVARIANT */ - HIGH_PRECISION = 650, /* HIGH_PRECISION */ - MEDIUM_PRECISION = 651, /* MEDIUM_PRECISION */ - LOW_PRECISION = 652, /* LOW_PRECISION */ - PRECISION = 653, /* PRECISION */ - PACKED = 654, /* PACKED */ - RESOURCE = 655, /* RESOURCE */ - SUPERP = 656, /* SUPERP */ - FLOATCONSTANT = 657, /* FLOATCONSTANT */ - INTCONSTANT = 658, /* INTCONSTANT */ - UINTCONSTANT = 659, /* UINTCONSTANT */ - BOOLCONSTANT = 660, /* BOOLCONSTANT */ - IDENTIFIER = 661, /* IDENTIFIER */ - TYPE_NAME = 662, /* TYPE_NAME */ - CENTROID = 663, /* CENTROID */ - IN = 664, /* IN */ - OUT = 665, /* OUT */ - INOUT = 666, /* INOUT */ - STRUCT = 667, /* STRUCT */ - VOID = 668, /* VOID */ - WHILE = 669, /* WHILE */ - BREAK = 670, /* BREAK */ - CONTINUE = 671, /* CONTINUE */ - DO = 672, /* DO */ - ELSE = 673, /* ELSE */ - FOR = 674, /* FOR */ - IF = 675, /* IF */ - DISCARD = 676, /* DISCARD */ - RETURN = 677, /* RETURN */ - SWITCH = 678, /* SWITCH */ - CASE = 679, /* CASE */ - DEFAULT = 680, /* DEFAULT */ - TERMINATE_INVOCATION = 681, /* TERMINATE_INVOCATION */ - TERMINATE_RAY = 682, /* TERMINATE_RAY */ - IGNORE_INTERSECTION = 683, /* IGNORE_INTERSECTION */ - UNIFORM = 684, /* UNIFORM */ - SHARED = 685, /* SHARED */ - BUFFER = 686, /* BUFFER */ - TILEIMAGEEXT = 687, /* TILEIMAGEEXT */ - FLAT = 688, /* FLAT */ - SMOOTH = 689, /* SMOOTH */ - LAYOUT = 690, /* LAYOUT */ - DOUBLECONSTANT = 691, /* DOUBLECONSTANT */ - INT16CONSTANT = 692, /* INT16CONSTANT */ - UINT16CONSTANT = 693, /* UINT16CONSTANT */ - FLOAT16CONSTANT = 694, /* FLOAT16CONSTANT */ - INT32CONSTANT = 695, /* INT32CONSTANT */ - UINT32CONSTANT = 696, /* UINT32CONSTANT */ - INT64CONSTANT = 697, /* INT64CONSTANT */ - UINT64CONSTANT = 698, /* UINT64CONSTANT */ - SUBROUTINE = 699, /* SUBROUTINE */ - DEMOTE = 700, /* DEMOTE */ - FUNCTION = 701, /* FUNCTION */ - PAYLOADNV = 702, /* PAYLOADNV */ - PAYLOADINNV = 703, /* PAYLOADINNV */ - HITATTRNV = 704, /* HITATTRNV */ - CALLDATANV = 705, /* CALLDATANV */ - CALLDATAINNV = 706, /* CALLDATAINNV */ - PAYLOADEXT = 707, /* PAYLOADEXT */ - PAYLOADINEXT = 708, /* PAYLOADINEXT */ - HITATTREXT = 709, /* HITATTREXT */ - CALLDATAEXT = 710, /* CALLDATAEXT */ - CALLDATAINEXT = 711, /* CALLDATAINEXT */ - PATCH = 712, /* PATCH */ - SAMPLE = 713, /* SAMPLE */ - NONUNIFORM = 714, /* NONUNIFORM */ - COHERENT = 715, /* COHERENT */ - VOLATILE = 716, /* VOLATILE */ - RESTRICT = 717, /* RESTRICT */ - READONLY = 718, /* READONLY */ - WRITEONLY = 719, /* WRITEONLY */ - NONTEMPORAL = 720, /* NONTEMPORAL */ - DEVICECOHERENT = 721, /* DEVICECOHERENT */ - QUEUEFAMILYCOHERENT = 722, /* QUEUEFAMILYCOHERENT */ - WORKGROUPCOHERENT = 723, /* WORKGROUPCOHERENT */ - SUBGROUPCOHERENT = 724, /* SUBGROUPCOHERENT */ - NONPRIVATE = 725, /* NONPRIVATE */ - SHADERCALLCOHERENT = 726, /* SHADERCALLCOHERENT */ - NOPERSPECTIVE = 727, /* NOPERSPECTIVE */ - EXPLICITINTERPAMD = 728, /* EXPLICITINTERPAMD */ - PERVERTEXEXT = 729, /* PERVERTEXEXT */ - PERVERTEXNV = 730, /* PERVERTEXNV */ - PERPRIMITIVENV = 731, /* PERPRIMITIVENV */ - PERVIEWNV = 732, /* PERVIEWNV */ - PERTASKNV = 733, /* PERTASKNV */ - PERPRIMITIVEEXT = 734, /* PERPRIMITIVEEXT */ - TASKPAYLOADWORKGROUPEXT = 735, /* TASKPAYLOADWORKGROUPEXT */ - PRECISE = 736 /* PRECISE */ + VECTOR = 435, /* VECTOR */ + HITOBJECTNV = 436, /* HITOBJECTNV */ + HITOBJECTATTRNV = 437, /* HITOBJECTATTRNV */ + HITOBJECTEXT = 438, /* HITOBJECTEXT */ + HITOBJECTATTREXT = 439, /* HITOBJECTATTREXT */ + TENSORLAYOUTNV = 440, /* TENSORLAYOUTNV */ + TENSORVIEWNV = 441, /* TENSORVIEWNV */ + TENSORARM = 442, /* TENSORARM */ + SAMPLERCUBEARRAY = 443, /* SAMPLERCUBEARRAY */ + SAMPLERCUBEARRAYSHADOW = 444, /* SAMPLERCUBEARRAYSHADOW */ + ISAMPLERCUBEARRAY = 445, /* ISAMPLERCUBEARRAY */ + USAMPLERCUBEARRAY = 446, /* USAMPLERCUBEARRAY */ + SAMPLER1D = 447, /* SAMPLER1D */ + SAMPLER1DARRAY = 448, /* SAMPLER1DARRAY */ + SAMPLER1DARRAYSHADOW = 449, /* SAMPLER1DARRAYSHADOW */ + ISAMPLER1D = 450, /* ISAMPLER1D */ + SAMPLER1DSHADOW = 451, /* SAMPLER1DSHADOW */ + SAMPLER2DRECT = 452, /* SAMPLER2DRECT */ + SAMPLER2DRECTSHADOW = 453, /* SAMPLER2DRECTSHADOW */ + ISAMPLER2DRECT = 454, /* ISAMPLER2DRECT */ + USAMPLER2DRECT = 455, /* USAMPLER2DRECT */ + SAMPLERBUFFER = 456, /* SAMPLERBUFFER */ + ISAMPLERBUFFER = 457, /* ISAMPLERBUFFER */ + USAMPLERBUFFER = 458, /* USAMPLERBUFFER */ + SAMPLER2DMS = 459, /* SAMPLER2DMS */ + ISAMPLER2DMS = 460, /* ISAMPLER2DMS */ + USAMPLER2DMS = 461, /* USAMPLER2DMS */ + SAMPLER2DMSARRAY = 462, /* SAMPLER2DMSARRAY */ + ISAMPLER2DMSARRAY = 463, /* ISAMPLER2DMSARRAY */ + USAMPLER2DMSARRAY = 464, /* USAMPLER2DMSARRAY */ + SAMPLEREXTERNALOES = 465, /* SAMPLEREXTERNALOES */ + SAMPLEREXTERNAL2DY2YEXT = 466, /* SAMPLEREXTERNAL2DY2YEXT */ + ISAMPLER1DARRAY = 467, /* ISAMPLER1DARRAY */ + USAMPLER1D = 468, /* USAMPLER1D */ + USAMPLER1DARRAY = 469, /* USAMPLER1DARRAY */ + F16SAMPLER1D = 470, /* F16SAMPLER1D */ + F16SAMPLER2D = 471, /* F16SAMPLER2D */ + F16SAMPLER3D = 472, /* F16SAMPLER3D */ + F16SAMPLER2DRECT = 473, /* F16SAMPLER2DRECT */ + F16SAMPLERCUBE = 474, /* F16SAMPLERCUBE */ + F16SAMPLER1DARRAY = 475, /* F16SAMPLER1DARRAY */ + F16SAMPLER2DARRAY = 476, /* F16SAMPLER2DARRAY */ + F16SAMPLERCUBEARRAY = 477, /* F16SAMPLERCUBEARRAY */ + F16SAMPLERBUFFER = 478, /* F16SAMPLERBUFFER */ + F16SAMPLER2DMS = 479, /* F16SAMPLER2DMS */ + F16SAMPLER2DMSARRAY = 480, /* F16SAMPLER2DMSARRAY */ + F16SAMPLER1DSHADOW = 481, /* F16SAMPLER1DSHADOW */ + F16SAMPLER2DSHADOW = 482, /* F16SAMPLER2DSHADOW */ + F16SAMPLER1DARRAYSHADOW = 483, /* F16SAMPLER1DARRAYSHADOW */ + F16SAMPLER2DARRAYSHADOW = 484, /* F16SAMPLER2DARRAYSHADOW */ + F16SAMPLER2DRECTSHADOW = 485, /* F16SAMPLER2DRECTSHADOW */ + F16SAMPLERCUBESHADOW = 486, /* F16SAMPLERCUBESHADOW */ + F16SAMPLERCUBEARRAYSHADOW = 487, /* F16SAMPLERCUBEARRAYSHADOW */ + IMAGE1D = 488, /* IMAGE1D */ + IIMAGE1D = 489, /* IIMAGE1D */ + UIMAGE1D = 490, /* UIMAGE1D */ + IMAGE2D = 491, /* IMAGE2D */ + IIMAGE2D = 492, /* IIMAGE2D */ + UIMAGE2D = 493, /* UIMAGE2D */ + IMAGE3D = 494, /* IMAGE3D */ + IIMAGE3D = 495, /* IIMAGE3D */ + UIMAGE3D = 496, /* UIMAGE3D */ + IMAGE2DRECT = 497, /* IMAGE2DRECT */ + IIMAGE2DRECT = 498, /* IIMAGE2DRECT */ + UIMAGE2DRECT = 499, /* UIMAGE2DRECT */ + IMAGECUBE = 500, /* IMAGECUBE */ + IIMAGECUBE = 501, /* IIMAGECUBE */ + UIMAGECUBE = 502, /* UIMAGECUBE */ + IMAGEBUFFER = 503, /* IMAGEBUFFER */ + IIMAGEBUFFER = 504, /* IIMAGEBUFFER */ + UIMAGEBUFFER = 505, /* UIMAGEBUFFER */ + IMAGE1DARRAY = 506, /* IMAGE1DARRAY */ + IIMAGE1DARRAY = 507, /* IIMAGE1DARRAY */ + UIMAGE1DARRAY = 508, /* UIMAGE1DARRAY */ + IMAGE2DARRAY = 509, /* IMAGE2DARRAY */ + IIMAGE2DARRAY = 510, /* IIMAGE2DARRAY */ + UIMAGE2DARRAY = 511, /* UIMAGE2DARRAY */ + IMAGECUBEARRAY = 512, /* IMAGECUBEARRAY */ + IIMAGECUBEARRAY = 513, /* IIMAGECUBEARRAY */ + UIMAGECUBEARRAY = 514, /* UIMAGECUBEARRAY */ + IMAGE2DMS = 515, /* IMAGE2DMS */ + IIMAGE2DMS = 516, /* IIMAGE2DMS */ + UIMAGE2DMS = 517, /* UIMAGE2DMS */ + IMAGE2DMSARRAY = 518, /* IMAGE2DMSARRAY */ + IIMAGE2DMSARRAY = 519, /* IIMAGE2DMSARRAY */ + UIMAGE2DMSARRAY = 520, /* UIMAGE2DMSARRAY */ + F16IMAGE1D = 521, /* F16IMAGE1D */ + F16IMAGE2D = 522, /* F16IMAGE2D */ + F16IMAGE3D = 523, /* F16IMAGE3D */ + F16IMAGE2DRECT = 524, /* F16IMAGE2DRECT */ + F16IMAGECUBE = 525, /* F16IMAGECUBE */ + F16IMAGE1DARRAY = 526, /* F16IMAGE1DARRAY */ + F16IMAGE2DARRAY = 527, /* F16IMAGE2DARRAY */ + F16IMAGECUBEARRAY = 528, /* F16IMAGECUBEARRAY */ + F16IMAGEBUFFER = 529, /* F16IMAGEBUFFER */ + F16IMAGE2DMS = 530, /* F16IMAGE2DMS */ + F16IMAGE2DMSARRAY = 531, /* F16IMAGE2DMSARRAY */ + I64IMAGE1D = 532, /* I64IMAGE1D */ + U64IMAGE1D = 533, /* U64IMAGE1D */ + I64IMAGE2D = 534, /* I64IMAGE2D */ + U64IMAGE2D = 535, /* U64IMAGE2D */ + I64IMAGE3D = 536, /* I64IMAGE3D */ + U64IMAGE3D = 537, /* U64IMAGE3D */ + I64IMAGE2DRECT = 538, /* I64IMAGE2DRECT */ + U64IMAGE2DRECT = 539, /* U64IMAGE2DRECT */ + I64IMAGECUBE = 540, /* I64IMAGECUBE */ + U64IMAGECUBE = 541, /* U64IMAGECUBE */ + I64IMAGEBUFFER = 542, /* I64IMAGEBUFFER */ + U64IMAGEBUFFER = 543, /* U64IMAGEBUFFER */ + I64IMAGE1DARRAY = 544, /* I64IMAGE1DARRAY */ + U64IMAGE1DARRAY = 545, /* U64IMAGE1DARRAY */ + I64IMAGE2DARRAY = 546, /* I64IMAGE2DARRAY */ + U64IMAGE2DARRAY = 547, /* U64IMAGE2DARRAY */ + I64IMAGECUBEARRAY = 548, /* I64IMAGECUBEARRAY */ + U64IMAGECUBEARRAY = 549, /* U64IMAGECUBEARRAY */ + I64IMAGE2DMS = 550, /* I64IMAGE2DMS */ + U64IMAGE2DMS = 551, /* U64IMAGE2DMS */ + I64IMAGE2DMSARRAY = 552, /* I64IMAGE2DMSARRAY */ + U64IMAGE2DMSARRAY = 553, /* U64IMAGE2DMSARRAY */ + TEXTURECUBEARRAY = 554, /* TEXTURECUBEARRAY */ + ITEXTURECUBEARRAY = 555, /* ITEXTURECUBEARRAY */ + UTEXTURECUBEARRAY = 556, /* UTEXTURECUBEARRAY */ + TEXTURE1D = 557, /* TEXTURE1D */ + ITEXTURE1D = 558, /* ITEXTURE1D */ + UTEXTURE1D = 559, /* UTEXTURE1D */ + TEXTURE1DARRAY = 560, /* TEXTURE1DARRAY */ + ITEXTURE1DARRAY = 561, /* ITEXTURE1DARRAY */ + UTEXTURE1DARRAY = 562, /* UTEXTURE1DARRAY */ + TEXTURE2DRECT = 563, /* TEXTURE2DRECT */ + ITEXTURE2DRECT = 564, /* ITEXTURE2DRECT */ + UTEXTURE2DRECT = 565, /* UTEXTURE2DRECT */ + TEXTUREBUFFER = 566, /* TEXTUREBUFFER */ + ITEXTUREBUFFER = 567, /* ITEXTUREBUFFER */ + UTEXTUREBUFFER = 568, /* UTEXTUREBUFFER */ + TEXTURE2DMS = 569, /* TEXTURE2DMS */ + ITEXTURE2DMS = 570, /* ITEXTURE2DMS */ + UTEXTURE2DMS = 571, /* UTEXTURE2DMS */ + TEXTURE2DMSARRAY = 572, /* TEXTURE2DMSARRAY */ + ITEXTURE2DMSARRAY = 573, /* ITEXTURE2DMSARRAY */ + UTEXTURE2DMSARRAY = 574, /* UTEXTURE2DMSARRAY */ + F16TEXTURE1D = 575, /* F16TEXTURE1D */ + F16TEXTURE2D = 576, /* F16TEXTURE2D */ + F16TEXTURE3D = 577, /* F16TEXTURE3D */ + F16TEXTURE2DRECT = 578, /* F16TEXTURE2DRECT */ + F16TEXTURECUBE = 579, /* F16TEXTURECUBE */ + F16TEXTURE1DARRAY = 580, /* F16TEXTURE1DARRAY */ + F16TEXTURE2DARRAY = 581, /* F16TEXTURE2DARRAY */ + F16TEXTURECUBEARRAY = 582, /* F16TEXTURECUBEARRAY */ + F16TEXTUREBUFFER = 583, /* F16TEXTUREBUFFER */ + F16TEXTURE2DMS = 584, /* F16TEXTURE2DMS */ + F16TEXTURE2DMSARRAY = 585, /* F16TEXTURE2DMSARRAY */ + SUBPASSINPUT = 586, /* SUBPASSINPUT */ + SUBPASSINPUTMS = 587, /* SUBPASSINPUTMS */ + ISUBPASSINPUT = 588, /* ISUBPASSINPUT */ + ISUBPASSINPUTMS = 589, /* ISUBPASSINPUTMS */ + USUBPASSINPUT = 590, /* USUBPASSINPUT */ + USUBPASSINPUTMS = 591, /* USUBPASSINPUTMS */ + F16SUBPASSINPUT = 592, /* F16SUBPASSINPUT */ + F16SUBPASSINPUTMS = 593, /* F16SUBPASSINPUTMS */ + SPIRV_INSTRUCTION = 594, /* SPIRV_INSTRUCTION */ + SPIRV_EXECUTION_MODE = 595, /* SPIRV_EXECUTION_MODE */ + SPIRV_EXECUTION_MODE_ID = 596, /* SPIRV_EXECUTION_MODE_ID */ + SPIRV_DECORATE = 597, /* SPIRV_DECORATE */ + SPIRV_DECORATE_ID = 598, /* SPIRV_DECORATE_ID */ + SPIRV_DECORATE_STRING = 599, /* SPIRV_DECORATE_STRING */ + SPIRV_TYPE = 600, /* SPIRV_TYPE */ + SPIRV_STORAGE_CLASS = 601, /* SPIRV_STORAGE_CLASS */ + SPIRV_BY_REFERENCE = 602, /* SPIRV_BY_REFERENCE */ + SPIRV_LITERAL = 603, /* SPIRV_LITERAL */ + ATTACHMENTEXT = 604, /* ATTACHMENTEXT */ + IATTACHMENTEXT = 605, /* IATTACHMENTEXT */ + UATTACHMENTEXT = 606, /* UATTACHMENTEXT */ + LEFT_OP = 607, /* LEFT_OP */ + RIGHT_OP = 608, /* RIGHT_OP */ + INC_OP = 609, /* INC_OP */ + DEC_OP = 610, /* DEC_OP */ + LE_OP = 611, /* LE_OP */ + GE_OP = 612, /* GE_OP */ + EQ_OP = 613, /* EQ_OP */ + NE_OP = 614, /* NE_OP */ + AND_OP = 615, /* AND_OP */ + OR_OP = 616, /* OR_OP */ + XOR_OP = 617, /* XOR_OP */ + MUL_ASSIGN = 618, /* MUL_ASSIGN */ + DIV_ASSIGN = 619, /* DIV_ASSIGN */ + ADD_ASSIGN = 620, /* ADD_ASSIGN */ + MOD_ASSIGN = 621, /* MOD_ASSIGN */ + LEFT_ASSIGN = 622, /* LEFT_ASSIGN */ + RIGHT_ASSIGN = 623, /* RIGHT_ASSIGN */ + AND_ASSIGN = 624, /* AND_ASSIGN */ + XOR_ASSIGN = 625, /* XOR_ASSIGN */ + OR_ASSIGN = 626, /* OR_ASSIGN */ + SUB_ASSIGN = 627, /* SUB_ASSIGN */ + STRING_LITERAL = 628, /* STRING_LITERAL */ + LEFT_PAREN = 629, /* LEFT_PAREN */ + RIGHT_PAREN = 630, /* RIGHT_PAREN */ + LEFT_BRACKET = 631, /* LEFT_BRACKET */ + RIGHT_BRACKET = 632, /* RIGHT_BRACKET */ + LEFT_BRACE = 633, /* LEFT_BRACE */ + RIGHT_BRACE = 634, /* RIGHT_BRACE */ + DOT = 635, /* DOT */ + COMMA = 636, /* COMMA */ + COLON = 637, /* COLON */ + EQUAL = 638, /* EQUAL */ + SEMICOLON = 639, /* SEMICOLON */ + BANG = 640, /* BANG */ + DASH = 641, /* DASH */ + TILDE = 642, /* TILDE */ + PLUS = 643, /* PLUS */ + STAR = 644, /* STAR */ + SLASH = 645, /* SLASH */ + PERCENT = 646, /* PERCENT */ + LEFT_ANGLE = 647, /* LEFT_ANGLE */ + RIGHT_ANGLE = 648, /* RIGHT_ANGLE */ + VERTICAL_BAR = 649, /* VERTICAL_BAR */ + CARET = 650, /* CARET */ + AMPERSAND = 651, /* AMPERSAND */ + QUESTION = 652, /* QUESTION */ + INVARIANT = 653, /* INVARIANT */ + HIGH_PRECISION = 654, /* HIGH_PRECISION */ + MEDIUM_PRECISION = 655, /* MEDIUM_PRECISION */ + LOW_PRECISION = 656, /* LOW_PRECISION */ + PRECISION = 657, /* PRECISION */ + PACKED = 658, /* PACKED */ + RESOURCE = 659, /* RESOURCE */ + SUPERP = 660, /* SUPERP */ + FLOATCONSTANT = 661, /* FLOATCONSTANT */ + INTCONSTANT = 662, /* INTCONSTANT */ + UINTCONSTANT = 663, /* UINTCONSTANT */ + BOOLCONSTANT = 664, /* BOOLCONSTANT */ + IDENTIFIER = 665, /* IDENTIFIER */ + TYPE_NAME = 666, /* TYPE_NAME */ + CENTROID = 667, /* CENTROID */ + IN = 668, /* IN */ + OUT = 669, /* OUT */ + INOUT = 670, /* INOUT */ + STRUCT = 671, /* STRUCT */ + VOID = 672, /* VOID */ + WHILE = 673, /* WHILE */ + BREAK = 674, /* BREAK */ + CONTINUE = 675, /* CONTINUE */ + DO = 676, /* DO */ + ELSE = 677, /* ELSE */ + FOR = 678, /* FOR */ + IF = 679, /* IF */ + DISCARD = 680, /* DISCARD */ + RETURN = 681, /* RETURN */ + SWITCH = 682, /* SWITCH */ + CASE = 683, /* CASE */ + DEFAULT = 684, /* DEFAULT */ + TERMINATE_INVOCATION = 685, /* TERMINATE_INVOCATION */ + TERMINATE_RAY = 686, /* TERMINATE_RAY */ + IGNORE_INTERSECTION = 687, /* IGNORE_INTERSECTION */ + UNIFORM = 688, /* UNIFORM */ + SHARED = 689, /* SHARED */ + BUFFER = 690, /* BUFFER */ + TILEIMAGEEXT = 691, /* TILEIMAGEEXT */ + FLAT = 692, /* FLAT */ + SMOOTH = 693, /* SMOOTH */ + LAYOUT = 694, /* LAYOUT */ + DOUBLECONSTANT = 695, /* DOUBLECONSTANT */ + INT16CONSTANT = 696, /* INT16CONSTANT */ + UINT16CONSTANT = 697, /* UINT16CONSTANT */ + FLOAT16CONSTANT = 698, /* FLOAT16CONSTANT */ + INT32CONSTANT = 699, /* INT32CONSTANT */ + UINT32CONSTANT = 700, /* UINT32CONSTANT */ + INT64CONSTANT = 701, /* INT64CONSTANT */ + UINT64CONSTANT = 702, /* UINT64CONSTANT */ + SUBROUTINE = 703, /* SUBROUTINE */ + DEMOTE = 704, /* DEMOTE */ + FUNCTION = 705, /* FUNCTION */ + PAYLOADNV = 706, /* PAYLOADNV */ + PAYLOADINNV = 707, /* PAYLOADINNV */ + HITATTRNV = 708, /* HITATTRNV */ + CALLDATANV = 709, /* CALLDATANV */ + CALLDATAINNV = 710, /* CALLDATAINNV */ + PAYLOADEXT = 711, /* PAYLOADEXT */ + PAYLOADINEXT = 712, /* PAYLOADINEXT */ + HITATTREXT = 713, /* HITATTREXT */ + CALLDATAEXT = 714, /* CALLDATAEXT */ + CALLDATAINEXT = 715, /* CALLDATAINEXT */ + PATCH = 716, /* PATCH */ + SAMPLE = 717, /* SAMPLE */ + NONUNIFORM = 718, /* NONUNIFORM */ + RESOURCEHEAP = 719, /* RESOURCEHEAP */ + SAMPLERHEAP = 720, /* SAMPLERHEAP */ + COHERENT = 721, /* COHERENT */ + VOLATILE = 722, /* VOLATILE */ + RESTRICT = 723, /* RESTRICT */ + READONLY = 724, /* READONLY */ + WRITEONLY = 725, /* WRITEONLY */ + NONTEMPORAL = 726, /* NONTEMPORAL */ + DEVICECOHERENT = 727, /* DEVICECOHERENT */ + QUEUEFAMILYCOHERENT = 728, /* QUEUEFAMILYCOHERENT */ + WORKGROUPCOHERENT = 729, /* WORKGROUPCOHERENT */ + SUBGROUPCOHERENT = 730, /* SUBGROUPCOHERENT */ + NONPRIVATE = 731, /* NONPRIVATE */ + SHADERCALLCOHERENT = 732, /* SHADERCALLCOHERENT */ + NOPERSPECTIVE = 733, /* NOPERSPECTIVE */ + EXPLICITINTERPAMD = 734, /* EXPLICITINTERPAMD */ + PERVERTEXEXT = 735, /* PERVERTEXEXT */ + PERVERTEXNV = 736, /* PERVERTEXNV */ + PERPRIMITIVENV = 737, /* PERPRIMITIVENV */ + PERVIEWNV = 738, /* PERVIEWNV */ + PERTASKNV = 739, /* PERTASKNV */ + PERPRIMITIVEEXT = 740, /* PERPRIMITIVEEXT */ + TASKPAYLOADWORKGROUPEXT = 741, /* TASKPAYLOADWORKGROUPEXT */ + PRECISE = 742 /* PRECISE */ }; typedef enum yytokentype yytoken_kind_t; #endif @@ -580,7 +586,7 @@ union YYSTYPE glslang::TTypeParameters* typeParameters; } interm; -#line 584 "MachineIndependent/glslang_tab.cpp.h" +#line 590 "MachineIndependent/glslang_tab.cpp.h" }; typedef union YYSTYPE YYSTYPE; diff --git a/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp b/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp index 9d7c1dc55..7de6066d5 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp @@ -81,6 +81,7 @@ public: virtual bool visitLoop(TVisit, TIntermLoop* node); virtual bool visitBranch(TVisit, TIntermBranch* node); virtual bool visitSwitch(TVisit, TIntermSwitch* node); + virtual bool visitVariableDecl(TVisit, TIntermVariableDecl* node); TInfoSink& infoSink; protected: @@ -658,6 +659,11 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructCooperativeVectorNV: out.debug << "Construct cooperative vector NV"; break; case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break; + case EOpBitCastArrayQCOM: out.debug << "Bitcast To Array QCOM"; break; + case EOpExtractSubArrayQCOM: out.debug << "Extract Subarray QCOM"; break; + case EOpCompositeConstructCoopMatQCOM: out.debug << "Construct Cooperative Matrix QCOM"; break; + case EOpCompositeExtractCoopMatQCOM: out.debug << "Extract Cooperative Matrix QCOM"; break; + case EOpLessThan: out.debug << "Compare Less Than"; break; case EOpGreaterThan: out.debug << "Compare Greater Than"; break; case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break; @@ -983,8 +989,13 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpCooperativeVectorOuterProductAccumulateNV: out.debug << "Cooperative vector outer product accumulate NV"; break; case EOpCooperativeVectorReduceSumAccumulateNV: out.debug << "Cooperative vector reduce sum accumulate NV"; break; + case EOpTensorReadARM: out.debug << "Read from tensor"; break; + case EOpTensorWriteARM: out.debug << "Write to tensor"; break; + case EOpTensorSizeARM: out.debug << "Get tensor size"; break; + case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break; case EOpDebugPrintf: out.debug << "Debug printf"; break; + case EOpAbortEXT: out.debug << "Abort"; break; case EOpHitObjectTraceRayNV: out.debug << "HitObjectTraceRayNV"; break; case EOpHitObjectTraceRayMotionNV: out.debug << "HitObjectTraceRayMotionNV"; break; @@ -1390,6 +1401,16 @@ bool TOutputTraverser::visitSwitch(TVisit /* visit */, TIntermSwitch* node) return false; } +bool TOutputTraverser::visitVariableDecl(TVisit /* visit */, TIntermVariableDecl* node) +{ + TInfoSink& out = infoSink; + + OutputTreeText(out, node, depth); + + out.debug << "VarDecl: " << node->getDeclSymbol()->getName() << '\n'; + return true; +} + // // This function is the one to call externally to start the traversal. // Individual functions can be initialized to 0 to skip processing of that diff --git a/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp b/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp index 26c3eaa62..f7ab245dd 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp @@ -166,7 +166,7 @@ typedef std::vector TVarLiveVector; class TVarGatherTraverser : public TLiveTraverser { public: TVarGatherTraverser(const TIntermediate& i, bool traverseDeadCode, TVarLiveMap& inList, TVarLiveMap& outList, TVarLiveMap& uniformList) - : TLiveTraverser(i, traverseDeadCode, true, true, false) + : TLiveTraverser(i, traverseDeadCode, true, true, false, false) , inputList(inList) , outputList(outList) , uniformList(uniformList) @@ -209,7 +209,7 @@ class TVarSetTraverser : public TLiveTraverser { public: TVarSetTraverser(const TIntermediate& i, const TVarLiveMap& inList, const TVarLiveMap& outList, const TVarLiveMap& uniformList) - : TLiveTraverser(i, true, true, true, false) + : TLiveTraverser(i, true, true, true, false, true) , inputList(inList) , outputList(outList) , uniformList(uniformList) @@ -888,38 +888,38 @@ bool TDefaultIoResolverBase::doAutoBindingMapping() const { return referenceInte 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); +TDefaultIoResolverBase::TSlotSet::iterator TDefaultIoResolverBase::findSlot(int resource, int set, int slot) { + return std::lower_bound(slots[resource][set].begin(), slots[resource][set].end(), slot); } -bool TDefaultIoResolverBase::checkEmpty(int set, int slot) { - TSlotSet::iterator at = findSlot(set, slot); - return ! (at != slots[set].end() && *at == slot); +bool TDefaultIoResolverBase::checkEmpty(int resource, int set, int slot) { + TSlotSet::iterator at = findSlot(resource, set, slot); + return ! (at != slots[resource][set].end() && *at == slot); } -int TDefaultIoResolverBase::reserveSlot(int set, int slot, int size) { - TSlotSet::iterator at = findSlot(set, slot); +int TDefaultIoResolverBase::reserveSlot(int resource, int set, int slot, int size) { + TSlotSet::iterator at = findSlot(resource, set, slot); // tolerate aliasing, by not double-recording aliases // (policy about appropriateness of the alias is higher up) for (int i = 0; i < size; i++) { - if (at == slots[set].end() || *at != slot + i) - at = slots[set].insert(at, slot + i); + if (at == slots[resource][set].end() || *at != slot + i) + at = slots[resource][set].insert(at, slot + i); ++at; } return slot; } -int TDefaultIoResolverBase::getFreeSlot(int set, int base, int size) { - TSlotSet::iterator at = findSlot(set, base); - if (at == slots[set].end()) - return reserveSlot(set, base, size); +int TDefaultIoResolverBase::getFreeSlot(int resource, int set, int base, int size) { + TSlotSet::iterator at = findSlot(resource, set, base); + if (at == slots[resource][set].end()) + return reserveSlot(resource, set, base, size); // look for a big enough gap - for (; at != slots[set].end(); ++at) { + for (; at != slots[resource][set].end(); ++at) { if (*at - base >= size) break; base = *at + 1; } - return reserveSlot(set, base, size); + return reserveSlot(resource, set, base, size); } int TDefaultIoResolverBase::resolveSet(EShLanguage stage, TVarEntryInfo& ent) { @@ -1019,6 +1019,7 @@ uint32_t TDefaultIoResolverBase::computeTypeLocationSize(const TType& type, EShL //TDefaultGlslIoResolver TResourceType TDefaultGlslIoResolver::getResourceType(const glslang::TType& type) { + assert(isValidGlslType(type)); if (isImageType(type)) { return EResImage; } @@ -1034,6 +1035,15 @@ TResourceType TDefaultGlslIoResolver::getResourceType(const glslang::TType& type if (isUboType(type)) { return EResUbo; } + if (isCombinedSamplerType(type)) { + return EResCombinedSampler; + } + if (isAsType(type)) { + return EResAs; + } + if (isTensorType(type)) { + return EResTensor; + } return EResCount; } @@ -1113,13 +1123,13 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf // // vs: out vec4 a; // fs: in vec4 a; - location = getFreeSlot(resourceKey, 0, typeLocationSize); + location = getFreeSlot(0, resourceKey, 0, typeLocationSize); storageSlotMap[resourceKey][name] = location; } } else { // the first interface declarated in a program. TVarSlotMap varSlotMap; - location = getFreeSlot(resourceKey, 0, typeLocationSize); + location = getFreeSlot(0, resourceKey, 0, typeLocationSize); varSlotMap[name] = location; storageSlotMap[resourceKey] = varSlotMap; } @@ -1186,13 +1196,13 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn // // vs: uniform vec4 a; // fs: uniform vec4 a; - location = getFreeSlot(resourceKey, 0, computeTypeLocationSize(type, currentStage)); + location = getFreeSlot(0, resourceKey, 0, computeTypeLocationSize(type, currentStage)); storageSlotMap[resourceKey][name] = location; } } else { // the first uniform declaration in a program. TVarSlotMap varSlotMap; - location = getFreeSlot(resourceKey, 0, size); + location = getFreeSlot(0, resourceKey, 0, size); varSlotMap[name] = location; storageSlotMap[resourceKey] = varSlotMap; } @@ -1212,13 +1222,12 @@ 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 = referenceIntermediate.getSpv().openGl != 0 ? resource : ent.newSet; - int resourceKey = set; + int set = referenceIntermediate.getSpv().openGl != 0 ? 0 : ent.newSet; + int resourceKey = referenceIntermediate.getSpv().openGl != 0 || referenceIntermediate.getBindingsPerResourceType() ? resource : 0; if (resource < EResCount) { if (type.getQualifier().hasBinding()) { - int newBinding = reserveSlot(resourceKey, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); + int newBinding = reserveSlot(resourceKey, set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); return ent.newBinding = newBinding; - } else { // The resource in current stage is not declared with binding, but it is possible declared // with explicit binding in other stages, find the resourceSlotMap firstly to check whether @@ -1226,9 +1235,9 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent bool hasBinding = false; ent.newBinding = -1; // leave as -1 if it isn't set below - if (! resourceSlotMap[resourceKey].empty()) { - TVarSlotMap::iterator iter = resourceSlotMap[resourceKey].find(name); - if (iter != resourceSlotMap[resourceKey].end()) { + if (! resourceSlotMap[resourceKey][set].empty()) { + TVarSlotMap::iterator iter = resourceSlotMap[resourceKey][set].find(name); + if (iter != resourceSlotMap[resourceKey][set].end()) { hasBinding = true; ent.newBinding = iter->second; } @@ -1236,8 +1245,8 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent if (!hasBinding && (ent.live && doAutoBindingMapping())) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one - int binding = getFreeSlot(resourceKey, getBaseBinding(stage, resource, set), numBindings); - resourceSlotMap[resourceKey][name] = binding; + int binding = getFreeSlot(resourceKey, set, getBaseBinding(stage, resource, set), numBindings); + resourceSlotMap[resourceKey][set][name] = binding; ent.newBinding = binding; } return ent.newBinding; @@ -1292,7 +1301,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& TVarSlotMap::iterator iter = varSlotMap.find(name); if (iter == varSlotMap.end()) { int numLocations = TIntermediate::computeTypeUniformLocationSize(type); - reserveSlot(storageKey, location, numLocations); + reserveSlot(0, storageKey, location, numLocations); varSlotMap[name] = location; } else { // Allocate location by name for OpenGL driver, so the uniform in different @@ -1318,7 +1327,7 @@ void TDefaultGlslIoResolver::reserverStorageSlot(TVarEntryInfo& ent, TInfoSink& TVarSlotMap::iterator iter = varSlotMap.find(name); if (iter == varSlotMap.end()) { int numLocations = TIntermediate::computeTypeUniformLocationSize(type); - reserveSlot(storageKey, location, numLocations); + reserveSlot(0, storageKey, location, numLocations); varSlotMap[name] = location; } else { // Allocate location by name for OpenGL driver, so the uniform in different @@ -1340,19 +1349,18 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink& const TType& type = ent.symbol->getType(); const TString& name = ent.symbol->getAccessName(); TResourceType resource = getResourceType(type); - int set = referenceIntermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent); - int resourceKey = set; + int set = referenceIntermediate.getSpv().openGl != 0 ? 0 : resolveSet(ent.stage, ent); + int resourceKey = referenceIntermediate.getSpv().openGl != 0 || referenceIntermediate.getBindingsPerResourceType() ? resource : 0; if (type.getQualifier().hasBinding()) { - TVarSlotMap& varSlotMap = resourceSlotMap[resourceKey]; + TVarSlotMap& varSlotMap = resourceSlotMap[resourceKey][set]; TVarSlotMap::iterator iter = varSlotMap.find(name); int binding = type.getQualifier().layoutBinding + getBaseBinding(ent.stage, resource, set); - if (iter == varSlotMap.end()) { // Reserve the slots for the ubo, ssbo and opaques who has explicit binding int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; varSlotMap[name] = binding; - reserveSlot(resourceKey, binding, numBindings); + reserveSlot(resourceKey, set, binding, numBindings); } else { // Allocate binding by name for OpenGL driver, so the resource in different // stages should be declared with the same binding @@ -1383,6 +1391,7 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase { bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } TResourceType getResourceType(const glslang::TType& type) override { + assert(isValidGlslType(type)); if (isImageType(type)) { return EResImage; } @@ -1398,6 +1407,15 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase { if (isUboType(type)) { return EResUbo; } + if (isCombinedSamplerType(type)) { + return EResCombinedSampler; + } + if (isAsType(type)) { + return EResAs; + } + if (isTensorType(type)) { + return EResTensor; + } return EResCount; } @@ -1407,14 +1425,15 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase { // On OpenGL arrays of opaque types take a seperate binding for each element int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1; TResourceType resource = getResourceType(type); + int resourceKey = referenceIntermediate.getBindingsPerResourceType() ? resource : 0; if (resource < EResCount) { if (type.getQualifier().hasBinding()) { return ent.newBinding = reserveSlot( - set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); + resourceKey, set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding, numBindings); } else if (ent.live && doAutoBindingMapping()) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one - return ent.newBinding = getFreeSlot(set, getBaseBinding(stage, resource, set), numBindings); + return ent.newBinding = getFreeSlot(resourceKey, set, getBaseBinding(stage, resource, set), numBindings); } } return ent.newBinding = -1; @@ -1483,6 +1502,11 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase { if (isUboType(type)) { return EResUbo; } + // no support for combined samplers in HLSL + if (isAsType(type)) { + return EResAs; + } + // no support for tensors in HLSL return EResCount; } @@ -1490,13 +1514,14 @@ struct TDefaultHlslIoResolver : public TDefaultIoResolverBase { const TType& type = ent.symbol->getType(); const int set = getLayoutSet(type); TResourceType resource = getResourceType(type); + int resourceKey = referenceIntermediate.getBindingsPerResourceType() ? resource : 0; if (resource < EResCount) { if (type.getQualifier().hasBinding()) { - return ent.newBinding = reserveSlot(set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding); + return ent.newBinding = reserveSlot(resourceKey, set, getBaseBinding(stage, resource, set) + type.getQualifier().layoutBinding); } else if (ent.live && doAutoBindingMapping()) { // find free slot, the caller did make sure it passes all vars with binding // first and now all are passed that do not have a binding and needs one - return ent.newBinding = getFreeSlot(set, getBaseBinding(stage, resource, set)); + return ent.newBinding = getFreeSlot(resourceKey, set, getBaseBinding(stage, resource, set)); } } return ent.newBinding = -1; diff --git a/src/libraries/glslang/glslang/MachineIndependent/iomapper.h b/src/libraries/glslang/glslang/MachineIndependent/iomapper.h index ef513d9a6..d8c290733 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/iomapper.h +++ b/src/libraries/glslang/glslang/MachineIndependent/iomapper.h @@ -37,6 +37,7 @@ #define _IOMAPPER_INCLUDED #include +#include #include #include // @@ -55,6 +56,7 @@ public: TDefaultIoResolverBase(const TIntermediate& intermediate); typedef std::vector TSlotSet; typedef std::unordered_map TSlotSetMap; + typedef std::array TSlotSetMapResourceArray; // grow the reflection stage by stage void notifyBinding(EShLanguage, TVarEntryInfo& /*ent*/) override {} @@ -72,11 +74,11 @@ public: virtual TResourceType getResourceType(const glslang::TType& type) = 0; bool doAutoBindingMapping() const; bool doAutoLocationMapping() const; - TSlotSet::iterator findSlot(int set, int slot); - bool checkEmpty(int set, int slot); + TSlotSet::iterator findSlot(int resource, int set, int slot); + bool checkEmpty(int resource, int set, int slot); bool validateInOut(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } - int reserveSlot(int set, int slot, int size = 1); - int getFreeSlot(int set, int base, int size = 1); + int reserveSlot(int resource, int set, int slot, int size = 1); + int getFreeSlot(int resource, int set, int base, int size = 1); int resolveSet(EShLanguage /*stage*/, TVarEntryInfo& ent) override; int resolveUniformLocation(EShLanguage /*stage*/, TVarEntryInfo& ent) override; int resolveInOutLocation(EShLanguage stage, TVarEntryInfo& ent) override; @@ -90,7 +92,7 @@ public: } uint32_t computeTypeLocationSize(const TType& type, EShLanguage stage); - TSlotSetMap slots; + TSlotSetMapResourceArray slots; bool hasError = false; protected: @@ -120,12 +122,12 @@ protected: } static bool isTextureType(const glslang::TType& type) { - return (type.getBasicType() == glslang::EbtSampler && + return (type.getBasicType() == glslang::EbtSampler && !type.getSampler().isCombined() && (type.getSampler().isTexture() || type.getSampler().isSubpass())); } static bool isUboType(const glslang::TType& type) { - return type.getQualifier().storage == EvqUniform; + return type.getQualifier().storage == EvqUniform && type.isStruct(); } static bool isImageType(const glslang::TType& type) { @@ -136,6 +138,24 @@ protected: return type.getQualifier().storage == EvqBuffer; } + static bool isCombinedSamplerType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtSampler && type.getSampler().isCombined(); + } + + static bool isAsType(const glslang::TType& type) { + return type.getBasicType() == glslang::EbtAccStruct; + } + + static bool isTensorType(const glslang::TType& type) { + return type.isTensorARM(); + } + + static bool isValidGlslType(const glslang::TType& type) { + // at most one must be true + return (isSamplerType(type) + isTextureType(type) + isUboType(type) + isImageType(type) + + isSsboType(type) + isCombinedSamplerType(type) + isAsType(type) + isTensorType(type)) <= 1; + } + // Return true if this is a SRV (shader resource view) type: static bool isSrvType(const glslang::TType& type) { return isTextureType(type) || type.getQualifier().storage == EvqBuffer; @@ -155,6 +175,7 @@ struct TDefaultGlslIoResolver : public TDefaultIoResolverBase { public: typedef std::map TVarSlotMap; // typedef std::map TSlotMap; // + typedef std::array TResourceSlotMap; TDefaultGlslIoResolver(const TIntermediate& intermediate); bool validateBinding(EShLanguage /*stage*/, TVarEntryInfo& /*ent*/) override { return true; } TResourceType getResourceType(const glslang::TType& type) override; @@ -182,7 +203,7 @@ protected: // Use for mark current shader stage for resolver EShLanguage currentStage; // Slot map for storage resource(location of uniform and interface symbol) It's a program share slot - TSlotMap resourceSlotMap; + TResourceSlotMap resourceSlotMap; // Slot map for other resource(image, ubo, ssbo), It's a program share slot. TSlotMap storageSlotMap; }; diff --git a/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp b/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp index d2cf05b2f..48a564e11 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp @@ -524,7 +524,8 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) numErrors += unit.getNumErrors(); // Only one push_constant is allowed, mergeLinkerObjects() will ensure the push_constant // is the same for all units. - if (numPushConstants > 1 || unit.numPushConstants > 1) + if (!IsRequestedExtension(glslang::E_GL_NV_push_constant_bank) && + (numPushConstants > 1 || unit.numPushConstants > 1)) error(infoSink, "Only one push_constant block is allowed per stage"); numPushConstants = std::min(numPushConstants + unit.numPushConstants, 1); @@ -535,6 +536,9 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) error(infoSink, "number of invocations must match between compilation units"); } + // The GLSL specification requires that at least one compilation unit + // must declare the vertices layout, but not all units need to do so. + // However, all declarations must match. if (vertices == TQualifier::layoutNotSet) vertices = unit.vertices; else if (unit.vertices != TQualifier::layoutNotSet && vertices != unit.vertices) { @@ -545,20 +549,30 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) else assert(0); } + + // The mesh shader extension requires that at least one compilation unit + // must declare the max_primitives layout, but not all units need to do so. + // However, all declarations must match. if (primitives == TQualifier::layoutNotSet) primitives = unit.primitives; - else if (primitives != unit.primitives) { + else if (unit.primitives != TQualifier::layoutNotSet && primitives != unit.primitives) { if (language == EShLangMesh) error(infoSink, "Contradictory layout max_primitives values"); else assert(0); } + // The GLSL specification requires that at least one compilation unit + // must declare the input primitive layout, but not all units need to do so. + // However, all declarations must match. if (inputPrimitive == ElgNone) inputPrimitive = unit.inputPrimitive; else if (unit.inputPrimitive != ElgNone && inputPrimitive != unit.inputPrimitive) error(infoSink, "Contradictory input layout primitives"); + // The GLSL specification requires that at least one compilation unit + // must declare the output primitive layout, but not all units need to do so. + // However, all declarations must match. if (outputPrimitive == ElgNone) outputPrimitive = unit.outputPrimitive; else if (unit.outputPrimitive != ElgNone && outputPrimitive != unit.outputPrimitive) @@ -567,19 +581,27 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger) error(infoSink, "gl_FragCoord redeclarations must match across shaders"); + // The GLSL specification requires that at least one compilation unit + // must declare the vertex spacing layout, but not all units need to do so. + // However, all declarations must match. if (vertexSpacing == EvsNone) vertexSpacing = unit.vertexSpacing; - else if (vertexSpacing != unit.vertexSpacing) + else if (unit.vertexSpacing != EvsNone && vertexSpacing != unit.vertexSpacing) error(infoSink, "Contradictory input vertex spacing"); + // The GLSL specification requires that at least one compilation unit + // must declare the triangle ordering layout, but not all units need to do so. + // However, all declarations must match. if (vertexOrder == EvoNone) vertexOrder = unit.vertexOrder; - else if (vertexOrder != unit.vertexOrder) + else if (unit.vertexOrder != EvoNone && vertexOrder != unit.vertexOrder) error(infoSink, "Contradictory triangle ordering"); MERGE_TRUE(pointMode); for (int i = 0; i < 3; ++i) { + // The GLSL specification requires that all workgroup size declarations must match + // but not all units have to declare the layout. if (unit.localSizeNotDefault[i]) { if (!localSizeNotDefault[i]) { localSize[i] = unit.localSize[i]; @@ -589,9 +611,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) error(infoSink, "Contradictory local size"); } + // The GLSL specification requires that all workgroup size specialization + // ids declarations must match, but not all units have to declare the layout. if (localSizeSpecId[i] == TQualifier::layoutNotSet) localSizeSpecId[i] = unit.localSizeSpecId[i]; - else if (localSizeSpecId[i] != unit.localSizeSpecId[i]) + else if (unit.localSizeSpecId[i] != TQualifier::layoutNotSet && localSizeSpecId[i] != unit.localSizeSpecId[i]) error(infoSink, "Contradictory local size specialization ids"); } @@ -602,9 +626,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(nonCoherentStencilAttachmentReadEXT); MERGE_TRUE(nonCoherentTileAttachmentReadQCOM); + // The GLSL specification requires that all depth layout redeclarations must match, + // but not all units have to declare the layout. if (depthLayout == EldNone) depthLayout = unit.depthLayout; - else if (depthLayout != unit.depthLayout) + else if (unit.depthLayout != EldNone && depthLayout != unit.depthLayout) error(infoSink, "Contradictory depth layouts"); MERGE_TRUE(depthReplacing); @@ -615,9 +641,11 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit) MERGE_TRUE(xfbMode); for (size_t b = 0; b < xfbBuffers.size(); ++b) { + // The GLSL specification requires that all xfb_stride declarations for + // the same buffer must match, but not all units have to declare the layout. if (xfbBuffers[b].stride == TQualifier::layoutXfbStrideEnd) xfbBuffers[b].stride = unit.xfbBuffers[b].stride; - else if (xfbBuffers[b].stride != unit.xfbBuffers[b].stride) + else if (unit.xfbBuffers[b].stride != TQualifier::layoutXfbStrideEnd && xfbBuffers[b].stride != unit.xfbBuffers[b].stride) error(infoSink, "Contradictory xfb_stride"); xfbBuffers[b].implicitStride = std::max(xfbBuffers[b].implicitStride, unit.xfbBuffers[b].implicitStride); if (unit.xfbBuffers[b].contains64BitType) @@ -1098,7 +1126,8 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin mergeErrorCheck(infoSink, *symbol, *unitSymbol); } // If different symbols, verify they arn't push_constant since there can only be one per stage - else if (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant() && getStage() == unitStage) + else if (!IsRequestedExtension(glslang::E_GL_NV_push_constant_bank) && + (symbol->getQualifier().isPushConstant() && unitSymbol->getQualifier().isPushConstant() && getStage() == unitStage)) error(infoSink, "Only one push_constant block is allowed per stage"); } @@ -1563,7 +1592,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled) // overlap/alias/missing I/O, etc. inOutLocationCheck(infoSink); - if (getNumPushConstants() > 1) + if (!IsRequestedExtension(glslang::E_GL_NV_push_constant_bank) && (getNumPushConstants() > 1)) error(infoSink, "Only one push_constant block is allowed per stage"); // invocations @@ -1959,6 +1988,8 @@ int TIntermediate::addUsedLocation(EShMessages messages, const TQualifier& quali set = 1; else if (qualifier.isHitObjectAttrNV()) set = 2; + else if (qualifier.isHitObjectAttrEXT()) + set = 2; else return -1; @@ -1997,7 +2028,7 @@ int TIntermediate::addUsedLocation(EShMessages messages, const TQualifier& quali // For raytracing IO (payloads and callabledata) each declaration occupies a single // slot irrespective of type. int collision = -1; // no collision - if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) { + if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV() || qualifier.isHitObjectAttrEXT()) { TRange range(qualifier.layoutLocation, qualifier.layoutLocation); collision = checkLocationRT(set, qualifier.layoutLocation); if (collision < 0) @@ -2544,6 +2575,22 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, T } } + // rules 2 and 3 + if (type.isLongVector()) { + int scalarAlign = getBaseAlignmentScalar(type, size); + uint32_t vectorSize = type.getTypeParameters()->arraySizes->getDimSize(0); + switch (vectorSize) { + case 1: // HLSL has this, GLSL does not + return scalarAlign; + case 2: + size *= 2; + return 2 * scalarAlign; + default: + size *= vectorSize; + return 4 * scalarAlign; + } + } + // rules 5 and 7 if (type.isMatrix()) { // rule 5: deref to row, not to column, meaning the size of vector is num columns instead of num rows @@ -2624,6 +2671,14 @@ int TIntermediate::getScalarAlignment(const TType& type, int& size, int& stride, return scalarAlign; } + if (type.isLongVector()) { + int scalarAlign = getBaseAlignmentScalar(type, size); + + uint32_t vectorSize = type.getTypeParameters()->arraySizes->getDimSize(0); + size *= vectorSize; + return scalarAlign; + } + if (type.isMatrix()) { TType derefType(type, 0, rowMajor); diff --git a/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h b/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h index f88aa08c7..8c8ac9861 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h +++ b/src/libraries/glslang/glslang/MachineIndependent/localintermediate.h @@ -48,6 +48,7 @@ #include #include #include +#include #include class TInfoSink; @@ -227,9 +228,9 @@ class TVariable; // Texture and Sampler transformation mode. // enum ComputeDerivativeMode { - LayoutDerivativeNone, // default layout as SPV_NV_compute_shader_derivatives not enabled - LayoutDerivativeGroupQuads, // derivative_group_quadsNV - LayoutDerivativeGroupLinear, // derivative_group_linearNV + LayoutDerivativeNone, + LayoutDerivativeGroupQuads, + LayoutDerivativeGroupLinear, }; // @@ -339,6 +340,7 @@ public: geoPassthroughEXT(false), numShaderRecordBlocks(0), computeDerivativeMode(LayoutDerivativeNone), + computeDerivativeExtension(EdgNone), primitives(TQualifier::layoutNotSet), numTaskNVBlocks(0), layoutPrimitiveCulling(false), @@ -351,6 +353,7 @@ public: hlslOffsets(false), hlslIoMapping(false), useVariablePointers(false), + bindingsPerResourceType(false), textureSamplerTransformMode(EShTexSampTransKeep), needToLegalize(false), binaryDoubleOutput(false), @@ -574,8 +577,8 @@ public: TIntermConstantUnion* addConstantUnion(const TString*, const TSourceLoc&, bool literal = false) const; TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); - TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); - TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, + TIntermLoop* addLoop(TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermNode*, TIntermTyped*, bool testFirst, const TSourceLoc&, TIntermLoop*&); TIntermBranch* addBranch(TOperator, const TSourceLoc&); TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); @@ -763,6 +766,16 @@ public: useReplicatedComposites = true; } bool usingReplicatedComposites() const { return useReplicatedComposites; } + void setPromoteUint32Indices() + { + promoteUint32Indices = true; + } + bool usingPromoteUint32Indices() const { return promoteUint32Indices; } + void setShader64BitIndexing() + { + shader64BitIndexing = true; + } + bool usingShader64BitIndexing() const { return shader64BitIndexing; } void setUseVariablePointers() { useVariablePointers = true; @@ -829,6 +842,13 @@ public: bool usingVariablePointers() const { return useVariablePointers; } + void setBindingsPerResourceType() + { + bindingsPerResourceType = true; + processes.addProcess("bindings-per-resource-type"); + } + bool getBindingsPerResourceType() const { return bindingsPerResourceType; } + #ifdef ENABLE_HLSL template T addCounterBufferName(const T& name) const { return name + implicitCounterName; } bool hasCounterBufferName(const TString& name) const { @@ -965,9 +985,14 @@ public: bool getLayoutOverrideCoverage() const { return layoutOverrideCoverage; } void setGeoPassthroughEXT() { geoPassthroughEXT = true; } bool getGeoPassthroughEXT() const { return geoPassthroughEXT; } - void setLayoutDerivativeMode(ComputeDerivativeMode mode) { computeDerivativeMode = mode; } + void setLayoutDerivativeMode(ComputeDerivativeMode mode, TDerivativeGroupExtension extension) + { + computeDerivativeMode = mode; + computeDerivativeExtension = extension; + } bool hasLayoutDerivativeModeNone() const { return computeDerivativeMode != LayoutDerivativeNone; } ComputeDerivativeMode getLayoutDerivativeModeNone() const { return computeDerivativeMode; } + TDerivativeGroupExtension getLayoutDerivativeExtension() const { return computeDerivativeExtension; } void setLayoutPrimitiveCulling() { layoutPrimitiveCulling = true; } bool getLayoutPrimitiveCulling() const { return layoutPrimitiveCulling; } bool setPrimitives(int m) @@ -1151,6 +1176,13 @@ public: void updateNumericFeature(TNumericFeatures::feature f, bool on) { on ? numericFeatures.insert(f) : numericFeatures.erase(f); } + void setBuiltinAliasLookup(std::unordered_multimap symbolMap) { + builtinAliasLookup = std::move(symbolMap); + } + const std::unordered_multimap& getBuiltinAliasLookup() const { + return builtinAliasLookup; + } + protected: TIntermSymbol* addSymbol(long long Id, const TString&, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&); void error(TInfoSink& infoSink, const TSourceLoc* loc, EShMessages messages, const char*, EShLanguage unitStage = EShLangCount); @@ -1261,6 +1293,7 @@ protected: bool geoPassthroughEXT; int numShaderRecordBlocks; ComputeDerivativeMode computeDerivativeMode; + TDerivativeGroupExtension computeDerivativeExtension; int primitives; int numTaskNVBlocks; bool layoutPrimitiveCulling; @@ -1284,6 +1317,7 @@ protected: bool hlslOffsets; bool hlslIoMapping; bool useVariablePointers; + bool bindingsPerResourceType; std::set semanticNameSet; @@ -1295,6 +1329,8 @@ protected: bool maximallyReconverges; bool usePhysicalStorageBuffer; bool useReplicatedComposites { false }; + bool promoteUint32Indices { false }; + bool shader64BitIndexing { false }; TSpirvRequirement* spirvRequirement; TSpirvExecutionMode* spirvExecutionMode; @@ -1323,6 +1359,9 @@ protected: // Included text. First string is a name, second is the included text std::map includeText; + // Maps from canonical symbol name to alias symbol names + std::unordered_multimap builtinAliasLookup; + // for OpModuleProcessed, or equivalent TProcesses processes; diff --git a/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h b/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h index c70ac47f5..df1fa5701 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h +++ b/src/libraries/glslang/glslang/MachineIndependent/parseVersions.h @@ -124,9 +124,12 @@ public: virtual void fcoopmatCheckNV(const TSourceLoc&, const char* op, bool builtIn = false); virtual void intcoopmatCheckNV(const TSourceLoc&, const char *op, bool builtIn = false); virtual void coopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void coopmatConverisonCheckQCOM(const TSourceLoc& loc, const char* op, bool builtIn = false); virtual void tensorLayoutViewCheck(const TSourceLoc&, const char* op, bool builtIn = false); virtual void coopvecCheck(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void longVectorCheck(const TSourceLoc&, const char* op, bool builtIn = false); virtual void intattachmentCheck(const TSourceLoc&, const char *op, bool builtIn = false); + virtual void tensorCheckARM(const TSourceLoc&, const char *op, bool builtIn = false); bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } bool isForwardCompatible() const { return forwardCompatible; } diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp index 5b44b1304..2f4a79bab 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -81,7 +81,6 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define _CRT_SECURE_NO_WARNINGS #endif -#include #include #include #include @@ -153,12 +152,57 @@ int TPpContext::CPPdefine(TPpToken* ppToken) return token; } + int pendingPoundSymbols = 0; + TPpToken savePound; // record the definition of the macro while (token != '\n' && token != EndOfInput) { - mac.body.putToken(token, ppToken); + if (token == '#') { + pendingPoundSymbols++; + if (pendingPoundSymbols == 0) { + savePound = *ppToken; + } + } else if (pendingPoundSymbols == 0) { + mac.body.putToken(token, ppToken); + } else if (pendingPoundSymbols == 1) { + // A single #: stringify + parseContext.requireProfile(ppToken->loc, ~EEsProfile, "stringify (#)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "stringify (#)"); + bool isArg = false; + if (token == PpAtomIdentifier) { + for (int i = (int)mac.args.size() - 1; i >= 0; i--) { + if (strcmp(atomStrings.getString(mac.args[i]), ppToken->name) == 0) { + isArg = true; + break; + } + } + } + if (!isArg) { + parseContext.ppError(ppToken->loc, "'#' is not followed by a macro parameter.", "#", ""); + return token; + } + mac.body.putToken(tStringifyLevelInput::PUSH, ppToken); + mac.body.putToken(token, ppToken); + mac.body.putToken(tStringifyLevelInput::POP, ppToken); + pendingPoundSymbols = 0; + } else if (pendingPoundSymbols % 2 == 0) { + // Any number of pastes '##' in a row: idempotent, just becomes one paste + parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); + parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)"); + for (int i = 0; i < pendingPoundSymbols / 2; i++) { + mac.body.putToken(PpAtomPaste, &savePound); + } + mac.body.putToken(token, ppToken); + pendingPoundSymbols = 0; + } else { + // An odd number of '#' i.e., mix of paste and stringify: does not give valid preprocessing token + parseContext.ppError(ppToken->loc, "Illegal sequence of paste (##) and stringify (#).", "#", ""); + return token; + } + token = scanToken(ppToken); - if (token != '\n' && ppToken->space) - mac.body.putToken(' ', ppToken); + } + if (pendingPoundSymbols != 0) { + parseContext.ppError(ppToken->loc, "Macro ended with incomplete '#' paste/stringify operators", "#", ""); } // check for duplicate definition @@ -679,12 +723,11 @@ int TPpContext::CPPinclude(TPpToken* ppToken) if (res->headerData != nullptr && res->headerLength > 0) { // path for processing one or more tokens from an included header, hand off 'res' const bool forNextLine = parseContext.lineDirectiveShouldSetNextLine(); - std::ostringstream prologue; - std::ostringstream epilogue; - prologue << "#line " << forNextLine << " " << "\"" << res->headerName << "\"\n"; - epilogue << (res->headerData[res->headerLength - 1] == '\n'? "" : "\n") << - "#line " << directiveLoc.line + forNextLine << " " << directiveLoc.getStringNameOrNum() << "\n"; - pushInput(new TokenizableIncludeFile(directiveLoc, prologue.str(), res, epilogue.str(), this)); + std::string prologue = "#line " + std::to_string((int)forNextLine) + " \"" + res->headerName + "\"\n"; + std::string epilogue = (res->headerData[res->headerLength - 1] == '\n' ? "" : "\n") + + std::string("#line ") + std::to_string(directiveLoc.line + forNextLine) + " " + + directiveLoc.getStringNameOrNum() + "\n"; + pushInput(new TokenizableIncludeFile(directiveLoc, prologue, res, epilogue, this)); parseContext.intermediate.addIncludeText(res->headerName.c_str(), res->headerData, res->headerLength); // There's no "current" location anymore. parseContext.setCurrentColumn(0); @@ -1119,7 +1162,7 @@ int TPpContext::tMacroInput::scan(TPpToken* ppToken) } // see if are preceding a ## - if (mac->body.peekUntokenizedPasting()) { + if (mac->body.peekTokenizedPasting(false)) { prepaste = true; pasting = true; } diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h index 3446f1e1c..582d119f4 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpContext.h @@ -311,7 +311,6 @@ public: int getToken(TParseContextBase&, TPpToken*); bool atEnd() { return currentPos >= stream.size(); } bool peekTokenizedPasting(bool lastTokenPastes); - bool peekUntokenizedPasting(); void reset() { currentPos = 0; } protected: @@ -373,22 +372,6 @@ protected: } if (!inputStack.empty() && inputStack.back()->isStringInput() && !inElseSkip) { if (token == '\n') { - bool seenNumSign = false; - for (int i = 0; i < (int)lastLineTokens.size() - 1;) { - int curPos = i; - int curToken = lastLineTokens[i++]; - if (curToken == '#' && lastLineTokens[i] == '#') { - curToken = PpAtomPaste; - i++; - } - if (curToken == '#') { - if (seenNumSign) { - parseContext.ppError(lastLineTokenLocs[curPos], "(#) can be preceded in its line only by spaces or horizontal tabs", "#", ""); - } else { - seenNumSign = true; - } - } - } lastLineTokens.clear(); lastLineTokenLocs.clear(); } else { @@ -458,6 +441,38 @@ protected: static const int marker = -3; }; + class tStringifyLevelInput : public tInput { + int what; + tStringifyLevelInput(TPpContext* pp) : tInput(pp) { } + public: + static tStringifyLevelInput popMarker(TPpContext* pp) + { + tStringifyLevelInput sl(pp); + sl.what = POP; + return sl; + } + + static tStringifyLevelInput pushMarker(TPpContext* pp) + { + tStringifyLevelInput sl(pp); + sl.what = PUSH; + return sl; + } + + int scan(TPpToken*) override + { + if (done) + return EndOfInput; + done = true; + + return what; + } + virtual int getch() override { assert(0); return EndOfInput; } + virtual void ungetch() override { assert(0); } + static const int PUSH = -4; + static const int POP = -5; + }; + class tZeroInput : public tInput { public: tZeroInput(TPpContext* pp) : tInput(pp) { } diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp index df64b7bd5..61b75b745 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -97,7 +97,6 @@ namespace glslang { /////////////////////////////////// Floating point constants: ///////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// -// // Scan a single- or double-precision floating point constant. // Assumes that the scanner has seen at least one digit, // followed by either a decimal '.' or the letter 'e', or a @@ -1226,7 +1225,9 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) // int TPpContext::tokenize(TPpToken& ppToken) { - for(;;) { + int stringifyDepth = 0; + TPpToken stringifiedToken; // Tokens are appended to this as they come in + for (;;) { int token = scanToken(&ppToken); // Handle token-pasting logic @@ -1254,6 +1255,20 @@ int TPpContext::tokenize(TPpToken& ppToken) if (token == '\n') continue; + if (token == tStringifyLevelInput::PUSH) { + stringifyDepth++; + continue; + } + if (token == tStringifyLevelInput::POP) { + assert(stringifyDepth > 0); + stringifyDepth--; + if (stringifyDepth == 0) { + snprintf(ppToken.name, sizeof(ppToken.name), "%s", stringifiedToken.name); + return PpAtomConstString; + } + continue; + } + // expand macros if (token == PpAtomIdentifier) { switch (MacroExpand(&ppToken, false, true)) { @@ -1267,7 +1282,22 @@ int TPpContext::tokenize(TPpToken& ppToken) } } + bool needStringSupport = ifdepth == 0 && (token == PpAtomConstString || stringifyDepth > 0); + if (needStringSupport && parseContext.intermediate.getSource() != EShSourceHlsl) { + // HLSL allows string literals. + // GLSL allows string literals with GL_EXT_debug_printf. + const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics, E_GL_EXT_abort }; + parseContext.requireExtensions(ppToken.loc, 3, string_literal_EXTs, "string literal"); + if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) && + !parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)&& + !parseContext.extensionTurnedOn(E_GL_EXT_abort)) { + continue; + } + } + switch (token) { + case PpAtomConstString: + break; case PpAtomIdentifier: case PpAtomConstInt: case PpAtomConstUint: @@ -1281,17 +1311,6 @@ int TPpContext::tokenize(TPpToken& ppToken) if (ppToken.name[0] == '\0') continue; break; - case PpAtomConstString: - // HLSL allows string literals. - // GLSL allows string literals with GL_EXT_debug_printf. - if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) { - const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics }; - parseContext.requireExtensions(ppToken.loc, 2, string_literal_EXTs, "string literal"); - if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) && - !parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) - continue; - } - break; case '\'': parseContext.ppError(ppToken.loc, "character literals not supported", "\'", ""); continue; @@ -1299,6 +1318,17 @@ int TPpContext::tokenize(TPpToken& ppToken) snprintf(ppToken.name, sizeof(ppToken.name), "%s", atomStrings.getString(token)); break; } + if (stringifyDepth > 0) { + size_t existingLen = strlen(stringifiedToken.name); + char* dst = stringifiedToken.name + existingLen; + // stringify_depth would determine how many layers of \\\"\\\" are needed, if we wanted to. + if (ppToken.space) { + snprintf(dst, sizeof(stringifiedToken.name) - existingLen - 1, " %s", ppToken.name); + } else { + snprintf(dst, sizeof(stringifiedToken.name) - existingLen, "%s", ppToken.name); + } + continue; + } return token; } @@ -1329,6 +1359,7 @@ int TPpContext::tokenPaste(int token, TPpToken& ppToken) // This covers end of macro expansion if (endOfReplacementList()) { + // this should be unreachable, incomplete #/## sequences are caught at macro parsing time. parseContext.ppError(ppToken.loc, "unexpected location; end of replacement list", "##", ""); break; } diff --git a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp index e6ee64cf9..472df78f1 100644 --- a/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -105,7 +105,7 @@ void TPpContext::TokenStream::putToken(int atom, TPpToken* ppToken) } // Read the next token from a macro token stream. -int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken *ppToken) +int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken* ppToken) { if (atEnd()) return EndOfInput; @@ -113,16 +113,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken int atom = stream[currentPos++].get(*ppToken); ppToken->loc = parseContext.getCurrentLoc(); - // Check for ##, unless the current # is the last character - if (atom == '#') { - if (peekToken('#')) { - parseContext.requireProfile(ppToken->loc, ~EEsProfile, "token pasting (##)"); - parseContext.profileRequires(ppToken->loc, ~EEsProfile, 130, nullptr, "token pasting (##)"); - currentPos++; - atom = PpAtomPaste; - } - } - return atom; } @@ -146,8 +136,10 @@ bool TPpContext::TokenStream::peekTokenizedPasting(bool lastTokenPastes) // 2. last token and we've been told after this there will be a ## - if (! lastTokenPastes) + if (! lastTokenPastes) { + currentPos = savePos; return false; + } // Getting here means the last token will be pasted, after this // Are we at the last non-whitespace token? @@ -167,29 +159,6 @@ bool TPpContext::TokenStream::peekTokenizedPasting(bool lastTokenPastes) return !moreTokens; } -// See if the next non-white-space tokens are two consecutive # -bool TPpContext::TokenStream::peekUntokenizedPasting() -{ - // don't return early, have to restore this - size_t savePos = currentPos; - - // skip white-space - while (peekToken(' ')) - ++currentPos; - - // check for ## - bool pasting = false; - if (peekToken('#')) { - ++currentPos; - if (peekToken('#')) - pasting = true; - } - - currentPos = savePos; - - return pasting; -} - void TPpContext::pushTokenStreamInput(TokenStream& ts, bool prepasting, bool expanded) { pushInput(new tTokenInput(this, &ts, prepasting, expanded)); diff --git a/src/libraries/glslang/glslang/Public/ShaderLang.h b/src/libraries/glslang/glslang/Public/ShaderLang.h index 7226c9ee1..d44d664e3 100644 --- a/src/libraries/glslang/glslang/Public/ShaderLang.h +++ b/src/libraries/glslang/glslang/Public/ShaderLang.h @@ -134,7 +134,7 @@ class TConstUnionArray; typedef enum { EShSourceNone, EShSourceGlsl, // GLSL, includes ESSL (OpenGL ES GLSL) - EShSourceHlsl, // HLSL + EShSourceHlsl, // HLSL (deprecated, see issue #4210) LAST_ELEMENT_MARKER(EShSourceCount), } EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead @@ -261,14 +261,14 @@ enum EShMessages : unsigned { EShMsgSpvRules = (1 << 3), // issue messages for SPIR-V generation EShMsgVulkanRules = (1 << 4), // issue messages for Vulkan-requirements of GLSL for SPIR-V EShMsgOnlyPreprocessor = (1 << 5), // only print out errors produced by the preprocessor - EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics + EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics (deprecated, see issue #4210) EShMsgCascadingErrors = (1 << 7), // get cascading errors; risks error-recovery issues, instead of an early exit EShMsgKeepUncalled = (1 << 8), // for testing, don't eliminate uncalled functions - EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules + EShMsgHlslOffsets = (1 << 9), // allow block offsets to follow HLSL rules instead of GLSL rules (deprecated, see issue #4210) EShMsgDebugInfo = (1 << 10), // save debug information - EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL - EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages - EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics) + EShMsgHlslEnable16BitTypes = (1 << 11), // enable use of 16-bit types in SPIR-V for HLSL (deprecated, see issue #4210) + EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages (deprecated, see issue #4210) + EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics) (deprecated, see issue #4210) EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table EShMsgEnhanced = (1 << 15), // enhanced message readability EShMsgAbsolutePath = (1 << 16), // Output Absolute path for messages @@ -436,6 +436,9 @@ enum TResourceType { EResUbo, EResSsbo, EResUav, + EResCombinedSampler, + EResAs, + EResTensor, EResCount }; @@ -465,59 +468,60 @@ enum TBlockStorageClass // // N.B.: Destruct a linked program *before* destructing the shaders linked into it. // -class TShader { +class GLSLANG_EXPORT TShader { public: - GLSLANG_EXPORT explicit TShader(EShLanguage); - GLSLANG_EXPORT virtual ~TShader(); - GLSLANG_EXPORT void setStrings(const char* const* s, int n); - GLSLANG_EXPORT void setStringsWithLengths( + explicit TShader(EShLanguage); + virtual ~TShader(); + void setStrings(const char* const* s, int n); + void setStringsWithLengths( const char* const* s, const int* l, int n); - GLSLANG_EXPORT void setStringsWithLengthsAndNames( + void setStringsWithLengthsAndNames( const char* const* s, const int* l, const char* const* names, int n); void setPreamble(const char* s) { preamble = s; } - GLSLANG_EXPORT void setEntryPoint(const char* entryPoint); - GLSLANG_EXPORT void setSourceEntryPoint(const char* sourceEntryPointName); - GLSLANG_EXPORT void addProcesses(const std::vector&); - GLSLANG_EXPORT void setUniqueId(unsigned long long id); - GLSLANG_EXPORT void setOverrideVersion(int version); - GLSLANG_EXPORT void setDebugInfo(bool debugInfo); + void setEntryPoint(const char* entryPoint); + void setSourceEntryPoint(const char* sourceEntryPointName); + void addProcesses(const std::vector&); + void setUniqueId(unsigned long long id); + void setOverrideVersion(int version); + void setDebugInfo(bool debugInfo); // IO resolver binding data: see comments in ShaderLang.cpp - GLSLANG_EXPORT void setShiftBinding(TResourceType res, unsigned int base); - GLSLANG_EXPORT void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding - GLSLANG_EXPORT void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding - GLSLANG_EXPORT void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); - GLSLANG_EXPORT void setResourceSetBinding(const std::vector& base); - GLSLANG_EXPORT void setAutoMapBindings(bool map); - GLSLANG_EXPORT void setAutoMapLocations(bool map); - 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); - GLSLANG_EXPORT void setEnhancedMsgs(); + void setShiftBinding(TResourceType res, unsigned int base); + void setShiftSamplerBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftTextureBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftImageBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftUavBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftCbufferBinding(unsigned int base); // synonym for setShiftUboBinding + void setShiftSsboBinding(unsigned int base); // DEPRECATED: use setShiftBinding + void setShiftBindingForSet(TResourceType res, unsigned int base, unsigned int set); + void setResourceSetBinding(const std::vector& base); + void setAutoMapBindings(bool map); + void setAutoMapLocations(bool map); + void setBindingsPerResourceType(); + void addUniformLocationOverride(const char* name, int loc); + void setUniformLocationBase(int base); + void setInvertY(bool invert); + void setDxPositionW(bool dxPosW); + void setEnhancedMsgs(); #ifdef ENABLE_HLSL - GLSLANG_EXPORT void setHlslIoMapping(bool hlslIoMap); - GLSLANG_EXPORT void setFlattenUniformArrays(bool flatten); + void setHlslIoMapping(bool hlslIoMap); // deprecated, see issue #4210 + void setFlattenUniformArrays(bool flatten); // deprecated, see issue #4210 #endif - GLSLANG_EXPORT void setNoStorageFormat(bool useUnknownFormat); - GLSLANG_EXPORT void setNanMinMaxClamp(bool nanMinMaxClamp); - GLSLANG_EXPORT void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); - GLSLANG_EXPORT void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing); + void setNoStorageFormat(bool useUnknownFormat); + void setNanMinMaxClamp(bool nanMinMaxClamp); + void setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode); + void addBlockStorageOverride(const char* nameStr, glslang::TBlockStorageClass backing); - GLSLANG_EXPORT void setGlobalUniformBlockName(const char* name); - GLSLANG_EXPORT void setAtomicCounterBlockName(const char* name); - GLSLANG_EXPORT void setGlobalUniformSet(unsigned int set); - GLSLANG_EXPORT void setGlobalUniformBinding(unsigned int binding); - GLSLANG_EXPORT void setAtomicCounterBlockSet(unsigned int set); - GLSLANG_EXPORT void setAtomicCounterBlockBinding(unsigned int binding); + void setGlobalUniformBlockName(const char* name); + void setAtomicCounterBlockName(const char* name); + void setGlobalUniformSet(unsigned int set); + void setGlobalUniformBinding(unsigned int binding); + void setAtomicCounterBlockSet(unsigned int set); + void setAtomicCounterBlockBinding(unsigned int binding); - GLSLANG_EXPORT void addSourceText(const char* text, size_t len); - GLSLANG_EXPORT void setSourceFile(const char* file); + void addSourceText(const char* text, size_t len); + void setSourceFile(const char* file); // For setting up the environment (cleared to nothingness in the constructor). // These must be called so that parsing is done for the right source language and @@ -571,8 +575,8 @@ public: void getStrings(const char* const* &s, int& n) { s = strings; n = numStrings; } #ifdef ENABLE_HLSL - void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } - bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } + void setEnvTargetHlslFunctionality1() { environment.target.hlslFunctionality1 = true; } // deprecated, see issue #4210 + bool getEnvTargetHlslFunctionality1() const { return environment.target.hlslFunctionality1; } // deprecated, see issue #4210 #else bool getEnvTargetHlslFunctionality1() const { return false; } #endif @@ -666,7 +670,7 @@ public: virtual void releaseInclude(IncludeResult*) override { } }; - GLSLANG_EXPORT bool parse( + bool parse( const TBuiltInResource*, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages, Includer&); @@ -692,14 +696,14 @@ public: // NOTE: Doing just preprocessing to obtain a correct preprocessed shader string // is not an officially supported or fully working path. - GLSLANG_EXPORT bool preprocess( + bool preprocess( const TBuiltInResource* builtInResources, int defaultVersion, EProfile defaultProfile, bool forceDefaultVersionAndProfile, bool forwardCompatible, EShMessages message, std::string* outputString, Includer& includer); - GLSLANG_EXPORT const char* getInfoLog(); - GLSLANG_EXPORT const char* getInfoDebugLog(); + const char* getInfoLog(); + const char* getInfoDebugLog(); EShLanguage getStage() const { return stage; } TIntermediate* getIntermediate() const { return intermediate; } @@ -746,17 +750,17 @@ private: // // Data needed for just a single object at the granularity exchanged by the reflection API -class TObjectReflection { +class GLSLANG_EXPORT TObjectReflection { public: - GLSLANG_EXPORT TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex, const TConstUnionArray* pConstArray = nullptr); + TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex, const TConstUnionArray* pConstArray = nullptr); const TType* getType() const { return type; } const TConstUnionArray* getConstArray() const { return constArray; } - GLSLANG_EXPORT int getBinding() const; - GLSLANG_EXPORT void dump() const; + int getBinding() const; + void dump() const; static TObjectReflection badReflection() { return TObjectReflection(); } - GLSLANG_EXPORT unsigned int layoutLocation() const; + unsigned int layoutLocation() const; std::string name; int offset; @@ -808,8 +812,7 @@ struct TVarEntryInfo; // // NOTE: that still limit checks are applied to bindings and sets // and may result in an error. -class TIoMapResolver -{ +class GLSLANG_EXPORT TIoMapResolver { public: virtual ~TIoMapResolver() {} @@ -881,41 +884,41 @@ GLSLANG_EXPORT TIoMapper* GetGlslIoMapper(); // // N.B.: Destruct a linked program *before* destructing the shaders linked into it. // -class TProgram { +class GLSLANG_EXPORT TProgram { public: - GLSLANG_EXPORT TProgram(); - GLSLANG_EXPORT virtual ~TProgram(); + TProgram(); + virtual ~TProgram(); void addShader(TShader* shader) { stages[shader->stage].push_back(shader); } std::list& getShaders(EShLanguage stage) { return stages[stage]; } // Link Validation interface - GLSLANG_EXPORT bool link(EShMessages); - GLSLANG_EXPORT const char* getInfoLog(); - GLSLANG_EXPORT const char* getInfoDebugLog(); + bool link(EShMessages); + const char* getInfoLog(); + const char* getInfoDebugLog(); TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; } // Reflection Interface // call first, to do liveness analysis, index mapping, etc.; returns false on failure - GLSLANG_EXPORT bool buildReflection(int opts = EShReflectionDefault); - GLSLANG_EXPORT unsigned getLocalSize(int dim) const; // return dim'th local size - GLSLANG_EXPORT unsigned getTileShadingRateQCOM(int dim) const; // return dim'th tile shading rate QCOM - GLSLANG_EXPORT int getReflectionIndex(const char *name) const; - GLSLANG_EXPORT int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const; - GLSLANG_EXPORT int getNumUniformVariables() const; - GLSLANG_EXPORT const TObjectReflection& getUniform(int index) const; - GLSLANG_EXPORT int getNumUniformBlocks() const; - GLSLANG_EXPORT const TObjectReflection& getUniformBlock(int index) const; - GLSLANG_EXPORT int getNumPipeInputs() const; - GLSLANG_EXPORT const TObjectReflection& getPipeInput(int index) const; - GLSLANG_EXPORT int getNumPipeOutputs() const; - GLSLANG_EXPORT const TObjectReflection& getPipeOutput(int index) const; - GLSLANG_EXPORT int getNumBufferVariables() const; - GLSLANG_EXPORT const TObjectReflection& getBufferVariable(int index) const; - GLSLANG_EXPORT int getNumBufferBlocks() const; - GLSLANG_EXPORT const TObjectReflection& getBufferBlock(int index) const; - GLSLANG_EXPORT int getNumAtomicCounters() const; - GLSLANG_EXPORT const TObjectReflection& getAtomicCounter(int index) const; + bool buildReflection(int opts = EShReflectionDefault); + unsigned getLocalSize(int dim) const; // return dim'th local size + unsigned getTileShadingRateQCOM(int dim) const; // return dim'th tile shading rate QCOM + int getReflectionIndex(const char *name) const; + int getReflectionPipeIOIndex(const char* name, const bool inOrOut) const; + int getNumUniformVariables() const; + const TObjectReflection& getUniform(int index) const; + int getNumUniformBlocks() const; + const TObjectReflection& getUniformBlock(int index) const; + int getNumPipeInputs() const; + const TObjectReflection& getPipeInput(int index) const; + int getNumPipeOutputs() const; + const TObjectReflection& getPipeOutput(int index) const; + int getNumBufferVariables() const; + const TObjectReflection& getBufferVariable(int index) const; + int getNumBufferBlocks() const; + const TObjectReflection& getBufferBlock(int index) const; + int getNumAtomicCounters() const; + const TObjectReflection& getAtomicCounter(int index) const; // Legacy Reflection Interface - expressed in terms of above interface @@ -982,19 +985,19 @@ public: // returns a TType* const TType *getAttributeTType(int index) const { return getPipeInput(index).getType(); } - GLSLANG_EXPORT void dumpReflection(); + void dumpReflection(); // Get the IO resolver to use for mapIO - GLSLANG_EXPORT TIoMapResolver* getGlslIoResolver(EShLanguage stage); + TIoMapResolver* getGlslIoResolver(EShLanguage stage); // I/O mapping: apply base offsets and map live unbound variables // If resolver is not provided it uses the previous approach // and respects auto assignment and offsets. - GLSLANG_EXPORT bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr); + bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr); protected: - GLSLANG_EXPORT bool linkStage(EShLanguage, EShMessages); - GLSLANG_EXPORT bool crossStageCheck(EShMessages); + bool linkStage(EShLanguage, EShMessages); + bool crossStageCheck(EShMessages); TPoolAllocator* pool; std::list stages[EShLangCount]; diff --git a/src/libraries/glslang/glslang/ResourceLimits/ResourceLimits.cpp b/src/libraries/glslang/glslang/ResourceLimits/ResourceLimits.cpp index c255604b9..c55f1512b 100644 --- a/src/libraries/glslang/glslang/ResourceLimits/ResourceLimits.cpp +++ b/src/libraries/glslang/glslang/ResourceLimits/ResourceLimits.cpp @@ -39,9 +39,9 @@ #include "../../glslang/Public/ResourceLimits.h" -TBuiltInResource Resources; +static TBuiltInResource Resources; -const TBuiltInResource DefaultTBuiltInResource = { +static const TBuiltInResource DefaultTBuiltInResource = { /* .MaxLights = */ 32, /* .MaxClipPlanes = */ 6, /* .MaxTextureUnits = */ 32, diff --git a/src/libraries/glslang/glslang/build_info.h b/src/libraries/glslang/glslang/build_info.h index f78ec2a13..85a2f4181 100644 --- a/src/libraries/glslang/glslang/build_info.h +++ b/src/libraries/glslang/glslang/build_info.h @@ -34,7 +34,7 @@ #ifndef GLSLANG_BUILD_INFO #define GLSLANG_BUILD_INFO -#define GLSLANG_VERSION_MAJOR 15 +#define GLSLANG_VERSION_MAJOR 16 #define GLSLANG_VERSION_MINOR 3 #define GLSLANG_VERSION_PATCH 0 #define GLSLANG_VERSION_FLAVOR ""