Browse Source

Updated glslang.

Бранимир Караџић 2 years ago
parent
commit
b471939ffb
60 changed files with 1777 additions and 7121 deletions
  1. 0 128
      3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp
  2. 4 4
      3rdparty/glslang/OGLCompilersDLL/InitializeDll.h
  3. 1 0
      3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
  4. 106 145
      3rdparty/glslang/SPIRV/GlslangToSpv.cpp
  5. 0 4
      3rdparty/glslang/SPIRV/Logger.cpp
  6. 0 9
      3rdparty/glslang/SPIRV/Logger.h
  7. 1 0
      3rdparty/glslang/SPIRV/SPVRemapper.cpp
  8. 63 49
      3rdparty/glslang/SPIRV/SpvBuilder.cpp
  9. 10 15
      3rdparty/glslang/SPIRV/SpvBuilder.h
  10. 0 6
      3rdparty/glslang/SPIRV/SpvPostProcess.cpp
  11. 53 0
      3rdparty/glslang/SPIRV/doc.cpp
  12. 1 0
      3rdparty/glslang/SPIRV/doc.h
  13. 46 0
      3rdparty/glslang/SPIRV/spirv.hpp
  14. 2 17
      3rdparty/glslang/StandAlone/StandAlone.cpp
  15. 61 32
      3rdparty/glslang/StandAlone/spirv-remap.cpp
  16. 2 2
      3rdparty/glslang/build_info.h
  17. 1 11
      3rdparty/glslang/glslang/Include/BaseTypes.h
  18. 0 36
      3rdparty/glslang/glslang/Include/ConstantUnion.h
  19. 1 1
      3rdparty/glslang/glslang/Include/InitializeGlobals.h
  20. 0 4
      3rdparty/glslang/glslang/Include/SpirvIntrinsics.h
  21. 150 279
      3rdparty/glslang/glslang/Include/Types.h
  22. 10 0
      3rdparty/glslang/glslang/Include/arrays.h
  23. 6 31
      3rdparty/glslang/glslang/Include/intermediate.h
  24. 0 14
      3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
  25. 102 136
      3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
  26. 25 70
      3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
  27. 0 8
      3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
  28. 28 155
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
  29. 3 13
      3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
  30. 11 17
      3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp
  31. 11 19
      3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
  32. 2 53
      3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
  33. 3 6
      3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
  34. 0 12
      3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
  35. 0 16
      3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
  36. 15 29
      3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
  37. 1 0
      3rdparty/glslang/glslang/MachineIndependent/Versions.h
  38. 0 4
      3rdparty/glslang/glslang/MachineIndependent/attribute.cpp
  39. 0 4472
      3rdparty/glslang/glslang/MachineIndependent/glslang.m4
  40. 41 102
      3rdparty/glslang/glslang/MachineIndependent/glslang.y
  41. 538 518
      3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
  42. 306 303
      3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
  43. 8 12
      3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
  44. 19 18
      3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
  45. 2 4
      3rdparty/glslang/glslang/MachineIndependent/iomapper.h
  46. 0 2
      3rdparty/glslang/glslang/MachineIndependent/limits.cpp
  47. 31 58
      3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
  48. 1 50
      3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
  49. 5 65
      3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
  50. 1 6
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp
  51. 104 11
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
  52. 0 2
      3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
  53. 1 5
      3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp
  54. 0 4
      3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
  55. 0 4
      3rdparty/glslang/glslang/MachineIndependent/reflection.h
  56. 0 70
      3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
  57. 0 56
      3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp
  58. 0 11
      3rdparty/glslang/glslang/OSDependent/osinclude.h
  59. 0 9
      3rdparty/glslang/glslang/Public/ShaderLang.h
  60. 1 14
      3rdparty/glslang/glslang/updateGrammar

+ 0 - 128
3rdparty/glslang/OGLCompilersDLL/InitializeDll.cpp

@@ -32,134 +32,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#define SH_EXPORTING
-
-#include <cassert>
-
-#include "InitializeDll.h"
-#include "../glslang/Include/InitializeGlobals.h"
-#include "../glslang/Public/ShaderLang.h"
-#include "../glslang/Include/PoolAlloc.h"
-
 namespace glslang {
 
-OS_TLSIndex ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
-
-// Per-process initialization.
-// Needs to be called at least once before parsing, etc. is done.
-// Will also do thread initialization for the calling thread; other
-// threads will need to do that explicitly.
-bool InitProcess()
-{
-    glslang::GetGlobalLock();
-
-    if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) {
-        //
-        // Function is re-entrant.
-        //
-
-        glslang::ReleaseGlobalLock();
-        return true;
-    }
-
-    ThreadInitializeIndex = OS_AllocTLSIndex();
-
-    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "InitProcess(): Failed to allocate TLS area for init flag");
-
-        glslang::ReleaseGlobalLock();
-        return false;
-    }
-
-    if (! InitializePoolIndex()) {
-        assert(0 && "InitProcess(): Failed to initialize global pool");
-
-        glslang::ReleaseGlobalLock();
-        return false;
-    }
-
-    if (! InitThread()) {
-        assert(0 && "InitProcess(): Failed to initialize thread");
-
-        glslang::ReleaseGlobalLock();
-        return false;
-    }
-
-    glslang::ReleaseGlobalLock();
-    return true;
-}
-
-// Per-thread scoped initialization.
-// Must be called at least once by each new thread sharing the
-// symbol tables, etc., needed to parse.
-bool InitThread()
-{
-    //
-    // This function is re-entrant
-    //
-    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "InitThread(): Process hasn't been initalised.");
-        return false;
-    }
-
-    if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr)
-        return true;
-
-    if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) {
-        assert(0 && "InitThread(): Unable to set init flag.");
-        return false;
-    }
-
-    glslang::SetThreadPoolAllocator(nullptr);
-
-    return true;
-}
-
-// Not necessary to call this: InitThread() is reentrant, and the need
-// to do per thread tear down has been removed.
-//
-// This is kept, with memory management removed, to satisfy any exiting
-// calls to it that rely on it.
-bool DetachThread()
-{
-    bool success = true;
-
-    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX)
-        return true;
-
-    //
-    // Function is re-entrant and this thread may not have been initialized.
-    //
-    if (OS_GetTLSValue(ThreadInitializeIndex) != nullptr) {
-        if (!OS_SetTLSValue(ThreadInitializeIndex, nullptr)) {
-            assert(0 && "DetachThread(): Unable to clear init flag.");
-            success = false;
-        }
-    }
-
-    return success;
-}
-
-// Not necessary to call this: InitProcess() is reentrant.
-//
-// This is kept, with memory management removed, to satisfy any exiting
-// calls to it that rely on it.
-//
-// Users of glslang should call shFinalize() or glslang::FinalizeProcess() for
-// process-scoped memory tear down.
-bool DetachProcess()
-{
-    bool success = true;
-
-    if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX)
-        return true;
-
-    success = DetachThread();
-
-    OS_FreeTLSIndex(ThreadInitializeIndex);
-    ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
-
-    return success;
-}
-
 } // end namespace glslang

+ 4 - 4
3rdparty/glslang/OGLCompilersDLL/InitializeDll.h

@@ -38,10 +38,10 @@
 
 namespace glslang {
 
-bool InitProcess();
-bool InitThread();
-bool DetachThread();  // not called from standalone, perhaps other tools rely on parts of it
-bool DetachProcess(); // not called from standalone, perhaps other tools rely on parts of it
+inline bool InitProcess()   { return true; } // DEPRECATED
+inline bool InitThread()    { return true; } // DEPRECATED
+inline bool DetachThread()  { return true; } // DEPRECATED
+inline bool DetachProcess() { return true; } // DEPRECATED
 
 } // end namespace glslang
 

+ 1 - 0
3rdparty/glslang/SPIRV/GLSL.ext.KHR.h

@@ -55,5 +55,6 @@ static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subg
 static const char* const E_SPV_KHR_fragment_shader_barycentric = "SPV_KHR_fragment_shader_barycentric";
 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";
 
 #endif  // #ifndef GLSLextKHR_H

File diff suppressed because it is too large
+ 106 - 145
3rdparty/glslang/SPIRV/GlslangToSpv.cpp


+ 0 - 4
3rdparty/glslang/SPIRV/Logger.cpp

@@ -32,8 +32,6 @@
 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 // POSSIBILITY OF SUCH DAMAGE.
 
-#ifndef GLSLANG_WEB
-
 #include "Logger.h"
 
 #include <algorithm>
@@ -68,5 +66,3 @@ std::string SpvBuildLogger::getAllMessages() const {
 }
 
 } // end spv namespace
-
-#endif

+ 0 - 9
3rdparty/glslang/SPIRV/Logger.h

@@ -46,14 +46,6 @@ class SpvBuildLogger {
 public:
     SpvBuildLogger() {}
 
-#ifdef GLSLANG_WEB
-    void tbdFunctionality(const std::string& f) { }
-    void missingFunctionality(const std::string& f) { }
-    void warning(const std::string& w) { }
-    void error(const std::string& e) { errors.push_back(e); }
-    std::string getAllMessages() { return ""; }
-#else
-
     // Registers a TBD functionality.
     void tbdFunctionality(const std::string& f);
     // Registers a missing functionality.
@@ -67,7 +59,6 @@ public:
     // Returns all messages accumulated in the order of:
     // TBD functionalities, missing functionalities, warnings, errors.
     std::string getAllMessages() const;
-#endif
 
 private:
     SpvBuildLogger(const SpvBuildLogger&);

+ 1 - 0
3rdparty/glslang/SPIRV/SPVRemapper.cpp

@@ -680,6 +680,7 @@ namespace spv {
             case spv::OperandKernelEnqueueFlags:
             case spv::OperandKernelProfilingInfo:
             case spv::OperandCapability:
+            case spv::OperandCooperativeMatrixOperands:
                 ++word;
                 break;
 

+ 63 - 49
3rdparty/glslang/SPIRV/SpvBuilder.cpp

@@ -46,10 +46,7 @@
 #include <algorithm>
 
 #include "SpvBuilder.h"
-
-#ifndef GLSLANG_WEB
 #include "hex_float.h"
-#endif
 
 #ifndef _WIN32
     #include <cstdio>
@@ -283,11 +280,6 @@ Id Builder::makePointerFromForwardPointer(StorageClass storageClass, Id forwardP
 
 Id Builder::makeIntegerType(int width, bool hasSign)
 {
-#ifdef GLSLANG_WEB
-    assert(width == 32);
-    width = 32;
-#endif
-
     // try to find it
     Instruction* type;
     for (int t = 0; t < (int)groupedTypes[OpTypeInt].size(); ++t) {
@@ -329,11 +321,6 @@ Id Builder::makeIntegerType(int width, bool hasSign)
 
 Id Builder::makeFloatType(int width)
 {
-#ifdef GLSLANG_WEB
-    assert(width == 32);
-    width = 32;
-#endif
-
     // try to find it
     Instruction* type;
     for (int t = 0; t < (int)groupedTypes[OpTypeFloat].size(); ++t) {
@@ -481,15 +468,41 @@ Id Builder::makeMatrixType(Id component, int cols, int rows)
     return type->getResultId();
 }
 
-Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
+Id Builder::makeCooperativeMatrixTypeKHR(Id component, Id scope, Id rows, Id cols, Id use)
 {
     // try to find it
     Instruction* type;
-    for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixNV].size(); ++t) {
-        type = groupedTypes[OpTypeCooperativeMatrixNV][t];
+    for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixKHR].size(); ++t) {
+        type = groupedTypes[OpTypeCooperativeMatrixKHR][t];
         if (type->getIdOperand(0) == component &&
             type->getIdOperand(1) == scope &&
             type->getIdOperand(2) == rows &&
+            type->getIdOperand(3) == cols &&
+            type->getIdOperand(4) == use)
+            return type->getResultId();
+    }
+
+    // not found, make it
+    type = new Instruction(getUniqueId(), NoType, OpTypeCooperativeMatrixKHR);
+    type->addIdOperand(component);
+    type->addIdOperand(scope);
+    type->addIdOperand(rows);
+    type->addIdOperand(cols);
+    type->addIdOperand(use);
+    groupedTypes[OpTypeCooperativeMatrixKHR].push_back(type);
+    constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+    module.mapInstruction(type);
+
+    return type->getResultId();
+}
+
+Id Builder::makeCooperativeMatrixTypeNV(Id component, Id scope, Id rows, Id cols)
+{
+    // try to find it
+    Instruction* type;
+    for (int t = 0; t < (int)groupedTypes[OpTypeCooperativeMatrixNV].size(); ++t) {
+        type = groupedTypes[OpTypeCooperativeMatrixNV][t];
+        if (type->getIdOperand(0) == component && type->getIdOperand(1) == scope && type->getIdOperand(2) == rows &&
             type->getIdOperand(3) == cols)
             return type->getResultId();
     }
@@ -507,6 +520,17 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
     return type->getResultId();
 }
 
+Id Builder::makeCooperativeMatrixTypeWithSameShape(Id component, Id otherType)
+{
+    Instruction* instr = module.getInstruction(otherType);
+    if (instr->getOpCode() == OpTypeCooperativeMatrixNV) {
+        return makeCooperativeMatrixTypeNV(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3));
+    } else {
+        assert(instr->getOpCode() == OpTypeCooperativeMatrixKHR);
+        return makeCooperativeMatrixTypeKHR(component, instr->getIdOperand(1), instr->getIdOperand(2), instr->getIdOperand(3), instr->getIdOperand(4));
+    }
+}
+
 Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
 {
     // try to find it
@@ -696,7 +720,6 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
     constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
     module.mapInstruction(type);
 
-#ifndef GLSLANG_WEB
     // deal with capabilities
     switch (dim) {
     case DimBuffer:
@@ -742,7 +765,6 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
                 addCapability(CapabilityImageMSArray);
         }
     }
-#endif
 
     if (emitNonSemanticShaderDebugInfo)
     {
@@ -934,7 +956,7 @@ Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount)
 
 Id Builder::makeVectorDebugType(Id const baseType, int const componentCount)
 {
-    return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);;
+    return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);
 }
 
 Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor)
@@ -1159,7 +1181,6 @@ Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const localVariable
     return inst->getResultId();
 }
 
-#ifndef GLSLANG_WEB
 Id Builder::makeAccelerationStructureType()
 {
     Instruction *type;
@@ -1204,7 +1225,6 @@ Id Builder::makeHitObjectNVType()
 
     return type->getResultId();
 }
-#endif
 
 Id Builder::getDerefTypeId(Id resultId) const
 {
@@ -1254,6 +1274,7 @@ int Builder::getNumTypeConstituents(Id typeId) const
     }
     case OpTypeStruct:
         return instr->getNumOperands();
+    case OpTypeCooperativeMatrixKHR:
     case OpTypeCooperativeMatrixNV:
         // has only one constituent when used with OpCompositeConstruct.
         return 1;
@@ -1303,6 +1324,7 @@ Id Builder::getContainedTypeId(Id typeId, int member) const
     case OpTypeMatrix:
     case OpTypeArray:
     case OpTypeRuntimeArray:
+    case OpTypeCooperativeMatrixKHR:
     case OpTypeCooperativeMatrixNV:
         return instr->getIdOperand(0);
     case OpTypePointer:
@@ -1604,10 +1626,6 @@ Id Builder::makeFloatConstant(float f, bool specConstant)
 
 Id Builder::makeDoubleConstant(double d, bool specConstant)
 {
-#ifdef GLSLANG_WEB
-    assert(0);
-    return NoResult;
-#else
     Op opcode = specConstant ? OpSpecConstant : OpConstant;
     Id typeId = makeFloatType(64);
     union { double db; unsigned long long ull; } u;
@@ -1632,15 +1650,10 @@ Id Builder::makeDoubleConstant(double d, bool specConstant)
     module.mapInstruction(c);
 
     return c->getResultId();
-#endif
 }
 
 Id Builder::makeFloat16Constant(float f16, bool specConstant)
 {
-#ifdef GLSLANG_WEB
-    assert(0);
-    return NoResult;
-#else
     Op opcode = specConstant ? OpSpecConstant : OpConstant;
     Id typeId = makeFloatType(16);
 
@@ -1665,17 +1678,11 @@ Id Builder::makeFloat16Constant(float f16, bool specConstant)
     module.mapInstruction(c);
 
     return c->getResultId();
-#endif
 }
 
 Id Builder::makeFpConstant(Id type, double d, bool specConstant)
 {
-#ifdef GLSLANG_WEB
-    const int width = 32;
-    assert(width == getScalarTypeWidth(type));
-#else
     const int width = getScalarTypeWidth(type);
-#endif
 
     assert(isFloatType(type));
 
@@ -1769,6 +1776,7 @@ Id Builder::makeCompositeConstant(Id typeId, const std::vector<Id>& members, boo
     case OpTypeVector:
     case OpTypeArray:
     case OpTypeMatrix:
+    case OpTypeCooperativeMatrixKHR:
     case OpTypeCooperativeMatrixNV:
         if (! specConstant) {
             Id existing = findCompositeConstant(typeClass, typeId, members);
@@ -2405,7 +2413,24 @@ Id Builder::createArrayLength(Id base, unsigned int member)
     return length->getResultId();
 }
 
-Id Builder::createCooperativeMatrixLength(Id type)
+Id Builder::createCooperativeMatrixLengthKHR(Id type)
+{
+    spv::Id intType = makeUintType(32);
+
+    // Generate code for spec constants if in spec constant operation
+    // generation mode.
+    if (generatingOpCodeForSpecConst) {
+        return createSpecConstantOp(OpCooperativeMatrixLengthKHR, intType, std::vector<Id>(1, type), std::vector<Id>());
+    }
+
+    Instruction* length = new Instruction(getUniqueId(), intType, OpCooperativeMatrixLengthKHR);
+    length->addIdOperand(type);
+    buildPoint->addInstruction(std::unique_ptr<Instruction>(length));
+
+    return length->getResultId();
+}
+
+Id Builder::createCooperativeMatrixLengthNV(Id type)
 {
     spv::Id intType = makeUintType(32);
 
@@ -2789,12 +2814,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
     if (parameters.component != NoResult)
         texArgs.push_back(parameters.component);
 
-#ifndef GLSLANG_WEB
     if (parameters.granularity != NoResult)
         texArgs.push_back(parameters.granularity);
     if (parameters.coarse != NoResult)
         texArgs.push_back(parameters.coarse);
-#endif
 
     //
     // Set up the optional arguments
@@ -2835,7 +2858,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
         mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetsMask);
         texArgs.push_back(parameters.offsets);
     }
-#ifndef GLSLANG_WEB
     if (parameters.sample) {
         mask = (ImageOperandsMask)(mask | ImageOperandsSampleMask);
         texArgs.push_back(parameters.sample);
@@ -2853,7 +2875,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
     if (parameters.volatil) {
         mask = mask | ImageOperandsVolatileTexelKHRMask;
     }
-#endif
     mask = mask | signExtensionMask;
     // insert the operand for the mask, if any bits were set.
     if (mask != ImageOperandsMaskNone)
@@ -2868,7 +2889,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
             opCode = OpImageSparseFetch;
         else
             opCode = OpImageFetch;
-#ifndef GLSLANG_WEB
     } else if (parameters.granularity && parameters.coarse) {
         opCode = OpImageSampleFootprintNV;
     } else if (gather) {
@@ -2882,7 +2902,6 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
                 opCode = OpImageSparseGather;
             else
                 opCode = OpImageGather;
-#endif
     } else if (explicitLod) {
         if (parameters.Dref) {
             if (proj)
@@ -3245,12 +3264,7 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
     int numRows = getTypeNumRows(resultTypeId);
 
     Instruction* instr = module.getInstruction(componentTypeId);
-#ifdef GLSLANG_WEB
-    const unsigned bitCount = 32;
-    assert(bitCount == instr->getImmediateOperand(0));
-#else
     const unsigned bitCount = instr->getImmediateOperand(0);
-#endif
 
     // Optimize matrix constructed from a bigger matrix
     if (isMatrix(sources[0]) && getNumColumns(sources[0]) >= numCols && getNumRows(sources[0]) >= numRows) {
@@ -4071,4 +4085,4 @@ void Builder::dumpModuleProcesses(std::vector<unsigned int>& out) const
     }
 }
 
-}; // end spv namespace
+} // end spv namespace

+ 10 - 15
3rdparty/glslang/SPIRV/SpvBuilder.h

@@ -203,7 +203,9 @@ public:
     Id makeImageType(Id sampledType, Dim, bool depth, bool arrayed, bool ms, unsigned sampled, ImageFormat format);
     Id makeSamplerType();
     Id makeSampledImageType(Id imageType);
-    Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
+    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 makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
 
     // SPIR-V NonSemantic Shader DebugInfo Instructions
@@ -283,11 +285,10 @@ public:
     bool isMatrixType(Id typeId)       const { return getTypeClass(typeId) == OpTypeMatrix; }
     bool isStructType(Id typeId)       const { return getTypeClass(typeId) == OpTypeStruct; }
     bool isArrayType(Id typeId)        const { return getTypeClass(typeId) == OpTypeArray; }
-#ifdef GLSLANG_WEB
-    bool isCooperativeMatrixType(Id typeId)const { return false; }
-#else
-    bool isCooperativeMatrixType(Id typeId)const { return getTypeClass(typeId) == OpTypeCooperativeMatrixNV; }
-#endif
+    bool isCooperativeMatrixType(Id typeId)const
+    {
+        return getTypeClass(typeId) == OpTypeCooperativeMatrixKHR || getTypeClass(typeId) == OpTypeCooperativeMatrixNV;
+    }
     bool isAggregateType(Id typeId)    const
         { return isArrayType(typeId) || isStructType(typeId) || isCooperativeMatrixType(typeId); }
     bool isImageType(Id typeId)        const { return getTypeClass(typeId) == OpTypeImage; }
@@ -464,8 +465,10 @@ public:
     // Create an OpArrayLength instruction
     Id createArrayLength(Id base, unsigned int member);
 
+    // Create an OpCooperativeMatrixLengthKHR instruction
+    Id createCooperativeMatrixLengthKHR(Id type);
     // Create an OpCooperativeMatrixLengthNV instruction
-    Id createCooperativeMatrixLength(Id type);
+    Id createCooperativeMatrixLengthNV(Id type);
 
     // Create an OpCompositeExtract instruction
     Id createCompositeExtract(Id composite, Id typeId, unsigned index);
@@ -700,11 +703,6 @@ public:
         // Accumulate whether anything in the chain of structures has coherent decorations.
         struct CoherentFlags {
             CoherentFlags() { clear(); }
-#ifdef GLSLANG_WEB
-            void clear() { }
-            bool isVolatile() const { return false; }
-            CoherentFlags operator |=(const CoherentFlags &other) { return *this; }
-#else
             bool isVolatile() const { return volatil; }
             bool isNonUniform() const { return nonUniform; }
             bool anyCoherent() const {
@@ -749,7 +747,6 @@ public:
                 nonUniform |= other.nonUniform;
                 return *this;
             }
-#endif
         };
         CoherentFlags coherentFlags;
     };
@@ -835,14 +832,12 @@ public:
     // Prune unreachable blocks in the CFG and remove unneeded decorations.
     void postProcessCFG();
 
-#ifndef GLSLANG_WEB
     // Add capabilities, extensions based on instructions in the module.
     void postProcessFeatures();
     // Hook to visit each instruction in a block in a function
     void postProcess(Instruction&);
     // Hook to visit each non-32-bit sized float/int operation in a block.
     void postProcessType(const Instruction&, spv::Id typeId);
-#endif
 
     void dump(std::vector<unsigned int>&) const;
 

+ 0 - 6
3rdparty/glslang/SPIRV/SpvPostProcess.cpp

@@ -57,7 +57,6 @@ namespace spv {
 
 namespace spv {
 
-#ifndef GLSLANG_WEB
 // Hook to visit each operand type and result type of an instruction.
 // Will be called multiple times for one instruction, once for each typed
 // operand and the result.
@@ -334,7 +333,6 @@ void Builder::postProcess(Instruction& inst)
         }
     }
 }
-#endif
 
 // comment in header
 void Builder::postProcessCFG()
@@ -395,7 +393,6 @@ void Builder::postProcessCFG()
         decorations.end());
 }
 
-#ifndef GLSLANG_WEB
 // comment in header
 void Builder::postProcessFeatures() {
     // Add per-instruction capabilities, extensions, etc.,
@@ -483,14 +480,11 @@ void Builder::postProcessFeatures() {
         }
     }
 }
-#endif
 
 // comment in header
 void Builder::postProcess() {
   postProcessCFG();
-#ifndef GLSLANG_WEB
   postProcessFeatures();
-#endif
 }
 
 }; // end spv namespace

+ 53 - 0
3rdparty/glslang/SPIRV/doc.cpp

@@ -790,6 +790,21 @@ const char* MemoryAccessString(int mem)
     }
 }
 
+const int CooperativeMatrixOperandsCeiling = 6;
+
+const char* CooperativeMatrixOperandsString(int op)
+{
+    switch (op) {
+    case CooperativeMatrixOperandsMatrixASignedComponentsShift:  return "ASignedComponents";
+    case CooperativeMatrixOperandsMatrixBSignedComponentsShift:  return "BSignedComponents";
+    case CooperativeMatrixOperandsMatrixCSignedComponentsShift:  return "CSignedComponents";
+    case CooperativeMatrixOperandsMatrixResultSignedComponentsShift:  return "ResultSignedComponents";
+    case CooperativeMatrixOperandsSaturatingAccumulationShift:   return "SaturatingAccumulation";
+
+    default: return "Bad";
+    }
+}
+
 const char* ScopeString(int mem)
 {
     switch (mem) {
@@ -993,6 +1008,7 @@ const char* CapabilityString(int info)
     case CapabilityVariablePointers:                    return "VariablePointers";
 
     case CapabilityCooperativeMatrixNV:     return "CooperativeMatrixNV";
+    case CapabilityCooperativeMatrixKHR:    return "CooperativeMatrixKHR";
     case CapabilityShaderSMBuiltinsNV:      return "ShaderSMBuiltinsNV";
 
     case CapabilityFragmentShaderSampleInterlockEXT:        return "CapabilityFragmentShaderSampleInterlockEXT";
@@ -1473,6 +1489,11 @@ const char* OpcodeString(int op)
     case OpCooperativeMatrixStoreNV:        return "OpCooperativeMatrixStoreNV";
     case OpCooperativeMatrixMulAddNV:       return "OpCooperativeMatrixMulAddNV";
     case OpCooperativeMatrixLengthNV:       return "OpCooperativeMatrixLengthNV";
+    case OpTypeCooperativeMatrixKHR:        return "OpTypeCooperativeMatrixKHR";
+    case OpCooperativeMatrixLoadKHR:        return "OpCooperativeMatrixLoadKHR";
+    case OpCooperativeMatrixStoreKHR:       return "OpCooperativeMatrixStoreKHR";
+    case OpCooperativeMatrixMulAddKHR:      return "OpCooperativeMatrixMulAddKHR";
+    case OpCooperativeMatrixLengthKHR:      return "OpCooperativeMatrixLengthKHR";
     case OpDemoteToHelperInvocationEXT:     return "OpDemoteToHelperInvocationEXT";
     case OpIsHelperInvocationEXT:           return "OpIsHelperInvocationEXT";
 
@@ -1536,6 +1557,7 @@ EnumParameters LoopControlParams[FunctionControlCeiling];
 EnumParameters SelectionControlParams[SelectControlCeiling];
 EnumParameters FunctionControlParams[FunctionControlCeiling];
 EnumParameters MemoryAccessParams[MemoryAccessCeiling];
+EnumParameters CooperativeMatrixOperandsParams[CooperativeMatrixOperandsCeiling];
 
 // Set up all the parameterizing descriptions of the opcodes, operands, etc.
 void Parameterize()
@@ -1630,6 +1652,8 @@ void Parameterize()
         InstructionDesc[OpModuleProcessed].setResultAndType(false, false);
         InstructionDesc[OpTypeCooperativeMatrixNV].setResultAndType(true, false);
         InstructionDesc[OpCooperativeMatrixStoreNV].setResultAndType(false, false);
+        InstructionDesc[OpTypeCooperativeMatrixKHR].setResultAndType(true, false);
+        InstructionDesc[OpCooperativeMatrixStoreKHR].setResultAndType(false, false);
         InstructionDesc[OpBeginInvocationInterlockEXT].setResultAndType(false, false);
         InstructionDesc[OpEndInvocationInterlockEXT].setResultAndType(false, false);
 
@@ -1701,6 +1725,7 @@ void Parameterize()
         OperandClassParams[OperandKernelEnqueueFlags].set(0, KernelEnqueueFlagsString, nullptr);
         OperandClassParams[OperandKernelProfilingInfo].set(0, KernelProfilingInfoString, nullptr, true);
         OperandClassParams[OperandCapability].set(0, CapabilityString, nullptr);
+        OperandClassParams[OperandCooperativeMatrixOperands].set(CooperativeMatrixOperandsCeiling, CooperativeMatrixOperandsString, CooperativeMatrixOperandsParams, true);
         OperandClassParams[OperandOpcode].set(OpCodeMask + 1, OpcodeString, nullptr);
 
         // set name of operator, an initial set of <id> style operands, and the description
@@ -3093,6 +3118,34 @@ void Parameterize()
 
         InstructionDesc[OpCooperativeMatrixLengthNV].operands.push(OperandId, "'Type'");
 
+        InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Component Type'");
+        InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Scope'");
+        InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Rows'");
+        InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Columns'");
+        InstructionDesc[OpTypeCooperativeMatrixKHR].operands.push(OperandId, "'Use'");
+
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Pointer'");
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Memory Layout'");
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "'Stride'");
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandMemoryAccess, "'Memory Access'");
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandLiteralNumber, "", true);
+        InstructionDesc[OpCooperativeMatrixLoadKHR].operands.push(OperandId, "", true);
+
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Pointer'");
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Object'");
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Memory Layout'");
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "'Stride'");
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandMemoryAccess, "'Memory Access'");
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandLiteralNumber, "", true);
+        InstructionDesc[OpCooperativeMatrixStoreKHR].operands.push(OperandId, "", true);
+
+        InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'A'");
+        InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'B'");
+        InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandId, "'C'");
+        InstructionDesc[OpCooperativeMatrixMulAddKHR].operands.push(OperandCooperativeMatrixOperands, "'Cooperative Matrix Operands'", true);
+
+        InstructionDesc[OpCooperativeMatrixLengthKHR].operands.push(OperandId, "'Type'");
+
         InstructionDesc[OpDemoteToHelperInvocationEXT].setResultAndType(false, false);
 
         InstructionDesc[OpReadClockKHR].operands.push(OperandScope, "'Scope'");

+ 1 - 0
3rdparty/glslang/SPIRV/doc.h

@@ -156,6 +156,7 @@ enum OperandClass {
     OperandKernelEnqueueFlags,
     OperandKernelProfilingInfo,
     OperandCapability,
+    OperandCooperativeMatrixOperands,
 
     OperandOpcode,
 

+ 46 - 0
3rdparty/glslang/SPIRV/spirv.hpp

@@ -1144,6 +1144,7 @@ enum Capability {
     CapabilityDotProduct = 6019,
     CapabilityDotProductKHR = 6019,
     CapabilityRayCullMaskKHR = 6020,
+    CapabilityCooperativeMatrixKHR = 6022,
     CapabilityBitInstructions = 6025,
     CapabilityGroupNonUniformRotateKHR = 6026,
     CapabilityAtomicFloat32AddEXT = 6033,
@@ -1261,6 +1262,37 @@ enum PackedVectorFormat {
     PackedVectorFormatMax = 0x7fffffff,
 };
 
+enum CooperativeMatrixOperandsShift {
+    CooperativeMatrixOperandsMatrixASignedComponentsShift = 0,
+    CooperativeMatrixOperandsMatrixBSignedComponentsShift = 1,
+    CooperativeMatrixOperandsMatrixCSignedComponentsShift = 2,
+    CooperativeMatrixOperandsMatrixResultSignedComponentsShift = 3,
+    CooperativeMatrixOperandsSaturatingAccumulationShift = 4,
+    CooperativeMatrixOperandsMax = 0x7fffffff,
+};
+
+enum CooperativeMatrixOperandsMask {
+    CooperativeMatrixOperandsMaskNone = 0,
+    CooperativeMatrixOperandsMatrixASignedComponentsMask = 0x00000001,
+    CooperativeMatrixOperandsMatrixBSignedComponentsMask = 0x00000002,
+    CooperativeMatrixOperandsMatrixCSignedComponentsMask = 0x00000004,
+    CooperativeMatrixOperandsMatrixResultSignedComponentsMask = 0x00000008,
+    CooperativeMatrixOperandsSaturatingAccumulationMask = 0x00000010,
+};
+
+enum CooperativeMatrixLayout {
+    CooperativeMatrixLayoutCooperativeMatrixRowMajorKHR = 0,
+    CooperativeMatrixLayoutCooperativeMatrixColumnMajorKHR = 1,
+    CooperativeMatrixLayoutMax = 0x7fffffff,
+};
+
+enum CooperativeMatrixUse {
+    CooperativeMatrixUseMatrixAKHR = 0,
+    CooperativeMatrixUseMatrixBKHR = 1,
+    CooperativeMatrixUseMatrixAccumulatorKHR = 2,
+    CooperativeMatrixUseMax = 0x7fffffff,
+};
+
 enum Op {
     OpNop = 0,
     OpUndef = 1,
@@ -1634,6 +1666,11 @@ enum Op {
     OpUDotAccSatKHR = 4454,
     OpSUDotAccSat = 4455,
     OpSUDotAccSatKHR = 4455,
+    OpTypeCooperativeMatrixKHR = 4456,
+    OpCooperativeMatrixLoadKHR = 4457,
+    OpCooperativeMatrixStoreKHR = 4458,
+    OpCooperativeMatrixMulAddKHR = 4459,
+    OpCooperativeMatrixLengthKHR = 4460,
     OpTypeRayQueryKHR = 4472,
     OpRayQueryInitializeKHR = 4473,
     OpRayQueryTerminateKHR = 4474,
@@ -2346,6 +2383,11 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
     case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
     case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case OpTypeCooperativeMatrixKHR: *hasResult = true; *hasResultType = false; break;
+    case OpCooperativeMatrixLoadKHR: *hasResult = true; *hasResultType = true; break;
+    case OpCooperativeMatrixStoreKHR: *hasResult = false; *hasResultType = false; break;
+    case OpCooperativeMatrixMulAddKHR: *hasResult = true; *hasResultType = true; break;
+    case OpCooperativeMatrixLengthKHR: *hasResult = true; *hasResultType = true; break;
     case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
     case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
     case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2722,6 +2764,10 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad
 inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
 inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
 inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
+inline CooperativeMatrixOperandsMask operator|(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) | unsigned(b)); }
+inline CooperativeMatrixOperandsMask operator&(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) & unsigned(b)); }
+inline CooperativeMatrixOperandsMask operator^(CooperativeMatrixOperandsMask a, CooperativeMatrixOperandsMask b) { return CooperativeMatrixOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline CooperativeMatrixOperandsMask operator~(CooperativeMatrixOperandsMask a) { return CooperativeMatrixOperandsMask(~unsigned(a)); }
 
 }  // end namespace spv
 

+ 2 - 17
3rdparty/glslang/StandAlone/StandAlone.cpp

@@ -158,13 +158,11 @@ void ProcessConfigFile()
 {
     if (ConfigFile.size() == 0)
         *GetResources() = *GetDefaultResources();
-#ifndef GLSLANG_WEB
     else {
         char* configString = ReadFileData(ConfigFile.c_str());
         DecodeResourceLimits(GetResources(),  configString);
         FreeFileData(configString);
     }
-#endif
 }
 
 int ReflectOptions = EShReflectionDefault;
@@ -1342,7 +1340,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
         shader->setPreamble(PreambleString.c_str());
         shader->addProcesses(Processes);
 
-#ifndef GLSLANG_WEB
         // Set IO mapper binding shift values
         for (int r = 0; r < glslang::EResCount; ++r) {
             const glslang::TResourceType res = glslang::TResourceType(r);
@@ -1374,7 +1371,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
         }
 
         shader->setUniformLocationBase(uniformBase);
-#endif
 
         if (VulkanRulesRelaxed) {
             for (auto& storageOverride : blockStorageOverrides) {
@@ -1434,7 +1430,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
 
         const int defaultVersion = Options & EOptionDefaultDesktop ? 110 : 100;
 
-#ifndef GLSLANG_WEB
         if (Options & EOptionOutputPreprocessed) {
             std::string str;
             if (shader->preprocess(GetResources(), defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
@@ -1446,7 +1441,6 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
             StderrIfNonEmpty(shader->getInfoDebugLog());
             continue;
         }
-#endif
 
         if (! shader->parse(GetResources(), defaultVersion, false, messages, includer))
             CompileFailed = true;
@@ -1470,13 +1464,11 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
     if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages))
         LinkFailed = true;
 
-#ifndef GLSLANG_WEB
     // Map IO
     if (Options & EOptionSpv) {
         if (!program.mapIO())
             LinkFailed = true;
     }
-#endif
 
     // Report
     if (! (Options & EOptionSuppressInfolog) &&
@@ -1485,13 +1477,11 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
         PutsIfNonEmpty(program.getInfoDebugLog());
     }
 
-#ifndef GLSLANG_WEB
     // Reflect
     if (Options & EOptionDumpReflection) {
         program.buildReflection(ReflectOptions);
         program.dumpReflection();
     }
-#endif
 
     std::vector<std::string> outputFiles;
 
@@ -1534,10 +1524,8 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
                         }
 
                         outputFiles.push_back(GetBinaryName((EShLanguage)stage));
-#ifndef GLSLANG_WEB
                         if (!SpvToolsDisassembler && (Options & EOptionHumanReadableSpv))
                             spv::Disassemble(std::cout, spirv);
-#endif
                     }
                 }
             }
@@ -1632,13 +1620,11 @@ int singleMain()
         workList.add(item.get());
     });
 
-#ifndef GLSLANG_WEB
     if (Options & EOptionDumpConfig) {
         printf("%s", GetDefaultTBuiltInResourceString().c_str());
         if (workList.empty())
             return ESuccess;
     }
-#endif
 
     if (Options & EOptionDumpBareVersion) {
         printf("%d:%d.%d.%d%s\n", glslang::GetSpirvGeneratorVersion(), GLSLANG_VERSION_MAJOR, GLSLANG_VERSION_MINOR,
@@ -1884,7 +1870,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
 //
 void usage()
 {
-    printf("Usage: glslangValidator [option]... [file]...\n"
+    printf("Usage: glslang [option]... [file]...\n"
            "\n"
            "'file' can end in .<stage> for auto-stage classification, where <stage> is:\n"
            "    .conf   to provide a config file that replaces the default configuration\n"
@@ -2089,8 +2075,7 @@ void usage()
            "  --variable-name <name>\n"
            "  --vn <name>                       creates a C header file that contains a\n"
            "                                    uint32_t array named <name>\n"
-           "                                    initialized with the shader binary code\n"
-           );
+           "                                    initialized with the shader binary code\n");
 
     exit(EFailUsage);
 }

+ 61 - 32
3rdparty/glslang/StandAlone/spirv-remap.cpp

@@ -37,7 +37,11 @@
 #include <fstream>
 #include <cstring>
 #include <stdexcept>
+#include <filesystem>
 
+//
+// Include remapper
+//
 #include "../SPIRV/SPVRemapper.h"
 
 namespace {
@@ -172,7 +176,7 @@ namespace {
             << " [--strip-all | --strip all | -s]"
             << " [--strip-white-list]"
             << " [--do-everything]"
-            << " --input | -i file1 [file2...] --output|-o DESTDIR"
+            << " --input | -i file1 [file2...] --output|-o DESTDIR | destfile1 [destfile2...]"
             << std::endl;
 
         std::cout << "  " << basename(name) << " [--version | -V]" << std::endl;
@@ -182,32 +186,45 @@ namespace {
     }
 
     // grind through each SPIR in turn
-    void execute(const std::vector<std::string>& inputFile, const std::string& outputDir,
-                 const std::string& whiteListFile, int opts, int verbosity)
+    void execute(const std::vector<std::string>& inputFiles,
+                 const std::vector<std::string>& outputDirOrFiles,
+                 const bool                      isSingleOutputDir,
+                 const std::string&              whiteListFile,
+                 int                             opts,
+                 int                             verbosity)
     {
         std::vector<std::string> whiteListStrings;
-        if(!whiteListFile.empty())
+        if (!whiteListFile.empty())
             read(whiteListStrings, whiteListFile, verbosity);
 
-        for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) {
-            const std::string &filename = *it;
+        for (std::size_t ii=0; ii<inputFiles.size(); ii++) {
             std::vector<SpvWord> spv;
-            read(spv, filename, verbosity);
+            read(spv, inputFiles[ii], verbosity);
+
             spv::spirvbin_t(verbosity).remap(spv, whiteListStrings, opts);
-            const std::string outfile = outputDir + path_sep_char() + basename(filename);
-            write(spv, outfile, verbosity);
+
+            if (isSingleOutputDir) {
+                // write all outputs to same directory
+                const std::string outFile = outputDirOrFiles[0] + path_sep_char() + basename(inputFiles[ii]);
+                write(spv, outFile, verbosity);
+            } else {
+                // write each input to its associated output
+                write(spv, outputDirOrFiles[ii], verbosity);
+            }
         }
 
         if (verbosity > 0)
-            std::cout << "Done: " << inputFile.size() << " file(s) processed" << std::endl;
+            std::cout << "Done: " << inputFiles.size() << " file(s) processed" << std::endl;
     }
 
     // Parse command line options
-    void parseCmdLine(int argc, char** argv, std::vector<std::string>& inputFile,
-        std::string& outputDir,
-        std::string& stripWhiteListFile,
-        int& options,
-        int& verbosity)
+    void parseCmdLine(int argc,
+                      char** argv,
+                      std::vector<std::string>& inputFiles,
+                      std::vector<std::string>& outputDirOrFiles,
+                      std::string& stripWhiteListFile,
+                      int& options,
+                      int& verbosity)
     {
         if (argc < 2)
             usage(argv[0]);
@@ -222,18 +239,19 @@ namespace {
             const std::string arg = argv[a];
 
             if (arg == "--output" || arg == "-o") {
-                // Output directory
-                if (++a >= argc)
-                    usage(argv[0], "--output requires an argument");
-                if (!outputDir.empty())
-                    usage(argv[0], "--output can be provided only once");
-
-                outputDir = argv[a++];
+                // Collect output dirs or files
+                for (++a; a < argc && argv[a][0] != '-'; ++a)
+                    outputDirOrFiles.push_back(argv[a]);
 
-                // Remove trailing directory separator characters
-                while (!outputDir.empty() && outputDir.back() == path_sep_char())
-                    outputDir.pop_back();
+                if (outputDirOrFiles.size() == 0)
+                    usage(argv[0], "--output requires an argument");
 
+                // Remove trailing directory separator characters from all paths
+                for (std::size_t ii=0; ii<outputDirOrFiles.size(); ii++) {
+                    auto path = outputDirOrFiles[ii];
+                    while (!path.empty() && path.back() == path_sep_char())
+                        path.pop_back();
+                }
             }
             else if (arg == "-vv")     { verbosity = 2; ++a; } // verbosity shortcuts
             else if (arg == "-vvv")    { verbosity = 3; ++a; } // ...
@@ -262,7 +280,7 @@ namespace {
             } else if (arg == "--input" || arg == "-i") {
                 // Collect input files
                 for (++a; a < argc && argv[a][0] != '-'; ++a)
-                    inputFile.push_back(argv[a]);
+                    inputFiles.push_back(argv[a]);
             } else if (arg == "--do-everything") {
                 ++a;
                 options = options | spv::spirvbin_t::DO_EVERYTHING;
@@ -346,8 +364,8 @@ namespace {
 
 int main(int argc, char** argv)
 {
-    std::vector<std::string> inputFile;
-    std::string              outputDir;
+    std::vector<std::string> inputFiles;
+    std::vector<std::string> outputDirOrFiles;
     std::string              whiteListFile;
     int                      opts;
     int                      verbosity;
@@ -361,13 +379,24 @@ int main(int argc, char** argv)
     if (argc < 2)
         usage(argv[0]);
 
-    parseCmdLine(argc, argv, inputFile, outputDir, whiteListFile, opts, verbosity);
+    parseCmdLine(argc, argv, inputFiles, outputDirOrFiles, whiteListFile, opts, verbosity);
+
+    if (outputDirOrFiles.empty())
+        usage(argv[0], "Output directory or file(s) required.");
+
+    const bool isMultiInput      = inputFiles.size() > 1;
+    const bool isMultiOutput     = outputDirOrFiles.size() > 1;
+    const bool isSingleOutputDir = !isMultiOutput && std::filesystem::is_directory(outputDirOrFiles[0]);
+
+    if (isMultiInput && !isMultiOutput && !isSingleOutputDir)
+        usage(argv[0], "Output is not a directory.");
+
 
-    if (outputDir.empty())
-        usage(argv[0], "Output directory required");
+    if (isMultiInput && isMultiOutput && (outputDirOrFiles.size() != inputFiles.size()))
+        usage(argv[0], "Output must be either a single directory or one output file per input.");
 
     // Main operations: read, remap, and write.
-    execute(inputFile, outputDir, whiteListFile, opts, verbosity);
+    execute(inputFiles, outputDirOrFiles, isSingleOutputDir, whiteListFile, opts, verbosity);
 
     // If we get here, everything went OK!  Nothing more to be done.
 }

+ 2 - 2
3rdparty/glslang/build_info.h

@@ -35,8 +35,8 @@
 #define GLSLANG_BUILD_INFO
 
 #define GLSLANG_VERSION_MAJOR 12
-#define GLSLANG_VERSION_MINOR 2
-#define GLSLANG_VERSION_PATCH 0
+#define GLSLANG_VERSION_MINOR 3
+#define GLSLANG_VERSION_PATCH 1
 #define GLSLANG_VERSION_FLAVOR ""
 
 #define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \

+ 1 - 11
3rdparty/glslang/glslang/Include/BaseTypes.h

@@ -66,10 +66,9 @@ enum TBasicType {
     EbtReference,
     EbtRayQuery,
     EbtHitObjectNV,
-#ifndef GLSLANG_WEB
+    EbtCoopmat,
     // SPIR-V type defined by spirv_type
     EbtSpirvType,
-#endif
 
     // HLSL types that live only temporarily.
     EbtString,
@@ -96,9 +95,7 @@ enum TStorageQualifier {
     EvqUniform,       // read only, shared with app
     EvqBuffer,        // read/write, shared with app
     EvqShared,        // compute shader's read/write 'shared' qualifier
-#ifndef GLSLANG_WEB
     EvqSpirvStorageClass, // spirv_storage_class
-#endif
 
     EvqPayload,
     EvqPayloadIn,
@@ -341,10 +338,6 @@ enum TPrecisionQualifier {
     EpqHigh
 };
 
-#ifdef GLSLANG_WEB
-__inline const char* GetStorageQualifierString(TStorageQualifier q) { return ""; }
-__inline const char* GetPrecisionQualifierString(TPrecisionQualifier p) { return ""; }
-#else
 // These will show up in error messages
 __inline const char* GetStorageQualifierString(TStorageQualifier q)
 {
@@ -353,9 +346,7 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
     case EvqGlobal:         return "global";         break;
     case EvqConst:          return "const";          break;
     case EvqConstReadOnly:  return "const (read only)"; break;
-#ifndef GLSLANG_WEB
     case EvqSpirvStorageClass: return "spirv_storage_class"; break;
-#endif
     case EvqVaryingIn:      return "in";             break;
     case EvqVaryingOut:     return "out";            break;
     case EvqUniform:        return "uniform";        break;
@@ -546,7 +537,6 @@ __inline const char* GetPrecisionQualifierString(TPrecisionQualifier p)
     default:        return "unknown precision qualifier";
     }
 }
-#endif
 
 __inline bool isTypeSignedInt(TBasicType type)
 {

+ 0 - 36
3rdparty/glslang/glslang/Include/ConstantUnion.h

@@ -234,7 +234,6 @@ public:
 
             break;
 
-#ifndef GLSLANG_WEB
         case EbtInt16:
             if (constant.i16Const == i16Const)
                 return true;
@@ -265,7 +264,6 @@ public:
                 return true;
 
             break;
-#endif
         default:
             assert(false && "Default missing");
         }
@@ -347,7 +345,6 @@ public:
                 return true;
 
             return false;
-#ifndef GLSLANG_WEB
         case EbtInt8:
             if (i8Const > constant.i8Const)
                 return true;
@@ -378,7 +375,6 @@ public:
                 return true;
 
             return false;
-#endif
         default:
             assert(false && "Default missing");
             return false;
@@ -389,7 +385,6 @@ public:
     {
         assert(type == constant.type);
         switch (type) {
-#ifndef GLSLANG_WEB
         case EbtInt8:
             if (i8Const < constant.i8Const)
                 return true;
@@ -419,7 +414,6 @@ public:
                 return true;
 
             return false;
-#endif
         case EbtDouble:
             if (dConst < constant.dConst)
                 return true;
@@ -449,14 +443,12 @@ public:
         case EbtInt:    returnValue.setIConst(iConst + constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst + constant.uConst); break;
         case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const + constant.i8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const + constant.i16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const + constant.i64Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const + constant.u8Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const + constant.u16Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break;
-#endif
         default: assert(false && "Default missing");
         }
 
@@ -471,14 +463,12 @@ public:
         case EbtInt:    returnValue.setIConst(iConst - constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst - constant.uConst); break;
         case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const - constant.i8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const - constant.i16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const - constant.i64Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const - constant.u8Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const - constant.u16Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break;
-#endif
         default: assert(false && "Default missing");
         }
 
@@ -493,14 +483,12 @@ public:
         case EbtInt:    returnValue.setIConst(iConst * constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst * constant.uConst); break;
         case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const * constant.i8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const * constant.i16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const * constant.i64Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const * constant.u8Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const * constant.u16Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break;
-#endif
         default: assert(false && "Default missing");
         }
 
@@ -514,14 +502,12 @@ public:
         switch (type) {
         case EbtInt:    returnValue.setIConst(iConst % constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst % constant.uConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const % constant.i8Const); break;
         case EbtInt16:  returnValue.setI8Const(i8Const % constant.i16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const % constant.i64Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const % constant.u8Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const % constant.u16Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break;
-#endif
         default:     assert(false && "Default missing");
         }
 
@@ -532,7 +518,6 @@ public:
     {
         TConstUnion returnValue;
         switch (type) {
-#ifndef GLSLANG_WEB
         case EbtInt8:
             switch (constant.type) {
             case EbtInt8:   returnValue.setI8Const(i8Const >> constant.i8Const);  break;
@@ -585,19 +570,16 @@ public:
             default:       assert(false && "Default missing");
             }
             break;
-#endif
         case EbtInt:
             switch (constant.type) {
             case EbtInt:    returnValue.setIConst(iConst >> constant.iConst);   break;
             case EbtUint:   returnValue.setIConst(iConst >> constant.uConst);   break;
-#ifndef GLSLANG_WEB
             case EbtInt8:   returnValue.setIConst(iConst >> constant.i8Const);  break;
             case EbtUint8:  returnValue.setIConst(iConst >> constant.u8Const);  break;
             case EbtInt16:  returnValue.setIConst(iConst >> constant.i16Const); break;
             case EbtUint16: returnValue.setIConst(iConst >> constant.u16Const); break;
             case EbtInt64:  returnValue.setIConst(iConst >> constant.i64Const); break;
             case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break;
-#endif
             default:       assert(false && "Default missing");
             }
             break;
@@ -605,18 +587,15 @@ public:
             switch (constant.type) {
             case EbtInt:    returnValue.setUConst(uConst >> constant.iConst);   break;
             case EbtUint:   returnValue.setUConst(uConst >> constant.uConst);   break;
-#ifndef GLSLANG_WEB
             case EbtInt8:   returnValue.setUConst(uConst >> constant.i8Const);  break;
             case EbtUint8:  returnValue.setUConst(uConst >> constant.u8Const);  break;
             case EbtInt16:  returnValue.setUConst(uConst >> constant.i16Const); break;
             case EbtUint16: returnValue.setUConst(uConst >> constant.u16Const); break;
             case EbtInt64:  returnValue.setUConst(uConst >> constant.i64Const); break;
             case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break;
-#endif
             default:       assert(false && "Default missing");
             }
             break;
-#ifndef GLSLANG_WEB
          case EbtInt64:
             switch (constant.type) {
             case EbtInt8:   returnValue.setI64Const(i64Const >> constant.i8Const);  break;
@@ -643,7 +622,6 @@ public:
             default:       assert(false && "Default missing");
             }
             break;
-#endif
         default:     assert(false && "Default missing");
         }
 
@@ -654,7 +632,6 @@ public:
     {
         TConstUnion returnValue;
         switch (type) {
-#ifndef GLSLANG_WEB
         case EbtInt8:
             switch (constant.type) {
             case EbtInt8:   returnValue.setI8Const(i8Const << constant.i8Const);  break;
@@ -733,19 +710,16 @@ public:
             default:       assert(false && "Default missing");
             }
             break;
-#endif
         case EbtInt:
             switch (constant.type) {
             case EbtInt:    returnValue.setIConst(iConst << constant.iConst);   break;
             case EbtUint:   returnValue.setIConst(iConst << constant.uConst);   break;
-#ifndef GLSLANG_WEB
             case EbtInt8:   returnValue.setIConst(iConst << constant.i8Const);  break;
             case EbtUint8:  returnValue.setIConst(iConst << constant.u8Const);  break;
             case EbtInt16:  returnValue.setIConst(iConst << constant.i16Const); break;
             case EbtUint16: returnValue.setIConst(iConst << constant.u16Const); break;
             case EbtInt64:  returnValue.setIConst(iConst << constant.i64Const); break;
             case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break;
-#endif
             default:       assert(false && "Default missing");
             }
             break;
@@ -753,14 +727,12 @@ public:
             switch (constant.type) {
             case EbtInt:    returnValue.setUConst(uConst << constant.iConst);   break;
             case EbtUint:   returnValue.setUConst(uConst << constant.uConst);   break;
-#ifndef GLSLANG_WEB
             case EbtInt8:   returnValue.setUConst(uConst << constant.i8Const);  break;
             case EbtUint8:  returnValue.setUConst(uConst << constant.u8Const);  break;
             case EbtInt16:  returnValue.setUConst(uConst << constant.i16Const); break;
             case EbtUint16: returnValue.setUConst(uConst << constant.u16Const); break;
             case EbtInt64:  returnValue.setUConst(uConst << constant.i64Const); break;
             case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break;
-#endif
             default:       assert(false && "Default missing");
             }
             break;
@@ -777,14 +749,12 @@ public:
         switch (type) {
         case EbtInt:    returnValue.setIConst(iConst & constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst & constant.uConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const & constant.i8Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const & constant.u8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const & constant.i16Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const & constant.u16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const & constant.i64Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break;
-#endif
         default:     assert(false && "Default missing");
         }
 
@@ -798,14 +768,12 @@ public:
         switch (type) {
         case EbtInt:    returnValue.setIConst(iConst | constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst | constant.uConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const | constant.i8Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const | constant.u8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const | constant.i16Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const | constant.u16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const | constant.i64Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break;
-#endif
         default:     assert(false && "Default missing");
         }
 
@@ -819,14 +787,12 @@ public:
         switch (type) {
         case EbtInt:    returnValue.setIConst(iConst ^ constant.iConst); break;
         case EbtUint:   returnValue.setUConst(uConst ^ constant.uConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(i8Const ^ constant.i8Const); break;
         case EbtUint8:  returnValue.setU8Const(u8Const ^ constant.u8Const); break;
         case EbtInt16:  returnValue.setI16Const(i16Const ^ constant.i16Const); break;
         case EbtUint16: returnValue.setU16Const(u16Const ^ constant.u16Const); break;
         case EbtInt64:  returnValue.setI64Const(i64Const ^ constant.i64Const); break;
         case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break;
-#endif
         default:     assert(false && "Default missing");
         }
 
@@ -839,14 +805,12 @@ public:
         switch (type) {
         case EbtInt:    returnValue.setIConst(~iConst); break;
         case EbtUint:   returnValue.setUConst(~uConst); break;
-#ifndef GLSLANG_WEB
         case EbtInt8:   returnValue.setI8Const(~i8Const); break;
         case EbtUint8:  returnValue.setU8Const(~u8Const); break;
         case EbtInt16:  returnValue.setI16Const(~i16Const); break;
         case EbtUint16: returnValue.setU16Const(~u16Const); break;
         case EbtInt64:  returnValue.setI64Const(~i64Const); break;
         case EbtUint64: returnValue.setU64Const(~u64Const); break;
-#endif
         default:     assert(false && "Default missing");
         }
 

+ 1 - 1
3rdparty/glslang/glslang/Include/InitializeGlobals.h

@@ -37,7 +37,7 @@
 
 namespace glslang {
 
-bool InitializePoolIndex();
+inline bool InitializePoolIndex() { return true; } // DEPRECATED: No need to call
 
 } // end namespace glslang
 

+ 0 - 4
3rdparty/glslang/glslang/Include/SpirvIntrinsics.h

@@ -35,8 +35,6 @@
 
 #pragma once
 
-#ifndef GLSLANG_WEB
-
 //
 // GL_EXT_spirv_intrinsics
 //
@@ -135,5 +133,3 @@ struct TSpirvType {
 };
 
 } // end namespace glslang
-
-#endif // GLSLANG_WEB

File diff suppressed because it is too large
+ 150 - 279
3rdparty/glslang/glslang/Include/Types.h


+ 10 - 0
3rdparty/glslang/glslang/Include/arrays.h

@@ -147,6 +147,15 @@ struct TSmallArrayVector {
             sizes->erase(sizes->begin());
     }
 
+    void pop_back()
+    {
+        assert(sizes != nullptr && sizes->size() > 0);
+        if (sizes->size() == 1)
+            dealloc();
+        else
+            sizes->resize(sizes->size() - 1);
+    }
+
     // 'this' should currently not be holding anything, and copyNonFront
     // will make it hold a copy of all but the first element of rhs.
     // (This would be useful for making a type that is dereferenced by
@@ -306,6 +315,7 @@ struct TArraySizes {
     bool isDefaultImplicitlySized() const { return implicitlySized && implicitArraySize == 0; }
     void setImplicitlySized(bool isImplicitSizing) { implicitlySized = isImplicitSizing; }
     void dereference() { sizes.pop_front(); }
+    void removeLastSize() { sizes.pop_back(); }
     void copyDereferenced(const TArraySizes& rhs)
     {
         assert(sizes.size() == 0);

+ 6 - 31
3rdparty/glslang/glslang/Include/intermediate.h

@@ -72,9 +72,7 @@ enum TOperator {
     EOpFunctionCall,
     EOpFunction,        // For function definition
     EOpParameters,      // an aggregate listing the parameters to a function
-#ifndef GLSLANG_WEB
     EOpSpirvInst,
-#endif
 
     //
     // Unary operators
@@ -629,6 +627,9 @@ enum TOperator {
     EOpCooperativeMatrixLoad,
     EOpCooperativeMatrixStore,
     EOpCooperativeMatrixMulAdd,
+    EOpCooperativeMatrixLoadNV,
+    EOpCooperativeMatrixStoreNV,
+    EOpCooperativeMatrixMulAddNV,
 
     EOpBeginInvocationInterlock, // Fragment only
     EOpEndInvocationInterlock, // Fragment only
@@ -766,7 +767,8 @@ enum TOperator {
     EOpConstructTextureSampler,
     EOpConstructNonuniform,     // expected to be transformed away, not present in final AST
     EOpConstructReference,
-    EOpConstructCooperativeMatrix,
+    EOpConstructCooperativeMatrixNV,
+    EOpConstructCooperativeMatrixKHR,
     EOpConstructAccStruct,
     EOpConstructGuardEnd,
 
@@ -1331,12 +1333,7 @@ public:
     // per process threadPoolAllocator, then it causes increased memory usage per compile
     // it is essential to use "symbol = sym" to assign to symbol
     TIntermSymbol(long long i, const TString& n, const TType& t)
-        : TIntermTyped(t), id(i),
-#ifndef GLSLANG_WEB
-        flattenSubset(-1),
-#endif
-        constSubtree(nullptr)
-          { name = n; }
+        : TIntermTyped(t), id(i), flattenSubset(-1), constSubtree(nullptr) { name = n; }
     virtual long long getId() const { return id; }
     virtual void changeId(long long i) { id = i; }
     virtual const TString& getName() const { return name; }
@@ -1347,12 +1344,10 @@ public:
     const TConstUnionArray& getConstArray() const { return constArray; }
     void setConstSubtree(TIntermTyped* subtree) { constSubtree = subtree; }
     TIntermTyped* getConstSubtree() const { return constSubtree; }
-#ifndef GLSLANG_WEB
     void setFlattenSubset(int subset) { flattenSubset = subset; }
     virtual const TString& getAccessName() const;
 
     int getFlattenSubset() const { return flattenSubset; } // -1 means full object
-#endif
 
     // This is meant for cases where a node has already been constructed, and
     // later on, it becomes necessary to switch to a different symbol.
@@ -1360,9 +1355,7 @@ public:
 
 protected:
     long long id;                // the unique id of the symbol this node represents
-#ifndef GLSLANG_WEB
     int flattenSubset;           // how deeply the flattened object rooted at id has been dereferenced
-#endif
     TString name;                // the name of the symbol this node represents
     TConstUnionArray constArray; // if the symbol is a front-end compile-time constant, this is its value
     TIntermTyped* constSubtree;
@@ -1417,19 +1410,11 @@ public:
     bool isConstructor() const;
     bool isTexture()  const { return op > EOpTextureGuardBegin  && op < EOpTextureGuardEnd; }
     bool isSampling() const { return op > EOpSamplingGuardBegin && op < EOpSamplingGuardEnd; }
-#ifdef GLSLANG_WEB
-    bool isImage()          const { return false; }
-    bool isSparseTexture()  const { return false; }
-    bool isImageFootprint() const { return false; }
-    bool isSparseImage()    const { return false; }
-    bool isSubgroup()       const { return false; }
-#else
     bool isImage()    const { return op > EOpImageGuardBegin    && op < EOpImageGuardEnd; }
     bool isSparseTexture() const { return op > EOpSparseTextureGuardBegin && op < EOpSparseTextureGuardEnd; }
     bool isImageFootprint() const { return op > EOpImageFootprintGuardBegin && op < EOpImageFootprintGuardEnd; }
     bool isSparseImage()   const { return op == EOpSparseImageLoad; }
     bool isSubgroup() const { return op > EOpSubgroupGuardStart && op < EOpSubgroupGuardStop; }
-#endif
 
     void setOperationPrecision(TPrecisionQualifier p) { operationPrecision = p; }
     TPrecisionQualifier getOperationPrecision() const { return operationPrecision != EpqNone ?
@@ -1535,7 +1520,6 @@ public:
             cracked.offset = true;
             cracked.proj = true;
             break;
-#ifndef GLSLANG_WEB
         case EOpTextureClamp:
         case EOpSparseTextureClamp:
             cracked.lodClamp = true;
@@ -1622,7 +1606,6 @@ public:
         case EOpColorAttachmentReadEXT:
             cracked.attachmentEXT = true;
             break;
-#endif
         default:
             break;
         }
@@ -1673,15 +1656,11 @@ public:
     virtual       TIntermUnary* getAsUnaryNode()       { return this; }
     virtual const TIntermUnary* getAsUnaryNode() const { return this; }
     virtual void updatePrecision();
-#ifndef GLSLANG_WEB
     void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; }
     const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
-#endif
 protected:
     TIntermTyped* operand;
-#ifndef GLSLANG_WEB
     TSpirvInstruction spirvInst;
-#endif
 };
 
 typedef TVector<TIntermNode*> TIntermSequence;
@@ -1713,10 +1692,8 @@ public:
     bool getDebug() const { return debug; }
     void setPragmaTable(const TPragmaTable& pTable);
     const TPragmaTable& getPragmaTable() const { return *pragmaTable; }
-#ifndef GLSLANG_WEB
     void setSpirvInstruction(const TSpirvInstruction& inst) { spirvInst = inst; }
     const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
-#endif
 protected:
     TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
     TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
@@ -1727,9 +1704,7 @@ protected:
     bool optimize;
     bool debug;
     TPragmaTable* pragmaTable;
-#ifndef GLSLANG_WEB
     TSpirvInstruction spirvInst;
-#endif
 };
 
 //

+ 0 - 14
3rdparty/glslang/glslang/MachineIndependent/Constant.cpp

@@ -177,7 +177,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
                     newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst());
                 break;
 
-#ifndef GLSLANG_WEB
             case EbtInt8:
                 if (rightUnionArray[i] == (signed char)0)
                     newConstArray[i].setI8Const((signed char)0x7F);
@@ -227,7 +226,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
                 break;
             default:
                 return nullptr;
-#endif
             }
         }
         break;
@@ -266,7 +264,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
                         newConstArray[i].setIConst(0);
                         break;
                     } else goto modulo_default;
-#ifndef GLSLANG_WEB
                 case EbtInt64:
                     if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == LLONG_MIN) {
                         newConstArray[i].setI64Const(0);
@@ -277,7 +274,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right
                         newConstArray[i].setIConst(0);
                         break;
                     } else goto modulo_default;
-#endif
                 default:
                 modulo_default:
                     newConstArray[i] = leftUnionArray[i] % rightUnionArray[i];
@@ -507,14 +503,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
                                     : -unionArray[i].getIConst());
                            break;
             case EbtUint:  newConstArray[i].setUConst(static_cast<unsigned int>(-static_cast<int>(unionArray[i].getUConst())));  break;
-#ifndef GLSLANG_WEB
             case EbtInt8:  newConstArray[i].setI8Const(-unionArray[i].getI8Const()); break;
             case EbtUint8: newConstArray[i].setU8Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU8Const())));  break;
             case EbtInt16: newConstArray[i].setI16Const(-unionArray[i].getI16Const()); break;
             case EbtUint16:newConstArray[i].setU16Const(static_cast<unsigned int>(-static_cast<signed int>(unionArray[i].getU16Const())));  break;
             case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break;
             case EbtUint64: newConstArray[i].setU64Const(static_cast<unsigned long long>(-static_cast<long long>(unionArray[i].getU64Const())));  break;
-#endif
             default:
                 return nullptr;
             }
@@ -684,7 +678,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
         case EOpConvDoubleToInt:
             newConstArray[i].setIConst(static_cast<int>(unionArray[i].getDConst())); break;
 
-#ifndef GLSLANG_WEB
         case EOpConvInt8ToBool:
             newConstArray[i].setBConst(unionArray[i].getI8Const() != 0); break;
         case EOpConvUint8ToBool:
@@ -919,7 +912,6 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
         case EOpConvUint64ToPtr:
         case EOpConstructReference:
             newConstArray[i].setU64Const(unionArray[i].getU64Const()); break;
-#endif
 
         // TODO: 3.0 Functionality: unary constant folding: the rest of the ops have to be fleshed out
 
@@ -1066,7 +1058,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                 case EbtUint:
                     newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
                     break;
-#ifndef GLSLANG_WEB
                 case EbtInt8:
                     newConstArray[comp].setI8Const(std::min(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
                     break;
@@ -1085,7 +1076,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                 case EbtUint64:
                     newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
                     break;
-#endif
                 default: assert(false && "Default missing");
                 }
                 break;
@@ -1102,7 +1092,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                 case EbtUint:
                     newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()));
                     break;
-#ifndef GLSLANG_WEB
                 case EbtInt8:
                     newConstArray[comp].setI8Const(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()));
                     break;
@@ -1121,7 +1110,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                 case EbtUint64:
                     newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()));
                     break;
-#endif
                 default: assert(false && "Default missing");
                 }
                 break;
@@ -1137,7 +1125,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                     newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()),
                                                                                                                    childConstUnions[2][arg2comp].getUConst()));
                     break;
-#ifndef GLSLANG_WEB
                 case EbtInt8:
                     newConstArray[comp].setI8Const(std::min(std::max(childConstUnions[0][arg0comp].getI8Const(), childConstUnions[1][arg1comp].getI8Const()),
                                                                                                                    childConstUnions[2][arg2comp].getI8Const()));
@@ -1166,7 +1153,6 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode)
                     newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()),
                                                                                                                        childConstUnions[2][arg2comp].getU64Const()));
                     break;
-#endif
                 default: assert(false && "Default missing");
                 }
                 break;

+ 102 - 136
3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp

@@ -144,10 +144,6 @@ struct Versioning {
 EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECompatibilityProfile);
 
 // Declare pointers to put into the table for versioning.
-#ifdef GLSLANG_WEB
-    const Versioning* Es300Desktop130 = nullptr;
-    const Versioning* Es310Desktop420 = nullptr;
-#else
     const Versioning Es300Desktop130Version[] = { { EEsProfile,      0, 300, 0, nullptr },
                                                   { EDesktopProfile, 0, 130, 0, nullptr },
                                                   { EBadProfile } };
@@ -162,7 +158,6 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
                                                   { EDesktopProfile, 0, 450, 0, nullptr },
                                                   { EBadProfile } };
     const Versioning* Es310Desktop450 = &Es310Desktop450Version[0];
-#endif
 
 // The main descriptor of what a set of function prototypes can look like, and
 // a pointer to extra versioning information, when needed.
@@ -264,10 +259,8 @@ const BuiltInFunction BaseFunctions[] = {
     { EOpAtomicXor,        "atomicXor",        2,   TypeIU,    ClassV1FIOCV, Es310Desktop420 },
     { EOpAtomicExchange,   "atomicExchange",   2,   TypeIU,    ClassV1FIOCV, Es310Desktop420 },
     { EOpAtomicCompSwap,   "atomicCompSwap",   3,   TypeIU,    ClassV1FIOCV, Es310Desktop420 },
-#ifndef GLSLANG_WEB
     { EOpMix,              "mix",              3,   TypeB,     ClassRegular, Es310Desktop450 },
     { EOpMix,              "mix",              3,   TypeIU,    ClassLB,      Es310Desktop450 },
-#endif
 
     { EOpNull }
 };
@@ -386,10 +379,8 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
                 if (arg == function.numArguments - 1 && (function.classes & ClassLO))
                     decls.append("out ");
                 if (arg == 0) {
-#ifndef GLSLANG_WEB
                     if (function.classes & ClassCV)
                         decls.append("coherent volatile ");
-#endif
                     if (function.classes & ClassFIO)
                         decls.append("inout ");
                     if (function.classes & ClassFO)
@@ -416,11 +407,6 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
 // See if the tabled versioning information allows the current version.
 bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */)
 {
-#if defined(GLSLANG_WEB)
-    // all entries in table are valid
-    return true;
-#endif
-
     // nullptr means always valid
     if (function.versioning == nullptr)
         return true;
@@ -501,7 +487,6 @@ TBuiltIns::TBuiltIns()
     prefixes[EbtFloat] =  "";
     prefixes[EbtInt]   = "i";
     prefixes[EbtUint]  = "u";
-#if !defined(GLSLANG_WEB)
     prefixes[EbtFloat16] = "f16";
     prefixes[EbtInt8]  = "i8";
     prefixes[EbtUint8] = "u8";
@@ -509,7 +494,6 @@ TBuiltIns::TBuiltIns()
     prefixes[EbtUint16] = "u16";
     prefixes[EbtInt64]  = "i64";
     prefixes[EbtUint64] = "u64";
-#endif
 
     postfixes[2] = "2";
     postfixes[3] = "3";
@@ -519,13 +503,11 @@ TBuiltIns::TBuiltIns()
     dimMap[Esd2D] = 2;
     dimMap[Esd3D] = 3;
     dimMap[EsdCube] = 3;
-#ifndef GLSLANG_WEB
     dimMap[Esd1D] = 1;
     dimMap[EsdRect] = 2;
     dimMap[EsdBuffer] = 1;
     dimMap[EsdSubpass] = 2;  // potentially unused for now
     dimMap[EsdAttachmentEXT] = 2;  // potentially unused for now
-#endif
 }
 
 TBuiltIns::~TBuiltIns()
@@ -543,10 +525,6 @@ TBuiltIns::~TBuiltIns()
 //
 void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvVersion)
 {
-#ifdef GLSLANG_WEB
-    version = 310;
-    profile = EEsProfile;
-#endif
     addTabledBuiltins(version, profile, spvVersion);
 
     //============================================================================
@@ -555,7 +533,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
     //
     //============================================================================
 
-#ifndef GLSLANG_WEB
     //
     // Derivatives Functions.
     //
@@ -1500,7 +1477,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "void atomicStore(coherent volatile out double, double, int, int, int);"
             "\n");
     }
-#endif // !GLSLANG_WEB
 
     if ((profile == EEsProfile && version >= 300) ||
         (profile != EEsProfile && version >= 150)) { // GL_ARB_shader_bit_encoding
@@ -1528,7 +1504,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-#ifndef GLSLANG_WEB
     if ((profile != EEsProfile && version >= 400) ||
         (profile == EEsProfile && version >= 310)) {    // GL_OES_gpu_shader5
 
@@ -1606,7 +1581,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
             "\n");
     }
-#endif
 
     if ((profile == EEsProfile && version >= 300) ||
         (profile != EEsProfile && version >= 150)) {
@@ -1635,7 +1609,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-#ifndef GLSLANG_WEB
     if ((profile == EEsProfile && version >= 310) ||
         (profile != EEsProfile && version >= 150)) {
         commonBuiltins.append(
@@ -1655,7 +1628,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                     "vec4 unpackUnorm4x8(highp uint);"
             "\n");
     }
-#endif
 
     //
     // Matrix Functions.
@@ -1714,7 +1686,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
         }
     }
 
-#ifndef GLSLANG_WEB
     //
     // Original-style texture functions existing in all stages.
     // (Per-stage functions below.)
@@ -4257,7 +4228,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "void EndPrimitive();"
             "\n");
     }
-#endif // !GLSLANG_WEB
 
     //============================================================================
     //
@@ -4294,7 +4264,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "void groupMemoryBarrier();"
             );
     }
-#ifndef GLSLANG_WEB
     if ((profile != EEsProfile && version >= 420) || esBarrier) {
         if (spvVersion.vulkan == 0 || spvVersion.vulkanRelaxed) {
             commonBuiltins.append("void memoryBarrierAtomicCounter();");
@@ -4397,6 +4366,94 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "icoopmatNV coopMatMulAddNV(icoopmatNV A, icoopmatNV B, icoopmatNV C);\n"
             "ucoopmatNV coopMatMulAddNV(ucoopmatNV A, ucoopmatNV B, ucoopmatNV C);\n"
             );
+
+        std::string cooperativeMatrixFuncs =
+            "void coopMatLoad(out coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "void coopMatLoad(out coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "void coopMatLoad(out coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatLoad(out coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "void coopMatStore(coopmat m, volatile coherent int8_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent int16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent int32_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent int64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent uint8_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent uint16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent uint32_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent uint64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent float16_t[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent float[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent float64_t[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "void coopMatStore(coopmat m, volatile coherent i8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u8vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f16vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f32vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f64vec2[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "void coopMatStore(coopmat m, volatile coherent i8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent i64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u8vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent u64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f16vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f32vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+            "void coopMatStore(coopmat m, volatile coherent f64vec4[] buf, uint element, uint stride, int matrixLayout);\n"
+
+            "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C);\n"
+            "coopmat coopMatMulAdd(coopmat A, coopmat B, coopmat C, int matrixOperands);\n";
+
+        commonBuiltins.append(cooperativeMatrixFuncs.c_str());
+
+        commonBuiltins.append(
+            "const int gl_MatrixUseA = 0;\n"
+            "const int gl_MatrixUseB = 1;\n"
+            "const int gl_MatrixUseAccumulator = 2;\n"
+            "const int gl_MatrixOperandsSaturatingAccumulation = 0x10;\n"
+            "const int gl_CooperativeMatrixLayoutRowMajor = 0;\n"
+            "const int gl_CooperativeMatrixLayoutColumnMajor = 1;\n"
+            "\n"
+            );
     }
 
     //============================================================================
@@ -4754,7 +4811,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "void SetMeshOutputsEXT(uint, uint);"
             "\n");
     }
-#endif // !GLSLANG_WEB
 
     //============================================================================
     //
@@ -4776,13 +4832,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "highp float diff;"   // f - n
                 );
         } else {
-#ifndef GLSLANG_WEB
             commonBuiltins.append(
                 "float near;"  // n
                 "float far;"   // f
                 "float diff;"  // f - n
                 );
-#endif
         }
 
         commonBuiltins.append(
@@ -4791,7 +4845,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-#if !defined(GLSLANG_WEB)
     if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) {
         //
         // Matrix state. p. 31, 32, 37, 39, 40.
@@ -4909,7 +4962,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
             "\n");
     }
-#endif // !GLSLANG_WEB
 
     //============================================================================
     //
@@ -4939,7 +4991,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-#ifndef GLSLANG_WEB
     //============================================================================
     //
     // Define the interface to the mesh/task shader.
@@ -5222,19 +5273,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                     "in highp int gl_InstanceID;"    // needs qualifier fixed later
                     );
             if (spvVersion.vulkan > 0)
-#endif
                 stageBuiltins[EShLangVertex].append(
                     "in highp int gl_VertexIndex;"
                     "in highp int gl_InstanceIndex;"
                     );
-#ifndef GLSLANG_WEB
             if (version < 310)
-#endif
                 stageBuiltins[EShLangVertex].append(
                     "highp vec4  gl_Position;"    // needs qualifier fixed later
                     "highp float gl_PointSize;"   // needs qualifier fixed later
                     );
-#ifndef GLSLANG_WEB
             else
                 stageBuiltins[EShLangVertex].append(
                     "out gl_PerVertex {"
@@ -5712,7 +5759,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "mediump vec2 gl_PointCoord;"   // needs qualifier fixed later
                 );
         }
-#endif
         if (version >= 300) {
             stageBuiltins[EShLangFragment].append(
                 "highp   vec4  gl_FragCoord;"    // needs qualifier fixed later
@@ -5721,7 +5767,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "highp   float gl_FragDepth;"    // needs qualifier fixed later
                 );
         }
-#ifndef GLSLANG_WEB
         if (version >= 310) {
             stageBuiltins[EShLangFragment].append(
                 "bool gl_HelperInvocation;"          // needs qualifier fixed later
@@ -5766,15 +5811,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate
             );
     }
-#endif
 
     stageBuiltins[EShLangFragment].append("\n");
 
     if (version >= 130)
         add2ndGenerationSamplingImaging(version, profile, spvVersion);
 
-#ifndef GLSLANG_WEB
-
     if ((profile != EEsProfile && version >= 140) ||
         (profile == EEsProfile && version >= 310)) {
         stageBuiltins[EShLangFragment].append(
@@ -6166,7 +6208,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             }
         }
     }
-#endif // !GLSLANG_WEB
 
     // printf("%s\n", commonBuiltins.c_str());
     // printf("%s\n", stageBuiltins[EShLangFragment].c_str());
@@ -6185,26 +6226,14 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 
     // enumerate all the types
     const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint,
-#if !defined(GLSLANG_WEB)
-        EbtFloat16
-#endif
+         EbtFloat16
     };
-#ifdef GLSLANG_WEB
-    bool skipBuffer = true;
-    bool skipCubeArrayed = true;
-    const int image = 0;
-#else
     bool skipBuffer = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 140);
     bool skipCubeArrayed = (profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 130);
     for (int image = 0; image <= 1; ++image) // loop over "bool" image vs sampler
-#endif
     {
         for (int shadow = 0; shadow <= 1; ++shadow) { // loop over "bool" shadow or not
-#ifdef GLSLANG_WEB
-            const int ms = 0;
-#else
             for (int ms = 0; ms <= 1; ++ms) // loop over "bool" multisample or not
-#endif
             {
                 if ((ms || image) && shadow)
                     continue;
@@ -6216,9 +6245,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
                     continue;
 
                 for (int arrayed = 0; arrayed <= 1; ++arrayed) { // loop over "bool" arrayed or not
-#ifdef GLSLANG_WEB
-                    for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube
-#else
                     for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass
                         if (dim == EsdAttachmentEXT)
                             continue;
@@ -6242,7 +6268,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
                             continue;
                         if (ms && arrayed && profile == EEsProfile && version < 310)
                             continue;
-#endif
                         if (dim == Esd3D && shadow)
                             continue;
                         if (dim == EsdCube && arrayed && skipCubeArrayed)
@@ -6252,25 +6277,21 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 
                         // Loop over the bTypes
                         for (size_t bType = 0; bType < sizeof(bTypes)/sizeof(TBasicType); ++bType) {
-#ifndef GLSLANG_WEB
                             if (bTypes[bType] == EbtFloat16 && (profile == EEsProfile || version < 450))
                                 continue;
                             if (dim == EsdRect && version < 140 && bType > 0)
                                 continue;
-#endif
                             if (shadow && (bTypes[bType] == EbtInt || bTypes[bType] == EbtUint))
                                 continue;
                             //
                             // Now, make all the function prototypes for the type we just built...
                             //
                             TSampler sampler;
-#ifndef GLSLANG_WEB
                             if (dim == EsdSubpass) {
                                 sampler.setSubpass(bTypes[bType], ms ? true : false);
                             } else if (dim == EsdAttachmentEXT) {
                                 sampler.setAttachmentEXT(bTypes[bType]);
                             } else
-#endif
                             if (image) {
                                 sampler.setImage(bTypes[bType], (TSamplerDim)dim, arrayed ? true : false,
                                                                                   shadow  ? true : false,
@@ -6283,12 +6304,10 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
 
                             TString typeName = sampler.getString();
 
-#ifndef GLSLANG_WEB
                             if (dim == EsdSubpass) {
                                 addSubpassSampling(sampler, typeName, version, profile);
                                 continue;
                             }
-#endif
 
                             addQueryFunctions(sampler, typeName, version, profile);
 
@@ -6296,7 +6315,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
                                 addImageFunctions(sampler, typeName, version, profile);
                             else {
                                 addSamplingFunctions(sampler, typeName, version, profile);
-#ifndef GLSLANG_WEB
                                 addGatherFunctions(sampler, typeName, version, profile);
                                 if (spvVersion.vulkan > 0 && sampler.isCombined() && !sampler.shadow) {
                                     // Base Vulkan allows texelFetch() for
@@ -6312,7 +6330,6 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
                                     addSamplingFunctions(sampler, textureTypeName, version, profile);
                                     addQueryFunctions(sampler, textureTypeName, version, profile);
                                 }
-#endif
                             }
                         }
                     }
@@ -6343,16 +6360,6 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int
 
     int sizeDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0) - (sampler.dim == EsdCube ? 1 : 0);
 
-#ifdef GLSLANG_WEB
-    commonBuiltins.append("highp ");
-    commonBuiltins.append("ivec");
-    commonBuiltins.append(postfixes[sizeDims]);
-    commonBuiltins.append(" textureSize(");
-    commonBuiltins.append(typeName);
-    commonBuiltins.append(",int);\n");
-    return;
-#endif
-
     if (sampler.isImage() && ((profile == EEsProfile && version < 310) || (profile != EEsProfile && version < 420)))
         return;
 
@@ -6672,11 +6679,6 @@ void TBuiltIns::addSubpassSampling(TSampler sampler, const TString& typeName, in
 //
 void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 {
-#ifdef GLSLANG_WEB
-    profile = EEsProfile;
-    version = 310;
-#endif
-
     //
     // texturing
     //
@@ -6751,11 +6753,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
                                     continue;
 
                                 // loop over 16-bit floating-point texel addressing
-#if defined(GLSLANG_WEB)
-                                const int f16TexAddr = 0;
-#else
                                 for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr)
-#endif
                                 {
                                     if (f16TexAddr && sampler.type != EbtFloat16)
                                         continue;
@@ -6764,11 +6762,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
                                         totalDims--;
                                     }
                                     // loop over "bool" lod clamp
-#if defined(GLSLANG_WEB)
-                                    const int lodClamp = 0;
-#else
                                     for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp)
-#endif
                                     {
                                         if (lodClamp && (profile == EEsProfile || version < 450))
                                             continue;
@@ -6776,11 +6770,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
                                             continue;
 
                                         // loop over "bool" sparse or not
-#if defined(GLSLANG_WEB)
-                                        const int sparse = 0;
-#else
                                         for (int sparse = 0; sparse <= 1; ++sparse)
-#endif
                                         {
                                             if (sparse && (profile == EEsProfile || version < 450))
                                                 continue;
@@ -6957,11 +6947,6 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
 //
 void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, int version, EProfile profile)
 {
-#ifdef GLSLANG_WEB
-    profile = EEsProfile;
-    version = 310;
-#endif
-
     switch (sampler.dim) {
     case Esd2D:
     case EsdRect:
@@ -7200,11 +7185,6 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
 //
 void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language)
 {
-#ifdef GLSLANG_WEB
-    version = 310;
-    profile = EEsProfile;
-#endif
-
     //
     // Initialize the context-dependent (resource-dependent) built-in strings for parsing.
     //
@@ -7262,7 +7242,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
             s.append(builtInConstant);
         }
 
-#ifndef GLSLANG_WEB
         if (version >= 310) {
             // geometry
 
@@ -7585,7 +7564,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
             snprintf(builtInConstant, maxSize, "const int gl_MaxTransformFeedbackInterleavedComponents = %d;", resources.maxTransformFeedbackInterleavedComponents);
             s.append(builtInConstant);
         }
-#endif
     }
 
     // compute
@@ -7607,7 +7585,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         s.append("\n");
     }
 
-#ifndef GLSLANG_WEB
     // images (some in compute below)
     if ((profile == EEsProfile && version >= 310) ||
         (profile != EEsProfile && version >= 130)) {
@@ -7709,7 +7686,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 
         s.append("\n");
     }
-#endif
 
     s.append("\n");
 }
@@ -7812,11 +7788,6 @@ static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVar
 //
 void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable)
 {
-#ifdef GLSLANG_WEB
-    version = 310;
-    profile = EEsProfile;
-#endif
-
     //
     // Tag built-in variables and functions with additional qualifier and extension information
     // that cannot be declared with the text strings.
@@ -7836,7 +7807,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_InstanceIndex", EbvInstanceIndex, symbolTable);
         }
 
-#ifndef GLSLANG_WEB
         if (spvVersion.vulkan == 0) {
             SpecialQualifier("gl_VertexID",   EvqVertexId,   EbvVertexId,   symbolTable);
             SpecialQualifier("gl_InstanceID", EvqInstanceId, EbvInstanceId, symbolTable);
@@ -8010,7 +7980,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 
     case EShLangTessEvaluation:
     case EShLangGeometry:
-#endif // !GLSLANG_WEB
         SpecialQualifier("gl_Position",   EvqPosition,   EbvPosition,   symbolTable);
         SpecialQualifier("gl_PointSize",  EvqPointSize,  EbvPointSize,  symbolTable);
 
@@ -8020,7 +7989,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         BuiltInVariable("gl_out", "gl_Position",     EbvPosition,     symbolTable);
         BuiltInVariable("gl_out", "gl_PointSize",    EbvPointSize,    symbolTable);
 
-#ifndef GLSLANG_WEB
         SpecialQualifier("gl_ClipVertex", EvqClipVertex, EbvClipVertex, symbolTable);
 
         BuiltInVariable("gl_in",  "gl_ClipDistance", EbvClipDistance, symbolTable);
@@ -8200,8 +8168,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 				symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
 			}
 		}
-
-#endif // !GLSLANG_WEB
         break;
 
     case EShLangFragment:
@@ -8218,7 +8184,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             }
         }
         SpecialQualifier("gl_FragDepth",        EvqFragDepth,  EbvFragDepth,        symbolTable);
-#ifndef GLSLANG_WEB
         SpecialQualifier("gl_FragDepthEXT",     EvqFragDepth,  EbvFragDepth,        symbolTable);
         SpecialQualifier("gl_FragStencilRefARB", EvqFragStencil, EbvFragStencilRef, symbolTable);
         SpecialQualifier("gl_HelperInvocation", EvqVaryingIn,  EbvHelperInvocation, symbolTable);
@@ -8760,7 +8725,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         symbolTable.setFunctionExtensions("stencilAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
         symbolTable.setFunctionExtensions("depthAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
         symbolTable.setFunctionExtensions("colorAttachmentReadEXT", 1, &E_GL_EXT_shader_tile_image);
-#endif // !GLSLANG_WEB
         break;
 
     case EShLangCompute:
@@ -8773,7 +8737,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         BuiltInVariable("gl_DeviceIndex",           EbvDeviceIndex,          symbolTable);
         BuiltInVariable("gl_ViewIndex",             EbvViewIndex,            symbolTable);
 
-#ifndef GLSLANG_WEB
         if ((profile != EEsProfile && version >= 140) ||
             (profile == EEsProfile && version >= 310)) {
             symbolTable.setVariableExtensions("gl_DeviceIndex",  1, &E_GL_EXT_device_group);
@@ -8897,6 +8860,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("coopMatMulAddNV", 2, coopExt);
         }
 
+        {
+            symbolTable.setFunctionExtensions("coopMatLoad",   1, &E_GL_KHR_cooperative_matrix);
+            symbolTable.setFunctionExtensions("coopMatStore",  1, &E_GL_KHR_cooperative_matrix);
+            symbolTable.setFunctionExtensions("coopMatMulAdd", 1, &E_GL_KHR_cooperative_matrix);
+        }
+
         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);
@@ -8916,10 +8885,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setVariableExtensions("gl_ShadingRateFlag2HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
             symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
         }
-#endif // !GLSLANG_WEB
         break;
 
-#if !defined(GLSLANG_WEB)
     case EShLangRayGen:
     case EShLangIntersect:
     case EShLangAnyHit:
@@ -9488,7 +9455,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setVariableExtensions("gl_ShadingRateFlag4HorizontalPixelsEXT", 1, &E_GL_EXT_fragment_shading_rate);
         }
         break;
-#endif
 
     default:
         assert(false && "Language not supported");
@@ -9504,7 +9470,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 
     relateTabledBuiltins(version, profile, spvVersion, language, symbolTable);
 
-#ifndef GLSLANG_WEB
     symbolTable.relateToOperator("doubleBitsToInt64",  EOpDoubleBitsToInt64);
     symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64);
     symbolTable.relateToOperator("int64BitsToDouble",  EOpInt64BitsToDouble);
@@ -10005,9 +9970,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.relateToOperator("dFdyCoarse",  EOpDPdyCoarse);
             symbolTable.relateToOperator("fwidthCoarse",EOpFwidthCoarse);
         }
-        symbolTable.relateToOperator("coopMatLoadNV",              EOpCooperativeMatrixLoad);
-        symbolTable.relateToOperator("coopMatStoreNV",             EOpCooperativeMatrixStore);
-        symbolTable.relateToOperator("coopMatMulAddNV",            EOpCooperativeMatrixMulAdd);
+        symbolTable.relateToOperator("coopMatLoadNV",              EOpCooperativeMatrixLoadNV);
+        symbolTable.relateToOperator("coopMatStoreNV",             EOpCooperativeMatrixStoreNV);
+        symbolTable.relateToOperator("coopMatMulAddNV",            EOpCooperativeMatrixMulAddNV);
+
+        symbolTable.relateToOperator("coopMatLoad",                EOpCooperativeMatrixLoad);
+        symbolTable.relateToOperator("coopMatStore",               EOpCooperativeMatrixStore);
+        symbolTable.relateToOperator("coopMatMulAdd",              EOpCooperativeMatrixMulAdd);
         break;
 
     case EShLangRayGen:
@@ -10097,7 +10066,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
     default:
         assert(false && "Language not supported");
     }
-#endif // !GLSLANG_WEB
 }
 
 //
@@ -10111,7 +10079,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 //
 void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources)
 {
-#ifndef GLSLANG_WEB
     if (profile != EEsProfile && version >= 430 && version < 440) {
         symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts);
         symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &E_GL_ARB_enhanced_layouts);
@@ -10183,7 +10150,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
     default:
         break;
     }
-#endif
 }
 
 } // end namespace glslang

+ 25 - 70
3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp

@@ -388,7 +388,6 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
     case EOpConstructFloat:  newType = EbtFloat;  break;
     case EOpConstructInt:    newType = EbtInt;    break;
     case EOpConstructUint:   newType = EbtUint;   break;
-#ifndef GLSLANG_WEB
     case EOpConstructInt8:   newType = EbtInt8;   break;
     case EOpConstructUint8:  newType = EbtUint8;  break;
     case EOpConstructInt16:  newType = EbtInt16;  break;
@@ -397,7 +396,6 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
     case EOpConstructUint64: newType = EbtUint64; break;
     case EOpConstructDouble: newType = EbtDouble; break;
     case EOpConstructFloat16: newType = EbtFloat16; break;
-#endif
     default: break; // some compilers want this
     }
 
@@ -569,7 +567,6 @@ bool TIntermediate::isConversionAllowed(TOperator op, TIntermTyped* node) const
 bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& newOp) const
 {
     switch (dst) {
-#ifndef GLSLANG_WEB
     case EbtDouble:
         switch (src) {
         case EbtUint:    newOp = EOpConvUintToDouble;    break;
@@ -587,13 +584,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
             return false;
         }
         break;
-#endif
     case EbtFloat:
         switch (src) {
         case EbtInt:     newOp = EOpConvIntToFloat;     break;
         case EbtUint:    newOp = EOpConvUintToFloat;    break;
         case EbtBool:    newOp = EOpConvBoolToFloat;    break;
-#ifndef GLSLANG_WEB
         case EbtDouble:  newOp = EOpConvDoubleToFloat;  break;
         case EbtInt8:    newOp = EOpConvInt8ToFloat;    break;
         case EbtUint8:   newOp = EOpConvUint8ToFloat;   break;
@@ -602,12 +597,10 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
         case EbtFloat16: newOp = EOpConvFloat16ToFloat; break;
         case EbtInt64:   newOp = EOpConvInt64ToFloat;   break;
         case EbtUint64:  newOp = EOpConvUint64ToFloat;  break;
-#endif
         default:
             return false;
         }
         break;
-#ifndef GLSLANG_WEB
     case EbtFloat16:
         switch (src) {
         case EbtInt8:   newOp = EOpConvInt8ToFloat16;   break;
@@ -625,13 +618,11 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
             return false;
         }
         break;
-#endif
     case EbtBool:
         switch (src) {
         case EbtInt:     newOp = EOpConvIntToBool;     break;
         case EbtUint:    newOp = EOpConvUintToBool;    break;
         case EbtFloat:   newOp = EOpConvFloatToBool;   break;
-#ifndef GLSLANG_WEB
         case EbtDouble:  newOp = EOpConvDoubleToBool;  break;
         case EbtInt8:    newOp = EOpConvInt8ToBool;    break;
         case EbtUint8:   newOp = EOpConvUint8ToBool;   break;
@@ -640,12 +631,10 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
         case EbtFloat16: newOp = EOpConvFloat16ToBool; break;
         case EbtInt64:   newOp = EOpConvInt64ToBool;   break;
         case EbtUint64:  newOp = EOpConvUint64ToBool;  break;
-#endif
         default:
             return false;
         }
         break;
-#ifndef GLSLANG_WEB
     case EbtInt8:
         switch (src) {
         case EbtUint8:   newOp = EOpConvUint8ToInt8;   break;
@@ -715,14 +704,12 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
             return false;
         }
         break;
-#endif
 
     case EbtInt:
         switch (src) {
         case EbtUint:    newOp = EOpConvUintToInt;    break;
         case EbtBool:    newOp = EOpConvBoolToInt;    break;
         case EbtFloat:   newOp = EOpConvFloatToInt;   break;
-#ifndef GLSLANG_WEB
         case EbtInt8:    newOp = EOpConvInt8ToInt;    break;
         case EbtUint8:   newOp = EOpConvUint8ToInt;   break;
         case EbtInt16:   newOp = EOpConvInt16ToInt;   break;
@@ -731,7 +718,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
         case EbtFloat16: newOp = EOpConvFloat16ToInt; break;
         case EbtInt64:   newOp = EOpConvInt64ToInt;   break;
         case EbtUint64:  newOp = EOpConvUint64ToInt;  break;
-#endif
         default:
             return false;
         }
@@ -741,7 +727,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
         case EbtInt:     newOp = EOpConvIntToUint;     break;
         case EbtBool:    newOp = EOpConvBoolToUint;    break;
         case EbtFloat:   newOp = EOpConvFloatToUint;   break;
-#ifndef GLSLANG_WEB
         case EbtInt8:    newOp = EOpConvInt8ToUint;    break;
         case EbtUint8:   newOp = EOpConvUint8ToUint;   break;
         case EbtInt16:   newOp = EOpConvInt16ToUint;   break;
@@ -750,7 +735,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
         case EbtFloat16: newOp = EOpConvFloat16ToUint; break;
         case EbtInt64:   newOp = EOpConvInt64ToUint;   break;
         case EbtUint64:  newOp = EOpConvUint64ToUint;  break;
-#endif
         // For bindless texture type conversion, add a dummy convert op, just
         // to generate a new TIntermTyped
         // uvec2(any sampler type)
@@ -760,7 +744,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
             return false;
         }
         break;
-#ifndef GLSLANG_WEB
     case EbtInt64:
         switch (src) {
         case EbtInt8:    newOp = EOpConvInt8ToInt64;    break;
@@ -795,7 +778,6 @@ bool TIntermediate::buildConvertOp(TBasicType dst, TBasicType src, TOperator& ne
             return false;
         }
         break;
-#endif
     default:
         return false;
     }
@@ -811,7 +793,6 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
     // Add a new newNode for the conversion.
     //
 
-#ifndef GLSLANG_WEB
     bool convertToIntTypes = (convertTo == EbtInt8  || convertTo == EbtUint8  ||
                               convertTo == EbtInt16 || convertTo == EbtUint16 ||
                               convertTo == EbtInt   || convertTo == EbtUint   ||
@@ -848,7 +829,6 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
             return nullptr;
         }
     }
-#endif
 
     TIntermUnary* newNode = nullptr;
     TOperator newOp = EOpNull;
@@ -860,13 +840,11 @@ TIntermTyped* TIntermediate::createConversion(TBasicType convertTo, TIntermTyped
     newNode = addUnaryNode(newOp, node, node->getLoc(), newType);
 
     if (node->getAsConstantUnion()) {
-#ifndef GLSLANG_WEB
         // 8/16-bit storage extensions don't support 8/16-bit constants, so don't fold conversions
         // to those types
         if ((getArithemeticInt8Enabled() || !(convertTo == EbtInt8 || convertTo == EbtUint8)) &&
             (getArithemeticInt16Enabled() || !(convertTo == EbtInt16 || convertTo == EbtUint16)) &&
             (getArithemeticFloat16Enabled() || !(convertTo == EbtFloat16)))
-#endif
         {
             TIntermTyped* folded = node->getAsConstantUnion()->fold(newOp, newType);
             if (folded)
@@ -1049,6 +1027,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     if (type.isArray() || node->getType().isArray())
         return nullptr;
 
+    // Reject implicit conversions to cooperative matrix types
+    if (node->getType().isCoopMat() &&
+        op != EOpConstructCooperativeMatrixNV &&
+        op != EOpConstructCooperativeMatrixKHR)
+        return nullptr;
+
     // Note: callers are responsible for other aspects of shape,
     // like vector and matrix sizes.
 
@@ -1060,7 +1044,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     case EOpConstructFloat:
     case EOpConstructInt:
     case EOpConstructUint:
-#ifndef GLSLANG_WEB
     case EOpConstructDouble:
     case EOpConstructFloat16:
     case EOpConstructInt8:
@@ -1071,8 +1054,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     case EOpConstructUint64:
         break;
 
-#endif
-
     //
     // Implicit conversions
     //
@@ -1117,7 +1098,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
 
     case EOpSequence:
     case EOpConstructStruct:
-    case EOpConstructCooperativeMatrix:
+    case EOpConstructCooperativeMatrixNV:
+    case EOpConstructCooperativeMatrixKHR:
 
         if (type.isReference() || node->getType().isReference()) {
             // types must match to assign a reference
@@ -1159,7 +1141,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     }
 
     bool canPromoteConstant = true;
-#ifndef GLSLANG_WEB
     // GL_EXT_shader_16bit_storage can't do OpConstantComposite with
     // 16-bit types, so disable promotion for those types.
     // Many issues with this, from JohnK:
@@ -1187,7 +1168,6 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt
     default:
         break;
     }
-#endif
 
     if (canPromoteConstant && node->getAsConstantUnion())
         return promoteConstantUnion(type.getBasicType(), node->getAsConstantUnion());
@@ -1484,10 +1464,6 @@ bool TIntermediate::isFPPromotion(TBasicType from, TBasicType to) const
 
 bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
 {
-#ifdef GLSLANG_WEB
-    return false;
-#endif
-
     switch (from) {
     case EbtInt:
         switch(to) {
@@ -1568,10 +1544,6 @@ bool TIntermediate::isIntegralConversion(TBasicType from, TBasicType to) const
 
 bool TIntermediate::isFPConversion(TBasicType from, TBasicType to) const
 {
-#ifdef GLSLANG_WEB
-    return false;
-#endif
-
     if (to == EbtFloat && from == EbtFloat16) {
         return true;
     } else {
@@ -1592,7 +1564,6 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
             break;
         }
         break;
-#ifndef GLSLANG_WEB
     case EbtInt8:
     case EbtUint8:
     case EbtInt16:
@@ -1612,7 +1583,6 @@ bool TIntermediate::isFPIntegralConversion(TBasicType from, TBasicType to) const
             return true;
         }
         break;
-#endif
     default:
         break;
     }
@@ -1814,10 +1784,6 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
 
 static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBasicType uintType)
 {
-#ifdef GLSLANG_WEB
-    return false;
-#endif
-
     switch(sintType) {
     case EbtInt8:
         switch(uintType) {
@@ -1878,11 +1844,6 @@ static bool canSignedIntTypeRepresentAllUnsignedValues(TBasicType sintType, TBas
 
 static TBasicType getCorrespondingUnsignedType(TBasicType type)
 {
-#ifdef GLSLANG_WEB
-    assert(type == EbtInt);
-    return EbtUint;
-#endif
-
     switch(type) {
     case EbtInt8:
         return EbtUint8;
@@ -2008,8 +1969,11 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
     if (type.getQualifier().isNonUniform())
         return EOpConstructNonuniform;
 
-    if (type.isCoopMat())
-        return EOpConstructCooperativeMatrix;
+    if (type.isCoopMatNV())
+        return EOpConstructCooperativeMatrixNV;
+
+    if (type.isCoopMatKHR())
+        return EOpConstructCooperativeMatrixKHR;
 
     switch (type.getBasicType()) {
     case EbtStruct:
@@ -2172,7 +2136,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
             }
         }
         break;
-#ifndef GLSLANG_WEB
     case EbtDouble:
         if (type.getMatrixCols()) {
             switch (type.getMatrixCols()) {
@@ -2311,7 +2274,6 @@ TOperator TIntermediate::mapTypeToConstructorOp(const TType& type) const
     case EbtAccStruct:
         op = EOpConstructAccStruct;
         break;
-#endif
     default:
         break;
     }
@@ -2792,7 +2754,6 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
     if (aggRoot && aggRoot->getOp() == EOpNull)
         aggRoot->setOperator(EOpSequence);
 
-#ifndef GLSLANG_WEB
     // Propagate 'noContraction' label in backward from 'precise' variables.
     glslang::PropagateNoContraction(*this);
 
@@ -2806,7 +2767,6 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/)
         assert(0);
         break;
     }
-#endif
 
     return true;
 }
@@ -3526,20 +3486,28 @@ bool TIntermediate::promoteBinary(TIntermBinary& node)
     }
 
     if (left->getType().isCoopMat() || right->getType().isCoopMat()) {
+        // Operations on two cooperative matrices must have identical types
         if (left->getType().isCoopMat() && right->getType().isCoopMat() &&
-            *left->getType().getTypeParameters() != *right->getType().getTypeParameters()) {
+            left->getType() != right->getType()) {
             return false;
         }
         switch (op) {
         case EOpMul:
         case EOpMulAssign:
-            if (left->getType().isCoopMat() && right->getType().isCoopMat()) {
+            // Mul not supported in NV_cooperative_matrix
+            if (left->getType().isCoopMatNV() && right->getType().isCoopMatNV()) {
                 return false;
             }
-            if (op == EOpMulAssign && right->getType().isCoopMat()) {
+            // NV_cooperative_matrix supports MulAssign is for mat*=scalar only.
+            // KHR_cooperative_matrix supports it for mat*=mat as well.
+            if (op == EOpMulAssign && right->getType().isCoopMatNV()) {
                 return false;
             }
-            node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar);
+            // Use MatrixTimesScalar if either operand is not a matrix. Otherwise use Mul.
+            if (!left->getType().isCoopMat() || !right->getType().isCoopMat()) {
+                node.setOp(op == EOpMulAssign ? EOpMatrixTimesScalarAssign : EOpMatrixTimesScalar);
+            }
+            // In case of scalar*matrix, take the result type from the matrix.
             if (right->getType().isCoopMat()) {
                 node.setType(right->getType());
             }
@@ -3892,16 +3860,6 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
 #define PROMOTE(Set, CType, Get) leftUnionArray[i].Set(static_cast<CType>(rightUnionArray[i].Get()))
 #define PROMOTE_TO_BOOL(Get) leftUnionArray[i].setBConst(rightUnionArray[i].Get() != 0)
 
-#ifdef GLSLANG_WEB
-#define TO_ALL(Get)   \
-        switch (promoteTo) { \
-        case EbtFloat: PROMOTE(setDConst, double, Get); break; \
-        case EbtInt: PROMOTE(setIConst, int, Get); break; \
-        case EbtUint: PROMOTE(setUConst, unsigned int, Get); break; \
-        case EbtBool: PROMOTE_TO_BOOL(Get); break; \
-        default: return node; \
-        }
-#else
 #define TO_ALL(Get)   \
         switch (promoteTo) { \
         case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
@@ -3918,14 +3876,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
         case EbtBool: PROMOTE_TO_BOOL(Get); break; \
         default: return node; \
         }
-#endif
 
         switch (node->getType().getBasicType()) {
         case EbtFloat: TO_ALL(getDConst); break;
         case EbtInt: TO_ALL(getIConst); break;
         case EbtUint: TO_ALL(getUConst); break;
         case EbtBool: TO_ALL(getBConst); break;
-#ifndef GLSLANG_WEB
         case EbtFloat16: TO_ALL(getDConst); break;
         case EbtDouble: TO_ALL(getDConst); break;
         case EbtInt8: TO_ALL(getI8Const); break;
@@ -3934,7 +3890,6 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
         case EbtUint8: TO_ALL(getU8Const); break;
         case EbtUint16: TO_ALL(getU16Const); break;
         case EbtUint64: TO_ALL(getU64Const); break;
-#endif
         default: return node;
         }
     }

+ 0 - 8
3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp

@@ -67,8 +67,6 @@ void TParseContextBase::outputMessage(const TSourceLoc& loc, const char* szReaso
     }
 }
 
-#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
-
 void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason, const char* szToken,
                                      const char* szExtraInfoFormat, ...)
 {
@@ -118,8 +116,6 @@ void C_DECL TParseContextBase::ppWarn(const TSourceLoc& loc, const char* szReaso
     va_end(args);
 }
 
-#endif
-
 //
 // Both test and if necessary, spit out an error, to see if the node is really
 // an l-value that can be operated on this way.
@@ -140,7 +136,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
     case EvqConst:          message = "can't modify a const";        break;
     case EvqConstReadOnly:  message = "can't modify a const";        break;
     case EvqUniform:        message = "can't modify a uniform";      break;
-#ifndef GLSLANG_WEB
     case EvqBuffer:
         if (node->getQualifier().isReadOnly())
             message = "can't modify a readonly buffer";
@@ -151,7 +146,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
         if (language != EShLangIntersect)
             message = "cannot modify hitAttributeNV in this stage";
         break;
-#endif
 
     default:
         //
@@ -165,7 +159,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
         case EbtVoid:
             message = "can't modify void";
             break;
-#ifndef GLSLANG_WEB
         case EbtAtomicUint:
             message = "can't modify an atomic_uint";
             break;
@@ -178,7 +171,6 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
         case EbtHitObjectNV:
             message = "can't modify hitObjectNV";
             break;
-#endif
         default:
             break;
         }

File diff suppressed because it is too large
+ 28 - 155
3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp


+ 3 - 13
3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h

@@ -104,7 +104,6 @@ public:
     }
     virtual ~TParseContextBase() { }
 
-#if !defined(GLSLANG_WEB) || defined(GLSLANG_WEB_DEVEL)
     virtual void C_DECL   error(const TSourceLoc&, const char* szReason, const char* szToken,
                                 const char* szExtraInfoFormat, ...);
     virtual void C_DECL    warn(const TSourceLoc&, const char* szReason, const char* szToken,
@@ -113,7 +112,6 @@ public:
                                 const char* szExtraInfoFormat, ...);
     virtual void C_DECL  ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
                                 const char* szExtraInfoFormat, ...);
-#endif
 
     virtual void setLimits(const TBuiltInResource&) = 0;
 
@@ -331,10 +329,8 @@ public:
     TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
     void handleIndexLimits(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index);
 
-#ifndef GLSLANG_WEB
     void makeEditable(TSymbol*&) override;
     void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
-#endif
     bool isIoResizeArray(const TType&) const;
     void fixIoArraySize(const TSourceLoc&, TType&);
     void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base);
@@ -382,7 +378,7 @@ public:
     void globalCheck(const TSourceLoc&, const char* token);
     bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&);
     bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&);
-    void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType);
+    void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&, const char *sizeType, const bool allowZero = false);
     bool arrayQualifierError(const TSourceLoc&, const TQualifier&);
     bool arrayError(const TSourceLoc&, const TType&);
     void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&);
@@ -404,7 +400,7 @@ public:
     void setDefaultPrecision(const TSourceLoc&, TPublicType&, TPrecisionQualifier);
     int computeSamplerTypeIndex(TSampler&);
     TPrecisionQualifier getDefaultPrecision(TPublicType&);
-    void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&);
+    void precisionQualifierCheck(const TSourceLoc&, TBasicType, TQualifier&, bool isCoopMat);
     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&);
@@ -422,6 +418,7 @@ public:
     void inductiveLoopCheck(const TSourceLoc&, TIntermNode* init, TIntermLoop* loop);
     void arrayLimitCheck(const TSourceLoc&, const TString&, int size);
     void limitCheck(const TSourceLoc&, int value, const char* limit, const char* feature);
+    void coopMatTypeParametersCheck(const TSourceLoc&, const TPublicType&);
 
     void inductiveLoopBodyCheck(TIntermNode*, long long loopIndexId, TSymbolTable&);
     void constantIndexExpressionCheck(TIntermNode*);
@@ -466,7 +463,6 @@ public:
     const TTypeList* recordStructCopy(TStructRecord&, const TType*, const TType*);
     TLayoutFormat mapLegacyLayoutFormat(TLayoutFormat legacyLayoutFormat, TBasicType imageType);
 
-#ifndef GLSLANG_WEB
     TAttributeType attributeFromName(const TString& name) const;
     TAttributes* makeAttributes(const TString& identifier) const;
     TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
@@ -493,8 +489,6 @@ public:
     TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, int value);
     TSpirvInstruction* mergeSpirvInstruction(const TSourceLoc& loc, TSpirvInstruction* spirvInst1,
                                              TSpirvInstruction* spirvInst2);
-#endif
-
     void checkAndResizeMeshViewDim(const TSourceLoc&, TType&, bool isBlockMember);
 
 protected:
@@ -507,9 +501,7 @@ protected:
     bool isRuntimeLength(const TIntermTyped&) const;
     TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
     TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
-#ifndef GLSLANG_WEB
     void finish() override;
-#endif
 
     virtual const char* getGlobalUniformBlockName() const override;
     virtual void finalizeGlobalUniformBlockLayout(TVariable&) override;
@@ -546,7 +538,6 @@ protected:
     TQualifier globalOutputDefaults;
     TQualifier globalSharedDefaults;
     TString currentCaller;        // name of last function body entered (not valid when at global scope)
-#ifndef GLSLANG_WEB
     int* atomicUintOffsets;       // to become an array of the right size to hold an offset per binding point
     bool anyIndexLimits;
     TIdSetType inductiveLoopIds;
@@ -587,7 +578,6 @@ protected:
     //    array-sizing declarations
     //
     TVector<TSymbol*> ioArraySymbolResizeList;
-#endif
 };
 
 } // end namespace glslang

+ 11 - 17
3rdparty/glslang/glslang/MachineIndependent/PoolAlloc.cpp

@@ -35,34 +35,28 @@
 #include "../Include/Common.h"
 #include "../Include/PoolAlloc.h"
 
-#include "../Include/InitializeGlobals.h"
-#include "../OSDependent/osinclude.h"
-
 namespace glslang {
 
-// Process-wide TLS index
-OS_TLSIndex PoolIndex;
+namespace {
+thread_local TPoolAllocator* threadPoolAllocator = nullptr;
+
+TPoolAllocator* GetDefaultThreadPoolAllocator()
+{
+    thread_local TPoolAllocator defaultAllocator;
+    return &defaultAllocator;
+}
+} // anonymous namespace
 
 // Return the thread-specific current pool.
 TPoolAllocator& GetThreadPoolAllocator()
 {
-    return *static_cast<TPoolAllocator*>(OS_GetTLSValue(PoolIndex));
+    return *(threadPoolAllocator ? threadPoolAllocator : GetDefaultThreadPoolAllocator());
 }
 
 // Set the thread-specific current pool.
 void SetThreadPoolAllocator(TPoolAllocator* poolAllocator)
 {
-    OS_SetTLSValue(PoolIndex, poolAllocator);
-}
-
-// Process-wide set up of the TLS pool storage.
-bool InitializePoolIndex()
-{
-    // Allocate a TLS index.
-    if ((PoolIndex = OS_AllocTLSIndex()) == OS_INVALID_TLS_INDEX)
-        return false;
-
-    return true;
+    threadPoolAllocator = poolAllocator;
 }
 
 //

+ 11 - 19
3rdparty/glslang/glslang/MachineIndependent/Scan.cpp

@@ -324,11 +324,9 @@ struct str_hash
 // A single global usable by all threads, by all versions, by all languages.
 // After a single process-level initialization, this is read only and thread safe
 std::unordered_map<const char*, int, str_hash, str_eq>* KeywordMap = nullptr;
-#ifndef GLSLANG_WEB
 std::unordered_set<const char*, str_hash, str_eq>* ReservedSet = nullptr;
-#endif
 
-};
+}
 
 namespace glslang {
 
@@ -409,7 +407,6 @@ void TScanContext::fillInKeywordMap()
     (*KeywordMap)["uvec3"] =                   UVEC3;
     (*KeywordMap)["uvec4"] =                   UVEC4;
 
-#ifndef GLSLANG_WEB
     (*KeywordMap)["nonuniformEXT"] =           NONUNIFORM;
     (*KeywordMap)["demote"] =                  DEMOTE;
     (*KeywordMap)["attribute"] =               ATTRIBUTE;
@@ -599,7 +596,6 @@ void TScanContext::fillInKeywordMap()
     (*KeywordMap)["spirv_storage_class"] =     SPIRV_STORAGE_CLASS;
     (*KeywordMap)["spirv_by_reference"] =      SPIRV_BY_REFERENCE;
     (*KeywordMap)["spirv_literal"] =           SPIRV_LITERAL;
-#endif
 
     (*KeywordMap)["sampler2D"] =               SAMPLER2D;
     (*KeywordMap)["samplerCube"] =             SAMPLERCUBE;
@@ -633,7 +629,6 @@ void TScanContext::fillInKeywordMap()
     (*KeywordMap)["sampler"] =                 SAMPLER;
     (*KeywordMap)["samplerShadow"] =           SAMPLERSHADOW;
 
-#ifndef GLSLANG_WEB
     (*KeywordMap)["textureCubeArray"] =        TEXTURECUBEARRAY;
     (*KeywordMap)["itextureCubeArray"] =       ITEXTURECUBEARRAY;
     (*KeywordMap)["utextureCubeArray"] =       UTEXTURECUBEARRAY;
@@ -770,6 +765,8 @@ void TScanContext::fillInKeywordMap()
     (*KeywordMap)["icoopmatNV"] =              ICOOPMATNV;
     (*KeywordMap)["ucoopmatNV"] =              UCOOPMATNV;
 
+    (*KeywordMap)["coopmat"] =                 COOPMAT;
+
     (*KeywordMap)["hitObjectNV"] =             HITOBJECTNV;
     (*KeywordMap)["hitObjectAttributeNV"] =    HITOBJECTATTRNV;
 
@@ -812,17 +809,14 @@ void TScanContext::fillInKeywordMap()
     ReservedSet->insert("cast");
     ReservedSet->insert("namespace");
     ReservedSet->insert("using");
-#endif
 }
 
 void TScanContext::deleteKeywordMap()
 {
     delete KeywordMap;
     KeywordMap = nullptr;
-#ifndef GLSLANG_WEB
     delete ReservedSet;
     ReservedSet = nullptr;
-#endif
 }
 
 // Called by yylex to get the next token.
@@ -903,14 +897,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
         case PpAtomConstInt:           parserToken->sType.lex.i    = ppToken.ival;       return INTCONSTANT;
         case PpAtomConstUint:          parserToken->sType.lex.i    = ppToken.ival;       return UINTCONSTANT;
         case PpAtomConstFloat:         parserToken->sType.lex.d    = ppToken.dval;       return FLOATCONSTANT;
-#ifndef GLSLANG_WEB
         case PpAtomConstInt16:         parserToken->sType.lex.i    = ppToken.ival;       return INT16CONSTANT;
         case PpAtomConstUint16:        parserToken->sType.lex.i    = ppToken.ival;       return UINT16CONSTANT;
         case PpAtomConstInt64:         parserToken->sType.lex.i64  = ppToken.i64val;     return INT64CONSTANT;
         case PpAtomConstUint64:        parserToken->sType.lex.i64  = ppToken.i64val;     return UINT64CONSTANT;
         case PpAtomConstDouble:        parserToken->sType.lex.d    = ppToken.dval;       return DOUBLECONSTANT;
         case PpAtomConstFloat16:       parserToken->sType.lex.d    = ppToken.dval;       return FLOAT16CONSTANT;
-#endif
         case PpAtomIdentifier:
         {
             int token = tokenizeIdentifier();
@@ -932,10 +924,8 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token)
 
 int TScanContext::tokenizeIdentifier()
 {
-#ifndef GLSLANG_WEB
     if (ReservedSet->find(tokenText) != ReservedSet->end())
         return reservedWord();
-#endif
 
     auto it = KeywordMap->find(tokenText);
     if (it == KeywordMap->end()) {
@@ -1058,7 +1048,6 @@ int TScanContext::tokenizeIdentifier()
         return identifierOrReserved(reserved);
     }
 
-#ifndef GLSLANG_WEB
     case NOPERSPECTIVE:
         if (parseContext.extensionTurnedOn(E_GL_NV_shader_noperspective_interpolation))
             return keyword;
@@ -1145,7 +1134,7 @@ int TScanContext::tokenizeIdentifier()
 
     case SUBROUTINE:
         return es30ReservedFromGLSL(400);
-#endif
+
     case SHARED:
         if ((parseContext.isEsProfile() && parseContext.version < 300) ||
             (!parseContext.isEsProfile() && parseContext.version < 140))
@@ -1180,7 +1169,6 @@ int TScanContext::tokenizeIdentifier()
     case MAT4X4:
         return matNxM();
 
-#ifndef GLSLANG_WEB
     case DMAT2:
     case DMAT3:
     case DMAT4:
@@ -1485,7 +1473,6 @@ int TScanContext::tokenizeIdentifier()
             return keyword;
         else
             return identifierOrType();
-#endif
 
     case UINT:
     case UVEC2:
@@ -1540,7 +1527,6 @@ int TScanContext::tokenizeIdentifier()
         else
             return identifierOrType();
 
-#ifndef GLSLANG_WEB
     case ISAMPLER1D:
     case ISAMPLER1DARRAY:
     case SAMPLER1DARRAYSHADOW:
@@ -1781,6 +1767,13 @@ int TScanContext::tokenizeIdentifier()
             return keyword;
         return identifierOrType();
 
+    case COOPMAT:
+        afterType = true;
+        if (parseContext.symbolTable.atBuiltInLevel() ||
+            parseContext.extensionTurnedOn(E_GL_KHR_cooperative_matrix))
+            return keyword;
+        return identifierOrType();
+
     case DEMOTE:
         if (parseContext.extensionTurnedOn(E_GL_EXT_demote_to_helper_invocation))
             return keyword;
@@ -1815,7 +1808,6 @@ int TScanContext::tokenizeIdentifier()
                  && parseContext.extensionTurnedOn(E_GL_NV_shader_invocation_reorder)))
             return keyword;
         return identifierOrType();
-#endif
 
     default:
         parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc);

+ 2 - 53
3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp

@@ -295,11 +295,6 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
                                 EShLanguage language, EShSource source, TInfoSink& infoSink, TSymbolTable** commonTable,
                                 TSymbolTable** symbolTables)
 {
-#ifdef GLSLANG_WEB
-    profile = EEsProfile;
-    version = 310;
-#endif
-
     (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
     InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spvVersion, language, source,
                           infoSink, *symbolTables[language]);
@@ -316,11 +311,6 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
 //
 bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TSymbolTable** symbolTables, int version, EProfile profile, const SpvVersion& spvVersion, EShSource source)
 {
-#ifdef GLSLANG_WEB
-    profile = EEsProfile;
-    version = 310;
-#endif
-
     std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
 
     if (builtInParseables == nullptr)
@@ -343,7 +333,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TS
     InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangFragment, source,
                                infoSink, commonTable, symbolTables);
 
-#ifndef GLSLANG_WEB
     // check for tessellation
     if ((profile != EEsProfile && version >= 150) ||
         (profile == EEsProfile && version >= 310)) {
@@ -392,7 +381,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TS
         (profile == EEsProfile && version >= 320))
         InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source,
                                    infoSink, commonTable, symbolTables);
-#endif // !GLSLANG_WEB
 
     return true;
 }
@@ -494,13 +482,11 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
 // Function to Print all builtins
 void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
 {
-#if !defined(GLSLANG_WEB)
     infoSink.debug << "BuiltinSymbolTable {\n";
 
     symbolTable.dump(infoSink, true);
 
     infoSink.debug << "}\n";
-#endif
 }
 
 // Return true if the shader was correctly specified for version/profile/stage.
@@ -598,7 +584,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
         break;
     }
 
-#if !defined(GLSLANG_WEB)
     // Correct for stage type...
     switch (stage) {
     case EShLangGeometry:
@@ -686,7 +671,6 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
             break;
         }
     }
-#endif
 
     return correct;
 }
@@ -876,7 +860,6 @@ bool ProcessDeferred(
                                 : userInput.scanVersion(version, profile, versionNotFirstToken);
     bool versionNotFound = version == 0;
     if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
-#if !defined(GLSLANG_WEB)
         if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
             (version != defaultVersion || profile != defaultProfile)) {
             compiler->infoSink.info << "Warning, (version, profile) forced to be ("
@@ -884,7 +867,7 @@ bool ProcessDeferred(
                                     << "), while in source code it is ("
                                     << version << ", " << ProfileName(profile) << ")\n";
         }
-#endif
+
         if (versionNotFound) {
             versionNotFirstToken = false;
             versionNotFirst = false;
@@ -899,13 +882,7 @@ bool ProcessDeferred(
 
     bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
                                             versionNotFirst, defaultVersion, source, version, profile, spvVersion);
-#ifdef GLSLANG_WEB
-    profile = EEsProfile;
-    version = 310;
-#endif
-
     bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
-#if !defined(GLSLANG_WEB)
     bool warnVersionNotFirst = false;
     if (! versionWillBeError && versionNotFirstToken) {
         if (messages & EShMsgRelaxedErrors)
@@ -913,7 +890,6 @@ bool ProcessDeferred(
         else
             versionWillBeError = true;
     }
-#endif
 
     intermediate.setSource(source);
     intermediate.setVersion(version);
@@ -978,13 +954,11 @@ bool ProcessDeferred(
     parseContext->setLimits(*resources);
     if (! goodVersion)
         parseContext->addError();
-#if !defined(GLSLANG_WEB)
     if (warnVersionNotFirst) {
         TSourceLoc loc;
         loc.init();
         parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", "");
     }
-#endif
 
     parseContext->initializeExtensionBehavior();
 
@@ -1016,8 +990,6 @@ bool ProcessDeferred(
     return success;
 }
 
-#if !defined(GLSLANG_WEB)
-
 // Responsible for keeping track of the most recent source string and line in
 // the preprocessor and outputting newlines appropriately if the source string
 // or line changes.
@@ -1214,8 +1186,6 @@ struct DoPreprocessing {
     std::string* outputString;
 };
 
-#endif
-
 // DoFullParse is a valid ProcessingConext template argument for fully
 // parsing the shader.  It populates the "intermediate" with the AST.
 struct DoFullParse{
@@ -1246,7 +1216,6 @@ struct DoFullParse{
     }
 };
 
-#if !defined(GLSLANG_WEB)
 // Take a single compilation unit, and run the preprocessor on it.
 // Return: True if there were no issues found in preprocessing,
 //         False if during preprocessing any unknown version, pragmas or
@@ -1281,7 +1250,6 @@ bool PreprocessDeferred(
                            forwardCompatible, messages, intermediate, parser,
                            false, includer, "", environment);
 }
-#endif
 
 //
 // do a partial compile on the given strings for a single compilation unit
@@ -1831,8 +1799,6 @@ void TShader::setDxPositionW(bool invert)               { intermediate->setDxPos
 void TShader::setEnhancedMsgs()                         { intermediate->setEnhancedMsgs(); }
 void TShader::setNanMinMaxClamp(bool useNonNan)         { intermediate->setNanMinMaxClamp(useNonNan); }
 
-#ifndef GLSLANG_WEB
-
 // Set binding base for given resource type
 void TShader::setShiftBinding(TResourceType res, unsigned int base) {
     intermediate->setShiftBinding(res, base);
@@ -1874,7 +1840,6 @@ void TShader::setUniformLocationBase(int base)
 void TShader::setNoStorageFormat(bool useUnknownFormat) { intermediate->setNoStorageFormat(useUnknownFormat); }
 void TShader::setResourceSetBinding(const std::vector<std::string>& base)   { intermediate->setResourceSetBinding(base); }
 void TShader::setTextureSamplerTransformMode(EShTextureSamplerTransformMode mode) { intermediate->setTextureSamplerTransformMode(mode); }
-#endif
 
 void TShader::addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing) { intermediate->addBlockStorageOverride(nameStr, backing); }
 
@@ -1913,7 +1878,6 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
                            &environment);
 }
 
-#if !defined(GLSLANG_WEB)
 // Fill in a string with the result of preprocessing ShaderStrings
 // Returns true if all extensions, pragmas and version strings were valid.
 //
@@ -1939,7 +1903,6 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
                               forwardCompatible, message, includer, *intermediate, output_string,
                               &environment);
 }
-#endif
 
 const char* TShader::getInfoLog()
 {
@@ -1951,11 +1914,7 @@ const char* TShader::getInfoDebugLog()
     return infoSink->debug.c_str();
 }
 
-TProgram::TProgram() :
-#if !defined(GLSLANG_WEB)
-    reflection(nullptr),
-#endif
-    linked(false)
+TProgram::TProgram() : reflection(nullptr), linked(false)
 {
     pool = new TPoolAllocator;
     infoSink = new TInfoSink;
@@ -1968,9 +1927,7 @@ TProgram::TProgram() :
 TProgram::~TProgram()
 {
     delete infoSink;
-#if !defined(GLSLANG_WEB)
     delete reflection;
-#endif
 
     for (int s = 0; s < EShLangCount; ++s)
         if (newedIntermediate[s])
@@ -2018,7 +1975,6 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
     if (stages[stage].size() == 0)
         return true;
 
-#if !defined(GLSLANG_WEB)
     int numEsShaders = 0, numNonEsShaders = 0;
     for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
         if ((*it)->intermediate->getProfile() == EEsProfile) {
@@ -2069,9 +2025,6 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
         for (it = stages[stage].begin(); it != stages[stage].end(); ++it)
             intermediate[stage]->merge(*infoSink, *(*it)->intermediate);
     }
-#else
-    intermediate[stage] = stages[stage].front()->intermediate;
-#endif
     intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
 
     if (messages & EShMsgAST)
@@ -2153,8 +2106,6 @@ const char* TProgram::getInfoDebugLog()
     return infoSink->debug.c_str();
 }
 
-#if !defined(GLSLANG_WEB)
-
 //
 // Reflection implementation.
 //
@@ -2235,6 +2186,4 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
     return ioMapper->doMap(pResolver, *infoSink);
 }
 
-#endif // !GLSLANG_WEB
-
 } // end namespace glslang

+ 3 - 6
3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp

@@ -33,8 +33,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#ifndef GLSLANG_WEB
-
 //
 // GL_EXT_spirv_intrinsics
 //
@@ -76,7 +74,7 @@ TSpirvRequirement* TParseContext::makeSpirvRequirement(const TSourceLoc& loc, co
             spirvReq->capabilities.insert(capability->getAsConstantUnion()->getConstArray()[0].getIConst());
         }
     } else
-        error(loc, "unknow SPIR-V requirement", name.c_str(), "");
+        error(loc, "unknown SPIR-V requirement", name.c_str(), "");
 
     return spirvReq;
 }
@@ -298,7 +296,8 @@ TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& l
     return spirvTypeParams;
 }
 
-TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& loc, const TPublicType& type)
+TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& /* loc */,
+                                                             const TPublicType& type)
 {
     TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters;
     spirvTypeParams->push_back(TSpirvTypeParameter(new TType(type)));
@@ -359,5 +358,3 @@ TSpirvInstruction* TParseContext::mergeSpirvInstruction(const TSourceLoc& loc, T
 }
 
 } // end namespace glslang
-
-#endif // GLSLANG_WEB

+ 0 - 12
3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp

@@ -65,7 +65,6 @@ void TType::buildMangledName(TString& mangledName) const
     case EbtInt:                mangledName += 'i';      break;
     case EbtUint:               mangledName += 'u';      break;
     case EbtBool:               mangledName += 'b';      break;
-#ifndef GLSLANG_WEB
     case EbtDouble:             mangledName += 'd';      break;
     case EbtFloat16:            mangledName += "f16";    break;
     case EbtInt8:               mangledName += "i8";     break;
@@ -79,12 +78,9 @@ void TType::buildMangledName(TString& mangledName) const
     case EbtRayQuery:           mangledName += "rq";     break;
     case EbtSpirvType:          mangledName += "spv-t";  break;
     case EbtHitObjectNV:        mangledName += "ho";     break;
-#endif
     case EbtSampler:
         switch (sampler.type) {
-#ifndef GLSLANG_WEB
         case EbtFloat16: mangledName += "f16"; break;
-#endif
         case EbtInt:   mangledName += "i"; break;
         case EbtUint:  mangledName += "u"; break;
         case EbtInt64:   mangledName += "i64"; break;
@@ -111,12 +107,10 @@ void TType::buildMangledName(TString& mangledName) const
         case Esd2D:       mangledName += "2";  break;
         case Esd3D:       mangledName += "3";  break;
         case EsdCube:     mangledName += "C";  break;
-#ifndef GLSLANG_WEB
         case Esd1D:       mangledName += "1";  break;
         case EsdRect:     mangledName += "R2"; break;
         case EsdBuffer:   mangledName += "B";  break;
         case EsdSubpass:  mangledName += "P";  break;
-#endif
         default: break; // some compilers want this
         }
 
@@ -184,8 +178,6 @@ void TType::buildMangledName(TString& mangledName) const
     }
 }
 
-#if !defined(GLSLANG_WEB)
-
 //
 // Dump functions.
 //
@@ -264,8 +256,6 @@ void TSymbolTable::dump(TInfoSink& infoSink, bool complete) const
     }
 }
 
-#endif
-
 //
 // Functions have buried pointers to delete.
 //
@@ -398,9 +388,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
     implicitThis = copyOf.implicitThis;
     illegalImplicitThis = copyOf.illegalImplicitThis;
     defaultParamCount = copyOf.defaultParamCount;
-#ifndef GLSLANG_WEB
     spirvInst = copyOf.spirvInst;
-#endif
 }
 
 TFunction* TFunction::clone() const

+ 0 - 16
3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h

@@ -117,10 +117,8 @@ public:
     virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
     virtual const char** getExtensions() const { return extensions->data(); }
 
-#if !defined(GLSLANG_WEB)
     virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
     void dumpExtensions(TInfoSink& infoSink) const;
-#endif
 
     virtual bool isReadOnly() const { return ! writable; }
     virtual void makeReadOnly() { writable = false; }
@@ -196,9 +194,7 @@ public:
     }
     virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
 
-#if !defined(GLSLANG_WEB)
     virtual void dump(TInfoSink& infoSink, bool complete = false) const;
-#endif
 
 protected:
     explicit TVariable(const TVariable&);
@@ -321,18 +317,14 @@ public:
     virtual const TParameter& operator[](int i) const { return parameters[i]; }
     const TQualifier& getQualifier() const { return returnType.getQualifier(); }
 
-#ifndef GLSLANG_WEB
     virtual void setSpirvInstruction(const TSpirvInstruction& inst)
     {
         relateToOperator(EOpSpirvInst);
         spirvInst = inst;
     }
     virtual const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
-#endif
 
-#if !defined(GLSLANG_WEB)
     virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
-#endif
 
 protected:
     explicit TFunction(const TFunction&);
@@ -354,9 +346,7 @@ protected:
                                // but is not allowed to use them, or see hidden symbols instead.
     int  defaultParamCount;
 
-#ifndef GLSLANG_WEB
     TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers
-#endif
 };
 
 //
@@ -396,9 +386,7 @@ public:
     virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
 
     virtual int getAnonId() const { return anonId; }
-#if !defined(GLSLANG_WEB)
     virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
-#endif
 
 protected:
     explicit TAnonMember(const TAnonMember&);
@@ -583,9 +571,7 @@ public:
 
     void relateToOperator(const char* name, TOperator op);
     void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
-#if !defined(GLSLANG_WEB)
     void dump(TInfoSink& infoSink, bool complete = false) const;
-#endif
     TSymbolTableLevel* clone() const;
     void readOnly();
 
@@ -913,9 +899,7 @@ public:
     }
 
     long long getMaxSymbolId() { return uniqueId; }
-#if !defined(GLSLANG_WEB)
     void dump(TInfoSink& infoSink, bool complete = false) const;
-#endif
     void copyTable(const TSymbolTable& copyOf);
 
     void setPreviousDefaultPrecisions(TPrecisionQualifier *p) { table[currentLevel()]->setPreviousDefaultPrecisions(p); }

+ 15 - 29
3rdparty/glslang/glslang/MachineIndependent/Versions.cpp

@@ -151,8 +151,6 @@
 
 namespace glslang {
 
-#ifndef GLSLANG_WEB
-
 //
 // Initialize all extensions, almost always to 'disable', as once their features
 // are incorporated into a core version, their features are supported through allowing that
@@ -263,6 +261,8 @@ void TParseVersions::initializeExtensionBehavior()
 
     extensionBehavior[E_GL_EXT_fragment_shader_barycentric]             = EBhDisable;
 
+    extensionBehavior[E_GL_KHR_cooperative_matrix]                      = EBhDisable;
+
     // #line and #include
     extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive]          = EBhDisable;
     extensionBehavior[E_GL_GOOGLE_include_directive]                 = EBhDisable;
@@ -383,8 +383,6 @@ void TParseVersions::initializeExtensionBehavior()
     spvUnsupportedExt.push_back(E_GL_ARB_bindless_texture);
 }
 
-#endif // GLSLANG_WEB
-
 // Get code that is not part of a shared symbol table, is specific to this shader,
 // or needed by the preprocessor (which does not use a shared symbol table).
 void TParseVersions::getPreamble(std::string& preamble)
@@ -393,9 +391,6 @@ void TParseVersions::getPreamble(std::string& preamble)
         preamble =
             "#define GL_ES 1\n"
             "#define GL_FRAGMENT_PRECISION_HIGH 1\n"
-#ifdef GLSLANG_WEB
-            ;
-#else
             "#define GL_OES_texture_3D 1\n"
             "#define GL_OES_standard_derivatives 1\n"
             "#define GL_EXT_frag_depth 1\n"
@@ -517,6 +512,8 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_KHR_shader_subgroup_clustered 1\n"
             "#define GL_KHR_shader_subgroup_quad 1\n"
 
+            "#define GL_KHR_cooperative_matrix 1\n"
+
             "#define GL_EXT_shader_image_int64 1\n"
             "#define GL_EXT_shader_atomic_int64 1\n"
             "#define GL_EXT_shader_realtime_clock 1\n"
@@ -592,11 +589,8 @@ void TParseVersions::getPreamble(std::string& preamble)
         if (version >= 130) {
             preamble +="#define GL_FRAGMENT_PRECISION_HIGH 1\n";
         }
-
-#endif // GLSLANG_WEB
     }
 
-#ifndef GLSLANG_WEB
     if ((!isEsProfile() && version >= 140) ||
         (isEsProfile() && version >= 310)) {
         preamble +=
@@ -624,7 +618,6 @@ void TParseVersions::getPreamble(std::string& preamble)
     preamble +=
             "#define GL_EXT_terminate_invocation 1\n"
             ;
-#endif
 
     // #define VULKAN XXXX
     const int numberBufSize = 12;
@@ -636,7 +629,6 @@ void TParseVersions::getPreamble(std::string& preamble)
         preamble += "\n";
     }
 
-#ifndef GLSLANG_WEB
     // #define GL_SPIRV XXXX
     if (spvVersion.openGl > 0) {
         preamble += "#define GL_SPIRV ";
@@ -644,9 +636,7 @@ void TParseVersions::getPreamble(std::string& preamble)
         preamble += numberBuf;
         preamble += "\n";
     }
-#endif
 
-#ifndef GLSLANG_WEB
     // GL_EXT_spirv_intrinsics
     if (!isEsProfile()) {
         switch (language) {
@@ -667,7 +657,6 @@ void TParseVersions::getPreamble(std::string& preamble)
         default:                                                                                    break;
         }
     }
-#endif
 }
 
 //
@@ -679,7 +668,6 @@ const char* StageName(EShLanguage stage)
     case EShLangVertex:         return "vertex";
     case EShLangFragment:       return "fragment";
     case EShLangCompute:        return "compute";
-#ifndef GLSLANG_WEB
     case EShLangTessControl:    return "tessellation control";
     case EShLangTessEvaluation: return "tessellation evaluation";
     case EShLangGeometry:       return "geometry";
@@ -691,7 +679,6 @@ const char* StageName(EShLanguage stage)
     case EShLangCallable:       return "callable";
     case EShLangMesh:           return "mesh";
     case EShLangTask:           return "task";
-#endif
     default:                    return "unknown stage";
     }
 }
@@ -716,7 +703,6 @@ void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, cons
     requireStage(loc, static_cast<EShLanguageMask>(1 << stage), featureDesc);
 }
 
-#ifndef GLSLANG_WEB
 //
 // When to use requireProfile():
 //
@@ -754,7 +740,6 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int
 {
     if (profile & profileMask) {
         bool okay = minVersion > 0 && version >= minVersion;
-#ifndef GLSLANG_WEB
         for (int i = 0; i < numExtensions; ++i) {
             switch (getExtensionBehavior(extensions[i])) {
             case EBhWarn:
@@ -767,7 +752,6 @@ void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int
             default: break; // some compilers want this
             }
         }
-#endif
         if (! okay)
             error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
     }
@@ -1335,7 +1319,7 @@ void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool buil
     }
 }
 
-void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
+void TParseVersions::fcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
 {
     if (!builtIn) {
         const char* const extensions[] = {E_GL_NV_cooperative_matrix};
@@ -1343,14 +1327,22 @@ void TParseVersions::fcoopmatCheck(const TSourceLoc& loc, const char* op, bool b
     }
 }
 
-void TParseVersions::intcoopmatCheck(const TSourceLoc& loc, const char* op, bool builtIn)
+void TParseVersions::intcoopmatCheckNV(const TSourceLoc& loc, const char* op, bool builtIn)
 {
     if (!builtIn) {
         const char* const extensions[] = {E_GL_NV_integer_cooperative_matrix};
         requireExtensions(loc, sizeof(extensions)/sizeof(extensions[0]), extensions, op);
     }
 }
-#endif // GLSLANG_WEB
+
+void TParseVersions::coopmatCheck(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);
+    }
+}
+
 // Call for any operation removed because SPIR-V is in use.
 void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op)
 {
@@ -1368,26 +1360,20 @@ void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op)
 // Call for any operation that requires Vulkan.
 void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op)
 {
-#ifndef GLSLANG_WEB
     if (spvVersion.vulkan == 0)
         error(loc, "only allowed when using GLSL for Vulkan", op, "");
-#endif
 }
 
 // Call for any operation that requires SPIR-V.
 void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op)
 {
-#ifndef GLSLANG_WEB
     if (spvVersion.spv == 0)
         error(loc, "only allowed when generating SPIR-V", op, "");
-#endif
 }
 void TParseVersions::requireSpv(const TSourceLoc& loc, const char *op, unsigned int version)
 {
-#ifndef GLSLANG_WEB
     if (spvVersion.spv < version)
         error(loc, "not supported for current targeted SPIR-V version", op, "");
-#endif
 }
 
 } // end namespace glslang

+ 1 - 0
3rdparty/glslang/glslang/MachineIndependent/Versions.h

@@ -174,6 +174,7 @@ const char* const E_GL_KHR_shader_subgroup_shuffle_relative = "GL_KHR_shader_sub
 const char* const E_GL_KHR_shader_subgroup_clustered        = "GL_KHR_shader_subgroup_clustered";
 const char* const E_GL_KHR_shader_subgroup_quad             = "GL_KHR_shader_subgroup_quad";
 const char* const E_GL_KHR_memory_scope_semantics           = "GL_KHR_memory_scope_semantics";
+const char* const E_GL_KHR_cooperative_matrix               = "GL_KHR_cooperative_matrix";
 
 const char* const E_GL_EXT_shader_atomic_int64              = "GL_EXT_shader_atomic_int64";
 

+ 0 - 4
3rdparty/glslang/glslang/MachineIndependent/attribute.cpp

@@ -34,8 +34,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#ifndef GLSLANG_WEB
-
 #include "attribute.h"
 #include "../Include/intermediate.h"
 #include "ParseHelper.h"
@@ -367,5 +365,3 @@ void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttri
 }
 
 } // end namespace glslang
-
-#endif // GLSLANG_WEB

+ 0 - 4472
3rdparty/glslang/glslang/MachineIndependent/glslang.m4

@@ -1,4472 +0,0 @@
-//
-// Copyright (C) 2002-2005  3Dlabs Inc. Ltd.
-// Copyright (C) 2012-2013 LunarG, Inc.
-// Copyright (C) 2017 ARM Limited.
-// Copyright (C) 2015-2019 Google, Inc.
-// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//    Redistributions of source code must retain the above copyright
-//    notice, this list of conditions and the following disclaimer.
-//
-//    Redistributions in binary form must reproduce the above
-//    copyright notice, this list of conditions and the following
-//    disclaimer in the documentation and/or other materials provided
-//    with the distribution.
-//
-//    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
-//    contributors may be used to endorse or promote products derived
-//    from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-// POSSIBILITY OF SUCH DAMAGE.
-//
-
-//
-// Do not edit the .y file, only edit the .m4 file.
-// The .y bison file is not a source file, it is a derivative of the .m4 file.
-// The m4 file needs to be processed by m4 to generate the .y bison file.
-//
-// Code sandwiched between a pair:
-//
-//    GLSLANG_WEB_EXCLUDE_ON
-//      ...
-//      ...
-//      ...
-//    GLSLANG_WEB_EXCLUDE_OFF
-//
-// Will be excluded from the grammar when m4 is executed as:
-//
-//    m4 -P -DGLSLANG_WEB
-//
-// It will be included when m4 is executed as:
-//
-//    m4 -P
-//
-
-m4_define(`GLSLANG_WEB_EXCLUDE_ON', `m4_ifdef(`GLSLANG_WEB', `m4_divert(`-1')')')
-m4_define(`GLSLANG_WEB_EXCLUDE_OFF', `m4_ifdef(`GLSLANG_WEB', `m4_divert')')
-
-/**
- * This is bison grammar and productions for parsing all versions of the
- * GLSL shading languages.
- */
-%{
-
-/* Based on:
-ANSI C Yacc grammar
-
-In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a
-matching Lex specification) for the April 30, 1985 draft version of the
-ANSI C standard.  Tom Stockfisch reposted it to net.sources in 1987; that
-original, as mentioned in the answer to question 17.25 of the comp.lang.c
-FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z.
-
-I intend to keep this version as close to the current C Standard grammar as
-possible; please let me know if you discover discrepancies.
-
-Jutta Degener, 1995
-*/
-
-#include "SymbolTable.h"
-#include "ParseHelper.h"
-#include "../Public/ShaderLang.h"
-#include "attribute.h"
-
-using namespace glslang;
-
-%}
-
-%define parse.error verbose
-
-%union {
-    struct {
-        glslang::TSourceLoc loc;
-        union {
-            glslang::TString *string;
-            int i;
-            unsigned int u;
-            long long i64;
-            unsigned long long u64;
-            bool b;
-            double d;
-        };
-        glslang::TSymbol* symbol;
-    } lex;
-    struct {
-        glslang::TSourceLoc loc;
-        glslang::TOperator op;
-        union {
-            TIntermNode* intermNode;
-            glslang::TIntermNodePair nodePair;
-            glslang::TIntermTyped* intermTypedNode;
-            glslang::TAttributes* attributes;
-            glslang::TSpirvRequirement* spirvReq;
-            glslang::TSpirvInstruction* spirvInst;
-            glslang::TSpirvTypeParameters* spirvTypeParams;
-        };
-        union {
-            glslang::TPublicType type;
-            glslang::TFunction* function;
-            glslang::TParameter param;
-            glslang::TTypeLoc typeLine;
-            glslang::TTypeList* typeList;
-            glslang::TArraySizes* arraySizes;
-            glslang::TIdentifierList* identifierList;
-        };
-        glslang::TArraySizes* typeParameters;
-    } interm;
-}
-
-%{
-
-/* windows only pragma */
-#ifdef _MSC_VER
-    #pragma warning(disable : 4065)
-    #pragma warning(disable : 4127)
-    #pragma warning(disable : 4244)
-#endif
-
-#define parseContext (*pParseContext)
-#define yyerror(context, msg) context->parserError(msg)
-
-extern int yylex(YYSTYPE*, TParseContext&);
-
-%}
-
-%parse-param {glslang::TParseContext* pParseContext}
-%lex-param {parseContext}
-%pure-parser  // enable thread safety
-%expect 1     // One shift reduce conflict because of if | else
-
-%token <lex> CONST BOOL INT UINT FLOAT
-%token <lex> BVEC2 BVEC3 BVEC4
-%token <lex> IVEC2 IVEC3 IVEC4
-%token <lex> UVEC2 UVEC3 UVEC4
-%token <lex> VEC2 VEC3 VEC4
-%token <lex> MAT2 MAT3 MAT4
-%token <lex> MAT2X2 MAT2X3 MAT2X4
-%token <lex> MAT3X2 MAT3X3 MAT3X4
-%token <lex> MAT4X2 MAT4X3 MAT4X4
-
-// combined image/sampler
-%token <lex> SAMPLER2D SAMPLER3D SAMPLERCUBE SAMPLER2DSHADOW
-%token <lex> SAMPLERCUBESHADOW SAMPLER2DARRAY
-%token <lex> SAMPLER2DARRAYSHADOW ISAMPLER2D ISAMPLER3D ISAMPLERCUBE
-%token <lex> ISAMPLER2DARRAY USAMPLER2D USAMPLER3D
-%token <lex> USAMPLERCUBE USAMPLER2DARRAY
-
-// separate image/sampler
-%token <lex> SAMPLER SAMPLERSHADOW
-%token <lex>  TEXTURE2D  TEXTURE3D  TEXTURECUBE  TEXTURE2DARRAY
-%token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
-%token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
-
-GLSLANG_WEB_EXCLUDE_ON
-
-%token <lex> ATTRIBUTE VARYING
-%token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
-%token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
-%token <lex> I64VEC2 I64VEC3 I64VEC4
-%token <lex> U64VEC2 U64VEC3 U64VEC4
-%token <lex> I32VEC2 I32VEC3 I32VEC4
-%token <lex> U32VEC2 U32VEC3 U32VEC4
-%token <lex> I16VEC2 I16VEC3 I16VEC4
-%token <lex> U16VEC2 U16VEC3 U16VEC4
-%token <lex> I8VEC2  I8VEC3  I8VEC4
-%token <lex> U8VEC2  U8VEC3  U8VEC4
-%token <lex> DVEC2 DVEC3 DVEC4 DMAT2 DMAT3 DMAT4
-%token <lex> F16VEC2 F16VEC3 F16VEC4 F16MAT2 F16MAT3 F16MAT4
-%token <lex> F32VEC2 F32VEC3 F32VEC4 F32MAT2 F32MAT3 F32MAT4
-%token <lex> F64VEC2 F64VEC3 F64VEC4 F64MAT2 F64MAT3 F64MAT4
-%token <lex> DMAT2X2 DMAT2X3 DMAT2X4
-%token <lex> DMAT3X2 DMAT3X3 DMAT3X4
-%token <lex> DMAT4X2 DMAT4X3 DMAT4X4
-%token <lex> F16MAT2X2 F16MAT2X3 F16MAT2X4
-%token <lex> F16MAT3X2 F16MAT3X3 F16MAT3X4
-%token <lex> F16MAT4X2 F16MAT4X3 F16MAT4X4
-%token <lex> F32MAT2X2 F32MAT2X3 F32MAT2X4
-%token <lex> F32MAT3X2 F32MAT3X3 F32MAT3X4
-%token <lex> F32MAT4X2 F32MAT4X3 F32MAT4X4
-%token <lex> F64MAT2X2 F64MAT2X3 F64MAT2X4
-%token <lex> F64MAT3X2 F64MAT3X3 F64MAT3X4
-%token <lex> F64MAT4X2 F64MAT4X3 F64MAT4X4
-%token <lex> ATOMIC_UINT
-%token <lex> ACCSTRUCTNV
-%token <lex> ACCSTRUCTEXT
-%token <lex> RAYQUERYEXT
-%token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
-%token <lex> HITOBJECTNV HITOBJECTATTRNV
-
-// combined image/sampler
-%token <lex> SAMPLERCUBEARRAY SAMPLERCUBEARRAYSHADOW
-%token <lex> ISAMPLERCUBEARRAY USAMPLERCUBEARRAY
-%token <lex> SAMPLER1D SAMPLER1DARRAY SAMPLER1DARRAYSHADOW ISAMPLER1D SAMPLER1DSHADOW
-%token <lex> SAMPLER2DRECT SAMPLER2DRECTSHADOW ISAMPLER2DRECT USAMPLER2DRECT
-%token <lex> SAMPLERBUFFER ISAMPLERBUFFER USAMPLERBUFFER
-%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
-%token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
-%token <lex> SAMPLEREXTERNALOES
-%token <lex> SAMPLEREXTERNAL2DY2YEXT
-%token <lex> ISAMPLER1DARRAY USAMPLER1D USAMPLER1DARRAY 
-%token <lex> F16SAMPLER1D F16SAMPLER2D F16SAMPLER3D F16SAMPLER2DRECT F16SAMPLERCUBE
-%token <lex> F16SAMPLER1DARRAY F16SAMPLER2DARRAY F16SAMPLERCUBEARRAY
-%token <lex> F16SAMPLERBUFFER F16SAMPLER2DMS F16SAMPLER2DMSARRAY
-%token <lex> F16SAMPLER1DSHADOW F16SAMPLER2DSHADOW F16SAMPLER1DARRAYSHADOW F16SAMPLER2DARRAYSHADOW
-%token <lex> F16SAMPLER2DRECTSHADOW F16SAMPLERCUBESHADOW F16SAMPLERCUBEARRAYSHADOW
-
-// images
-%token <lex> IMAGE1D IIMAGE1D UIMAGE1D IMAGE2D IIMAGE2D
-%token <lex> UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D
-%token <lex> IMAGE2DRECT IIMAGE2DRECT UIMAGE2DRECT
-%token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE
-%token <lex> IMAGEBUFFER IIMAGEBUFFER UIMAGEBUFFER
-%token <lex> IMAGE1DARRAY IIMAGE1DARRAY UIMAGE1DARRAY
-%token <lex> IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY
-%token <lex> IMAGECUBEARRAY IIMAGECUBEARRAY UIMAGECUBEARRAY
-%token <lex> IMAGE2DMS IIMAGE2DMS UIMAGE2DMS
-%token <lex> IMAGE2DMSARRAY IIMAGE2DMSARRAY UIMAGE2DMSARRAY
-
-%token <lex> F16IMAGE1D F16IMAGE2D F16IMAGE3D F16IMAGE2DRECT
-%token <lex> F16IMAGECUBE F16IMAGE1DARRAY F16IMAGE2DARRAY F16IMAGECUBEARRAY
-%token <lex> F16IMAGEBUFFER F16IMAGE2DMS F16IMAGE2DMSARRAY
-
-%token <lex> I64IMAGE1D U64IMAGE1D
-%token <lex> I64IMAGE2D U64IMAGE2D
-%token <lex> I64IMAGE3D U64IMAGE3D
-%token <lex> I64IMAGE2DRECT U64IMAGE2DRECT
-%token <lex> I64IMAGECUBE U64IMAGECUBE
-%token <lex> I64IMAGEBUFFER U64IMAGEBUFFER
-%token <lex> I64IMAGE1DARRAY U64IMAGE1DARRAY
-%token <lex> I64IMAGE2DARRAY U64IMAGE2DARRAY
-%token <lex> I64IMAGECUBEARRAY U64IMAGECUBEARRAY
-%token <lex> I64IMAGE2DMS U64IMAGE2DMS
-%token <lex> I64IMAGE2DMSARRAY U64IMAGE2DMSARRAY
-
-// texture without sampler
-%token <lex> TEXTURECUBEARRAY ITEXTURECUBEARRAY UTEXTURECUBEARRAY
-%token <lex> TEXTURE1D ITEXTURE1D UTEXTURE1D
-%token <lex> TEXTURE1DARRAY ITEXTURE1DARRAY UTEXTURE1DARRAY
-%token <lex> TEXTURE2DRECT ITEXTURE2DRECT UTEXTURE2DRECT
-%token <lex> TEXTUREBUFFER ITEXTUREBUFFER UTEXTUREBUFFER
-%token <lex> TEXTURE2DMS ITEXTURE2DMS UTEXTURE2DMS
-%token <lex> TEXTURE2DMSARRAY ITEXTURE2DMSARRAY UTEXTURE2DMSARRAY
-
-%token <lex> F16TEXTURE1D F16TEXTURE2D F16TEXTURE3D F16TEXTURE2DRECT F16TEXTURECUBE
-%token <lex> F16TEXTURE1DARRAY F16TEXTURE2DARRAY F16TEXTURECUBEARRAY
-%token <lex> F16TEXTUREBUFFER F16TEXTURE2DMS F16TEXTURE2DMSARRAY
-
-// input attachments
-%token <lex> SUBPASSINPUT SUBPASSINPUTMS ISUBPASSINPUT ISUBPASSINPUTMS USUBPASSINPUT USUBPASSINPUTMS
-%token <lex> F16SUBPASSINPUT F16SUBPASSINPUTMS
-
-// spirv intrinsics
-%token <lex> SPIRV_INSTRUCTION SPIRV_EXECUTION_MODE SPIRV_EXECUTION_MODE_ID
-%token <lex> SPIRV_DECORATE SPIRV_DECORATE_ID SPIRV_DECORATE_STRING
-%token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
-%token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
-
-GLSLANG_WEB_EXCLUDE_OFF
-
-%token <lex> LEFT_OP RIGHT_OP
-%token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
-%token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
-%token <lex> MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
-%token <lex> SUB_ASSIGN
-%token <lex> STRING_LITERAL
-
-%token <lex> LEFT_PAREN RIGHT_PAREN LEFT_BRACKET RIGHT_BRACKET LEFT_BRACE RIGHT_BRACE DOT
-%token <lex> COMMA COLON EQUAL SEMICOLON BANG DASH TILDE PLUS STAR SLASH PERCENT
-%token <lex> LEFT_ANGLE RIGHT_ANGLE VERTICAL_BAR CARET AMPERSAND QUESTION
-
-%token <lex> INVARIANT
-%token <lex> HIGH_PRECISION MEDIUM_PRECISION LOW_PRECISION PRECISION
-%token <lex> PACKED RESOURCE SUPERP
-
-%token <lex> FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
-%token <lex> IDENTIFIER TYPE_NAME
-%token <lex> CENTROID IN OUT INOUT
-%token <lex> STRUCT VOID WHILE
-%token <lex> BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
-%token <lex> TERMINATE_INVOCATION
-%token <lex> TERMINATE_RAY IGNORE_INTERSECTION
-%token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
-%token <lex> FLAT SMOOTH LAYOUT
-
-GLSLANG_WEB_EXCLUDE_ON
-%token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
-%token <lex> INT64CONSTANT UINT64CONSTANT
-%token <lex> SUBROUTINE DEMOTE
-%token <lex> PAYLOADNV PAYLOADINNV HITATTRNV CALLDATANV CALLDATAINNV 
-%token <lex> PAYLOADEXT PAYLOADINEXT HITATTREXT CALLDATAEXT CALLDATAINEXT
-%token <lex> PATCH SAMPLE NONUNIFORM
-%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
-%token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
-%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
-%token <lex> PRECISE
-GLSLANG_WEB_EXCLUDE_OFF
-
-%type <interm> assignment_operator unary_operator
-%type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
-%type <interm.intermTypedNode> expression integer_expression assignment_expression
-%type <interm.intermTypedNode> unary_expression multiplicative_expression additive_expression
-%type <interm.intermTypedNode> relational_expression equality_expression
-%type <interm.intermTypedNode> conditional_expression constant_expression
-%type <interm.intermTypedNode> logical_or_expression logical_xor_expression logical_and_expression
-%type <interm.intermTypedNode> shift_expression and_expression exclusive_or_expression inclusive_or_expression
-%type <interm.intermTypedNode> function_call initializer condition conditionopt
-
-%type <interm.intermNode> translation_unit function_definition
-%type <interm.intermNode> statement simple_statement
-%type <interm.intermNode> statement_list switch_statement_list compound_statement
-%type <interm.intermNode> declaration_statement selection_statement selection_statement_nonattributed expression_statement
-%type <interm.intermNode> switch_statement switch_statement_nonattributed case_label
-%type <interm.intermNode> declaration external_declaration
-%type <interm.intermNode> for_init_statement compound_statement_no_new_scope
-%type <interm.nodePair> selection_rest_statement for_rest_statement
-%type <interm.intermNode> iteration_statement iteration_statement_nonattributed jump_statement statement_no_new_scope statement_scoped
-%type <interm> single_declaration init_declarator_list
-
-%type <interm> parameter_declaration parameter_declarator parameter_type_specifier
-
-%type <interm> array_specifier
-%type <interm.type> invariant_qualifier interpolation_qualifier storage_qualifier precision_qualifier
-%type <interm.type> layout_qualifier layout_qualifier_id_list layout_qualifier_id
-
-%type <interm.typeParameters> type_parameter_specifier
-%type <interm.typeParameters> type_parameter_specifier_opt
-%type <interm.typeParameters> type_parameter_specifier_list
-
-%type <interm.type> type_qualifier fully_specified_type type_specifier
-%type <interm.type> single_type_qualifier
-%type <interm.type> type_specifier_nonarray
-%type <interm.type> struct_specifier
-%type <interm.typeLine> struct_declarator
-%type <interm.typeList> struct_declarator_list struct_declaration struct_declaration_list
-%type <interm> block_structure
-%type <interm.function> function_header function_declarator
-%type <interm.function> function_header_with_parameters
-%type <interm> function_call_header_with_parameters function_call_header_no_parameters function_call_generic function_prototype
-%type <interm> function_call_or_method function_identifier function_call_header
-
-%type <interm.identifierList> identifier_list
-
-GLSLANG_WEB_EXCLUDE_ON
-%type <interm.type> precise_qualifier non_uniform_qualifier
-%type <interm.typeList> type_name_list
-%type <interm.attributes> attribute attribute_list single_attribute
-%type <interm.intermNode> demote_statement
-%type <interm.intermTypedNode> initializer_list
-%type <interm.spirvReq> spirv_requirements_list spirv_requirements_parameter
-%type <interm.intermNode> spirv_extension_list spirv_capability_list
-%type <interm.intermNode> spirv_execution_mode_qualifier
-%type <interm.intermNode> spirv_execution_mode_parameter_list spirv_execution_mode_parameter spirv_execution_mode_id_parameter_list
-%type <interm.type> spirv_storage_class_qualifier
-%type <interm.type> spirv_decorate_qualifier
-%type <interm.intermNode> spirv_decorate_parameter_list spirv_decorate_parameter
-%type <interm.intermNode> spirv_decorate_id_parameter_list spirv_decorate_id_parameter
-%type <interm.intermNode> spirv_decorate_string_parameter_list
-%type <interm.type> spirv_type_specifier
-%type <interm.spirvTypeParams> spirv_type_parameter_list spirv_type_parameter
-%type <interm.spirvInst> spirv_instruction_qualifier
-%type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
-GLSLANG_WEB_EXCLUDE_OFF
-
-%start translation_unit
-%%
-
-variable_identifier
-    : IDENTIFIER {
-        $$ = parseContext.handleVariable($1.loc, $1.symbol, $1.string);
-    }
-    ;
-
-primary_expression
-    : variable_identifier {
-        $$ = $1;
-    }
-    | LEFT_PAREN expression RIGHT_PAREN {
-        $$ = $2;
-        if ($$->getAsConstantUnion())
-            $$->getAsConstantUnion()->setExpression();
-    }
-    | FLOATCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
-    }
-    | INTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
-    }
-    | UINTCONSTANT {
-        parseContext.fullIntegerCheck($1.loc, "unsigned literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
-    }
-    | BOOLCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | STRING_LITERAL {
-        $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
-    }
-    | INT32CONSTANT {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
-    }
-    | UINT32CONSTANT {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
-    }
-    | INT64CONSTANT {
-        parseContext.int64Check($1.loc, "64-bit integer literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true);
-    }
-    | UINT64CONSTANT {
-        parseContext.int64Check($1.loc, "64-bit unsigned integer literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true);
-    }
-    | INT16CONSTANT {
-        parseContext.explicitInt16Check($1.loc, "16-bit integer literal");
-        $$ = parseContext.intermediate.addConstantUnion((short)$1.i, $1.loc, true);
-    }
-    | UINT16CONSTANT {
-        parseContext.explicitInt16Check($1.loc, "16-bit unsigned integer literal");
-        $$ = parseContext.intermediate.addConstantUnion((unsigned short)$1.u, $1.loc, true);
-    }
-    | DOUBLECONSTANT {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double literal");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtDouble, $1.loc, true);
-    }
-    | FLOAT16CONSTANT {
-        parseContext.float16Check($1.loc, "half float literal");
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-postfix_expression
-    : primary_expression {
-        $$ = $1;
-    }
-    | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET {
-        $$ = parseContext.handleBracketDereference($2.loc, $1, $3);
-    }
-    | function_call {
-        $$ = $1;
-    }
-    | postfix_expression DOT IDENTIFIER {
-        $$ = parseContext.handleDotDereference($3.loc, $1, *$3.string);
-    }
-    | postfix_expression INC_OP {
-        parseContext.variableCheck($1);
-        parseContext.lValueErrorCheck($2.loc, "++", $1);
-        $$ = parseContext.handleUnaryMath($2.loc, "++", EOpPostIncrement, $1);
-    }
-    | postfix_expression DEC_OP {
-        parseContext.variableCheck($1);
-        parseContext.lValueErrorCheck($2.loc, "--", $1);
-        $$ = parseContext.handleUnaryMath($2.loc, "--", EOpPostDecrement, $1);
-    }
-    ;
-
-integer_expression
-    : expression {
-        parseContext.integerCheck($1, "[]");
-        $$ = $1;
-    }
-    ;
-
-function_call
-    : function_call_or_method {
-        $$ = parseContext.handleFunctionCall($1.loc, $1.function, $1.intermNode);
-        delete $1.function;
-    }
-    ;
-
-function_call_or_method
-    : function_call_generic {
-        $$ = $1;
-    }
-    ;
-
-function_call_generic
-    : function_call_header_with_parameters RIGHT_PAREN {
-        $$ = $1;
-        $$.loc = $2.loc;
-    }
-    | function_call_header_no_parameters RIGHT_PAREN {
-        $$ = $1;
-        $$.loc = $2.loc;
-    }
-    ;
-
-function_call_header_no_parameters
-    : function_call_header VOID {
-        $$ = $1;
-    }
-    | function_call_header {
-        $$ = $1;
-    }
-    ;
-
-function_call_header_with_parameters
-    : function_call_header assignment_expression {
-        TParameter param = { 0, new TType };
-        param.type->shallowCopy($2->getType());
-        $1.function->addParameter(param);
-        $$.function = $1.function;
-        $$.intermNode = $2;
-    }
-    | function_call_header_with_parameters COMMA assignment_expression {
-        TParameter param = { 0, new TType };
-        param.type->shallowCopy($3->getType());
-        $1.function->addParameter(param);
-        $$.function = $1.function;
-        $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, $3, $2.loc);
-    }
-    ;
-
-function_call_header
-    : function_identifier LEFT_PAREN {
-        $$ = $1;
-    }
-    ;
-
-// Grammar Note:  Constructors look like functions, but are recognized as types.
-
-function_identifier
-    : type_specifier {
-        // Constructor
-        $$.intermNode = 0;
-        $$.function = parseContext.handleConstructorCall($1.loc, $1);
-    }
-    | postfix_expression {
-        //
-        // Should be a method or subroutine call, but we haven't recognized the arguments yet.
-        //
-        $$.function = 0;
-        $$.intermNode = 0;
-
-        TIntermMethod* method = $1->getAsMethodNode();
-        if (method) {
-            $$.function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength);
-            $$.intermNode = method->getObject();
-        } else {
-            TIntermSymbol* symbol = $1->getAsSymbolNode();
-            if (symbol) {
-                parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName());
-                TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid));
-                $$.function = function;
-            } else
-                parseContext.error($1->getLoc(), "function call, method, or subroutine call expected", "", "");
-        }
-
-        if ($$.function == 0) {
-            // error recover
-            TString* empty = NewPoolTString("");
-            $$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
-        }
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | non_uniform_qualifier {
-        // Constructor
-        $$.intermNode = 0;
-        $$.function = parseContext.handleConstructorCall($1.loc, $1);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-unary_expression
-    : postfix_expression {
-        parseContext.variableCheck($1);
-        $$ = $1;
-        if (TIntermMethod* method = $1->getAsMethodNode())
-            parseContext.error($1->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), "");
-    }
-    | INC_OP unary_expression {
-        parseContext.lValueErrorCheck($1.loc, "++", $2);
-        $$ = parseContext.handleUnaryMath($1.loc, "++", EOpPreIncrement, $2);
-    }
-    | DEC_OP unary_expression {
-        parseContext.lValueErrorCheck($1.loc, "--", $2);
-        $$ = parseContext.handleUnaryMath($1.loc, "--", EOpPreDecrement, $2);
-    }
-    | unary_operator unary_expression {
-        if ($1.op != EOpNull) {
-            char errorOp[2] = {0, 0};
-            switch($1.op) {
-            case EOpNegative:   errorOp[0] = '-'; break;
-            case EOpLogicalNot: errorOp[0] = '!'; break;
-            case EOpBitwiseNot: errorOp[0] = '~'; break;
-            default: break; // some compilers want this
-            }
-            $$ = parseContext.handleUnaryMath($1.loc, errorOp, $1.op, $2);
-        } else {
-            $$ = $2;
-            if ($$->getAsConstantUnion())
-                $$->getAsConstantUnion()->setExpression();
-        }
-    }
-    ;
-// Grammar Note:  No traditional style type casts.
-
-unary_operator
-    : PLUS  { $$.loc = $1.loc; $$.op = EOpNull; }
-    | DASH  { $$.loc = $1.loc; $$.op = EOpNegative; }
-    | BANG  { $$.loc = $1.loc; $$.op = EOpLogicalNot; }
-    | TILDE { $$.loc = $1.loc; $$.op = EOpBitwiseNot;
-              parseContext.fullIntegerCheck($1.loc, "bitwise not"); }
-    ;
-// Grammar Note:  No '*' or '&' unary ops.  Pointers are not supported.
-
-multiplicative_expression
-    : unary_expression { $$ = $1; }
-    | multiplicative_expression STAR unary_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "*", EOpMul, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    | multiplicative_expression SLASH unary_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "/", EOpDiv, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    | multiplicative_expression PERCENT unary_expression {
-        parseContext.fullIntegerCheck($2.loc, "%");
-        $$ = parseContext.handleBinaryMath($2.loc, "%", EOpMod, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-additive_expression
-    : multiplicative_expression { $$ = $1; }
-    | additive_expression PLUS multiplicative_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "+", EOpAdd, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    | additive_expression DASH multiplicative_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "-", EOpSub, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-shift_expression
-    : additive_expression { $$ = $1; }
-    | shift_expression LEFT_OP additive_expression {
-        parseContext.fullIntegerCheck($2.loc, "bit shift left");
-        $$ = parseContext.handleBinaryMath($2.loc, "<<", EOpLeftShift, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    | shift_expression RIGHT_OP additive_expression {
-        parseContext.fullIntegerCheck($2.loc, "bit shift right");
-        $$ = parseContext.handleBinaryMath($2.loc, ">>", EOpRightShift, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-relational_expression
-    : shift_expression { $$ = $1; }
-    | relational_expression LEFT_ANGLE shift_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "<", EOpLessThan, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    | relational_expression RIGHT_ANGLE shift_expression  {
-        $$ = parseContext.handleBinaryMath($2.loc, ">", EOpGreaterThan, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    | relational_expression LE_OP shift_expression  {
-        $$ = parseContext.handleBinaryMath($2.loc, "<=", EOpLessThanEqual, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    | relational_expression GE_OP shift_expression  {
-        $$ = parseContext.handleBinaryMath($2.loc, ">=", EOpGreaterThanEqual, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    ;
-
-equality_expression
-    : relational_expression { $$ = $1; }
-    | equality_expression EQ_OP relational_expression  {
-        parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
-        parseContext.opaqueCheck($2.loc, $1->getType(), "==");
-        parseContext.specializationCheck($2.loc, $1->getType(), "==");
-        parseContext.referenceCheck($2.loc, $1->getType(), "==");
-        $$ = parseContext.handleBinaryMath($2.loc, "==", EOpEqual, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    | equality_expression NE_OP relational_expression {
-        parseContext.arrayObjectCheck($2.loc, $1->getType(), "array comparison");
-        parseContext.opaqueCheck($2.loc, $1->getType(), "!=");
-        parseContext.specializationCheck($2.loc, $1->getType(), "!=");
-        parseContext.referenceCheck($2.loc, $1->getType(), "!=");
-        $$ = parseContext.handleBinaryMath($2.loc, "!=", EOpNotEqual, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    ;
-
-and_expression
-    : equality_expression { $$ = $1; }
-    | and_expression AMPERSAND equality_expression {
-        parseContext.fullIntegerCheck($2.loc, "bitwise and");
-        $$ = parseContext.handleBinaryMath($2.loc, "&", EOpAnd, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-exclusive_or_expression
-    : and_expression { $$ = $1; }
-    | exclusive_or_expression CARET and_expression {
-        parseContext.fullIntegerCheck($2.loc, "bitwise exclusive or");
-        $$ = parseContext.handleBinaryMath($2.loc, "^", EOpExclusiveOr, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-inclusive_or_expression
-    : exclusive_or_expression { $$ = $1; }
-    | inclusive_or_expression VERTICAL_BAR exclusive_or_expression {
-        parseContext.fullIntegerCheck($2.loc, "bitwise inclusive or");
-        $$ = parseContext.handleBinaryMath($2.loc, "|", EOpInclusiveOr, $1, $3);
-        if ($$ == 0)
-            $$ = $1;
-    }
-    ;
-
-logical_and_expression
-    : inclusive_or_expression { $$ = $1; }
-    | logical_and_expression AND_OP inclusive_or_expression {
-        $$ = parseContext.handleBinaryMath($2.loc, "&&", EOpLogicalAnd, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    ;
-
-logical_xor_expression
-    : logical_and_expression { $$ = $1; }
-    | logical_xor_expression XOR_OP logical_and_expression  {
-        $$ = parseContext.handleBinaryMath($2.loc, "^^", EOpLogicalXor, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    ;
-
-logical_or_expression
-    : logical_xor_expression { $$ = $1; }
-    | logical_or_expression OR_OP logical_xor_expression  {
-        $$ = parseContext.handleBinaryMath($2.loc, "||", EOpLogicalOr, $1, $3);
-        if ($$ == 0)
-            $$ = parseContext.intermediate.addConstantUnion(false, $2.loc);
-    }
-    ;
-
-conditional_expression
-    : logical_or_expression { $$ = $1; }
-    | logical_or_expression QUESTION {
-        ++parseContext.controlFlowNestingLevel;
-    }
-      expression COLON assignment_expression {
-        --parseContext.controlFlowNestingLevel;
-        parseContext.boolCheck($2.loc, $1);
-        parseContext.rValueErrorCheck($2.loc, "?", $1);
-        parseContext.rValueErrorCheck($5.loc, ":", $4);
-        parseContext.rValueErrorCheck($5.loc, ":", $6);
-        $$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
-        if ($$ == 0) {
-            parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
-            $$ = $6;
-        }
-    }
-    ;
-
-assignment_expression
-    : conditional_expression { $$ = $1; }
-    | unary_expression assignment_operator assignment_expression {
-        parseContext.arrayObjectCheck($2.loc, $1->getType(), "array assignment");
-        parseContext.opaqueCheck($2.loc, $1->getType(), "=");
-        parseContext.storage16BitAssignmentCheck($2.loc, $1->getType(), "=");
-        parseContext.specializationCheck($2.loc, $1->getType(), "=");
-        parseContext.lValueErrorCheck($2.loc, "assign", $1);
-        parseContext.rValueErrorCheck($2.loc, "assign", $3);
-        $$ = parseContext.addAssign($2.loc, $2.op, $1, $3);
-        if ($$ == 0) {
-            parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
-            $$ = $1;
-        }
-    }
-    ;
-
-assignment_operator
-    : EQUAL {
-        $$.loc = $1.loc;
-        $$.op = EOpAssign;
-    }
-    | MUL_ASSIGN {
-        $$.loc = $1.loc;
-        $$.op = EOpMulAssign;
-    }
-    | DIV_ASSIGN {
-        $$.loc = $1.loc;
-        $$.op = EOpDivAssign;
-    }
-    | MOD_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "%=");
-        $$.loc = $1.loc;
-        $$.op = EOpModAssign;
-    }
-    | ADD_ASSIGN {
-        $$.loc = $1.loc;
-        $$.op = EOpAddAssign;
-    }
-    | SUB_ASSIGN {
-        $$.loc = $1.loc;
-        $$.op = EOpSubAssign;
-    }
-    | LEFT_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "bit-shift left assign");
-        $$.loc = $1.loc; $$.op = EOpLeftShiftAssign;
-    }
-    | RIGHT_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "bit-shift right assign");
-        $$.loc = $1.loc; $$.op = EOpRightShiftAssign;
-    }
-    | AND_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "bitwise-and assign");
-        $$.loc = $1.loc; $$.op = EOpAndAssign;
-    }
-    | XOR_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "bitwise-xor assign");
-        $$.loc = $1.loc; $$.op = EOpExclusiveOrAssign;
-    }
-    | OR_ASSIGN {
-        parseContext.fullIntegerCheck($1.loc, "bitwise-or assign");
-        $$.loc = $1.loc; $$.op = EOpInclusiveOrAssign;
-    }
-    ;
-
-expression
-    : assignment_expression {
-        $$ = $1;
-    }
-    | expression COMMA assignment_expression {
-        parseContext.samplerConstructorLocationCheck($2.loc, ",", $3);
-        $$ = parseContext.intermediate.addComma($1, $3, $2.loc);
-        if ($$ == 0) {
-            parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
-            $$ = $3;
-        }
-    }
-    ;
-
-constant_expression
-    : conditional_expression {
-        parseContext.constantValueCheck($1, "");
-        $$ = $1;
-    }
-    ;
-
-declaration
-    : function_prototype SEMICOLON {
-        parseContext.handleFunctionDeclarator($1.loc, *$1.function, true /* prototype */);
-        $$ = 0;
-        // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | spirv_instruction_qualifier function_prototype SEMICOLON {
-        parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
-        $2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
-        parseContext.handleFunctionDeclarator($2.loc, *$2.function, true /* prototype */);
-        $$ = 0;
-        // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
-    }
-    | spirv_execution_mode_qualifier SEMICOLON {
-        parseContext.globalCheck($2.loc, "SPIR-V execution mode qualifier");
-        parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
-        $$ = 0;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    | init_declarator_list SEMICOLON {
-        if ($1.intermNode && $1.intermNode->getAsAggregate())
-            $1.intermNode->getAsAggregate()->setOperator(EOpSequence);
-        $$ = $1.intermNode;
-    }
-    | PRECISION precision_qualifier type_specifier SEMICOLON {
-        parseContext.profileRequires($1.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
-        parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]);
-        parseContext.setDefaultPrecision($1.loc, $3, $2.qualifier.precision);
-        $$ = 0;
-    }
-    | block_structure SEMICOLON {
-        parseContext.declareBlock($1.loc, *$1.typeList);
-        $$ = 0;
-    }
-    | block_structure IDENTIFIER SEMICOLON {
-        parseContext.declareBlock($1.loc, *$1.typeList, $2.string);
-        $$ = 0;
-    }
-    | block_structure IDENTIFIER array_specifier SEMICOLON {
-        parseContext.declareBlock($1.loc, *$1.typeList, $2.string, $3.arraySizes);
-        $$ = 0;
-    }
-    | type_qualifier SEMICOLON {
-        parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
-        parseContext.updateStandaloneQualifierDefaults($1.loc, $1);
-        $$ = 0;
-    }
-    | type_qualifier IDENTIFIER SEMICOLON {
-        parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
-        parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$2.string);
-        $$ = 0;
-    }
-    | type_qualifier IDENTIFIER identifier_list SEMICOLON {
-        parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
-        $3->push_back($2.string);
-        parseContext.addQualifierToExisting($1.loc, $1.qualifier, *$3);
-        $$ = 0;
-    }
-    ;
-
-block_structure
-    : type_qualifier IDENTIFIER LEFT_BRACE { parseContext.nestedBlockCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
-        --parseContext.blockNestingLevel;
-        parseContext.blockName = $2.string;
-        parseContext.globalQualifierFixCheck($1.loc, $1.qualifier);
-        parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
-        parseContext.currentBlockQualifier = $1.qualifier;
-        $$.loc = $1.loc;
-        $$.typeList = $5;
-    }
-
-identifier_list
-    : COMMA IDENTIFIER {
-        $$ = new TIdentifierList;
-        $$->push_back($2.string);
-    }
-    | identifier_list COMMA IDENTIFIER {
-        $$ = $1;
-        $$->push_back($3.string);
-    }
-    ;
-
-function_prototype
-    : function_declarator RIGHT_PAREN  {
-        $$.function = $1;
-        $$.loc = $2.loc;
-    }
-    | function_declarator RIGHT_PAREN attribute {
-        $$.function = $1;
-        $$.loc = $2.loc;
-        parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
-        parseContext.handleFunctionAttributes($2.loc, *$3);
-    }
-    | attribute function_declarator RIGHT_PAREN {
-        $$.function = $2;
-        $$.loc = $3.loc;
-        parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
-        parseContext.handleFunctionAttributes($3.loc, *$1);
-    }
-    | attribute function_declarator RIGHT_PAREN attribute {
-        $$.function = $2;
-        $$.loc = $3.loc;
-        parseContext.requireExtensions($3.loc, 1, &E_GL_EXT_subgroup_uniform_control_flow, "attribute");
-        parseContext.handleFunctionAttributes($3.loc, *$1);
-        parseContext.handleFunctionAttributes($3.loc, *$4);
-    }
-    ;
-
-function_declarator
-    : function_header {
-        $$ = $1;
-    }
-    | function_header_with_parameters {
-        $$ = $1;
-    }
-    ;
-
-
-function_header_with_parameters
-    : function_header parameter_declaration {
-        // Add the parameter
-        $$ = $1;
-        if ($2.param.type->getBasicType() != EbtVoid)
-            $1->addParameter($2.param);
-        else
-            delete $2.param.type;
-    }
-    | function_header_with_parameters COMMA parameter_declaration {
-        //
-        // Only first parameter of one-parameter functions can be void
-        // The check for named parameters not being void is done in parameter_declarator
-        //
-        if ($3.param.type->getBasicType() == EbtVoid) {
-            //
-            // This parameter > first is void
-            //
-            parseContext.error($2.loc, "cannot be an argument type except for '(void)'", "void", "");
-            delete $3.param.type;
-        } else {
-            // Add the parameter
-            $$ = $1;
-            $1->addParameter($3.param);
-        }
-    }
-    ;
-
-function_header
-    : fully_specified_type IDENTIFIER LEFT_PAREN {
-        if ($1.qualifier.storage != EvqGlobal && $1.qualifier.storage != EvqTemporary) {
-            parseContext.error($2.loc, "no qualifiers allowed for function return",
-                               GetStorageQualifierString($1.qualifier.storage), "");
-        }
-        if ($1.arraySizes)
-            parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
-
-        // Add the function as a prototype after parsing it (we do not support recursion)
-        TFunction *function;
-        TType type($1);
-
-        // Potentially rename shader entry point function.  No-op most of the time.
-        parseContext.renameShaderFunction($2.string);
-
-        // Make the function
-        function = new TFunction($2.string, type);
-        $$ = function;
-    }
-    ;
-
-parameter_declarator
-    // Type + name
-    : type_specifier IDENTIFIER {
-        if ($1.arraySizes) {
-            parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
-            parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
-        }
-        if ($1.basicType == EbtVoid) {
-            parseContext.error($2.loc, "illegal use of type 'void'", $2.string->c_str(), "");
-        }
-        parseContext.reservedErrorCheck($2.loc, *$2.string);
-
-        TParameter param = {$2.string, new TType($1)};
-        $$.loc = $2.loc;
-        $$.param = param;
-    }
-    | type_specifier IDENTIFIER array_specifier {
-        if ($1.arraySizes) {
-            parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
-            parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
-        }
-        TType* type = new TType($1);
-        type->transferArraySizes($3.arraySizes);
-        type->copyArrayInnerSizes($1.arraySizes);
-
-        parseContext.arrayOfArrayVersionCheck($2.loc, type->getArraySizes());
-        parseContext.arraySizeRequiredCheck($3.loc, *$3.arraySizes);
-        parseContext.reservedErrorCheck($2.loc, *$2.string);
-
-        TParameter param = { $2.string, type };
-
-        $$.loc = $2.loc;
-        $$.param = param;
-    }
-    ;
-
-parameter_declaration
-    //
-    // With name
-    //
-    : type_qualifier parameter_declarator {
-        $$ = $2;
-        if ($1.qualifier.precision != EpqNone)
-            $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
-
-        parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
-        parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
-        parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
-
-    }
-    | parameter_declarator {
-        $$ = $1;
-
-        parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
-        parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
-    }
-    //
-    // Without name
-    //
-    | type_qualifier parameter_type_specifier {
-        $$ = $2;
-        if ($1.qualifier.precision != EpqNone)
-            $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
-
-        parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
-        parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
-        parseContext.paramCheckFix($1.loc, $1.qualifier, *$$.param.type);
-    }
-    | parameter_type_specifier {
-        $$ = $1;
-
-        parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
-        parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
-    }
-    ;
-
-parameter_type_specifier
-    : type_specifier {
-        TParameter param = { 0, new TType($1) };
-        $$.param = param;
-        if ($1.arraySizes)
-            parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
-    }
-    ;
-
-init_declarator_list
-    : single_declaration {
-        $$ = $1;
-    }
-    | init_declarator_list COMMA IDENTIFIER {
-        $$ = $1;
-        parseContext.declareVariable($3.loc, *$3.string, $1.type);
-    }
-    | init_declarator_list COMMA IDENTIFIER array_specifier {
-        $$ = $1;
-        parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes);
-    }
-    | init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer {
-        $$.type = $1.type;
-        TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, $4.arraySizes, $6);
-        $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $5.loc);
-    }
-    | init_declarator_list COMMA IDENTIFIER EQUAL initializer {
-        $$.type = $1.type;
-        TIntermNode* initNode = parseContext.declareVariable($3.loc, *$3.string, $1.type, 0, $5);
-        $$.intermNode = parseContext.intermediate.growAggregate($1.intermNode, initNode, $4.loc);
-    }
-    ;
-
-single_declaration
-    : fully_specified_type {
-        $$.type = $1;
-        $$.intermNode = 0;
-GLSLANG_WEB_EXCLUDE_ON
-        parseContext.declareTypeDefaults($$.loc, $$.type);
-GLSLANG_WEB_EXCLUDE_OFF
-    }
-    | fully_specified_type IDENTIFIER {
-        $$.type = $1;
-        $$.intermNode = 0;
-        parseContext.declareVariable($2.loc, *$2.string, $1);
-    }
-    | fully_specified_type IDENTIFIER array_specifier {
-        $$.type = $1;
-        $$.intermNode = 0;
-        parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes);
-    }
-    | fully_specified_type IDENTIFIER array_specifier EQUAL initializer {
-        $$.type = $1;
-        TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, $3.arraySizes, $5);
-        $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $4.loc);
-    }
-    | fully_specified_type IDENTIFIER EQUAL initializer {
-        $$.type = $1;
-        TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
-        $$.intermNode = parseContext.intermediate.growAggregate(0, initNode, $3.loc);
-    }
-
-// Grammar Note:  No 'enum', or 'typedef'.
-
-fully_specified_type
-    : type_specifier {
-        $$ = $1;
-
-        parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $$);
-        if ($1.arraySizes) {
-            parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
-        }
-        parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
-    }
-    | type_qualifier type_specifier  {
-        parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
-        parseContext.globalQualifierTypeCheck($1.loc, $1.qualifier, $2);
-
-        if ($2.arraySizes) {
-            parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
-        }
-
-        if ($2.arraySizes && parseContext.arrayQualifierError($2.loc, $1.qualifier))
-            $2.arraySizes = nullptr;
-
-        parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
-        $2.shaderQualifiers.merge($1.shaderQualifiers);
-        parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
-
-        $$ = $2;
-
-        if (! $$.qualifier.isInterpolation() &&
-            ((parseContext.language == EShLangVertex   && $$.qualifier.storage == EvqVaryingOut) ||
-             (parseContext.language == EShLangFragment && $$.qualifier.storage == EvqVaryingIn)))
-            $$.qualifier.smooth = true;
-    }
-    ;
-
-invariant_qualifier
-    : INVARIANT {
-        parseContext.globalCheck($1.loc, "invariant");
-        parseContext.profileRequires($$.loc, ENoProfile, 120, 0, "invariant");
-        $$.init($1.loc);
-        $$.qualifier.invariant = true;
-    }
-    ;
-
-interpolation_qualifier
-    : SMOOTH {
-        parseContext.globalCheck($1.loc, "smooth");
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "smooth");
-        parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "smooth");
-        $$.init($1.loc);
-        $$.qualifier.smooth = true;
-    }
-    | FLAT {
-        parseContext.globalCheck($1.loc, "flat");
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "flat");
-        parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "flat");
-        $$.init($1.loc);
-        $$.qualifier.flat = true;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | NOPERSPECTIVE {
-        parseContext.globalCheck($1.loc, "noperspective");
-        parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "noperspective");
-        $$.init($1.loc);
-        $$.qualifier.nopersp = true;
-    }
-    | EXPLICITINTERPAMD {
-        parseContext.globalCheck($1.loc, "__explicitInterpAMD");
-        parseContext.profileRequires($1.loc, ECoreProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
-        parseContext.profileRequires($1.loc, ECompatibilityProfile, 450, E_GL_AMD_shader_explicit_vertex_parameter, "explicit interpolation");
-        $$.init($1.loc);
-        $$.qualifier.explicitInterp = true;
-    }
-    | PERVERTEXNV {
-        parseContext.globalCheck($1.loc, "pervertexNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
-        parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
-        parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_fragment_shader_barycentric, "fragment shader barycentric");
-        $$.init($1.loc);
-        $$.qualifier.pervertexNV = true;
-    }
-    | PERVERTEXEXT {
-        parseContext.globalCheck($1.loc, "pervertexEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
-        parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
-        parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
-        $$.init($1.loc);
-        $$.qualifier.pervertexEXT = true;
-    }
-    | PERPRIMITIVENV {
-        // No need for profile version or extension check. Shader stage already checks both.
-        parseContext.globalCheck($1.loc, "perprimitiveNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
-        // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
-        if (parseContext.language == EShLangFragment)
-            parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
-        $$.init($1.loc);
-        $$.qualifier.perPrimitiveNV = true;
-    }
-    | PERPRIMITIVEEXT {
-        // No need for profile version or extension check. Shader stage already checks both.
-        parseContext.globalCheck($1.loc, "perprimitiveEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
-        // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
-        if (parseContext.language == EShLangFragment)
-            parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
-        $$.init($1.loc);
-        $$.qualifier.perPrimitiveNV = true;
-    }
-    | PERVIEWNV {
-        // No need for profile version or extension check. Shader stage already checks both.
-        parseContext.globalCheck($1.loc, "perviewNV");
-        parseContext.requireStage($1.loc, EShLangMesh, "perviewNV");
-        $$.init($1.loc);
-        $$.qualifier.perViewNV = true;
-    }
-    | PERTASKNV {
-        // No need for profile version or extension check. Shader stage already checks both.
-        parseContext.globalCheck($1.loc, "taskNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
-        $$.init($1.loc);
-        $$.qualifier.perTaskNV = true;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-layout_qualifier
-    : LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN {
-        $$ = $3;
-    }
-    ;
-
-layout_qualifier_id_list
-    : layout_qualifier_id {
-        $$ = $1;
-    }
-    | layout_qualifier_id_list COMMA layout_qualifier_id {
-        $$ = $1;
-        $$.shaderQualifiers.merge($3.shaderQualifiers);
-        parseContext.mergeObjectLayoutQualifiers($$.qualifier, $3.qualifier, false);
-    }
-
-layout_qualifier_id
-    : IDENTIFIER {
-        $$.init($1.loc);
-        parseContext.setLayoutQualifier($1.loc, $$, *$1.string);
-    }
-    | IDENTIFIER EQUAL constant_expression {
-        $$.init($1.loc);
-        parseContext.setLayoutQualifier($1.loc, $$, *$1.string, $3);
-    }
-    | SHARED { // because "shared" is both an identifier and a keyword
-        $$.init($1.loc);
-        TString strShared("shared");
-        parseContext.setLayoutQualifier($1.loc, $$, strShared);
-    }
-    ;
-
-GLSLANG_WEB_EXCLUDE_ON
-precise_qualifier
-    : PRECISE {
-        parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
-        parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise");
-        $$.init($1.loc);
-        $$.qualifier.noContraction = true;
-    }
-    ;
-GLSLANG_WEB_EXCLUDE_OFF
-
-type_qualifier
-    : single_type_qualifier {
-        $$ = $1;
-    }
-    | type_qualifier single_type_qualifier {
-        $$ = $1;
-        if ($$.basicType == EbtVoid)
-            $$.basicType = $2.basicType;
-
-        $$.shaderQualifiers.merge($2.shaderQualifiers);
-        parseContext.mergeQualifiers($$.loc, $$.qualifier, $2.qualifier, false);
-    }
-    ;
-
-single_type_qualifier
-    : storage_qualifier {
-        $$ = $1;
-    }
-    | layout_qualifier {
-        $$ = $1;
-    }
-    | precision_qualifier {
-        parseContext.checkPrecisionQualifier($1.loc, $1.qualifier.precision);
-        $$ = $1;
-    }
-    | interpolation_qualifier {
-        // allow inheritance of storage qualifier from block declaration
-        $$ = $1;
-    }
-    | invariant_qualifier {
-        // allow inheritance of storage qualifier from block declaration
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | precise_qualifier {
-        // allow inheritance of storage qualifier from block declaration
-        $$ = $1;
-    }
-    | non_uniform_qualifier {
-        $$ = $1;
-    }
-    | spirv_storage_class_qualifier {
-        parseContext.globalCheck($1.loc, "spirv_storage_class");
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V storage class qualifier");
-        $$ = $1;
-    }
-    | spirv_decorate_qualifier {
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V decorate qualifier");
-        $$ = $1;
-    }
-    | SPIRV_BY_REFERENCE {
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_reference");
-        $$.init($1.loc);
-        $$.qualifier.setSpirvByReference();
-    }
-    | SPIRV_LITERAL {
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "spirv_by_literal");
-        $$.init($1.loc);
-        $$.qualifier.setSpirvLiteral();
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-storage_qualifier
-    : CONST {
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqConst;  // will later turn into EvqConstReadOnly, if the initializer is not constant
-    }
-    | INOUT {
-        parseContext.globalCheck($1.loc, "inout");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqInOut;
-    }
-    | IN {
-        parseContext.globalCheck($1.loc, "in");
-        $$.init($1.loc);
-        // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later
-        $$.qualifier.storage = EvqIn;
-    }
-    | OUT {
-        parseContext.globalCheck($1.loc, "out");
-        $$.init($1.loc);
-        // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later
-        $$.qualifier.storage = EvqOut;
-    }
-    | CENTROID {
-        parseContext.profileRequires($1.loc, ENoProfile, 120, 0, "centroid");
-        parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "centroid");
-        parseContext.globalCheck($1.loc, "centroid");
-        $$.init($1.loc);
-        $$.qualifier.centroid = true;
-    }
-    | UNIFORM {
-        parseContext.globalCheck($1.loc, "uniform");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqUniform;
-    }
-    | TILEIMAGEEXT {
-        parseContext.globalCheck($1.loc, "tileImageEXT");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqTileImageEXT;
-    }
-    | SHARED {
-        parseContext.globalCheck($1.loc, "shared");
-        parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
-        parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqShared;
-    }
-    | BUFFER {
-        parseContext.globalCheck($1.loc, "buffer");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqBuffer;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | ATTRIBUTE {
-        parseContext.requireStage($1.loc, EShLangVertex, "attribute");
-        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
-        parseContext.checkDeprecated($1.loc, ENoProfile, 130, "attribute");
-        parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "attribute");
-        parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "attribute");
-
-        parseContext.globalCheck($1.loc, "attribute");
-
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqVaryingIn;
-    }
-    | VARYING {
-        parseContext.checkDeprecated($1.loc, ENoProfile, 130, "varying");
-        parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "varying");
-        parseContext.requireNotRemoved($1.loc, ECoreProfile, 420, "varying");
-        parseContext.requireNotRemoved($1.loc, EEsProfile, 300, "varying");
-
-        parseContext.globalCheck($1.loc, "varying");
-
-        $$.init($1.loc);
-        if (parseContext.language == EShLangVertex)
-            $$.qualifier.storage = EvqVaryingOut;
-        else
-            $$.qualifier.storage = EvqVaryingIn;
-    }
-    | PATCH {
-        parseContext.globalCheck($1.loc, "patch");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch");
-        $$.init($1.loc);
-        $$.qualifier.patch = true;
-    }
-    | SAMPLE {
-        parseContext.globalCheck($1.loc, "sample");
-        $$.init($1.loc);
-        $$.qualifier.sample = true;
-    }
-    | HITATTRNV {
-        parseContext.globalCheck($1.loc, "hitAttributeNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
-            | EShLangAnyHitMask), "hitAttributeNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "hitAttributeNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqHitAttr;
-    }
-	| HITOBJECTATTRNV {
-        parseContext.globalCheck($1.loc, "hitAttributeNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask
-            | EShLangMissMask), "hitObjectAttributeNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_shader_invocation_reorder, "hitObjectAttributeNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqHitObjectAttrNV;
-	}
-    | HITATTREXT {
-        parseContext.globalCheck($1.loc, "hitAttributeEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
-            | EShLangAnyHitMask), "hitAttributeEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "hitAttributeNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqHitAttr;
-    }
-    | PAYLOADNV {
-        parseContext.globalCheck($1.loc, "rayPayloadNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
-            EShLangAnyHitMask | EShLangMissMask), "rayPayloadNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqPayload;
-    }
-    | PAYLOADEXT {
-        parseContext.globalCheck($1.loc, "rayPayloadEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
-            EShLangAnyHitMask | EShLangMissMask), "rayPayloadEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadEXT");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqPayload;
-    }
-    | PAYLOADINNV {
-        parseContext.globalCheck($1.loc, "rayPayloadInNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
-            EShLangAnyHitMask | EShLangMissMask), "rayPayloadInNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "rayPayloadInNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqPayloadIn;
-    }
-    | PAYLOADINEXT {
-        parseContext.globalCheck($1.loc, "rayPayloadInEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangClosestHitMask |
-            EShLangAnyHitMask | EShLangMissMask), "rayPayloadInEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "rayPayloadInEXT");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqPayloadIn;
-    }
-    | CALLDATANV {
-        parseContext.globalCheck($1.loc, "callableDataNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
-            EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqCallableData;
-    }
-    | CALLDATAEXT {
-        parseContext.globalCheck($1.loc, "callableDataEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangRayGenMask |
-            EShLangClosestHitMask | EShLangMissMask | EShLangCallableMask), "callableDataEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataEXT");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqCallableData;
-    }
-    | CALLDATAINNV {
-        parseContext.globalCheck($1.loc, "callableDataInNV");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_NV_ray_tracing, "callableDataInNV");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqCallableDataIn;
-    }
-    | CALLDATAINEXT {
-        parseContext.globalCheck($1.loc, "callableDataInEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT");
-        parseContext.profileRequires($1.loc, ECoreProfile, 460, E_GL_EXT_ray_tracing, "callableDataInEXT");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqCallableDataIn;
-    }
-    | COHERENT {
-        $$.init($1.loc);
-        $$.qualifier.coherent = true;
-    }
-    | DEVICECOHERENT {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "devicecoherent");
-        $$.qualifier.devicecoherent = true;
-    }
-    | QUEUEFAMILYCOHERENT {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "queuefamilycoherent");
-        $$.qualifier.queuefamilycoherent = true;
-    }
-    | WORKGROUPCOHERENT {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "workgroupcoherent");
-        $$.qualifier.workgroupcoherent = true;
-    }
-    | SUBGROUPCOHERENT {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "subgroupcoherent");
-        $$.qualifier.subgroupcoherent = true;
-    }
-    | NONPRIVATE {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_KHR_memory_scope_semantics, "nonprivate");
-        $$.qualifier.nonprivate = true;
-    }
-    | SHADERCALLCOHERENT {
-        $$.init($1.loc);
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_ray_tracing, "shadercallcoherent");
-        $$.qualifier.shadercallcoherent = true;
-    }
-    | VOLATILE {
-        $$.init($1.loc);
-        $$.qualifier.volatil = true;
-    }
-    | RESTRICT {
-        $$.init($1.loc);
-        $$.qualifier.restrict = true;
-    }
-    | READONLY {
-        $$.init($1.loc);
-        $$.qualifier.readonly = true;
-    }
-    | WRITEONLY {
-        $$.init($1.loc);
-        $$.qualifier.writeonly = true;
-    }
-    | SUBROUTINE {
-        parseContext.spvRemoved($1.loc, "subroutine");
-        parseContext.globalCheck($1.loc, "subroutine");
-        parseContext.unimplemented($1.loc, "subroutine");
-        $$.init($1.loc);
-    }
-    | SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN {
-        parseContext.spvRemoved($1.loc, "subroutine");
-        parseContext.globalCheck($1.loc, "subroutine");
-        parseContext.unimplemented($1.loc, "subroutine");
-        $$.init($1.loc);
-    }
-    | TASKPAYLOADWORKGROUPEXT {
-        // No need for profile version or extension check. Shader stage already checks both.
-        parseContext.globalCheck($1.loc, "taskPayloadSharedEXT");
-        parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT  ");
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqtaskPayloadSharedEXT;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-GLSLANG_WEB_EXCLUDE_ON
-non_uniform_qualifier
-    : NONUNIFORM {
-        $$.init($1.loc);
-        $$.qualifier.nonUniform = true;
-    }
-    ;
-
-type_name_list
-    : IDENTIFIER {
-        // TODO
-    }
-    | type_name_list COMMA IDENTIFIER {
-        // 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
-    }
-    ;
-GLSLANG_WEB_EXCLUDE_OFF
-
-type_specifier
-    : type_specifier_nonarray type_parameter_specifier_opt {
-        $$ = $1;
-        $$.qualifier.precision = parseContext.getDefaultPrecision($$);
-        $$.typeParameters = $2;
-    }
-    | type_specifier_nonarray type_parameter_specifier_opt array_specifier {
-        parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
-        $$ = $1;
-        $$.qualifier.precision = parseContext.getDefaultPrecision($$);
-        $$.typeParameters = $2;
-        $$.arraySizes = $3.arraySizes;
-    }
-    ;
-
-array_specifier
-    : LEFT_BRACKET RIGHT_BRACKET {
-        $$.loc = $1.loc;
-        $$.arraySizes = new TArraySizes;
-        $$.arraySizes->addInnerSize();
-    }
-    | LEFT_BRACKET conditional_expression RIGHT_BRACKET {
-        $$.loc = $1.loc;
-        $$.arraySizes = new TArraySizes;
-
-        TArraySize size;
-        parseContext.arraySizeCheck($2->getLoc(), $2, size, "array size");
-        $$.arraySizes->addInnerSize(size);
-    }
-    | array_specifier LEFT_BRACKET RIGHT_BRACKET {
-        $$ = $1;
-        $$.arraySizes->addInnerSize();
-    }
-    | array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET {
-        $$ = $1;
-
-        TArraySize size;
-        parseContext.arraySizeCheck($3->getLoc(), $3, size, "array size");
-        $$.arraySizes->addInnerSize(size);
-    }
-    ;
-
-type_parameter_specifier_opt
-    : type_parameter_specifier {
-        $$ = $1;
-    }
-    | /* May be null */ {
-        $$ = 0;
-    }
-    ;
-
-type_parameter_specifier
-    : LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE {
-        $$ = $2;
-    }
-    ;
-
-type_parameter_specifier_list
-    : unary_expression {
-        $$ = new TArraySizes;
-
-        TArraySize size;
-        parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
-        $$->addInnerSize(size);
-    }
-    | type_parameter_specifier_list COMMA unary_expression {
-        $$ = $1;
-
-        TArraySize size;
-        parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
-        $$->addInnerSize(size);
-    }
-    ;
-
-type_specifier_nonarray
-    : VOID {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtVoid;
-    }
-    | FLOAT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-    }
-    | INT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-    }
-    | UINT {
-        parseContext.fullIntegerCheck($1.loc, "unsigned integer");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-    }
-    | BOOL {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtBool;
-    }
-    | VEC2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(2);
-    }
-    | VEC3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(3);
-    }
-    | VEC4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(4);
-    }
-    | BVEC2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtBool;
-        $$.setVector(2);
-    }
-    | BVEC3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtBool;
-        $$.setVector(3);
-    }
-    | BVEC4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtBool;
-        $$.setVector(4);
-    }
-    | IVEC2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(2);
-    }
-    | IVEC3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(3);
-    }
-    | IVEC4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(4);
-    }
-    | UVEC2 {
-        parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(2);
-    }
-    | UVEC3 {
-        parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(3);
-    }
-    | UVEC4 {
-        parseContext.fullIntegerCheck($1.loc, "unsigned integer vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(4);
-    }
-    | MAT2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 2);
-    }
-    | MAT3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 3);
-    }
-    | MAT4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 4);
-    }
-    | MAT2X2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 2);
-    }
-    | MAT2X3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 3);
-    }
-    | MAT2X4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 4);
-    }
-    | MAT3X2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 2);
-    }
-    | MAT3X3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 3);
-    }
-    | MAT3X4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 4);
-    }
-    | MAT4X2 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 2);
-    }
-    | MAT4X3 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 3);
-    }
-    | MAT4X4 {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 4);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | DOUBLE {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-    }
-    | FLOAT16_T {
-        parseContext.float16ScalarVectorCheck($1.loc, "float16_t", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-    }
-    | FLOAT32_T {
-        parseContext.explicitFloat32Check($1.loc, "float32_t", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-    }
-    | FLOAT64_T {
-        parseContext.explicitFloat64Check($1.loc, "float64_t", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-    }
-    | INT8_T {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt8;
-    }
-    | UINT8_T {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint8;
-    }
-    | INT16_T {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt16;
-    }
-    | UINT16_T {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint16;
-    }
-    | INT32_T {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-    }
-    | UINT32_T {
-        parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-    }
-    | INT64_T {
-        parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt64;
-    }
-    | UINT64_T {
-        parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint64;
-    }
-    | DVEC2 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(2);
-    }
-    | DVEC3 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(3);
-    }
-    | DVEC4 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double vector");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double vector");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(4);
-    }
-    | F16VEC2 {
-        parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setVector(2);
-    }
-    | F16VEC3 {
-        parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setVector(3);
-    }
-    | F16VEC4 {
-        parseContext.float16ScalarVectorCheck($1.loc, "half float vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setVector(4);
-    }
-    | F32VEC2 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(2);
-    }
-    | F32VEC3 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(3);
-    }
-    | F32VEC4 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setVector(4);
-    }
-    | F64VEC2 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(2);
-    }
-    | F64VEC3 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(3);
-    }
-    | F64VEC4 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setVector(4);
-    }
-    | I8VEC2 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt8;
-        $$.setVector(2);
-    }
-    | I8VEC3 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt8;
-        $$.setVector(3);
-    }
-    | I8VEC4 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt8;
-        $$.setVector(4);
-    }
-    | I16VEC2 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt16;
-        $$.setVector(2);
-    }
-    | I16VEC3 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt16;
-        $$.setVector(3);
-    }
-    | I16VEC4 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt16;
-        $$.setVector(4);
-    }
-    | I32VEC2 {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(2);
-    }
-    | I32VEC3 {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(3);
-    }
-    | I32VEC4 {
-        parseContext.explicitInt32Check($1.loc, "32-bit signed integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.setVector(4);
-    }
-    | I64VEC2 {
-        parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt64;
-        $$.setVector(2);
-    }
-    | I64VEC3 {
-        parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt64;
-        $$.setVector(3);
-    }
-    | I64VEC4 {
-        parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt64;
-        $$.setVector(4);
-    }
-    | U8VEC2 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint8;
-        $$.setVector(2);
-    }
-    | U8VEC3 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint8;
-        $$.setVector(3);
-    }
-    | U8VEC4 {
-        parseContext.int8ScalarVectorCheck($1.loc, "8-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint8;
-        $$.setVector(4);
-    }
-    | U16VEC2 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint16;
-        $$.setVector(2);
-    }
-    | U16VEC3 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint16;
-        $$.setVector(3);
-    }
-    | U16VEC4 {
-        parseContext.int16ScalarVectorCheck($1.loc, "16-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint16;
-        $$.setVector(4);
-    }
-    | U32VEC2 {
-        parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(2);
-    }
-    | U32VEC3 {
-        parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(3);
-    }
-    | U32VEC4 {
-        parseContext.explicitInt32Check($1.loc, "32-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.setVector(4);
-    }
-    | U64VEC2 {
-        parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint64;
-        $$.setVector(2);
-    }
-    | U64VEC3 {
-        parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint64;
-        $$.setVector(3);
-    }
-    | U64VEC4 {
-        parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint64;
-        $$.setVector(4);
-    }
-    | DMAT2 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 2);
-    }
-    | DMAT3 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 3);
-    }
-    | DMAT4 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 4);
-    }
-    | DMAT2X2 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 2);
-    }
-    | DMAT2X3 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 3);
-    }
-    | DMAT2X4 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 4);
-    }
-    | DMAT3X2 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 2);
-    }
-    | DMAT3X3 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 3);
-    }
-    | DMAT3X4 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 4);
-    }
-    | DMAT4X2 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 2);
-    }
-    | DMAT4X3 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 3);
-    }
-    | DMAT4X4 {
-        parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double matrix");
-        if (! parseContext.symbolTable.atBuiltInLevel())
-            parseContext.doubleCheck($1.loc, "double matrix");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 4);
-    }
-    | F16MAT2 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(2, 2);
-    }
-    | F16MAT3 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(3, 3);
-    }
-    | F16MAT4 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(4, 4);
-    }
-    | F16MAT2X2 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(2, 2);
-    }
-    | F16MAT2X3 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(2, 3);
-    }
-    | F16MAT2X4 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(2, 4);
-    }
-    | F16MAT3X2 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(3, 2);
-    }
-    | F16MAT3X3 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(3, 3);
-    }
-    | F16MAT3X4 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(3, 4);
-    }
-    | F16MAT4X2 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(4, 2);
-    }
-    | F16MAT4X3 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(4, 3);
-    }
-    | F16MAT4X4 {
-        parseContext.float16Check($1.loc, "half float matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat16;
-        $$.setMatrix(4, 4);
-    }
-    | F32MAT2 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 2);
-    }
-    | F32MAT3 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 3);
-    }
-    | F32MAT4 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 4);
-    }
-    | F32MAT2X2 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 2);
-    }
-    | F32MAT2X3 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 3);
-    }
-    | F32MAT2X4 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(2, 4);
-    }
-    | F32MAT3X2 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 2);
-    }
-    | F32MAT3X3 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 3);
-    }
-    | F32MAT3X4 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(3, 4);
-    }
-    | F32MAT4X2 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 2);
-    }
-    | F32MAT4X3 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 3);
-    }
-    | F32MAT4X4 {
-        parseContext.explicitFloat32Check($1.loc, "float32_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.setMatrix(4, 4);
-    }
-    | F64MAT2 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 2);
-    }
-    | F64MAT3 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 3);
-    }
-    | F64MAT4 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 4);
-    }
-    | F64MAT2X2 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 2);
-    }
-    | F64MAT2X3 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 3);
-    }
-    | F64MAT2X4 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(2, 4);
-    }
-    | F64MAT3X2 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 2);
-    }
-    | F64MAT3X3 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 3);
-    }
-    | F64MAT3X4 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(3, 4);
-    }
-    | F64MAT4X2 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 2);
-    }
-    | F64MAT4X3 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 3);
-    }
-    | F64MAT4X4 {
-        parseContext.explicitFloat64Check($1.loc, "float64_t matrix", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtDouble;
-        $$.setMatrix(4, 4);
-    }
-    | ACCSTRUCTNV {
-       $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-       $$.basicType = EbtAccStruct;
-    }
-    | ACCSTRUCTEXT {
-       $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-       $$.basicType = EbtAccStruct;
-    }
-    | RAYQUERYEXT {
-       $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-       $$.basicType = EbtRayQuery;
-    }
-    | ATOMIC_UINT {
-        parseContext.vulkanRemoved($1.loc, "atomic counter types");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtAtomicUint;
-    }
-    | SAMPLER1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd1D);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    | SAMPLER2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D);
-    }
-    | SAMPLER3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd3D);
-    }
-    | SAMPLERCUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdCube);
-    }
-    | SAMPLER2DSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D, false, true);
-    }
-    | SAMPLERCUBESHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdCube, false, true);
-    }
-    | SAMPLER2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D, true);
-    }
-    | SAMPLER2DARRAYSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D, true, true);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | SAMPLER1DSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd1D, false, true);
-    }
-    | SAMPLER1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd1D, true);
-    }
-    | SAMPLER1DARRAYSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd1D, true, true);
-    }
-    | SAMPLERCUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdCube, true);
-    }
-    | SAMPLERCUBEARRAYSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdCube, true, true);
-    }
-    | F16SAMPLER1D {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd1D);
-    }
-    | F16SAMPLER2D {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D);
-    }
-    | F16SAMPLER3D {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd3D);
-    }
-    | F16SAMPLERCUBE {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdCube);
-    }
-    | F16SAMPLER1DSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd1D, false, true);
-    }
-    | F16SAMPLER2DSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D, false, true);
-    }
-    | F16SAMPLERCUBESHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdCube, false, true);
-    }
-    | F16SAMPLER1DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd1D, true);
-    }
-    | F16SAMPLER2DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D, true);
-    }
-    | F16SAMPLER1DARRAYSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd1D, true, true);
-    }
-    | F16SAMPLER2DARRAYSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D, true, true);
-    }
-    | F16SAMPLERCUBEARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdCube, true);
-    }
-    | F16SAMPLERCUBEARRAYSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdCube, true, true);
-    }
-    | ISAMPLER1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd1D);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    | ISAMPLER2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd2D);
-    }
-    | ISAMPLER3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd3D);
-    }
-    | ISAMPLERCUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, EsdCube);
-    }
-    | ISAMPLER2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd2D, true);
-    }
-    | USAMPLER2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd2D);
-    }
-    | USAMPLER3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd3D);
-    }
-    | USAMPLERCUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, EsdCube);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | ISAMPLER1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd1D, true);
-    }
-    | ISAMPLERCUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, EsdCube, true);
-    }
-    | USAMPLER1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd1D);
-    }
-    | USAMPLER1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd1D, true);
-    }
-    | USAMPLERCUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, EsdCube, true);
-    }
-    | TEXTURECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, EsdCube, true);
-    }
-    | ITEXTURECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, EsdCube, true);
-    }
-    | UTEXTURECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, EsdCube, true);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    | USAMPLER2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd2D, true);
-    }
-    | TEXTURE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd2D);
-    }
-    | TEXTURE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd3D);
-    }
-    | TEXTURE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd2D, true);
-    }
-    | TEXTURECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, EsdCube);
-    }
-    | ITEXTURE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd2D);
-    }
-    | ITEXTURE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd3D);
-    }
-    | ITEXTURECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, EsdCube);
-    }
-    | ITEXTURE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd2D, true);
-    }
-    | UTEXTURE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd2D);
-    }
-    | UTEXTURE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd3D);
-    }
-    | UTEXTURECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, EsdCube);
-    }
-    | UTEXTURE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd2D, true);
-    }
-    | SAMPLER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setPureSampler(false);
-    }
-    | SAMPLERSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setPureSampler(true);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | SAMPLER2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdRect);
-    }
-    | SAMPLER2DRECTSHADOW {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdRect, false, true);
-    }
-    | F16SAMPLER2DRECT {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdRect);
-    }
-    | F16SAMPLER2DRECTSHADOW {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdRect, false, true);
-    }
-    | ISAMPLER2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, EsdRect);
-    }
-    | USAMPLER2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, EsdRect);
-    }
-    | SAMPLERBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, EsdBuffer);
-    }
-    | F16SAMPLERBUFFER {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, EsdBuffer);
-    }
-    | ISAMPLERBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, EsdBuffer);
-    }
-    | USAMPLERBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, EsdBuffer);
-    }
-    | SAMPLER2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D, false, false, true);
-    }
-    | F16SAMPLER2DMS {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D, false, false, true);
-    }
-    | ISAMPLER2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd2D, false, false, true);
-    }
-    | USAMPLER2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd2D, false, false, true);
-    }
-    | SAMPLER2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D, true, false, true);
-    }
-    | F16SAMPLER2DMSARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float sampler", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat16, Esd2D, true, false, true);
-    }
-    | ISAMPLER2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtInt, Esd2D, true, false, true);
-    }
-    | USAMPLER2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtUint, Esd2D, true, false, true);
-    }
-    | TEXTURE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd1D);
-    }
-    | F16TEXTURE1D {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd1D);
-    }
-    | F16TEXTURE2D {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd2D);
-    }
-    | F16TEXTURE3D {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd3D);
-    }
-    | F16TEXTURECUBE {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, EsdCube);
-    }
-    | TEXTURE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd1D, true);
-    }
-    | F16TEXTURE1DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd1D, true);
-    }
-    | F16TEXTURE2DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd2D, true);
-    }
-    | F16TEXTURECUBEARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, EsdCube, true);
-    }
-    | ITEXTURE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd1D);
-    }
-    | ITEXTURE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd1D, true);
-    }
-    | UTEXTURE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd1D);
-    }
-    | UTEXTURE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd1D, true);
-    }
-    | TEXTURE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, EsdRect);
-    }
-    | F16TEXTURE2DRECT {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, EsdRect);
-    }
-    | ITEXTURE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, EsdRect);
-    }
-    | UTEXTURE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, EsdRect);
-    }
-    | TEXTUREBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, EsdBuffer);
-    }
-    | F16TEXTUREBUFFER {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, EsdBuffer);
-    }
-    | ITEXTUREBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, EsdBuffer);
-    }
-    | UTEXTUREBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, EsdBuffer);
-    }
-    | TEXTURE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd2D, false, false, true);
-    }
-    | F16TEXTURE2DMS {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd2D, false, false, true);
-    }
-    | ITEXTURE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd2D, false, false, true);
-    }
-    | UTEXTURE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd2D, false, false, true);
-    }
-    | TEXTURE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat, Esd2D, true, false, true);
-    }
-    | F16TEXTURE2DMSARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float texture", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtFloat16, Esd2D, true, false, true);
-    }
-    | ITEXTURE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtInt, Esd2D, true, false, true);
-    }
-    | UTEXTURE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setTexture(EbtUint, Esd2D, true, false, true);
-    }
-    | IMAGE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd1D);
-    }
-    | F16IMAGE1D {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd1D);
-    }
-    | IIMAGE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd1D);
-    }
-    | UIMAGE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd1D);
-    }
-    | IMAGE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd2D);
-    }
-    | F16IMAGE2D {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd2D);
-    }
-    | IIMAGE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd2D);
-    }
-    | UIMAGE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd2D);
-    }
-    | IMAGE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd3D);
-    }
-    | F16IMAGE3D {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd3D);
-    }
-    | IIMAGE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd3D);
-    }
-    | UIMAGE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd3D);
-    }
-    | IMAGE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, EsdRect);
-    }
-    | F16IMAGE2DRECT {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, EsdRect);
-    }
-    | IIMAGE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, EsdRect);
-    }
-    | UIMAGE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, EsdRect);
-    }
-    | IMAGECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, EsdCube);
-    }
-    | F16IMAGECUBE {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, EsdCube);
-    }
-    | IIMAGECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, EsdCube);
-    }
-    | UIMAGECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, EsdCube);
-    }
-    | IMAGEBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, EsdBuffer);
-    }
-    | F16IMAGEBUFFER {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, EsdBuffer);
-    }
-    | IIMAGEBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, EsdBuffer);
-    }
-    | UIMAGEBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, EsdBuffer);
-    }
-    | IMAGE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd1D, true);
-    }
-    | F16IMAGE1DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd1D, true);
-    }
-    | IIMAGE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd1D, true);
-    }
-    | UIMAGE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd1D, true);
-    }
-    | IMAGE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd2D, true);
-    }
-    | F16IMAGE2DARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd2D, true);
-    }
-    | IIMAGE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd2D, true);
-    }
-    | UIMAGE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd2D, true);
-    }
-    | IMAGECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, EsdCube, true);
-    }
-    | F16IMAGECUBEARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, EsdCube, true);
-    }
-    | IIMAGECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, EsdCube, true);
-    }
-    | UIMAGECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, EsdCube, true);
-    }
-    | IMAGE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd2D, false, false, true);
-    }
-    | F16IMAGE2DMS {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd2D, false, false, true);
-    }
-    | IIMAGE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd2D, false, false, true);
-    }
-    | UIMAGE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd2D, false, false, true);
-    }
-    | IMAGE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat, Esd2D, true, false, true);
-    }
-    | F16IMAGE2DMSARRAY {
-        parseContext.float16OpaqueCheck($1.loc, "half float image", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtFloat16, Esd2D, true, false, true);
-    }
-    | IIMAGE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt, Esd2D, true, false, true);
-    }
-    | UIMAGE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint, Esd2D, true, false, true);
-    }
-    | I64IMAGE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd1D);
-    }
-    | U64IMAGE1D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd1D);
-    }
-    | I64IMAGE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd2D);
-    }
-    | U64IMAGE2D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd2D);
-    }
-    | I64IMAGE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd3D);
-    }
-    | U64IMAGE3D {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd3D);
-    }
-    | I64IMAGE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, EsdRect);
-    }
-    | U64IMAGE2DRECT {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, EsdRect);
-    }
-    | I64IMAGECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, EsdCube);
-    }
-    | U64IMAGECUBE {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, EsdCube);
-    }
-    | I64IMAGEBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, EsdBuffer);
-    }
-    | U64IMAGEBUFFER {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, EsdBuffer);
-    }
-    | I64IMAGE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd1D, true);
-    }
-    | U64IMAGE1DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd1D, true);
-    }
-    | I64IMAGE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd2D, true);
-    }
-    | U64IMAGE2DARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd2D, true);
-    }
-    | I64IMAGECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, EsdCube, true);
-    }
-    | U64IMAGECUBEARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, EsdCube, true);
-    }
-    | I64IMAGE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd2D, false, false, true);
-    }
-    | U64IMAGE2DMS {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd2D, false, false, true);
-    }
-    | I64IMAGE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtInt64, Esd2D, true, false, true);
-    }
-    | U64IMAGE2DMSARRAY {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setImage(EbtUint64, Esd2D, true, false, true);
-    }
-    | SAMPLEREXTERNALOES {  // GL_OES_EGL_image_external
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D);
-        $$.sampler.external = true;
-    }
-    | SAMPLEREXTERNAL2DY2YEXT { // GL_EXT_YUV_target
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.set(EbtFloat, Esd2D);
-        $$.sampler.yuv = true;
-    }
-    | ATTACHMENTEXT {
-        parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setAttachmentEXT(EbtFloat);
-    }
-    | IATTACHMENTEXT {
-        parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setAttachmentEXT(EbtInt);
-    }
-    | UATTACHMENTEXT {
-        parseContext.requireStage($1.loc, EShLangFragment, "attachmentEXT input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setAttachmentEXT(EbtUint);
-    }
-    | SUBPASSINPUT {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtFloat);
-    }
-    | SUBPASSINPUTMS {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtFloat, true);
-    }
-    | F16SUBPASSINPUT {
-        parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtFloat16);
-    }
-    | F16SUBPASSINPUTMS {
-        parseContext.float16OpaqueCheck($1.loc, "half float subpass input", parseContext.symbolTable.atBuiltInLevel());
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtFloat16, true);
-    }
-    | ISUBPASSINPUT {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtInt);
-    }
-    | ISUBPASSINPUTMS {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtInt, true);
-    }
-    | USUBPASSINPUT {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtUint);
-    }
-    | USUBPASSINPUTMS {
-        parseContext.requireStage($1.loc, EShLangFragment, "subpass input");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtSampler;
-        $$.sampler.setSubpass(EbtUint, true);
-    }
-    | FCOOPMATNV {
-        parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtFloat;
-        $$.coopmat = true;
-    }
-    | ICOOPMATNV {
-        parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtInt;
-        $$.coopmat = true;
-    }
-    | UCOOPMATNV {
-        parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.basicType = EbtUint;
-        $$.coopmat = true;
-    }
-    | spirv_type_specifier {
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
-        $$ = $1;
-    }
-	| HITOBJECTNV {
-       $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-       $$.basicType = EbtHitObjectNV;
-	}
-GLSLANG_WEB_EXCLUDE_OFF
-    | struct_specifier {
-        $$ = $1;
-        $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
-        parseContext.structTypeCheck($$.loc, $$);
-    }
-    | TYPE_NAME {
-        //
-        // This is for user defined type names.  The lexical phase looked up the
-        // type.
-        //
-        if (const TVariable* variable = ($1.symbol)->getAsVariable()) {
-            const TType& structure = variable->getType();
-            $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-            $$.basicType = EbtStruct;
-            $$.userDef = &structure;
-        } else
-            parseContext.error($1.loc, "expected type name", $1.string->c_str(), "");
-    }
-    ;
-
-precision_qualifier
-    : HIGH_PRECISION {
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "highp precision qualifier");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqHigh);
-    }
-    | MEDIUM_PRECISION {
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "mediump precision qualifier");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqMedium);
-    }
-    | LOW_PRECISION {
-        parseContext.profileRequires($1.loc, ENoProfile, 130, 0, "lowp precision qualifier");
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        parseContext.handlePrecisionQualifier($1.loc, $$.qualifier, EpqLow);
-    }
-    ;
-
-struct_specifier
-    : STRUCT IDENTIFIER LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
-        TType* structure = new TType($5, *$2.string);
-        parseContext.structArrayCheck($2.loc, *structure);
-        TVariable* userTypeDef = new TVariable($2.string, *structure, true);
-        if (! parseContext.symbolTable.insert(*userTypeDef))
-            parseContext.error($2.loc, "redefinition", $2.string->c_str(), "struct");
-        $$.init($1.loc);
-        $$.basicType = EbtStruct;
-        $$.userDef = structure;
-        --parseContext.structNestingLevel;
-    }
-    | STRUCT LEFT_BRACE { parseContext.nestedStructCheck($1.loc); } struct_declaration_list RIGHT_BRACE {
-        TType* structure = new TType($4, TString(""));
-        $$.init($1.loc);
-        $$.basicType = EbtStruct;
-        $$.userDef = structure;
-        --parseContext.structNestingLevel;
-    }
-    ;
-
-struct_declaration_list
-    : struct_declaration {
-        $$ = $1;
-    }
-    | struct_declaration_list struct_declaration {
-        $$ = $1;
-        for (unsigned int i = 0; i < $2->size(); ++i) {
-            for (unsigned int j = 0; j < $$->size(); ++j) {
-                if ((*$$)[j].type->getFieldName() == (*$2)[i].type->getFieldName())
-                    parseContext.error((*$2)[i].loc, "duplicate member name:", "", (*$2)[i].type->getFieldName().c_str());
-            }
-            $$->push_back((*$2)[i]);
-        }
-    }
-    ;
-
-struct_declaration
-    : type_specifier struct_declarator_list SEMICOLON {
-        if ($1.arraySizes) {
-            parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
-            if (parseContext.isEsProfile())
-                parseContext.arraySizeRequiredCheck($1.loc, *$1.arraySizes);
-        }
-
-        $$ = $2;
-
-        parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
-        parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
-
-        for (unsigned int i = 0; i < $$->size(); ++i) {
-            TType type($1);
-            type.setFieldName((*$$)[i].type->getFieldName());
-            type.transferArraySizes((*$$)[i].type->getArraySizes());
-            type.copyArrayInnerSizes($1.arraySizes);
-            parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
-            (*$$)[i].type->shallowCopy(type);
-        }
-    }
-    | type_qualifier type_specifier struct_declarator_list SEMICOLON {
-        if ($2.arraySizes) {
-            parseContext.profileRequires($2.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
-            parseContext.profileRequires($2.loc, EEsProfile, 300, 0, "arrayed type");
-            if (parseContext.isEsProfile())
-                parseContext.arraySizeRequiredCheck($2.loc, *$2.arraySizes);
-        }
-
-        $$ = $3;
-
-        parseContext.memberQualifierCheck($1);
-        parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
-        parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
-
-        for (unsigned int i = 0; i < $$->size(); ++i) {
-            TType type($2);
-            type.setFieldName((*$$)[i].type->getFieldName());
-            type.transferArraySizes((*$$)[i].type->getArraySizes());
-            type.copyArrayInnerSizes($2.arraySizes);
-            parseContext.arrayOfArrayVersionCheck((*$$)[i].loc, type.getArraySizes());
-            (*$$)[i].type->shallowCopy(type);
-        }
-    }
-    ;
-
-struct_declarator_list
-    : struct_declarator {
-        $$ = new TTypeList;
-        $$->push_back($1);
-    }
-    | struct_declarator_list COMMA struct_declarator {
-        $$->push_back($3);
-    }
-    ;
-
-struct_declarator
-    : IDENTIFIER {
-        $$.type = new TType(EbtVoid);
-        $$.loc = $1.loc;
-        $$.type->setFieldName(*$1.string);
-    }
-    | IDENTIFIER array_specifier {
-        parseContext.arrayOfArrayVersionCheck($1.loc, $2.arraySizes);
-
-        $$.type = new TType(EbtVoid);
-        $$.loc = $1.loc;
-        $$.type->setFieldName(*$1.string);
-        $$.type->transferArraySizes($2.arraySizes);
-    }
-    ;
-
-initializer
-    : assignment_expression {
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | LEFT_BRACE initializer_list RIGHT_BRACE {
-        const char* initFeature = "{ } style initializers";
-        parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
-        parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
-        $$ = $2;
-    }
-    | LEFT_BRACE initializer_list COMMA RIGHT_BRACE {
-        const char* initFeature = "{ } style initializers";
-        parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
-        parseContext.profileRequires($1.loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature);
-        $$ = $2;
-    }
-    | LEFT_BRACE RIGHT_BRACE {
-        const char* initFeature = "empty { } initializer";
-        parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
-        parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
-        $$ = parseContext.intermediate.makeAggregate($1.loc);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-GLSLANG_WEB_EXCLUDE_ON
-initializer_list
-    : initializer {
-        $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
-    }
-    | initializer_list COMMA initializer {
-        $$ = parseContext.intermediate.growAggregate($1, $3);
-    }
-    ;
-GLSLANG_WEB_EXCLUDE_OFF
-
-declaration_statement
-    : declaration { $$ = $1; }
-    ;
-
-statement
-    : compound_statement  { $$ = $1; }
-    | simple_statement    { $$ = $1; }
-    ;
-
-// Grammar Note:  labeled statements for switch statements only; 'goto' is not supported.
-
-simple_statement
-    : declaration_statement { $$ = $1; }
-    | expression_statement  { $$ = $1; }
-    | selection_statement   { $$ = $1; }
-    | switch_statement      { $$ = $1; }
-    | case_label            { $$ = $1; }
-    | iteration_statement   { $$ = $1; }
-    | jump_statement        { $$ = $1; }
-GLSLANG_WEB_EXCLUDE_ON
-    | demote_statement      { $$ = $1; }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-GLSLANG_WEB_EXCLUDE_ON
-demote_statement
-    : DEMOTE SEMICOLON {
-        parseContext.requireStage($1.loc, EShLangFragment, "demote");
-        parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_demote_to_helper_invocation, "demote");
-        $$ = parseContext.intermediate.addBranch(EOpDemote, $1.loc);
-    }
-    ;
-GLSLANG_WEB_EXCLUDE_OFF
-
-compound_statement
-    : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
-    | LEFT_BRACE {
-        parseContext.symbolTable.push();
-        ++parseContext.statementNestingLevel;
-    }
-      statement_list {
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        --parseContext.statementNestingLevel;
-    }
-      RIGHT_BRACE {
-        if ($3 && $3->getAsAggregate())
-            $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
-        $$ = $3;
-    }
-    ;
-
-statement_no_new_scope
-    : compound_statement_no_new_scope { $$ = $1; }
-    | simple_statement                { $$ = $1; }
-    ;
-
-statement_scoped
-    : {
-        ++parseContext.controlFlowNestingLevel;
-    }
-      compound_statement  {
-        --parseContext.controlFlowNestingLevel;
-        $$ = $2;
-    }
-    | {
-        parseContext.symbolTable.push();
-        ++parseContext.statementNestingLevel;
-        ++parseContext.controlFlowNestingLevel;
-    }
-      simple_statement {
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        --parseContext.statementNestingLevel;
-        --parseContext.controlFlowNestingLevel;
-        $$ = $2;
-    }
-
-compound_statement_no_new_scope
-    // Statement that doesn't create a new scope, for selection_statement, iteration_statement
-    : LEFT_BRACE RIGHT_BRACE {
-        $$ = 0;
-    }
-    | LEFT_BRACE statement_list RIGHT_BRACE {
-        if ($2 && $2->getAsAggregate())
-            $2->getAsAggregate()->setOperator(EOpSequence);
-        $$ = $2;
-    }
-    ;
-
-statement_list
-    : statement {
-        $$ = parseContext.intermediate.makeAggregate($1);
-        if ($1 && $1->getAsBranchNode() && ($1->getAsBranchNode()->getFlowOp() == EOpCase ||
-                                            $1->getAsBranchNode()->getFlowOp() == EOpDefault)) {
-            parseContext.wrapupSwitchSubsequence(0, $1);
-            $$ = 0;  // start a fresh subsequence for what's after this case
-        }
-    }
-    | statement_list statement {
-        if ($2 && $2->getAsBranchNode() && ($2->getAsBranchNode()->getFlowOp() == EOpCase ||
-                                            $2->getAsBranchNode()->getFlowOp() == EOpDefault)) {
-            parseContext.wrapupSwitchSubsequence($1 ? $1->getAsAggregate() : 0, $2);
-            $$ = 0;  // start a fresh subsequence for what's after this case
-        } else
-            $$ = parseContext.intermediate.growAggregate($1, $2);
-    }
-    ;
-
-expression_statement
-    : SEMICOLON  { $$ = 0; }
-    | expression SEMICOLON  { $$ = static_cast<TIntermNode*>($1); }
-    ;
-
-selection_statement
-    : selection_statement_nonattributed {
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | attribute selection_statement_nonattributed {
-        parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
-        parseContext.handleSelectionAttributes(*$1, $2);
-        $$ = $2;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-
-selection_statement_nonattributed
-    : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
-        parseContext.boolCheck($1.loc, $3);
-        $$ = parseContext.intermediate.addSelection($3, $5, $1.loc);
-    }
-    ;
-
-selection_rest_statement
-    : statement_scoped ELSE statement_scoped {
-        $$.node1 = $1;
-        $$.node2 = $3;
-    }
-    | statement_scoped {
-        $$.node1 = $1;
-        $$.node2 = 0;
-    }
-    ;
-
-condition
-    // In 1996 c++ draft, conditions can include single declarations
-    : expression {
-        $$ = $1;
-        parseContext.boolCheck($1->getLoc(), $1);
-    }
-    | fully_specified_type IDENTIFIER EQUAL initializer {
-        parseContext.boolCheck($2.loc, $1);
-
-        TType type($1);
-        TIntermNode* initNode = parseContext.declareVariable($2.loc, *$2.string, $1, 0, $4);
-        if (initNode)
-            $$ = initNode->getAsTyped();
-        else
-            $$ = 0;
-    }
-    ;
-
-switch_statement
-    : switch_statement_nonattributed {
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | attribute switch_statement_nonattributed {
-        parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
-        parseContext.handleSwitchAttributes(*$1, $2);
-        $$ = $2;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-
-switch_statement_nonattributed
-    : SWITCH LEFT_PAREN expression RIGHT_PAREN {
-        // start new switch sequence on the switch stack
-        ++parseContext.controlFlowNestingLevel;
-        ++parseContext.statementNestingLevel;
-        parseContext.switchSequenceStack.push_back(new TIntermSequence);
-        parseContext.switchLevel.push_back(parseContext.statementNestingLevel);
-        parseContext.symbolTable.push();
-    }
-    LEFT_BRACE switch_statement_list RIGHT_BRACE {
-        $$ = parseContext.addSwitch($1.loc, $3, $7 ? $7->getAsAggregate() : 0);
-        delete parseContext.switchSequenceStack.back();
-        parseContext.switchSequenceStack.pop_back();
-        parseContext.switchLevel.pop_back();
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        --parseContext.statementNestingLevel;
-        --parseContext.controlFlowNestingLevel;
-    }
-    ;
-
-switch_statement_list
-    : /* nothing */ {
-        $$ = 0;
-    }
-    | statement_list {
-        $$ = $1;
-    }
-    ;
-
-case_label
-    : CASE expression COLON {
-        $$ = 0;
-        if (parseContext.switchLevel.size() == 0)
-            parseContext.error($1.loc, "cannot appear outside switch statement", "case", "");
-        else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
-            parseContext.error($1.loc, "cannot be nested inside control flow", "case", "");
-        else {
-            parseContext.constantValueCheck($2, "case");
-            parseContext.integerCheck($2, "case");
-            $$ = parseContext.intermediate.addBranch(EOpCase, $2, $1.loc);
-        }
-    }
-    | DEFAULT COLON {
-        $$ = 0;
-        if (parseContext.switchLevel.size() == 0)
-            parseContext.error($1.loc, "cannot appear outside switch statement", "default", "");
-        else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel)
-            parseContext.error($1.loc, "cannot be nested inside control flow", "default", "");
-        else
-            $$ = parseContext.intermediate.addBranch(EOpDefault, $1.loc);
-    }
-    ;
-
-iteration_statement
-    : iteration_statement_nonattributed {
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | attribute iteration_statement_nonattributed {
-        parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
-        parseContext.handleLoopAttributes(*$1, $2);
-        $$ = $2;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-
-iteration_statement_nonattributed
-    : WHILE LEFT_PAREN {
-        if (! parseContext.limits.whileLoops)
-            parseContext.error($1.loc, "while loops not available", "limitation", "");
-        parseContext.symbolTable.push();
-        ++parseContext.loopNestingLevel;
-        ++parseContext.statementNestingLevel;
-        ++parseContext.controlFlowNestingLevel;
-    }
-      condition RIGHT_PAREN statement_no_new_scope {
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        $$ = parseContext.intermediate.addLoop($6, $4, 0, true, $1.loc);
-        --parseContext.loopNestingLevel;
-        --parseContext.statementNestingLevel;
-        --parseContext.controlFlowNestingLevel;
-    }
-    | DO {
-        parseContext.symbolTable.push();
-        ++parseContext.loopNestingLevel;
-        ++parseContext.statementNestingLevel;
-        ++parseContext.controlFlowNestingLevel;
-    }
-      statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON {
-        if (! parseContext.limits.whileLoops)
-            parseContext.error($1.loc, "do-while loops not available", "limitation", "");
-
-        parseContext.boolCheck($8.loc, $6);
-
-        $$ = parseContext.intermediate.addLoop($3, $6, 0, false, $4.loc);
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        --parseContext.loopNestingLevel;
-        --parseContext.statementNestingLevel;
-        --parseContext.controlFlowNestingLevel;
-    }
-    | FOR LEFT_PAREN {
-        parseContext.symbolTable.push();
-        ++parseContext.loopNestingLevel;
-        ++parseContext.statementNestingLevel;
-        ++parseContext.controlFlowNestingLevel;
-    }
-      for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope {
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        $$ = parseContext.intermediate.makeAggregate($4, $2.loc);
-        TIntermLoop* forLoop = parseContext.intermediate.addLoop($7, reinterpret_cast<TIntermTyped*>($5.node1), reinterpret_cast<TIntermTyped*>($5.node2), true, $1.loc);
-        if (! parseContext.limits.nonInductiveForLoops)
-            parseContext.inductiveLoopCheck($1.loc, $4, forLoop);
-        $$ = parseContext.intermediate.growAggregate($$, forLoop, $1.loc);
-        $$->getAsAggregate()->setOperator(EOpSequence);
-        --parseContext.loopNestingLevel;
-        --parseContext.statementNestingLevel;
-        --parseContext.controlFlowNestingLevel;
-    }
-    ;
-
-for_init_statement
-    : expression_statement {
-        $$ = $1;
-    }
-    | declaration_statement {
-        $$ = $1;
-    }
-    ;
-
-conditionopt
-    : condition {
-        $$ = $1;
-    }
-    | /* May be null */ {
-        $$ = 0;
-    }
-    ;
-
-for_rest_statement
-    : conditionopt SEMICOLON {
-        $$.node1 = $1;
-        $$.node2 = 0;
-    }
-    | conditionopt SEMICOLON expression  {
-        $$.node1 = $1;
-        $$.node2 = $3;
-    }
-    ;
-
-jump_statement
-    : CONTINUE SEMICOLON {
-        if (parseContext.loopNestingLevel <= 0)
-            parseContext.error($1.loc, "continue statement only allowed in loops", "", "");
-        $$ = parseContext.intermediate.addBranch(EOpContinue, $1.loc);
-    }
-    | BREAK SEMICOLON {
-        if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0)
-            parseContext.error($1.loc, "break statement only allowed in switch and loops", "", "");
-        $$ = parseContext.intermediate.addBranch(EOpBreak, $1.loc);
-    }
-    | RETURN SEMICOLON {
-        $$ = parseContext.intermediate.addBranch(EOpReturn, $1.loc);
-        if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
-            parseContext.error($1.loc, "non-void function must return a value", "return", "");
-        if (parseContext.inMain)
-            parseContext.postEntryPointReturn = true;
-    }
-    | RETURN expression SEMICOLON {
-        $$ = parseContext.handleReturnValue($1.loc, $2);
-    }
-    | DISCARD SEMICOLON {
-        parseContext.requireStage($1.loc, EShLangFragment, "discard");
-        $$ = parseContext.intermediate.addBranch(EOpKill, $1.loc);
-    }
-    | TERMINATE_INVOCATION SEMICOLON {
-        parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
-        $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | TERMINATE_RAY SEMICOLON {
-        parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
-        $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
-    }
-    | IGNORE_INTERSECTION SEMICOLON {
-        parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
-        $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-// Grammar Note:  No 'goto'.  Gotos are not supported.
-
-translation_unit
-    : external_declaration {
-        $$ = $1;
-        parseContext.intermediate.setTreeRoot($$);
-    }
-    | translation_unit external_declaration {
-        if ($2 != nullptr) {
-            $$ = parseContext.intermediate.growAggregate($1, $2);
-            parseContext.intermediate.setTreeRoot($$);
-        }
-    }
-    ;
-
-external_declaration
-    : function_definition {
-        $$ = $1;
-    }
-    | declaration {
-        $$ = $1;
-    }
-GLSLANG_WEB_EXCLUDE_ON
-    | SEMICOLON {
-        parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
-        parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
-        $$ = nullptr;
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-    ;
-
-function_definition
-    : function_prototype {
-        $1.function = parseContext.handleFunctionDeclarator($1.loc, *$1.function, false /* not prototype */);
-        $1.intermNode = parseContext.handleFunctionDefinition($1.loc, *$1.function);
-
-        // For ES 100 only, according to ES shading language 100 spec: A function
-        // body has a scope nested inside the function's definition.
-        if (parseContext.profile == EEsProfile && parseContext.version == 100)
-        {
-            parseContext.symbolTable.push();
-            ++parseContext.statementNestingLevel;
-        }
-    }
-    compound_statement_no_new_scope {
-        //   May be best done as post process phase on intermediate code
-        if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
-            parseContext.error($1.loc, "function does not return a value:", "", $1.function->getName().c_str());
-        parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-        $$ = parseContext.intermediate.growAggregate($1.intermNode, $3);
-        parseContext.intermediate.setAggregateOperator($$, EOpFunction, $1.function->getType(), $1.loc);
-        $$->getAsAggregate()->setName($1.function->getMangledName().c_str());
-
-        // store the pragma information for debug and optimize and other vendor specific
-        // information. This information can be queried from the parse tree
-        $$->getAsAggregate()->setOptimize(parseContext.contextPragma.optimize);
-        $$->getAsAggregate()->setDebug(parseContext.contextPragma.debug);
-        $$->getAsAggregate()->setPragmaTable(parseContext.contextPragma.pragmaTable);
-
-        // Set currentFunctionType to empty pointer when goes outside of the function
-        parseContext.currentFunctionType = nullptr;
-
-        // For ES 100 only, according to ES shading language 100 spec: A function
-        // body has a scope nested inside the function's definition.
-        if (parseContext.profile == EEsProfile && parseContext.version == 100)
-        {
-            parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
-            --parseContext.statementNestingLevel;
-        }
-    }
-    ;
-
-GLSLANG_WEB_EXCLUDE_ON
-attribute
-    : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
-        $$ = $3;
-    }
-
-attribute_list
-    : single_attribute {
-        $$ = $1;
-    }
-    | attribute_list COMMA single_attribute {
-        $$ = parseContext.mergeAttributes($1, $3);
-    }
-
-single_attribute
-    : IDENTIFIER {
-        $$ = parseContext.makeAttributes(*$1.string);
-    }
-    | IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN {
-        $$ = parseContext.makeAttributes(*$1.string, $3);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-
-GLSLANG_WEB_EXCLUDE_ON
-spirv_requirements_list
-    : spirv_requirements_parameter {
-        $$ = $1;
-    }
-    | spirv_requirements_list COMMA spirv_requirements_parameter {
-        $$ = parseContext.mergeSpirvRequirements($2.loc, $1, $3);
-    }
-
-spirv_requirements_parameter
-    : IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET {
-        $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, $4->getAsAggregate(), nullptr);
-    }
-    | IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET {
-        $$ = parseContext.makeSpirvRequirement($2.loc, *$1.string, nullptr, $4->getAsAggregate());
-    }
-
-spirv_extension_list
-    : STRING_LITERAL {
-        $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
-    }
-    | spirv_extension_list COMMA STRING_LITERAL {
-        $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
-    }
-
-spirv_capability_list
-    : INTCONSTANT {
-        $$ = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion($1.i, $1.loc, true));
-    }
-    | spirv_capability_list COMMA INTCONSTANT {
-        $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.i, $3.loc, true));
-    }
-
-spirv_execution_mode_qualifier
-    : SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvExecutionMode($3.i);
-        $$ = 0;
-    }
-    | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvRequirement($3);
-        parseContext.intermediate.insertSpirvExecutionMode($5.i);
-        $$ = 0;
-    }
-    | SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvExecutionMode($3.i, $5->getAsAggregate());
-        $$ = 0;
-    }
-    | SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvRequirement($3);
-        parseContext.intermediate.insertSpirvExecutionMode($5.i, $7->getAsAggregate());
-        $$ = 0;
-    }
-    | SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvExecutionModeId($3.i, $5->getAsAggregate());
-        $$ = 0;
-    }
-    | SPIRV_EXECUTION_MODE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvRequirement($3);
-        parseContext.intermediate.insertSpirvExecutionModeId($5.i, $7->getAsAggregate());
-        $$ = 0;
-    }
-
-spirv_execution_mode_parameter_list
-    : spirv_execution_mode_parameter {
-        $$ = parseContext.intermediate.makeAggregate($1);
-    }
-    | spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter {
-        $$ = parseContext.intermediate.growAggregate($1, $3);
-    }
-
-spirv_execution_mode_parameter
-    : FLOATCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
-    }
-    | INTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
-    }
-    | UINTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
-    }
-    | BOOLCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
-    }
-    | STRING_LITERAL {
-        $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
-    }
-
-spirv_execution_mode_id_parameter_list
-    : constant_expression {
-        if ($1->getBasicType() != EbtFloat &&
-            $1->getBasicType() != EbtInt &&
-            $1->getBasicType() != EbtUint &&
-            $1->getBasicType() != EbtBool &&
-            $1->getBasicType() != EbtString)
-            parseContext.error($1->getLoc(), "this type not allowed", $1->getType().getBasicString(), "");
-        $$ = parseContext.intermediate.makeAggregate($1);
-    }
-    | spirv_execution_mode_id_parameter_list COMMA constant_expression {
-        if ($3->getBasicType() != EbtFloat &&
-            $3->getBasicType() != EbtInt &&
-            $3->getBasicType() != EbtUint &&
-            $3->getBasicType() != EbtBool &&
-            $3->getBasicType() != EbtString)
-            parseContext.error($3->getLoc(), "this type not allowed", $3->getType().getBasicString(), "");
-        $$ = parseContext.intermediate.growAggregate($1, $3);
-    }
-
-spirv_storage_class_qualifier
-    : SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN {
-        $$.init($1.loc);
-        $$.qualifier.storage = EvqSpirvStorageClass;
-        $$.qualifier.spirvStorageClass = $3.i;
-    }
-    | SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN {
-        $$.init($1.loc);
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.qualifier.storage = EvqSpirvStorageClass;
-        $$.qualifier.spirvStorageClass = $5.i;
-    }
-
-spirv_decorate_qualifier
-    : SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN{
-        $$.init($1.loc);
-        $$.qualifier.setSpirvDecorate($3.i);
-    }
-    | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN{
-        $$.init($1.loc);
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.qualifier.setSpirvDecorate($5.i);
-    }
-    | SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        $$.qualifier.setSpirvDecorate($3.i, $5->getAsAggregate());
-    }
-    | SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.qualifier.setSpirvDecorate($5.i, $7->getAsAggregate());
-    }
-    | SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        $$.qualifier.setSpirvDecorateId($3.i, $5->getAsAggregate());
-    }
-    | SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.qualifier.setSpirvDecorateId($5.i, $7->getAsAggregate());
-    }
-    | SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        $$.qualifier.setSpirvDecorateString($3.i, $5->getAsAggregate());
-    }
-    | SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN {
-        $$.init($1.loc);
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.qualifier.setSpirvDecorateString($5.i, $7->getAsAggregate());
-    }
-
-spirv_decorate_parameter_list
-    : spirv_decorate_parameter {
-        $$ = parseContext.intermediate.makeAggregate($1);
-    }
-    | spirv_decorate_parameter_list COMMA spirv_decorate_parameter {
-        $$ = parseContext.intermediate.growAggregate($1, $3);
-    }
-
-spirv_decorate_parameter
-    : FLOATCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
-    }
-    | INTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
-    }
-    | UINTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
-    }
-    | BOOLCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
-    }
-
-spirv_decorate_id_parameter_list
-    : spirv_decorate_id_parameter {
-        $$ = parseContext.intermediate.makeAggregate($1);
-    }
-    | spirv_decorate_id_parameter_list COMMA spirv_decorate_id_parameter {
-        $$ = parseContext.intermediate.growAggregate($1, $3);
-    }
-
-spirv_decorate_id_parameter
-    : variable_identifier {
-        if ($1->getAsConstantUnion() || $1->getAsSymbolNode())
-            $$ = $1;
-        else
-            parseContext.error($1->getLoc(), "only allow constants or variables which are not elements of a composite", "", "");
-    }
-    | FLOATCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true);
-    }
-    | INTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.i, $1.loc, true);
-    }
-    | UINTCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true);
-    }
-    | BOOLCONSTANT {
-        $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
-    }
-
-spirv_decorate_string_parameter_list
-    : STRING_LITERAL {
-        $$ = parseContext.intermediate.makeAggregate(
-            parseContext.intermediate.addConstantUnion($1.string, $1.loc, true));
-    }
-    | spirv_decorate_string_parameter_list COMMA STRING_LITERAL {
-        $$ = parseContext.intermediate.growAggregate($1, parseContext.intermediate.addConstantUnion($3.string, $3.loc, true));
-    }
-
-spirv_type_specifier
-    : SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.setSpirvType(*$3, $5);
-    }
-    | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.setSpirvType(*$5, $7);
-    }
-    | SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        $$.setSpirvType(*$3);
-    }
-    | SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
-        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$.setSpirvType(*$5);
-    }
-
-spirv_type_parameter_list
-    : spirv_type_parameter {
-        $$ = $1;
-    }
-    | spirv_type_parameter_list COMMA spirv_type_parameter {
-        $$ = parseContext.mergeSpirvTypeParameters($1, $3);
-    }
-
-spirv_type_parameter
-    : constant_expression {
-        $$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
-    }
-    | type_specifier_nonarray {
-        $$ = parseContext.makeSpirvTypeParameters($1.loc, $1);
-    }
-
-spirv_instruction_qualifier
-    : SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
-        $$ = $3;
-    }
-    | SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN {
-        parseContext.intermediate.insertSpirvRequirement($3);
-        $$ = $5;
-    }
-
-spirv_instruction_qualifier_list
-    : spirv_instruction_qualifier_id {
-        $$ = $1;
-    }
-    | spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id {
-        $$ = parseContext.mergeSpirvInstruction($2.loc, $1, $3);
-    }
-
-spirv_instruction_qualifier_id
-    : IDENTIFIER EQUAL STRING_LITERAL {
-        $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, *$3.string);
-    }
-    | IDENTIFIER EQUAL INTCONSTANT {
-        $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
-    }
-GLSLANG_WEB_EXCLUDE_OFF
-
-%%

+ 41 - 102
3rdparty/glslang/glslang/MachineIndependent/glslang.y

@@ -37,31 +37,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-//
-// Do not edit the .y file, only edit the .m4 file.
-// The .y bison file is not a source file, it is a derivative of the .m4 file.
-// The m4 file needs to be processed by m4 to generate the .y bison file.
-//
-// Code sandwiched between a pair:
-//
-//    GLSLANG_WEB_EXCLUDE_ON
-//      ...
-//      ...
-//      ...
-//    GLSLANG_WEB_EXCLUDE_OFF
-//
-// Will be excluded from the grammar when m4 is executed as:
-//
-//    m4 -P -DGLSLANG_WEB
-//
-// It will be included when m4 is executed as:
-//
-//    m4 -P
-//
-
-
-
-
 /**
  * This is bison grammar and productions for parsing all versions of the
  * GLSL shading languages.
@@ -129,7 +104,7 @@ using namespace glslang;
             glslang::TArraySizes* arraySizes;
             glslang::TIdentifierList* identifierList;
         };
-        glslang::TArraySizes* typeParameters;
+        glslang::TTypeParameters* typeParameters;
     } interm;
 }
 
@@ -177,8 +152,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> ITEXTURE2D ITEXTURE3D ITEXTURECUBE ITEXTURE2DARRAY
 %token <lex> UTEXTURE2D UTEXTURE3D UTEXTURECUBE UTEXTURE2DARRAY
 
-
-
 %token <lex> ATTRIBUTE VARYING
 %token <lex> FLOAT16_T FLOAT32_T DOUBLE FLOAT64_T
 %token <lex> INT64_T UINT64_T INT32_T UINT32_T INT16_T UINT16_T INT8_T UINT8_T
@@ -211,6 +184,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> ACCSTRUCTEXT
 %token <lex> RAYQUERYEXT
 %token <lex> FCOOPMATNV ICOOPMATNV UCOOPMATNV
+%token <lex> COOPMAT
 %token <lex> HITOBJECTNV HITOBJECTATTRNV
 
 // combined image/sampler
@@ -281,8 +255,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> SPIRV_TYPE SPIRV_STORAGE_CLASS SPIRV_BY_REFERENCE SPIRV_LITERAL
 %token <lex> ATTACHMENTEXT IATTACHMENTEXT UATTACHMENTEXT
 
-
-
 %token <lex> LEFT_OP RIGHT_OP
 %token <lex> INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP
 %token <lex> AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
@@ -308,7 +280,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> UNIFORM SHARED BUFFER TILEIMAGEEXT
 %token <lex> FLAT SMOOTH LAYOUT
 
-
 %token <lex> DOUBLECONSTANT INT16CONSTANT UINT16CONSTANT FLOAT16CONSTANT INT32CONSTANT UINT32CONSTANT
 %token <lex> INT64CONSTANT UINT64CONSTANT
 %token <lex> SUBROUTINE DEMOTE
@@ -320,7 +291,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
 %token <lex> PRECISE
 
-
 %type <interm> assignment_operator unary_operator
 %type <interm.intermTypedNode> variable_identifier primary_expression postfix_expression
 %type <interm.intermTypedNode> expression integer_expression assignment_expression
@@ -366,7 +336,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 
 %type <interm.identifierList> identifier_list
 
-
 %type <interm.type> precise_qualifier non_uniform_qualifier
 %type <interm.typeList> type_name_list
 %type <interm.attributes> attribute attribute_list single_attribute
@@ -386,7 +355,6 @@ extern int yylex(YYSTYPE*, TParseContext&);
 %type <interm.spirvInst> spirv_instruction_qualifier
 %type <interm.spirvInst> spirv_instruction_qualifier_list spirv_instruction_qualifier_id
 
-
 %start translation_unit
 %%
 
@@ -418,7 +386,6 @@ primary_expression
     | BOOLCONSTANT {
         $$ = parseContext.intermediate.addConstantUnion($1.b, $1.loc, true);
     }
-
     | STRING_LITERAL {
         $$ = parseContext.intermediate.addConstantUnion($1.string, $1.loc, true);
     }
@@ -456,7 +423,6 @@ primary_expression
         parseContext.float16Check($1.loc, "half float literal");
         $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat16, $1.loc, true);
     }
-
     ;
 
 postfix_expression
@@ -582,13 +548,11 @@ function_identifier
             $$.function = new TFunction(empty, TType(EbtVoid), EOpNull);
         }
     }
-
     | non_uniform_qualifier {
         // Constructor
         $$.intermNode = 0;
         $$.function = parseContext.handleConstructorCall($1.loc, $1);
     }
-
     ;
 
 unary_expression
@@ -898,7 +862,6 @@ declaration
         $$ = 0;
         // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
     }
-
     | spirv_instruction_qualifier function_prototype SEMICOLON {
         parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V instruction qualifier");
         $2.function->setSpirvInstruction(*$1); // Attach SPIR-V intruction qualifier
@@ -911,7 +874,6 @@ declaration
         parseContext.requireExtensions($2.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
         $$ = 0;
     }
-
     | init_declarator_list SEMICOLON {
         if ($1.intermNode && $1.intermNode->getAsAggregate())
             $1.intermNode->getAsAggregate()->setOperator(EOpSequence);
@@ -1108,7 +1070,7 @@ parameter_declaration
         $$ = $2;
         if ($1.qualifier.precision != EpqNone)
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
 
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@@ -1120,7 +1082,7 @@ parameter_declaration
 
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
     }
     //
     // Without name
@@ -1129,7 +1091,7 @@ parameter_declaration
         $$ = $2;
         if ($1.qualifier.precision != EpqNone)
             $$.param.type->getQualifier().precision = $1.qualifier.precision;
-        parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
+        parseContext.precisionQualifierCheck($1.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
 
         parseContext.checkNoShaderLayouts($1.loc, $1.shaderQualifiers);
         parseContext.parameterTypeCheck($2.loc, $1.qualifier.storage, *$$.param.type);
@@ -1140,7 +1102,7 @@ parameter_declaration
 
         parseContext.parameterTypeCheck($1.loc, EvqIn, *$1.param.type);
         parseContext.paramCheckFixStorage($1.loc, EvqTemporary, *$$.param.type);
-        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier());
+        parseContext.precisionQualifierCheck($$.loc, $$.param.type->getBasicType(), $$.param.type->getQualifier(), $$.param.type->isCoopMat());
     }
     ;
 
@@ -1181,9 +1143,7 @@ single_declaration
     : fully_specified_type {
         $$.type = $1;
         $$.intermNode = 0;
-
         parseContext.declareTypeDefaults($$.loc, $$.type);
-
     }
     | fully_specified_type IDENTIFIER {
         $$.type = $1;
@@ -1217,7 +1177,7 @@ fully_specified_type
             parseContext.profileRequires($1.loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type");
             parseContext.profileRequires($1.loc, EEsProfile, 300, 0, "arrayed type");
         }
-        parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier);
+        parseContext.precisionQualifierCheck($$.loc, $$.basicType, $$.qualifier, $$.isCoopmat());
     }
     | type_qualifier type_specifier  {
         parseContext.globalQualifierFixCheck($1.loc, $1.qualifier, false, &$2);
@@ -1234,7 +1194,7 @@ fully_specified_type
         parseContext.checkNoShaderLayouts($2.loc, $1.shaderQualifiers);
         $2.shaderQualifiers.merge($1.shaderQualifiers);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
+        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
 
         $$ = $2;
 
@@ -1269,7 +1229,6 @@ interpolation_qualifier
         $$.init($1.loc);
         $$.qualifier.flat = true;
     }
-
     | NOPERSPECTIVE {
         parseContext.globalCheck($1.loc, "noperspective");
         parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_NV_shader_noperspective_interpolation, "noperspective");
@@ -1334,7 +1293,6 @@ interpolation_qualifier
         $$.init($1.loc);
         $$.qualifier.perTaskNV = true;
     }
-
     ;
 
 layout_qualifier
@@ -1369,7 +1327,6 @@ layout_qualifier_id
     }
     ;
 
-
 precise_qualifier
     : PRECISE {
         parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise");
@@ -1379,7 +1336,6 @@ precise_qualifier
     }
     ;
 
-
 type_qualifier
     : single_type_qualifier {
         $$ = $1;
@@ -1413,7 +1369,6 @@ single_type_qualifier
         // allow inheritance of storage qualifier from block declaration
         $$ = $1;
     }
-
     | precise_qualifier {
         // allow inheritance of storage qualifier from block declaration
         $$ = $1;
@@ -1440,7 +1395,6 @@ single_type_qualifier
         $$.init($1.loc);
         $$.qualifier.setSpirvLiteral();
     }
-
     ;
 
 storage_qualifier
@@ -1495,7 +1449,6 @@ storage_qualifier
         $$.init($1.loc);
         $$.qualifier.storage = EvqBuffer;
     }
-
     | ATTRIBUTE {
         parseContext.requireStage($1.loc, EShLangVertex, "attribute");
         parseContext.checkDeprecated($1.loc, ECoreProfile, 130, "attribute");
@@ -1688,10 +1641,8 @@ storage_qualifier
         $$.init($1.loc);
         $$.qualifier.storage = EvqtaskPayloadSharedEXT;
     }
-
     ;
 
-
 non_uniform_qualifier
     : NONUNIFORM {
         $$.init($1.loc);
@@ -1710,12 +1661,13 @@ type_name_list
     }
     ;
 
-
 type_specifier
     : type_specifier_nonarray type_parameter_specifier_opt {
         $$ = $1;
         $$.qualifier.precision = parseContext.getDefaultPrecision($$);
         $$.typeParameters = $2;
+        parseContext.coopMatTypeParametersCheck($1.loc, $$);
+
     }
     | type_specifier_nonarray type_parameter_specifier_opt array_specifier {
         parseContext.arrayOfArrayVersionCheck($3.loc, $3.arraySizes);
@@ -1723,6 +1675,7 @@ type_specifier
         $$.qualifier.precision = parseContext.getDefaultPrecision($$);
         $$.typeParameters = $2;
         $$.arraySizes = $3.arraySizes;
+        parseContext.coopMatTypeParametersCheck($1.loc, $$);
     }
     ;
 
@@ -1769,19 +1722,25 @@ type_parameter_specifier
     ;
 
 type_parameter_specifier_list
-    : unary_expression {
-        $$ = new TArraySizes;
+    : type_specifier {
+        $$ = new TTypeParameters;
+        $$->arraySizes = new TArraySizes;
+        $$->basicType = $1.basicType;
+    }
+    | unary_expression {
+        $$ = new TTypeParameters;
+        $$->arraySizes = new TArraySizes;
 
         TArraySize size;
-        parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter");
-        $$->addInnerSize(size);
+        parseContext.arraySizeCheck($1->getLoc(), $1, size, "type parameter", true);
+        $$->arraySizes->addInnerSize(size);
     }
     | type_parameter_specifier_list COMMA unary_expression {
         $$ = $1;
 
         TArraySize size;
-        parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter");
-        $$->addInnerSize(size);
+        parseContext.arraySizeCheck($3->getLoc(), $3, size, "type parameter", true);
+        $$->arraySizes->addInnerSize(size);
     }
     ;
 
@@ -1930,7 +1889,6 @@ type_specifier_nonarray
         $$.basicType = EbtFloat;
         $$.setMatrix(4, 4);
     }
-
     | DOUBLE {
         parseContext.requireProfile($1.loc, ECoreProfile | ECompatibilityProfile, "double");
         if (! parseContext.symbolTable.atBuiltInLevel())
@@ -2549,7 +2507,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.set(EbtFloat, Esd1D);
     }
-
     | SAMPLER2D {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -2585,7 +2542,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.set(EbtFloat, Esd2D, true, true);
     }
-
     | SAMPLER1DSHADOW {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -2694,7 +2650,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.set(EbtInt, Esd1D);
     }
-
     | ISAMPLER2D {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -2730,7 +2685,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.set(EbtUint, EsdCube);
     }
-
     | ISAMPLER1DARRAY {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -2771,7 +2725,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.setTexture(EbtUint, EsdCube, true);
     }
-
     | USAMPLER2DARRAY {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -2847,7 +2800,6 @@ type_specifier_nonarray
         $$.basicType = EbtSampler;
         $$.sampler.setPureSampler(true);
     }
-
     | SAMPLER2DRECT {
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtSampler;
@@ -3521,22 +3473,32 @@ type_specifier_nonarray
         $$.sampler.setSubpass(EbtUint, true);
     }
     | FCOOPMATNV {
-        parseContext.fcoopmatCheck($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
+        parseContext.fcoopmatCheckNV($1.loc, "fcoopmatNV", parseContext.symbolTable.atBuiltInLevel());
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtFloat;
-        $$.coopmat = true;
+        $$.coopmatNV = true;
+        $$.coopmatKHR = false;
     }
     | ICOOPMATNV {
-        parseContext.intcoopmatCheck($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
+        parseContext.intcoopmatCheckNV($1.loc, "icoopmatNV", parseContext.symbolTable.atBuiltInLevel());
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtInt;
-        $$.coopmat = true;
+        $$.coopmatNV = true;
+        $$.coopmatKHR = false;
     }
     | UCOOPMATNV {
-        parseContext.intcoopmatCheck($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
+        parseContext.intcoopmatCheckNV($1.loc, "ucoopmatNV", parseContext.symbolTable.atBuiltInLevel());
         $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
         $$.basicType = EbtUint;
-        $$.coopmat = true;
+        $$.coopmatNV = true;
+        $$.coopmatKHR = false;
+    }
+    | COOPMAT {
+        parseContext.coopmatCheck($1.loc, "coopmat", parseContext.symbolTable.atBuiltInLevel());
+        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
+        $$.basicType = EbtCoopmat;
+        $$.coopmatNV = false;
+        $$.coopmatKHR = true;
     }
     | spirv_type_specifier {
         parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V type specifier");
@@ -3546,7 +3508,6 @@ type_specifier_nonarray
        $$.init($1.loc, parseContext.symbolTable.atGlobalLevel());
        $$.basicType = EbtHitObjectNV;
 	}
-
     | struct_specifier {
         $$ = $1;
         $$.qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
@@ -3634,7 +3595,7 @@ struct_declaration
         $$ = $2;
 
         parseContext.voidErrorCheck($1.loc, (*$2)[0].type->getFieldName(), $1.basicType);
-        parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier);
+        parseContext.precisionQualifierCheck($1.loc, $1.basicType, $1.qualifier, $1.isCoopmat());
 
         for (unsigned int i = 0; i < $$->size(); ++i) {
             TType type($1);
@@ -3658,7 +3619,7 @@ struct_declaration
         parseContext.memberQualifierCheck($1);
         parseContext.voidErrorCheck($2.loc, (*$3)[0].type->getFieldName(), $2.basicType);
         parseContext.mergeQualifiers($2.loc, $2.qualifier, $1.qualifier, true);
-        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier);
+        parseContext.precisionQualifierCheck($2.loc, $2.basicType, $2.qualifier, $2.isCoopmat());
 
         for (unsigned int i = 0; i < $$->size(); ++i) {
             TType type($2);
@@ -3701,7 +3662,6 @@ initializer
     : assignment_expression {
         $$ = $1;
     }
-
     | LEFT_BRACE initializer_list RIGHT_BRACE {
         const char* initFeature = "{ } style initializers";
         parseContext.requireProfile($1.loc, ~EEsProfile, initFeature);
@@ -3720,10 +3680,8 @@ initializer
         parseContext.profileRequires($1.loc, ~EEsProfile, 0, E_GL_EXT_null_initializer, initFeature);
         $$ = parseContext.intermediate.makeAggregate($1.loc);
     }
-
     ;
 
-
 initializer_list
     : initializer {
         $$ = parseContext.intermediate.growAggregate(0, $1, $1->getLoc());
@@ -3733,7 +3691,6 @@ initializer_list
     }
     ;
 
-
 declaration_statement
     : declaration { $$ = $1; }
     ;
@@ -3753,12 +3710,9 @@ simple_statement
     | case_label            { $$ = $1; }
     | iteration_statement   { $$ = $1; }
     | jump_statement        { $$ = $1; }
-
     | demote_statement      { $$ = $1; }
-
     ;
 
-
 demote_statement
     : DEMOTE SEMICOLON {
         parseContext.requireStage($1.loc, EShLangFragment, "demote");
@@ -3767,7 +3721,6 @@ demote_statement
     }
     ;
 
-
 compound_statement
     : LEFT_BRACE RIGHT_BRACE { $$ = 0; }
     | LEFT_BRACE {
@@ -3850,14 +3803,12 @@ selection_statement
     : selection_statement_nonattributed {
         $$ = $1;
     }
-
     | attribute selection_statement_nonattributed {
         parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
         parseContext.handleSelectionAttributes(*$1, $2);
         $$ = $2;
     }
 
-
 selection_statement_nonattributed
     : IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement {
         parseContext.boolCheck($1.loc, $3);
@@ -3898,14 +3849,12 @@ switch_statement
     : switch_statement_nonattributed {
         $$ = $1;
     }
-
     | attribute switch_statement_nonattributed {
         parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
         parseContext.handleSwitchAttributes(*$1, $2);
         $$ = $2;
     }
 
-
 switch_statement_nonattributed
     : SWITCH LEFT_PAREN expression RIGHT_PAREN {
         // start new switch sequence on the switch stack
@@ -3963,14 +3912,12 @@ iteration_statement
     : iteration_statement_nonattributed {
         $$ = $1;
     }
-
     | attribute iteration_statement_nonattributed {
         parseContext.requireExtensions($2->getLoc(), 1, &E_GL_EXT_control_flow_attributes, "attribute");
         parseContext.handleLoopAttributes(*$1, $2);
         $$ = $2;
     }
 
-
 iteration_statement_nonattributed
     : WHILE LEFT_PAREN {
         if (! parseContext.limits.whileLoops)
@@ -4083,7 +4030,6 @@ jump_statement
         parseContext.requireStage($1.loc, EShLangFragment, "terminateInvocation");
         $$ = parseContext.intermediate.addBranch(EOpTerminateInvocation, $1.loc);
     }
-
     | TERMINATE_RAY SEMICOLON {
         parseContext.requireStage($1.loc, EShLangAnyHit, "terminateRayEXT");
         $$ = parseContext.intermediate.addBranch(EOpTerminateRayKHR, $1.loc);
@@ -4092,7 +4038,6 @@ jump_statement
         parseContext.requireStage($1.loc, EShLangAnyHit, "ignoreIntersectionEXT");
         $$ = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, $1.loc);
     }
-
     ;
 
 // Grammar Note:  No 'goto'.  Gotos are not supported.
@@ -4117,13 +4062,11 @@ external_declaration
     | declaration {
         $$ = $1;
     }
-
     | SEMICOLON {
         parseContext.requireProfile($1.loc, ~EEsProfile, "extraneous semicolon");
         parseContext.profileRequires($1.loc, ~EEsProfile, 460, nullptr, "extraneous semicolon");
         $$ = nullptr;
     }
-
     ;
 
 function_definition
@@ -4167,7 +4110,6 @@ function_definition
     }
     ;
 
-
 attribute
     : LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET {
         $$ = $3;
@@ -4189,8 +4131,6 @@ single_attribute
         $$ = parseContext.makeAttributes(*$1.string, $3);
     }
 
-
-
 spirv_requirements_list
     : spirv_requirements_parameter {
         $$ = $1;
@@ -4468,5 +4408,4 @@ spirv_instruction_qualifier_id
         $$ = parseContext.makeSpirvInstruction($2.loc, *$1.string, $3.i);
     }
 
-
 %%

File diff suppressed because it is too large
+ 538 - 518
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp


+ 306 - 303
3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h

@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 3.7.4.  */
+/* A Bison parser, made by GNU Bison 3.8.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* As a special exception, you may create a larger work that contains
    part or all of the Bison parser skeleton and distribute that work
@@ -217,304 +217,305 @@ extern int yydebug;
     FCOOPMATNV = 418,              /* FCOOPMATNV  */
     ICOOPMATNV = 419,              /* ICOOPMATNV  */
     UCOOPMATNV = 420,              /* UCOOPMATNV  */
-    HITOBJECTNV = 421,             /* HITOBJECTNV  */
-    HITOBJECTATTRNV = 422,         /* HITOBJECTATTRNV  */
-    SAMPLERCUBEARRAY = 423,        /* SAMPLERCUBEARRAY  */
-    SAMPLERCUBEARRAYSHADOW = 424,  /* SAMPLERCUBEARRAYSHADOW  */
-    ISAMPLERCUBEARRAY = 425,       /* ISAMPLERCUBEARRAY  */
-    USAMPLERCUBEARRAY = 426,       /* USAMPLERCUBEARRAY  */
-    SAMPLER1D = 427,               /* SAMPLER1D  */
-    SAMPLER1DARRAY = 428,          /* SAMPLER1DARRAY  */
-    SAMPLER1DARRAYSHADOW = 429,    /* SAMPLER1DARRAYSHADOW  */
-    ISAMPLER1D = 430,              /* ISAMPLER1D  */
-    SAMPLER1DSHADOW = 431,         /* SAMPLER1DSHADOW  */
-    SAMPLER2DRECT = 432,           /* SAMPLER2DRECT  */
-    SAMPLER2DRECTSHADOW = 433,     /* SAMPLER2DRECTSHADOW  */
-    ISAMPLER2DRECT = 434,          /* ISAMPLER2DRECT  */
-    USAMPLER2DRECT = 435,          /* USAMPLER2DRECT  */
-    SAMPLERBUFFER = 436,           /* SAMPLERBUFFER  */
-    ISAMPLERBUFFER = 437,          /* ISAMPLERBUFFER  */
-    USAMPLERBUFFER = 438,          /* USAMPLERBUFFER  */
-    SAMPLER2DMS = 439,             /* SAMPLER2DMS  */
-    ISAMPLER2DMS = 440,            /* ISAMPLER2DMS  */
-    USAMPLER2DMS = 441,            /* USAMPLER2DMS  */
-    SAMPLER2DMSARRAY = 442,        /* SAMPLER2DMSARRAY  */
-    ISAMPLER2DMSARRAY = 443,       /* ISAMPLER2DMSARRAY  */
-    USAMPLER2DMSARRAY = 444,       /* USAMPLER2DMSARRAY  */
-    SAMPLEREXTERNALOES = 445,      /* SAMPLEREXTERNALOES  */
-    SAMPLEREXTERNAL2DY2YEXT = 446, /* SAMPLEREXTERNAL2DY2YEXT  */
-    ISAMPLER1DARRAY = 447,         /* ISAMPLER1DARRAY  */
-    USAMPLER1D = 448,              /* USAMPLER1D  */
-    USAMPLER1DARRAY = 449,         /* USAMPLER1DARRAY  */
-    F16SAMPLER1D = 450,            /* F16SAMPLER1D  */
-    F16SAMPLER2D = 451,            /* F16SAMPLER2D  */
-    F16SAMPLER3D = 452,            /* F16SAMPLER3D  */
-    F16SAMPLER2DRECT = 453,        /* F16SAMPLER2DRECT  */
-    F16SAMPLERCUBE = 454,          /* F16SAMPLERCUBE  */
-    F16SAMPLER1DARRAY = 455,       /* F16SAMPLER1DARRAY  */
-    F16SAMPLER2DARRAY = 456,       /* F16SAMPLER2DARRAY  */
-    F16SAMPLERCUBEARRAY = 457,     /* F16SAMPLERCUBEARRAY  */
-    F16SAMPLERBUFFER = 458,        /* F16SAMPLERBUFFER  */
-    F16SAMPLER2DMS = 459,          /* F16SAMPLER2DMS  */
-    F16SAMPLER2DMSARRAY = 460,     /* F16SAMPLER2DMSARRAY  */
-    F16SAMPLER1DSHADOW = 461,      /* F16SAMPLER1DSHADOW  */
-    F16SAMPLER2DSHADOW = 462,      /* F16SAMPLER2DSHADOW  */
-    F16SAMPLER1DARRAYSHADOW = 463, /* F16SAMPLER1DARRAYSHADOW  */
-    F16SAMPLER2DARRAYSHADOW = 464, /* F16SAMPLER2DARRAYSHADOW  */
-    F16SAMPLER2DRECTSHADOW = 465,  /* F16SAMPLER2DRECTSHADOW  */
-    F16SAMPLERCUBESHADOW = 466,    /* F16SAMPLERCUBESHADOW  */
-    F16SAMPLERCUBEARRAYSHADOW = 467, /* F16SAMPLERCUBEARRAYSHADOW  */
-    IMAGE1D = 468,                 /* IMAGE1D  */
-    IIMAGE1D = 469,                /* IIMAGE1D  */
-    UIMAGE1D = 470,                /* UIMAGE1D  */
-    IMAGE2D = 471,                 /* IMAGE2D  */
-    IIMAGE2D = 472,                /* IIMAGE2D  */
-    UIMAGE2D = 473,                /* UIMAGE2D  */
-    IMAGE3D = 474,                 /* IMAGE3D  */
-    IIMAGE3D = 475,                /* IIMAGE3D  */
-    UIMAGE3D = 476,                /* UIMAGE3D  */
-    IMAGE2DRECT = 477,             /* IMAGE2DRECT  */
-    IIMAGE2DRECT = 478,            /* IIMAGE2DRECT  */
-    UIMAGE2DRECT = 479,            /* UIMAGE2DRECT  */
-    IMAGECUBE = 480,               /* IMAGECUBE  */
-    IIMAGECUBE = 481,              /* IIMAGECUBE  */
-    UIMAGECUBE = 482,              /* UIMAGECUBE  */
-    IMAGEBUFFER = 483,             /* IMAGEBUFFER  */
-    IIMAGEBUFFER = 484,            /* IIMAGEBUFFER  */
-    UIMAGEBUFFER = 485,            /* UIMAGEBUFFER  */
-    IMAGE1DARRAY = 486,            /* IMAGE1DARRAY  */
-    IIMAGE1DARRAY = 487,           /* IIMAGE1DARRAY  */
-    UIMAGE1DARRAY = 488,           /* UIMAGE1DARRAY  */
-    IMAGE2DARRAY = 489,            /* IMAGE2DARRAY  */
-    IIMAGE2DARRAY = 490,           /* IIMAGE2DARRAY  */
-    UIMAGE2DARRAY = 491,           /* UIMAGE2DARRAY  */
-    IMAGECUBEARRAY = 492,          /* IMAGECUBEARRAY  */
-    IIMAGECUBEARRAY = 493,         /* IIMAGECUBEARRAY  */
-    UIMAGECUBEARRAY = 494,         /* UIMAGECUBEARRAY  */
-    IMAGE2DMS = 495,               /* IMAGE2DMS  */
-    IIMAGE2DMS = 496,              /* IIMAGE2DMS  */
-    UIMAGE2DMS = 497,              /* UIMAGE2DMS  */
-    IMAGE2DMSARRAY = 498,          /* IMAGE2DMSARRAY  */
-    IIMAGE2DMSARRAY = 499,         /* IIMAGE2DMSARRAY  */
-    UIMAGE2DMSARRAY = 500,         /* UIMAGE2DMSARRAY  */
-    F16IMAGE1D = 501,              /* F16IMAGE1D  */
-    F16IMAGE2D = 502,              /* F16IMAGE2D  */
-    F16IMAGE3D = 503,              /* F16IMAGE3D  */
-    F16IMAGE2DRECT = 504,          /* F16IMAGE2DRECT  */
-    F16IMAGECUBE = 505,            /* F16IMAGECUBE  */
-    F16IMAGE1DARRAY = 506,         /* F16IMAGE1DARRAY  */
-    F16IMAGE2DARRAY = 507,         /* F16IMAGE2DARRAY  */
-    F16IMAGECUBEARRAY = 508,       /* F16IMAGECUBEARRAY  */
-    F16IMAGEBUFFER = 509,          /* F16IMAGEBUFFER  */
-    F16IMAGE2DMS = 510,            /* F16IMAGE2DMS  */
-    F16IMAGE2DMSARRAY = 511,       /* F16IMAGE2DMSARRAY  */
-    I64IMAGE1D = 512,              /* I64IMAGE1D  */
-    U64IMAGE1D = 513,              /* U64IMAGE1D  */
-    I64IMAGE2D = 514,              /* I64IMAGE2D  */
-    U64IMAGE2D = 515,              /* U64IMAGE2D  */
-    I64IMAGE3D = 516,              /* I64IMAGE3D  */
-    U64IMAGE3D = 517,              /* U64IMAGE3D  */
-    I64IMAGE2DRECT = 518,          /* I64IMAGE2DRECT  */
-    U64IMAGE2DRECT = 519,          /* U64IMAGE2DRECT  */
-    I64IMAGECUBE = 520,            /* I64IMAGECUBE  */
-    U64IMAGECUBE = 521,            /* U64IMAGECUBE  */
-    I64IMAGEBUFFER = 522,          /* I64IMAGEBUFFER  */
-    U64IMAGEBUFFER = 523,          /* U64IMAGEBUFFER  */
-    I64IMAGE1DARRAY = 524,         /* I64IMAGE1DARRAY  */
-    U64IMAGE1DARRAY = 525,         /* U64IMAGE1DARRAY  */
-    I64IMAGE2DARRAY = 526,         /* I64IMAGE2DARRAY  */
-    U64IMAGE2DARRAY = 527,         /* U64IMAGE2DARRAY  */
-    I64IMAGECUBEARRAY = 528,       /* I64IMAGECUBEARRAY  */
-    U64IMAGECUBEARRAY = 529,       /* U64IMAGECUBEARRAY  */
-    I64IMAGE2DMS = 530,            /* I64IMAGE2DMS  */
-    U64IMAGE2DMS = 531,            /* U64IMAGE2DMS  */
-    I64IMAGE2DMSARRAY = 532,       /* I64IMAGE2DMSARRAY  */
-    U64IMAGE2DMSARRAY = 533,       /* U64IMAGE2DMSARRAY  */
-    TEXTURECUBEARRAY = 534,        /* TEXTURECUBEARRAY  */
-    ITEXTURECUBEARRAY = 535,       /* ITEXTURECUBEARRAY  */
-    UTEXTURECUBEARRAY = 536,       /* UTEXTURECUBEARRAY  */
-    TEXTURE1D = 537,               /* TEXTURE1D  */
-    ITEXTURE1D = 538,              /* ITEXTURE1D  */
-    UTEXTURE1D = 539,              /* UTEXTURE1D  */
-    TEXTURE1DARRAY = 540,          /* TEXTURE1DARRAY  */
-    ITEXTURE1DARRAY = 541,         /* ITEXTURE1DARRAY  */
-    UTEXTURE1DARRAY = 542,         /* UTEXTURE1DARRAY  */
-    TEXTURE2DRECT = 543,           /* TEXTURE2DRECT  */
-    ITEXTURE2DRECT = 544,          /* ITEXTURE2DRECT  */
-    UTEXTURE2DRECT = 545,          /* UTEXTURE2DRECT  */
-    TEXTUREBUFFER = 546,           /* TEXTUREBUFFER  */
-    ITEXTUREBUFFER = 547,          /* ITEXTUREBUFFER  */
-    UTEXTUREBUFFER = 548,          /* UTEXTUREBUFFER  */
-    TEXTURE2DMS = 549,             /* TEXTURE2DMS  */
-    ITEXTURE2DMS = 550,            /* ITEXTURE2DMS  */
-    UTEXTURE2DMS = 551,            /* UTEXTURE2DMS  */
-    TEXTURE2DMSARRAY = 552,        /* TEXTURE2DMSARRAY  */
-    ITEXTURE2DMSARRAY = 553,       /* ITEXTURE2DMSARRAY  */
-    UTEXTURE2DMSARRAY = 554,       /* UTEXTURE2DMSARRAY  */
-    F16TEXTURE1D = 555,            /* F16TEXTURE1D  */
-    F16TEXTURE2D = 556,            /* F16TEXTURE2D  */
-    F16TEXTURE3D = 557,            /* F16TEXTURE3D  */
-    F16TEXTURE2DRECT = 558,        /* F16TEXTURE2DRECT  */
-    F16TEXTURECUBE = 559,          /* F16TEXTURECUBE  */
-    F16TEXTURE1DARRAY = 560,       /* F16TEXTURE1DARRAY  */
-    F16TEXTURE2DARRAY = 561,       /* F16TEXTURE2DARRAY  */
-    F16TEXTURECUBEARRAY = 562,     /* F16TEXTURECUBEARRAY  */
-    F16TEXTUREBUFFER = 563,        /* F16TEXTUREBUFFER  */
-    F16TEXTURE2DMS = 564,          /* F16TEXTURE2DMS  */
-    F16TEXTURE2DMSARRAY = 565,     /* F16TEXTURE2DMSARRAY  */
-    SUBPASSINPUT = 566,            /* SUBPASSINPUT  */
-    SUBPASSINPUTMS = 567,          /* SUBPASSINPUTMS  */
-    ISUBPASSINPUT = 568,           /* ISUBPASSINPUT  */
-    ISUBPASSINPUTMS = 569,         /* ISUBPASSINPUTMS  */
-    USUBPASSINPUT = 570,           /* USUBPASSINPUT  */
-    USUBPASSINPUTMS = 571,         /* USUBPASSINPUTMS  */
-    F16SUBPASSINPUT = 572,         /* F16SUBPASSINPUT  */
-    F16SUBPASSINPUTMS = 573,       /* F16SUBPASSINPUTMS  */
-    SPIRV_INSTRUCTION = 574,       /* SPIRV_INSTRUCTION  */
-    SPIRV_EXECUTION_MODE = 575,    /* SPIRV_EXECUTION_MODE  */
-    SPIRV_EXECUTION_MODE_ID = 576, /* SPIRV_EXECUTION_MODE_ID  */
-    SPIRV_DECORATE = 577,          /* SPIRV_DECORATE  */
-    SPIRV_DECORATE_ID = 578,       /* SPIRV_DECORATE_ID  */
-    SPIRV_DECORATE_STRING = 579,   /* SPIRV_DECORATE_STRING  */
-    SPIRV_TYPE = 580,              /* SPIRV_TYPE  */
-    SPIRV_STORAGE_CLASS = 581,     /* SPIRV_STORAGE_CLASS  */
-    SPIRV_BY_REFERENCE = 582,      /* SPIRV_BY_REFERENCE  */
-    SPIRV_LITERAL = 583,           /* SPIRV_LITERAL  */
-    ATTACHMENTEXT = 584,           /* ATTACHMENTEXT  */
-    IATTACHMENTEXT = 585,          /* IATTACHMENTEXT  */
-    UATTACHMENTEXT = 586,          /* UATTACHMENTEXT  */
-    LEFT_OP = 587,                 /* LEFT_OP  */
-    RIGHT_OP = 588,                /* RIGHT_OP  */
-    INC_OP = 589,                  /* INC_OP  */
-    DEC_OP = 590,                  /* DEC_OP  */
-    LE_OP = 591,                   /* LE_OP  */
-    GE_OP = 592,                   /* GE_OP  */
-    EQ_OP = 593,                   /* EQ_OP  */
-    NE_OP = 594,                   /* NE_OP  */
-    AND_OP = 595,                  /* AND_OP  */
-    OR_OP = 596,                   /* OR_OP  */
-    XOR_OP = 597,                  /* XOR_OP  */
-    MUL_ASSIGN = 598,              /* MUL_ASSIGN  */
-    DIV_ASSIGN = 599,              /* DIV_ASSIGN  */
-    ADD_ASSIGN = 600,              /* ADD_ASSIGN  */
-    MOD_ASSIGN = 601,              /* MOD_ASSIGN  */
-    LEFT_ASSIGN = 602,             /* LEFT_ASSIGN  */
-    RIGHT_ASSIGN = 603,            /* RIGHT_ASSIGN  */
-    AND_ASSIGN = 604,              /* AND_ASSIGN  */
-    XOR_ASSIGN = 605,              /* XOR_ASSIGN  */
-    OR_ASSIGN = 606,               /* OR_ASSIGN  */
-    SUB_ASSIGN = 607,              /* SUB_ASSIGN  */
-    STRING_LITERAL = 608,          /* STRING_LITERAL  */
-    LEFT_PAREN = 609,              /* LEFT_PAREN  */
-    RIGHT_PAREN = 610,             /* RIGHT_PAREN  */
-    LEFT_BRACKET = 611,            /* LEFT_BRACKET  */
-    RIGHT_BRACKET = 612,           /* RIGHT_BRACKET  */
-    LEFT_BRACE = 613,              /* LEFT_BRACE  */
-    RIGHT_BRACE = 614,             /* RIGHT_BRACE  */
-    DOT = 615,                     /* DOT  */
-    COMMA = 616,                   /* COMMA  */
-    COLON = 617,                   /* COLON  */
-    EQUAL = 618,                   /* EQUAL  */
-    SEMICOLON = 619,               /* SEMICOLON  */
-    BANG = 620,                    /* BANG  */
-    DASH = 621,                    /* DASH  */
-    TILDE = 622,                   /* TILDE  */
-    PLUS = 623,                    /* PLUS  */
-    STAR = 624,                    /* STAR  */
-    SLASH = 625,                   /* SLASH  */
-    PERCENT = 626,                 /* PERCENT  */
-    LEFT_ANGLE = 627,              /* LEFT_ANGLE  */
-    RIGHT_ANGLE = 628,             /* RIGHT_ANGLE  */
-    VERTICAL_BAR = 629,            /* VERTICAL_BAR  */
-    CARET = 630,                   /* CARET  */
-    AMPERSAND = 631,               /* AMPERSAND  */
-    QUESTION = 632,                /* QUESTION  */
-    INVARIANT = 633,               /* INVARIANT  */
-    HIGH_PRECISION = 634,          /* HIGH_PRECISION  */
-    MEDIUM_PRECISION = 635,        /* MEDIUM_PRECISION  */
-    LOW_PRECISION = 636,           /* LOW_PRECISION  */
-    PRECISION = 637,               /* PRECISION  */
-    PACKED = 638,                  /* PACKED  */
-    RESOURCE = 639,                /* RESOURCE  */
-    SUPERP = 640,                  /* SUPERP  */
-    FLOATCONSTANT = 641,           /* FLOATCONSTANT  */
-    INTCONSTANT = 642,             /* INTCONSTANT  */
-    UINTCONSTANT = 643,            /* UINTCONSTANT  */
-    BOOLCONSTANT = 644,            /* BOOLCONSTANT  */
-    IDENTIFIER = 645,              /* IDENTIFIER  */
-    TYPE_NAME = 646,               /* TYPE_NAME  */
-    CENTROID = 647,                /* CENTROID  */
-    IN = 648,                      /* IN  */
-    OUT = 649,                     /* OUT  */
-    INOUT = 650,                   /* INOUT  */
-    STRUCT = 651,                  /* STRUCT  */
-    VOID = 652,                    /* VOID  */
-    WHILE = 653,                   /* WHILE  */
-    BREAK = 654,                   /* BREAK  */
-    CONTINUE = 655,                /* CONTINUE  */
-    DO = 656,                      /* DO  */
-    ELSE = 657,                    /* ELSE  */
-    FOR = 658,                     /* FOR  */
-    IF = 659,                      /* IF  */
-    DISCARD = 660,                 /* DISCARD  */
-    RETURN = 661,                  /* RETURN  */
-    SWITCH = 662,                  /* SWITCH  */
-    CASE = 663,                    /* CASE  */
-    DEFAULT = 664,                 /* DEFAULT  */
-    TERMINATE_INVOCATION = 665,    /* TERMINATE_INVOCATION  */
-    TERMINATE_RAY = 666,           /* TERMINATE_RAY  */
-    IGNORE_INTERSECTION = 667,     /* IGNORE_INTERSECTION  */
-    UNIFORM = 668,                 /* UNIFORM  */
-    SHARED = 669,                  /* SHARED  */
-    BUFFER = 670,                  /* BUFFER  */
-    TILEIMAGEEXT = 671,            /* TILEIMAGEEXT  */
-    FLAT = 672,                    /* FLAT  */
-    SMOOTH = 673,                  /* SMOOTH  */
-    LAYOUT = 674,                  /* LAYOUT  */
-    DOUBLECONSTANT = 675,          /* DOUBLECONSTANT  */
-    INT16CONSTANT = 676,           /* INT16CONSTANT  */
-    UINT16CONSTANT = 677,          /* UINT16CONSTANT  */
-    FLOAT16CONSTANT = 678,         /* FLOAT16CONSTANT  */
-    INT32CONSTANT = 679,           /* INT32CONSTANT  */
-    UINT32CONSTANT = 680,          /* UINT32CONSTANT  */
-    INT64CONSTANT = 681,           /* INT64CONSTANT  */
-    UINT64CONSTANT = 682,          /* UINT64CONSTANT  */
-    SUBROUTINE = 683,              /* SUBROUTINE  */
-    DEMOTE = 684,                  /* DEMOTE  */
-    PAYLOADNV = 685,               /* PAYLOADNV  */
-    PAYLOADINNV = 686,             /* PAYLOADINNV  */
-    HITATTRNV = 687,               /* HITATTRNV  */
-    CALLDATANV = 688,              /* CALLDATANV  */
-    CALLDATAINNV = 689,            /* CALLDATAINNV  */
-    PAYLOADEXT = 690,              /* PAYLOADEXT  */
-    PAYLOADINEXT = 691,            /* PAYLOADINEXT  */
-    HITATTREXT = 692,              /* HITATTREXT  */
-    CALLDATAEXT = 693,             /* CALLDATAEXT  */
-    CALLDATAINEXT = 694,           /* CALLDATAINEXT  */
-    PATCH = 695,                   /* PATCH  */
-    SAMPLE = 696,                  /* SAMPLE  */
-    NONUNIFORM = 697,              /* NONUNIFORM  */
-    COHERENT = 698,                /* COHERENT  */
-    VOLATILE = 699,                /* VOLATILE  */
-    RESTRICT = 700,                /* RESTRICT  */
-    READONLY = 701,                /* READONLY  */
-    WRITEONLY = 702,               /* WRITEONLY  */
-    DEVICECOHERENT = 703,          /* DEVICECOHERENT  */
-    QUEUEFAMILYCOHERENT = 704,     /* QUEUEFAMILYCOHERENT  */
-    WORKGROUPCOHERENT = 705,       /* WORKGROUPCOHERENT  */
-    SUBGROUPCOHERENT = 706,        /* SUBGROUPCOHERENT  */
-    NONPRIVATE = 707,              /* NONPRIVATE  */
-    SHADERCALLCOHERENT = 708,      /* SHADERCALLCOHERENT  */
-    NOPERSPECTIVE = 709,           /* NOPERSPECTIVE  */
-    EXPLICITINTERPAMD = 710,       /* EXPLICITINTERPAMD  */
-    PERVERTEXEXT = 711,            /* PERVERTEXEXT  */
-    PERVERTEXNV = 712,             /* PERVERTEXNV  */
-    PERPRIMITIVENV = 713,          /* PERPRIMITIVENV  */
-    PERVIEWNV = 714,               /* PERVIEWNV  */
-    PERTASKNV = 715,               /* PERTASKNV  */
-    PERPRIMITIVEEXT = 716,         /* PERPRIMITIVEEXT  */
-    TASKPAYLOADWORKGROUPEXT = 717, /* TASKPAYLOADWORKGROUPEXT  */
-    PRECISE = 718                  /* PRECISE  */
+    COOPMAT = 421,                 /* COOPMAT  */
+    HITOBJECTNV = 422,             /* HITOBJECTNV  */
+    HITOBJECTATTRNV = 423,         /* HITOBJECTATTRNV  */
+    SAMPLERCUBEARRAY = 424,        /* SAMPLERCUBEARRAY  */
+    SAMPLERCUBEARRAYSHADOW = 425,  /* SAMPLERCUBEARRAYSHADOW  */
+    ISAMPLERCUBEARRAY = 426,       /* ISAMPLERCUBEARRAY  */
+    USAMPLERCUBEARRAY = 427,       /* USAMPLERCUBEARRAY  */
+    SAMPLER1D = 428,               /* SAMPLER1D  */
+    SAMPLER1DARRAY = 429,          /* SAMPLER1DARRAY  */
+    SAMPLER1DARRAYSHADOW = 430,    /* SAMPLER1DARRAYSHADOW  */
+    ISAMPLER1D = 431,              /* ISAMPLER1D  */
+    SAMPLER1DSHADOW = 432,         /* SAMPLER1DSHADOW  */
+    SAMPLER2DRECT = 433,           /* SAMPLER2DRECT  */
+    SAMPLER2DRECTSHADOW = 434,     /* SAMPLER2DRECTSHADOW  */
+    ISAMPLER2DRECT = 435,          /* ISAMPLER2DRECT  */
+    USAMPLER2DRECT = 436,          /* USAMPLER2DRECT  */
+    SAMPLERBUFFER = 437,           /* SAMPLERBUFFER  */
+    ISAMPLERBUFFER = 438,          /* ISAMPLERBUFFER  */
+    USAMPLERBUFFER = 439,          /* USAMPLERBUFFER  */
+    SAMPLER2DMS = 440,             /* SAMPLER2DMS  */
+    ISAMPLER2DMS = 441,            /* ISAMPLER2DMS  */
+    USAMPLER2DMS = 442,            /* USAMPLER2DMS  */
+    SAMPLER2DMSARRAY = 443,        /* SAMPLER2DMSARRAY  */
+    ISAMPLER2DMSARRAY = 444,       /* ISAMPLER2DMSARRAY  */
+    USAMPLER2DMSARRAY = 445,       /* USAMPLER2DMSARRAY  */
+    SAMPLEREXTERNALOES = 446,      /* SAMPLEREXTERNALOES  */
+    SAMPLEREXTERNAL2DY2YEXT = 447, /* SAMPLEREXTERNAL2DY2YEXT  */
+    ISAMPLER1DARRAY = 448,         /* ISAMPLER1DARRAY  */
+    USAMPLER1D = 449,              /* USAMPLER1D  */
+    USAMPLER1DARRAY = 450,         /* USAMPLER1DARRAY  */
+    F16SAMPLER1D = 451,            /* F16SAMPLER1D  */
+    F16SAMPLER2D = 452,            /* F16SAMPLER2D  */
+    F16SAMPLER3D = 453,            /* F16SAMPLER3D  */
+    F16SAMPLER2DRECT = 454,        /* F16SAMPLER2DRECT  */
+    F16SAMPLERCUBE = 455,          /* F16SAMPLERCUBE  */
+    F16SAMPLER1DARRAY = 456,       /* F16SAMPLER1DARRAY  */
+    F16SAMPLER2DARRAY = 457,       /* F16SAMPLER2DARRAY  */
+    F16SAMPLERCUBEARRAY = 458,     /* F16SAMPLERCUBEARRAY  */
+    F16SAMPLERBUFFER = 459,        /* F16SAMPLERBUFFER  */
+    F16SAMPLER2DMS = 460,          /* F16SAMPLER2DMS  */
+    F16SAMPLER2DMSARRAY = 461,     /* F16SAMPLER2DMSARRAY  */
+    F16SAMPLER1DSHADOW = 462,      /* F16SAMPLER1DSHADOW  */
+    F16SAMPLER2DSHADOW = 463,      /* F16SAMPLER2DSHADOW  */
+    F16SAMPLER1DARRAYSHADOW = 464, /* F16SAMPLER1DARRAYSHADOW  */
+    F16SAMPLER2DARRAYSHADOW = 465, /* F16SAMPLER2DARRAYSHADOW  */
+    F16SAMPLER2DRECTSHADOW = 466,  /* F16SAMPLER2DRECTSHADOW  */
+    F16SAMPLERCUBESHADOW = 467,    /* F16SAMPLERCUBESHADOW  */
+    F16SAMPLERCUBEARRAYSHADOW = 468, /* F16SAMPLERCUBEARRAYSHADOW  */
+    IMAGE1D = 469,                 /* IMAGE1D  */
+    IIMAGE1D = 470,                /* IIMAGE1D  */
+    UIMAGE1D = 471,                /* UIMAGE1D  */
+    IMAGE2D = 472,                 /* IMAGE2D  */
+    IIMAGE2D = 473,                /* IIMAGE2D  */
+    UIMAGE2D = 474,                /* UIMAGE2D  */
+    IMAGE3D = 475,                 /* IMAGE3D  */
+    IIMAGE3D = 476,                /* IIMAGE3D  */
+    UIMAGE3D = 477,                /* UIMAGE3D  */
+    IMAGE2DRECT = 478,             /* IMAGE2DRECT  */
+    IIMAGE2DRECT = 479,            /* IIMAGE2DRECT  */
+    UIMAGE2DRECT = 480,            /* UIMAGE2DRECT  */
+    IMAGECUBE = 481,               /* IMAGECUBE  */
+    IIMAGECUBE = 482,              /* IIMAGECUBE  */
+    UIMAGECUBE = 483,              /* UIMAGECUBE  */
+    IMAGEBUFFER = 484,             /* IMAGEBUFFER  */
+    IIMAGEBUFFER = 485,            /* IIMAGEBUFFER  */
+    UIMAGEBUFFER = 486,            /* UIMAGEBUFFER  */
+    IMAGE1DARRAY = 487,            /* IMAGE1DARRAY  */
+    IIMAGE1DARRAY = 488,           /* IIMAGE1DARRAY  */
+    UIMAGE1DARRAY = 489,           /* UIMAGE1DARRAY  */
+    IMAGE2DARRAY = 490,            /* IMAGE2DARRAY  */
+    IIMAGE2DARRAY = 491,           /* IIMAGE2DARRAY  */
+    UIMAGE2DARRAY = 492,           /* UIMAGE2DARRAY  */
+    IMAGECUBEARRAY = 493,          /* IMAGECUBEARRAY  */
+    IIMAGECUBEARRAY = 494,         /* IIMAGECUBEARRAY  */
+    UIMAGECUBEARRAY = 495,         /* UIMAGECUBEARRAY  */
+    IMAGE2DMS = 496,               /* IMAGE2DMS  */
+    IIMAGE2DMS = 497,              /* IIMAGE2DMS  */
+    UIMAGE2DMS = 498,              /* UIMAGE2DMS  */
+    IMAGE2DMSARRAY = 499,          /* IMAGE2DMSARRAY  */
+    IIMAGE2DMSARRAY = 500,         /* IIMAGE2DMSARRAY  */
+    UIMAGE2DMSARRAY = 501,         /* UIMAGE2DMSARRAY  */
+    F16IMAGE1D = 502,              /* F16IMAGE1D  */
+    F16IMAGE2D = 503,              /* F16IMAGE2D  */
+    F16IMAGE3D = 504,              /* F16IMAGE3D  */
+    F16IMAGE2DRECT = 505,          /* F16IMAGE2DRECT  */
+    F16IMAGECUBE = 506,            /* F16IMAGECUBE  */
+    F16IMAGE1DARRAY = 507,         /* F16IMAGE1DARRAY  */
+    F16IMAGE2DARRAY = 508,         /* F16IMAGE2DARRAY  */
+    F16IMAGECUBEARRAY = 509,       /* F16IMAGECUBEARRAY  */
+    F16IMAGEBUFFER = 510,          /* F16IMAGEBUFFER  */
+    F16IMAGE2DMS = 511,            /* F16IMAGE2DMS  */
+    F16IMAGE2DMSARRAY = 512,       /* F16IMAGE2DMSARRAY  */
+    I64IMAGE1D = 513,              /* I64IMAGE1D  */
+    U64IMAGE1D = 514,              /* U64IMAGE1D  */
+    I64IMAGE2D = 515,              /* I64IMAGE2D  */
+    U64IMAGE2D = 516,              /* U64IMAGE2D  */
+    I64IMAGE3D = 517,              /* I64IMAGE3D  */
+    U64IMAGE3D = 518,              /* U64IMAGE3D  */
+    I64IMAGE2DRECT = 519,          /* I64IMAGE2DRECT  */
+    U64IMAGE2DRECT = 520,          /* U64IMAGE2DRECT  */
+    I64IMAGECUBE = 521,            /* I64IMAGECUBE  */
+    U64IMAGECUBE = 522,            /* U64IMAGECUBE  */
+    I64IMAGEBUFFER = 523,          /* I64IMAGEBUFFER  */
+    U64IMAGEBUFFER = 524,          /* U64IMAGEBUFFER  */
+    I64IMAGE1DARRAY = 525,         /* I64IMAGE1DARRAY  */
+    U64IMAGE1DARRAY = 526,         /* U64IMAGE1DARRAY  */
+    I64IMAGE2DARRAY = 527,         /* I64IMAGE2DARRAY  */
+    U64IMAGE2DARRAY = 528,         /* U64IMAGE2DARRAY  */
+    I64IMAGECUBEARRAY = 529,       /* I64IMAGECUBEARRAY  */
+    U64IMAGECUBEARRAY = 530,       /* U64IMAGECUBEARRAY  */
+    I64IMAGE2DMS = 531,            /* I64IMAGE2DMS  */
+    U64IMAGE2DMS = 532,            /* U64IMAGE2DMS  */
+    I64IMAGE2DMSARRAY = 533,       /* I64IMAGE2DMSARRAY  */
+    U64IMAGE2DMSARRAY = 534,       /* U64IMAGE2DMSARRAY  */
+    TEXTURECUBEARRAY = 535,        /* TEXTURECUBEARRAY  */
+    ITEXTURECUBEARRAY = 536,       /* ITEXTURECUBEARRAY  */
+    UTEXTURECUBEARRAY = 537,       /* UTEXTURECUBEARRAY  */
+    TEXTURE1D = 538,               /* TEXTURE1D  */
+    ITEXTURE1D = 539,              /* ITEXTURE1D  */
+    UTEXTURE1D = 540,              /* UTEXTURE1D  */
+    TEXTURE1DARRAY = 541,          /* TEXTURE1DARRAY  */
+    ITEXTURE1DARRAY = 542,         /* ITEXTURE1DARRAY  */
+    UTEXTURE1DARRAY = 543,         /* UTEXTURE1DARRAY  */
+    TEXTURE2DRECT = 544,           /* TEXTURE2DRECT  */
+    ITEXTURE2DRECT = 545,          /* ITEXTURE2DRECT  */
+    UTEXTURE2DRECT = 546,          /* UTEXTURE2DRECT  */
+    TEXTUREBUFFER = 547,           /* TEXTUREBUFFER  */
+    ITEXTUREBUFFER = 548,          /* ITEXTUREBUFFER  */
+    UTEXTUREBUFFER = 549,          /* UTEXTUREBUFFER  */
+    TEXTURE2DMS = 550,             /* TEXTURE2DMS  */
+    ITEXTURE2DMS = 551,            /* ITEXTURE2DMS  */
+    UTEXTURE2DMS = 552,            /* UTEXTURE2DMS  */
+    TEXTURE2DMSARRAY = 553,        /* TEXTURE2DMSARRAY  */
+    ITEXTURE2DMSARRAY = 554,       /* ITEXTURE2DMSARRAY  */
+    UTEXTURE2DMSARRAY = 555,       /* UTEXTURE2DMSARRAY  */
+    F16TEXTURE1D = 556,            /* F16TEXTURE1D  */
+    F16TEXTURE2D = 557,            /* F16TEXTURE2D  */
+    F16TEXTURE3D = 558,            /* F16TEXTURE3D  */
+    F16TEXTURE2DRECT = 559,        /* F16TEXTURE2DRECT  */
+    F16TEXTURECUBE = 560,          /* F16TEXTURECUBE  */
+    F16TEXTURE1DARRAY = 561,       /* F16TEXTURE1DARRAY  */
+    F16TEXTURE2DARRAY = 562,       /* F16TEXTURE2DARRAY  */
+    F16TEXTURECUBEARRAY = 563,     /* F16TEXTURECUBEARRAY  */
+    F16TEXTUREBUFFER = 564,        /* F16TEXTUREBUFFER  */
+    F16TEXTURE2DMS = 565,          /* F16TEXTURE2DMS  */
+    F16TEXTURE2DMSARRAY = 566,     /* F16TEXTURE2DMSARRAY  */
+    SUBPASSINPUT = 567,            /* SUBPASSINPUT  */
+    SUBPASSINPUTMS = 568,          /* SUBPASSINPUTMS  */
+    ISUBPASSINPUT = 569,           /* ISUBPASSINPUT  */
+    ISUBPASSINPUTMS = 570,         /* ISUBPASSINPUTMS  */
+    USUBPASSINPUT = 571,           /* USUBPASSINPUT  */
+    USUBPASSINPUTMS = 572,         /* USUBPASSINPUTMS  */
+    F16SUBPASSINPUT = 573,         /* F16SUBPASSINPUT  */
+    F16SUBPASSINPUTMS = 574,       /* F16SUBPASSINPUTMS  */
+    SPIRV_INSTRUCTION = 575,       /* SPIRV_INSTRUCTION  */
+    SPIRV_EXECUTION_MODE = 576,    /* SPIRV_EXECUTION_MODE  */
+    SPIRV_EXECUTION_MODE_ID = 577, /* SPIRV_EXECUTION_MODE_ID  */
+    SPIRV_DECORATE = 578,          /* SPIRV_DECORATE  */
+    SPIRV_DECORATE_ID = 579,       /* SPIRV_DECORATE_ID  */
+    SPIRV_DECORATE_STRING = 580,   /* SPIRV_DECORATE_STRING  */
+    SPIRV_TYPE = 581,              /* SPIRV_TYPE  */
+    SPIRV_STORAGE_CLASS = 582,     /* SPIRV_STORAGE_CLASS  */
+    SPIRV_BY_REFERENCE = 583,      /* SPIRV_BY_REFERENCE  */
+    SPIRV_LITERAL = 584,           /* SPIRV_LITERAL  */
+    ATTACHMENTEXT = 585,           /* ATTACHMENTEXT  */
+    IATTACHMENTEXT = 586,          /* IATTACHMENTEXT  */
+    UATTACHMENTEXT = 587,          /* UATTACHMENTEXT  */
+    LEFT_OP = 588,                 /* LEFT_OP  */
+    RIGHT_OP = 589,                /* RIGHT_OP  */
+    INC_OP = 590,                  /* INC_OP  */
+    DEC_OP = 591,                  /* DEC_OP  */
+    LE_OP = 592,                   /* LE_OP  */
+    GE_OP = 593,                   /* GE_OP  */
+    EQ_OP = 594,                   /* EQ_OP  */
+    NE_OP = 595,                   /* NE_OP  */
+    AND_OP = 596,                  /* AND_OP  */
+    OR_OP = 597,                   /* OR_OP  */
+    XOR_OP = 598,                  /* XOR_OP  */
+    MUL_ASSIGN = 599,              /* MUL_ASSIGN  */
+    DIV_ASSIGN = 600,              /* DIV_ASSIGN  */
+    ADD_ASSIGN = 601,              /* ADD_ASSIGN  */
+    MOD_ASSIGN = 602,              /* MOD_ASSIGN  */
+    LEFT_ASSIGN = 603,             /* LEFT_ASSIGN  */
+    RIGHT_ASSIGN = 604,            /* RIGHT_ASSIGN  */
+    AND_ASSIGN = 605,              /* AND_ASSIGN  */
+    XOR_ASSIGN = 606,              /* XOR_ASSIGN  */
+    OR_ASSIGN = 607,               /* OR_ASSIGN  */
+    SUB_ASSIGN = 608,              /* SUB_ASSIGN  */
+    STRING_LITERAL = 609,          /* STRING_LITERAL  */
+    LEFT_PAREN = 610,              /* LEFT_PAREN  */
+    RIGHT_PAREN = 611,             /* RIGHT_PAREN  */
+    LEFT_BRACKET = 612,            /* LEFT_BRACKET  */
+    RIGHT_BRACKET = 613,           /* RIGHT_BRACKET  */
+    LEFT_BRACE = 614,              /* LEFT_BRACE  */
+    RIGHT_BRACE = 615,             /* RIGHT_BRACE  */
+    DOT = 616,                     /* DOT  */
+    COMMA = 617,                   /* COMMA  */
+    COLON = 618,                   /* COLON  */
+    EQUAL = 619,                   /* EQUAL  */
+    SEMICOLON = 620,               /* SEMICOLON  */
+    BANG = 621,                    /* BANG  */
+    DASH = 622,                    /* DASH  */
+    TILDE = 623,                   /* TILDE  */
+    PLUS = 624,                    /* PLUS  */
+    STAR = 625,                    /* STAR  */
+    SLASH = 626,                   /* SLASH  */
+    PERCENT = 627,                 /* PERCENT  */
+    LEFT_ANGLE = 628,              /* LEFT_ANGLE  */
+    RIGHT_ANGLE = 629,             /* RIGHT_ANGLE  */
+    VERTICAL_BAR = 630,            /* VERTICAL_BAR  */
+    CARET = 631,                   /* CARET  */
+    AMPERSAND = 632,               /* AMPERSAND  */
+    QUESTION = 633,                /* QUESTION  */
+    INVARIANT = 634,               /* INVARIANT  */
+    HIGH_PRECISION = 635,          /* HIGH_PRECISION  */
+    MEDIUM_PRECISION = 636,        /* MEDIUM_PRECISION  */
+    LOW_PRECISION = 637,           /* LOW_PRECISION  */
+    PRECISION = 638,               /* PRECISION  */
+    PACKED = 639,                  /* PACKED  */
+    RESOURCE = 640,                /* RESOURCE  */
+    SUPERP = 641,                  /* SUPERP  */
+    FLOATCONSTANT = 642,           /* FLOATCONSTANT  */
+    INTCONSTANT = 643,             /* INTCONSTANT  */
+    UINTCONSTANT = 644,            /* UINTCONSTANT  */
+    BOOLCONSTANT = 645,            /* BOOLCONSTANT  */
+    IDENTIFIER = 646,              /* IDENTIFIER  */
+    TYPE_NAME = 647,               /* TYPE_NAME  */
+    CENTROID = 648,                /* CENTROID  */
+    IN = 649,                      /* IN  */
+    OUT = 650,                     /* OUT  */
+    INOUT = 651,                   /* INOUT  */
+    STRUCT = 652,                  /* STRUCT  */
+    VOID = 653,                    /* VOID  */
+    WHILE = 654,                   /* WHILE  */
+    BREAK = 655,                   /* BREAK  */
+    CONTINUE = 656,                /* CONTINUE  */
+    DO = 657,                      /* DO  */
+    ELSE = 658,                    /* ELSE  */
+    FOR = 659,                     /* FOR  */
+    IF = 660,                      /* IF  */
+    DISCARD = 661,                 /* DISCARD  */
+    RETURN = 662,                  /* RETURN  */
+    SWITCH = 663,                  /* SWITCH  */
+    CASE = 664,                    /* CASE  */
+    DEFAULT = 665,                 /* DEFAULT  */
+    TERMINATE_INVOCATION = 666,    /* TERMINATE_INVOCATION  */
+    TERMINATE_RAY = 667,           /* TERMINATE_RAY  */
+    IGNORE_INTERSECTION = 668,     /* IGNORE_INTERSECTION  */
+    UNIFORM = 669,                 /* UNIFORM  */
+    SHARED = 670,                  /* SHARED  */
+    BUFFER = 671,                  /* BUFFER  */
+    TILEIMAGEEXT = 672,            /* TILEIMAGEEXT  */
+    FLAT = 673,                    /* FLAT  */
+    SMOOTH = 674,                  /* SMOOTH  */
+    LAYOUT = 675,                  /* LAYOUT  */
+    DOUBLECONSTANT = 676,          /* DOUBLECONSTANT  */
+    INT16CONSTANT = 677,           /* INT16CONSTANT  */
+    UINT16CONSTANT = 678,          /* UINT16CONSTANT  */
+    FLOAT16CONSTANT = 679,         /* FLOAT16CONSTANT  */
+    INT32CONSTANT = 680,           /* INT32CONSTANT  */
+    UINT32CONSTANT = 681,          /* UINT32CONSTANT  */
+    INT64CONSTANT = 682,           /* INT64CONSTANT  */
+    UINT64CONSTANT = 683,          /* UINT64CONSTANT  */
+    SUBROUTINE = 684,              /* SUBROUTINE  */
+    DEMOTE = 685,                  /* DEMOTE  */
+    PAYLOADNV = 686,               /* PAYLOADNV  */
+    PAYLOADINNV = 687,             /* PAYLOADINNV  */
+    HITATTRNV = 688,               /* HITATTRNV  */
+    CALLDATANV = 689,              /* CALLDATANV  */
+    CALLDATAINNV = 690,            /* CALLDATAINNV  */
+    PAYLOADEXT = 691,              /* PAYLOADEXT  */
+    PAYLOADINEXT = 692,            /* PAYLOADINEXT  */
+    HITATTREXT = 693,              /* HITATTREXT  */
+    CALLDATAEXT = 694,             /* CALLDATAEXT  */
+    CALLDATAINEXT = 695,           /* CALLDATAINEXT  */
+    PATCH = 696,                   /* PATCH  */
+    SAMPLE = 697,                  /* SAMPLE  */
+    NONUNIFORM = 698,              /* NONUNIFORM  */
+    COHERENT = 699,                /* COHERENT  */
+    VOLATILE = 700,                /* VOLATILE  */
+    RESTRICT = 701,                /* RESTRICT  */
+    READONLY = 702,                /* READONLY  */
+    WRITEONLY = 703,               /* WRITEONLY  */
+    DEVICECOHERENT = 704,          /* DEVICECOHERENT  */
+    QUEUEFAMILYCOHERENT = 705,     /* QUEUEFAMILYCOHERENT  */
+    WORKGROUPCOHERENT = 706,       /* WORKGROUPCOHERENT  */
+    SUBGROUPCOHERENT = 707,        /* SUBGROUPCOHERENT  */
+    NONPRIVATE = 708,              /* NONPRIVATE  */
+    SHADERCALLCOHERENT = 709,      /* SHADERCALLCOHERENT  */
+    NOPERSPECTIVE = 710,           /* NOPERSPECTIVE  */
+    EXPLICITINTERPAMD = 711,       /* EXPLICITINTERPAMD  */
+    PERVERTEXEXT = 712,            /* PERVERTEXEXT  */
+    PERVERTEXNV = 713,             /* PERVERTEXNV  */
+    PERPRIMITIVENV = 714,          /* PERPRIMITIVENV  */
+    PERVIEWNV = 715,               /* PERVIEWNV  */
+    PERTASKNV = 716,               /* PERTASKNV  */
+    PERPRIMITIVEEXT = 717,         /* PERPRIMITIVEEXT  */
+    TASKPAYLOADWORKGROUPEXT = 718, /* TASKPAYLOADWORKGROUPEXT  */
+    PRECISE = 719                  /* PRECISE  */
   };
   typedef enum yytokentype yytoken_kind_t;
 #endif
@@ -559,10 +560,10 @@ union YYSTYPE
             glslang::TArraySizes* arraySizes;
             glslang::TIdentifierList* identifierList;
         };
-        glslang::TArraySizes* typeParameters;
+        glslang::TTypeParameters* typeParameters;
     } interm;
 
-#line 566 "MachineIndependent/glslang_tab.cpp.h"
+#line 567 "MachineIndependent/glslang_tab.cpp.h"
 
 };
 typedef union YYSTYPE YYSTYPE;
@@ -572,6 +573,8 @@ typedef union YYSTYPE YYSTYPE;
 
 
 
+
 int yyparse (glslang::TParseContext* pParseContext);
 
+
 #endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED  */

+ 8 - 12
3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp

@@ -36,8 +36,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if !defined(GLSLANG_WEB)
-
 #include "localintermediate.h"
 #include "../Include/InfoSink.h"
 
@@ -669,9 +667,7 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
 
     case EOpDeclare: out.debug << "Declare"; break;
 
-#ifndef GLSLANG_WEB
     case EOpSpirvInst: out.debug << "spirv_instruction"; break;
-#endif
 
     default: out.debug.message(EPrefixError, "Bad unary op");
     }
@@ -809,7 +805,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpConstructStruct:  out.debug << "Construct structure";  break;
     case EOpConstructTextureSampler: out.debug << "Construct combined texture-sampler"; break;
     case EOpConstructReference:  out.debug << "Construct reference";  break;
-    case EOpConstructCooperativeMatrix:  out.debug << "Construct cooperative matrix";  break;
+    case EOpConstructCooperativeMatrixNV:  out.debug << "Construct cooperative matrix NV";  break;
+    case EOpConstructCooperativeMatrixKHR:  out.debug << "Construct cooperative matrix KHR";  break;
     case EOpConstructAccStruct: out.debug << "Construct acceleration structure"; break;
 
     case EOpLessThan:         out.debug << "Compare Less Than";             break;
@@ -1103,9 +1100,12 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpRayQueryGetIntersectionWorldToObject:                          out.debug << "rayQueryGetIntersectionWorldToObjectEXT"; break;
     case EOpRayQueryGetIntersectionTriangleVertexPositionsEXT:             out.debug << "rayQueryGetIntersectionTriangleVertexPositionsEXT"; break;
 
-    case EOpCooperativeMatrixLoad:  out.debug << "Load cooperative matrix";  break;
-    case EOpCooperativeMatrixStore:  out.debug << "Store cooperative matrix";  break;
-    case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices"; break;
+    case EOpCooperativeMatrixLoad:  out.debug << "Load cooperative matrix KHR"; break;
+    case EOpCooperativeMatrixStore:  out.debug << "Store cooperative matrix KHR"; break;
+    case EOpCooperativeMatrixMulAdd: out.debug << "MulAdd cooperative matrices KHR"; break;
+    case EOpCooperativeMatrixLoadNV:  out.debug << "Load cooperative matrix NV"; break;
+    case EOpCooperativeMatrixStoreNV:  out.debug << "Store cooperative matrix NV"; break;
+    case EOpCooperativeMatrixMulAddNV: out.debug << "MulAdd cooperative matrices NV"; break;
 
     case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
     case EOpDebugPrintf:  out.debug << "Debug printf";  break;
@@ -1142,9 +1142,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpHitObjectGetShaderRecordBufferHandleNV: out.debug << "HitObjectReadShaderRecordBufferHandleNV"; break;
     case EOpReorderThreadNV: out.debug << "ReorderThreadNV"; break;
 
-#ifndef GLSLANG_WEB
     case EOpSpirvInst: out.debug << "spirv_instruction"; break;
-#endif
     case EOpStencilAttachmentReadEXT: out.debug << "stencilAttachmentReadEXT"; break;
     case EOpDepthAttachmentReadEXT: out.debug << "depthAttachmentReadEXT"; break;
 
@@ -1607,5 +1605,3 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
 }
 
 } // end namespace glslang
-
-#endif // !GLSLANG_WEB

+ 19 - 18
3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp

@@ -33,8 +33,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if !defined(GLSLANG_WEB)
-
 #include "../Include/Common.h"
 #include "../Include/InfoSink.h"
 #include "../Include/Types.h"
@@ -145,6 +143,8 @@ public:
             base->getWritableType().getQualifier().layoutComponent = at->second.newComponent;
         if (at->second.newIndex != -1)
             base->getWritableType().getQualifier().layoutIndex = at->second.newIndex;
+        if (at->second.upgradedToPushConstant)
+            base->getWritableType().getQualifier().layoutPushConstant = true;
     }
 
   private:
@@ -1670,31 +1670,34 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
                     }
                 }
             }
-            // If it's been upgraded to push_constant, then remove it from the uniformVector
+            // If it's been upgraded to push_constant, then set the flag so when its traversed
+            // in the next for loop, all references to this symbol will get their flag changed.
             // so it doesn't get a set/binding assigned to it.
             if (upgraded) {
-                while (1) {
-                    auto at = std::find_if(uniformVector.begin(), uniformVector.end(),
-                                           [this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; });
-                    if (at != uniformVector.end())
-                        uniformVector.erase(at);
-                    else
-                        break;
-                }
+                std::for_each(uniformVector.begin(), uniformVector.end(),
+                                       [this](TVarLivePair& p) {
+                if (p.first == autoPushConstantBlockName) {
+                        p.second.upgradedToPushConstant = true;
+                    }
+                });
             }
         }
         for (size_t stage = 0; stage < EShLangCount; stage++) {
             if (intermediates[stage] != nullptr) {
                 // traverse each stage, set new location to each input/output and unifom symbol, set new binding to
-                // ubo, ssbo and opaque symbols
+                // ubo, ssbo and opaque symbols. Assign push_constant upgrades as well.
                 TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap;
                 std::for_each(uniformVector.begin(), uniformVector.end(), [pUniformVarMap, stage](TVarLivePair p) {
                     auto at = pUniformVarMap[stage]->find(p.second.symbol->getAccessName());
                     if (at != pUniformVarMap[stage]->end() && at->second.id == p.second.id){
-                        int resolvedBinding = at->second.newBinding;
-                        at->second = p.second;
-                        if (resolvedBinding > 0)
-                            at->second.newBinding = resolvedBinding;
+                        if (p.second.upgradedToPushConstant) {
+                            at->second.upgradedToPushConstant = true;
+                        } else {
+                            int resolvedBinding = at->second.newBinding;
+                            at->second = p.second;
+                            if (resolvedBinding > 0)
+                                at->second.newBinding = resolvedBinding;
+                        }
                     }
                 });
                 TVarSetTraverser iter_iomap(*intermediates[stage], *inVarMaps[stage], *outVarMaps[stage],
@@ -1709,5 +1712,3 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
 }
 
 } // end namespace glslang
-
-#endif // !GLSLANG_WEB

+ 2 - 4
3rdparty/glslang/glslang/MachineIndependent/iomapper.h

@@ -33,8 +33,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if !defined(GLSLANG_WEB)
-
 #ifndef _IOMAPPER_INCLUDED
 #define _IOMAPPER_INCLUDED
 
@@ -55,6 +53,7 @@ struct TVarEntryInfo {
     long long id;
     TIntermSymbol* symbol;
     bool live;
+    bool upgradedToPushConstant;
     int newBinding;
     int newSet;
     int newLocation;
@@ -63,6 +62,7 @@ struct TVarEntryInfo {
     EShLanguage stage;
 
     void clearNewAssignments() {
+        upgradedToPushConstant = false;
         newBinding = -1;
         newSet = -1;
         newLocation = -1;
@@ -357,5 +357,3 @@ private:
 } // end namespace glslang
 
 #endif // _IOMAPPER_INCLUDED
-
-#endif // !GLSLANG_WEB

+ 0 - 2
3rdparty/glslang/glslang/MachineIndependent/limits.cpp

@@ -187,14 +187,12 @@ bool TIndexTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node)
 //
 void TParseContext::constantIndexExpressionCheck(TIntermNode* index)
 {
-#ifndef GLSLANG_WEB
     TIndexTraverser it(inductiveLoopIds);
 
     index->traverse(&it);
 
     if (it.bad)
         error(it.badLoc, "Non-constant-index-expression", "limitations", "");
-#endif
 }
 
 } // end namespace glslang

+ 31 - 58
3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp

@@ -57,13 +57,11 @@ namespace glslang {
 //
 void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
 {
-#ifndef GLSLANG_WEB
     infoSink.info.prefix(EPrefixError);
     if (unitStage < EShLangCount)
         infoSink.info << "Linking " << StageName(getStage()) << " and " << StageName(unitStage) << " stages: " << message << "\n";
     else
         infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
-#endif
 
     ++numErrors;
 }
@@ -71,13 +69,11 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage
 // Link-time warning.
 void TIntermediate::warn(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
 {
-#ifndef GLSLANG_WEB
     infoSink.info.prefix(EPrefixWarning);
     if (unitStage < EShLangCount)
         infoSink.info << "Linking " << StageName(language) << " and " << StageName(unitStage) << " stages: " << message << "\n";
     else
         infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
-#endif
 }
 
 // TODO: 4.4 offset/align:  "Two blocks linked together in the same program with the same block
@@ -89,11 +85,9 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message, EShLanguage u
 //
 void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
 {
-#if !defined(GLSLANG_WEB)
     mergeCallGraphs(infoSink, unit);
     mergeModes(infoSink, unit);
     mergeTrees(infoSink, unit);
-#endif
 }
 
 //
@@ -161,8 +155,6 @@ void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
     callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end());
 }
 
-#if !defined(GLSLANG_WEB)
-
 #define MERGE_MAX(member) member = std::max(member, unit.member)
 #define MERGE_TRUE(member) if (unit.member) member = unit.member;
 
@@ -381,8 +373,6 @@ void TIntermediate::mergeTrees(TInfoSink& infoSink, TIntermediate& unit)
     ioAccessed.insert(unit.ioAccessed.begin(), unit.ioAccessed.end());
 }
 
-#endif
-
 static const TString& getNameForIdMap(TIntermSymbol* symbol)
 {
     TShaderInterface si = symbol->getType().getShaderInterface();
@@ -859,7 +849,6 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
 //
 void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, EShLanguage unitStage)
 {
-#if !defined(GLSLANG_WEB)
     bool crossStage = getStage() != unitStage;
     bool writeTypeComparison = false;
     bool errorReported = false;
@@ -1187,7 +1176,6 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
           }
         }
     }
-#endif
 }
 
 void TIntermediate::sharedBlockCheck(TInfoSink& infoSink)
@@ -1234,7 +1222,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
     // overlap/alias/missing I/O, etc.
     inOutLocationCheck(infoSink);
 
-#ifndef GLSLANG_WEB
     if (getNumPushConstants() > 1)
         error(infoSink, "Only one push_constant block is allowed per stage");
 
@@ -1392,7 +1379,6 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
     } finalLinkTraverser;
 
     treeRoot->traverse(&finalLinkTraverser);
-#endif
 }
 
 //
@@ -1633,7 +1619,6 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
     typeCollision = false;
 
     int set;
-    int setRT;
     if (qualifier.isPipeInput())
         set = 0;
     else if (qualifier.isPipeOutput())
@@ -1645,11 +1630,11 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
     else if (qualifier.storage == EvqTileImageEXT)
         set = 4;
     else if (qualifier.isAnyPayload())
-        setRT = 0;
+        set = 0;
     else if (qualifier.isAnyCallable())
-        setRT = 1;
+        set = 1;
     else if (qualifier.isHitObjectAttrNV())
-        setRT = 2;
+        set = 2;
     else
         return -1;
 
@@ -1688,13 +1673,14 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
     // For raytracing IO (payloads and callabledata) each declaration occupies a single
     // slot irrespective of type.
     int collision = -1; // no collision
-#ifndef GLSLANG_WEB
     if (qualifier.isAnyPayload() || qualifier.isAnyCallable() || qualifier.isHitObjectAttrNV()) {
         TRange range(qualifier.layoutLocation, qualifier.layoutLocation);
-        collision = checkLocationRT(setRT, qualifier.layoutLocation);
+        collision = checkLocationRT(set, qualifier.layoutLocation);
         if (collision < 0)
-            usedIoRT[setRT].push_back(range);
-    } else if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
+            usedIoRT[set].push_back(range);
+        return collision;
+    }
+    if (size == 2 && type.getBasicType() == EbtDouble && type.getVectorSize() == 3 &&
         (qualifier.isPipeInput() || qualifier.isPipeOutput())) {
         // Dealing with dvec3 in/out split across two locations.
         // Need two io-ranges.
@@ -1720,34 +1706,33 @@ int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& typ
             if (collision < 0)
                 usedIo[set].push_back(range2);
         }
-    } else
-#endif
-    {
-        // Not a dvec3 in/out split across two locations, generic path.
-        // Need a single IO-range block.
+        return collision;
+    }
 
-        TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
-        TRange componentRange(0, 3);
-        if (qualifier.hasComponent() || type.getVectorSize() > 0) {
-            int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
-            if (qualifier.hasComponent())
-                componentRange.start = qualifier.layoutComponent;
-            componentRange.last  = componentRange.start + consumedComponents - 1;
-        }
+    // Not a dvec3 in/out split across two locations, generic path.
+    // Need a single IO-range block.
 
-        // combine location and component ranges
-        TBasicType basicTy = type.getBasicType();
-        if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())
-            basicTy = type.getSampler().type;
-        TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0);
+    TRange locationRange(qualifier.layoutLocation, qualifier.layoutLocation + size - 1);
+    TRange componentRange(0, 3);
+    if (qualifier.hasComponent() || type.getVectorSize() > 0) {
+        int consumedComponents = type.getVectorSize() * (type.getBasicType() == EbtDouble ? 2 : 1);
+        if (qualifier.hasComponent())
+            componentRange.start = qualifier.layoutComponent;
+        componentRange.last  = componentRange.start + consumedComponents - 1;
+    }
 
-        // check for collisions, except for vertex inputs on desktop targeting OpenGL
-        if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
-            collision = checkLocationRange(set, range, type, typeCollision);
+    // combine location and component ranges
+    TBasicType basicTy = type.getBasicType();
+    if (basicTy == EbtSampler && type.getSampler().isAttachmentEXT())
+        basicTy = type.getSampler().type;
+    TIoRange range(locationRange, componentRange, basicTy, qualifier.hasIndex() ? qualifier.getIndex() : 0);
 
-        if (collision < 0)
-            usedIo[set].push_back(range);
-    }
+    // check for collisions, except for vertex inputs on desktop targeting OpenGL
+    if (! (!isEsProfile() && language == EShLangVertex && qualifier.isPipeInput()) || spvVersion.vulkan > 0)
+        collision = checkLocationRange(set, range, type, typeCollision);
+
+    if (collision < 0)
+        usedIo[set].push_back(range);
 
     return collision;
 }
@@ -1846,10 +1831,8 @@ int TIntermediate::computeTypeLocationSize(const TType& type, EShLanguage stage)
         if (type.isSizedArray() && !type.getQualifier().isPerView())
             return type.getOuterArraySize() * computeTypeLocationSize(elementType, stage);
         else {
-#ifndef GLSLANG_WEB
             // unset perViewNV attributes for arrayed per-view outputs: "perviewNV vec4 v[MAX_VIEWS][3];"
             elementType.getQualifier().perViewNV = false;
-#endif
             return computeTypeLocationSize(elementType, stage);
         }
     }
@@ -1925,8 +1908,6 @@ int TIntermediate::computeTypeUniformLocationSize(const TType& type)
     return 1;
 }
 
-#ifndef GLSLANG_WEB
-
 // Accumulate xfb buffer ranges and check for collisions as the accumulation is done.
 //
 // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value.
@@ -2044,8 +2025,6 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
     }
 }
 
-#endif
-
 const int baseAlignmentVec4Std140 = 16;
 
 // Return the size and alignment of a component of the given type.
@@ -2053,10 +2032,6 @@ const int baseAlignmentVec4Std140 = 16;
 // Return value is the alignment..
 int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size)
 {
-#ifdef GLSLANG_WEB
-    size = 4; return 4;
-#endif
-
     switch (type.getBasicType()) {
     case EbtInt64:
     case EbtUint64:
@@ -2396,7 +2371,6 @@ int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
     return size;
 }
 
-#ifndef GLSLANG_WEB
 bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
     return type.isArray() &&
             ((language == EShLangGeometry    && type.getQualifier().storage == EvqVaryingIn) ||
@@ -2408,6 +2382,5 @@ bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
             (language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut &&
                 !type.getQualifier().perTaskNV));
 }
-#endif // not GLSLANG_WEB
 
 } // end namespace glslang

+ 1 - 50
3rdparty/glslang/glslang/MachineIndependent/localintermediate.h

@@ -147,7 +147,6 @@ struct TOffsetRange {
     TRange offset;
 };
 
-#ifndef GLSLANG_WEB
 // Things that need to be tracked per xfb buffer.
 struct TXfbBuffer {
     TXfbBuffer() : stride(TQualifier::layoutXfbStrideEnd), implicitStride(0), contains64BitType(false),
@@ -159,7 +158,6 @@ struct TXfbBuffer {
     bool contains32BitType;
     bool contains16BitType;
 };
-#endif
 
 // Track a set of strings describing how the module was processed.
 // This includes command line options, transforms, etc., ideally inclusive enough
@@ -311,9 +309,7 @@ public:
         atomicCounterBlockName(""),
         globalUniformBlockSet(TQualifier::layoutSetEnd),
         globalUniformBlockBinding(TQualifier::layoutBindingEnd),
-        atomicCounterBlockSet(TQualifier::layoutSetEnd)
-#ifndef GLSLANG_WEB
-        ,
+        atomicCounterBlockSet(TQualifier::layoutSetEnd),
         implicitThisName("@this"), implicitCounterName("@count"),
         source(EShSourceNone),
         useVulkanMemoryModel(false),
@@ -352,7 +348,6 @@ public:
         spirvRequirement(nullptr),
         spirvExecutionMode(nullptr),
         uniformLocationBase(0)
-#endif
     {
         localSize[0] = 1;
         localSize[1] = 1;
@@ -363,10 +358,8 @@ public:
         localSizeSpecId[0] = TQualifier::layoutNotSet;
         localSizeSpecId[1] = TQualifier::layoutNotSet;
         localSizeSpecId[2] = TQualifier::layoutNotSet;
-#ifndef GLSLANG_WEB
         xfbBuffers.resize(TQualifier::layoutXfbBufferEnd);
         shiftBinding.fill(0);
-#endif
     }
 
     void setVersion(int v)
@@ -636,38 +629,6 @@ public:
                localSizeSpecId[1] != TQualifier::layoutNotSet ||
                localSizeSpecId[2] != TQualifier::layoutNotSet;
     }
-#ifdef GLSLANG_WEB
-    void output(TInfoSink&, bool tree) { }
-
-    bool isEsProfile() const { return false; }
-    bool getXfbMode() const { return false; }
-    bool isMultiStream() const { return false; }
-    TLayoutGeometry getOutputPrimitive() const { return ElgNone; }
-    bool getNonCoherentColorAttachmentReadEXT() const { return false; }
-    bool getNonCoherentDepthAttachmentReadEXT() const { return false; }
-    bool getNonCoherentStencilAttachmentReadEXT() const { return false; }
-    bool getPostDepthCoverage() const { return false; }
-    bool getEarlyFragmentTests() const { return false; }
-    TLayoutDepth getDepth() const { return EldNone; }
-    bool getPixelCenterInteger() const { return false; }
-    void setOriginUpperLeft() { }
-    bool getOriginUpperLeft() const { return true; }
-    TInterlockOrdering getInterlockOrdering() const { return EioNone; }
-
-    bool getAutoMapBindings() const { return false; }
-    bool getAutoMapLocations() const { return false; }
-    int getNumPushConstants() const { return 0; }
-    void addShaderRecordCount() { }
-    void addTaskNVCount() { }
-    void addTaskPayloadEXTCount() { }
-    void setUseVulkanMemoryModel() { }
-    bool usingVulkanMemoryModel() const { return false; }
-    bool usingPhysicalStorageBuffer() const { return false; }
-    bool usingVariablePointers() const { return false; }
-    unsigned getXfbStride(int buffer) const { return 0; }
-    bool hasLayoutDerivativeModeNone() const { return false; }
-    ComputeDerivativeMode getLayoutDerivativeModeNone() const { return LayoutDerivativeNone; }
-#else
     void output(TInfoSink&, bool tree);
 
     bool isEsProfile() const { return profile == EEsProfile; }
@@ -1006,7 +967,6 @@ public:
     void insertSpirvExecutionModeId(int executionMode, const TIntermAggregate* args);
     bool hasSpirvExecutionMode() const { return spirvExecutionMode != nullptr; }
     const TSpirvExecutionMode& getSpirvExecutionMode() const { return *spirvExecutionMode; }
-#endif // GLSLANG_WEB
 
     void addBlockStorageOverride(const char* nameStr, TBlockStorageClass backing)
     {
@@ -1113,12 +1073,6 @@ public:
     void setUniqueId(unsigned long long id) { uniqueId = id; }
 
     // Certain explicit conversions are allowed conditionally
-#ifdef GLSLANG_WEB
-    bool getArithemeticInt8Enabled() const { return false; }
-    bool getArithemeticInt16Enabled() const { return false; }
-    bool getArithemeticFloat16Enabled() const { return false; }
-    void updateNumericFeature(TNumericFeatures::feature f, bool on) { }
-#else
     bool getArithemeticInt8Enabled() const {
         return numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types) ||
                numericFeatures.contains(TNumericFeatures::shader_explicit_arithmetic_types_int8);
@@ -1136,7 +1090,6 @@ public:
     }
     void updateNumericFeature(TNumericFeatures::feature f, bool on)
         { on ? numericFeatures.insert(f) : numericFeatures.erase(f); }
-#endif
 
 protected:
     TIntermSymbol* addSymbol(long long Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
@@ -1208,7 +1161,6 @@ protected:
     unsigned int globalUniformBlockBinding;
     unsigned int atomicCounterBlockSet;
 
-#ifndef GLSLANG_WEB
 public:
     const char* const implicitThisName;
     const char* const implicitCounterName;
@@ -1279,7 +1231,6 @@ protected:
     std::unordered_map<std::string, int> uniformLocationOverrides;
     int uniformLocationBase;
     TNumericFeatures numericFeatures;
-#endif
     std::unordered_map<std::string, TBlockStorageClass> blockBackingOverrides;
 
     std::unordered_set<int> usedConstantId; // specialization constant ids used

+ 5 - 65
3rdparty/glslang/glslang/MachineIndependent/parseVersions.h

@@ -58,10 +58,8 @@ public:
                    const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
                    bool forwardCompatible, EShMessages messages)
         :
-#if !defined(GLSLANG_WEB)
         forwardCompatible(forwardCompatible),
         profile(profile),
-#endif
         infoSink(infoSink), version(version), 
         language(language),
         spvVersion(spvVersion), 
@@ -69,54 +67,7 @@ public:
     virtual ~TParseVersions() { }
     void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc);
     void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc);
-#ifdef GLSLANG_WEB
-    const EProfile profile = EEsProfile;
-    bool isEsProfile() const { return true; }
-    void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc)
-    {
-        if (! (EEsProfile & profileMask))
-            error(loc, "not supported with this profile:", featureDesc, ProfileName(profile));
-    }
-    void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
-        const char* const extensions[], const char* featureDesc)
-    {
-        if ((EEsProfile & profileMask) && (minVersion == 0 || version < minVersion))
-            error(loc, "not supported for this version or the enabled extensions", featureDesc, "");
-    }
-    void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension,
-        const char* featureDesc)
-    {
-        profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc);
-    }
-    void initializeExtensionBehavior() { }
-    void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc) { }
-    void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc) { }
-    void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
-        const char* featureDesc) { }
-    void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[],
-        const char* featureDesc) { }
-    TExtensionBehavior getExtensionBehavior(const char*) { return EBhMissing; }
-    bool extensionTurnedOn(const char* const extension) { return false; }
-    bool extensionsTurnedOn(int numExtensions, const char* const extensions[]) { return false; }
-    void updateExtensionBehavior(int line, const char* const extension, const char* behavior) { }
-    void updateExtensionBehavior(const char* const extension, TExtensionBehavior) { }
-    void checkExtensionStage(const TSourceLoc&, const char* const extension) { }
-    void extensionRequires(const TSourceLoc&, const char* const extension, const char* behavior) { }
-    void fullIntegerCheck(const TSourceLoc&, const char* op) { }
-    void doubleCheck(const TSourceLoc&, const char* op) { }
-    bool float16Arithmetic() { return false; }
-    void requireFloat16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
-    bool int16Arithmetic() { return false; }
-    void requireInt16Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
-    bool int8Arithmetic() { return false; }
-    void requireInt8Arithmetic(const TSourceLoc& loc, const char* op, const char* featureDesc) { }
-    void int64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
-    void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
-    void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false) { }
-    bool relaxedErrors()    const { return false; }
-    bool suppressWarnings() const { return true; }
-    bool isForwardCompatible() const { return false; }
-#else
+
     bool forwardCompatible;      // true if errors are to be given for use of deprecated features
     EProfile profile;            // the declared profile in the shader (core by default)
     bool isEsProfile() const { return profile == EEsProfile; }
@@ -162,29 +113,19 @@ public:
     virtual void explicitInt32Check(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void explicitFloat32Check(const TSourceLoc&, const char* op, bool builtIn = false);
     virtual void explicitFloat64Check(const TSourceLoc&, const char* op, bool builtIn = false);
-    virtual void fcoopmatCheck(const TSourceLoc&, const char* op, bool builtIn = false);
-    virtual void intcoopmatCheck(const TSourceLoc&, const char *op, bool builtIn = false);
+    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);
     bool relaxedErrors()    const { return (messages & EShMsgRelaxedErrors) != 0; }
     bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; }
     bool isForwardCompatible() const { return forwardCompatible; }
-#endif // GLSLANG_WEB
+
     virtual void spvRemoved(const TSourceLoc&, const char* op);
     virtual void vulkanRemoved(const TSourceLoc&, const char* op);
     virtual void requireVulkan(const TSourceLoc&, const char* op);
     virtual void requireSpv(const TSourceLoc&, const char* op);
     virtual void requireSpv(const TSourceLoc&, const char *op, unsigned int version);
 
-
-#if defined(GLSLANG_WEB) && !defined(GLSLANG_WEB_DEVEL)
-    void C_DECL   error(const TSourceLoc&, const char* szReason, const char* szToken,
-                        const char* szExtraInfoFormat, ...) { addError(); }
-    void C_DECL    warn(const TSourceLoc&, const char* szReason, const char* szToken,
-                        const char* szExtraInfoFormat, ...) { }
-    void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken,
-                        const char* szExtraInfoFormat, ...) { addError(); }
-    void C_DECL  ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
-                        const char* szExtraInfoFormat, ...) { }
-#else
     virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
         const char* szExtraInfoFormat, ...) = 0;
     virtual void C_DECL  warn(const TSourceLoc&, const char* szReason, const char* szToken,
@@ -193,7 +134,6 @@ public:
         const char* szExtraInfoFormat, ...) = 0;
     virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
         const char* szExtraInfoFormat, ...) = 0;
-#endif
 
     void addError() { ++numErrors; }
     int getNumErrors() const { return numErrors; }

+ 1 - 6
3rdparty/glslang/glslang/MachineIndependent/preprocessor/Pp.cpp

@@ -736,7 +736,6 @@ int TPpContext::CPPline(TPpToken* ppToken)
         parseContext.setCurrentLine(lineRes);
 
         if (token != '\n') {
-#ifndef GLSLANG_WEB
             if (token == PpAtomConstString) {
                 parseContext.ppRequireExtensions(directiveLoc, 1, &E_GL_GOOGLE_cpp_style_line_directive, "filename-based #line");
                 // We need to save a copy of the string instead of pointing
@@ -746,9 +745,7 @@ int TPpContext::CPPline(TPpToken* ppToken)
                 parseContext.setCurrentSourceName(sourceName);
                 hasFile = true;
                 token = scanToken(ppToken);
-            } else
-#endif
-            {
+            } else {
                 token = eval(token, MIN_PRECEDENCE, false, fileRes, fileErr, ppToken);
                 if (! fileErr) {
                     parseContext.setCurrentString(fileRes);
@@ -974,7 +971,6 @@ int TPpContext::readCPPline(TPpToken* ppToken)
         case PpAtomLine:
             token = CPPline(ppToken);
             break;
-#ifndef GLSLANG_WEB
         case PpAtomInclude:
             if(!parseContext.isReadingHLSL()) {
                 parseContext.ppRequireExtensions(ppToken->loc, 1, &E_GL_GOOGLE_include_directive, "#include");
@@ -984,7 +980,6 @@ int TPpContext::readCPPline(TPpToken* ppToken)
         case PpAtomPragma:
             token = CPPpragma(ppToken);
             break;
-#endif
         case PpAtomUndef:
             token = CPPundef(ppToken);
             break;

+ 104 - 11
3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp

@@ -3,6 +3,7 @@
 // Copyright (C) 2013 LunarG, Inc.
 // Copyright (C) 2017 ARM Limited.
 // Copyright (C) 2015-2018 Google, Inc.
+// Copyright (c) 2023, Mobica Limited
 //
 // All rights reserved.
 //
@@ -259,7 +260,6 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
     // Suffix:
     bool isDouble = false;
     bool isFloat16 = false;
-#ifndef GLSLANG_WEB
     if (ch == 'l' || ch == 'L') {
         if (ifdepth == 0 && parseContext.intermediate.getSource() == EShSourceGlsl)
             parseContext.doubleCheck(ppToken->loc, "double floating-point suffix");
@@ -299,14 +299,11 @@ int TPpContext::lFloatConst(int len, int ch, TPpToken* ppToken)
             isFloat16 = true;
         }
     } else
-#endif
     if (ch == 'f' || ch == 'F') {
-#ifndef GLSLANG_WEB
         if (ifdepth == 0)
             parseContext.profileRequires(ppToken->loc,  EEsProfile, 300, nullptr, "floating-point suffix");
         if (ifdepth == 0 && !parseContext.relaxedErrors())
             parseContext.profileRequires(ppToken->loc, ~EEsProfile, 120, nullptr, "floating-point suffix");
-#endif
         if (ifdepth == 0 && !hasDecimalOrExponent)
             parseContext.ppError(ppToken->loc, "float literal needs a decimal point or exponent", "", "");
         saveName(ch);
@@ -549,7 +546,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
 
                     ival = 0;
                     do {
-                        if (len < MaxTokenLength && ival <= 0x0fffffffffffffffull) {
+                        if (len < MaxTokenLength && ival <= 0x7fffffffffffffffull) {
                             ppToken->name[len++] = (char)ch;
                             if (ch >= '0' && ch <= '9') {
                                 ii = ch - '0';
@@ -582,7 +579,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                         ppToken->name[len++] = (char)ch;
                     isUnsigned = true;
 
-#ifndef GLSLANG_WEB
                     int nextCh = getch();
                     if (nextCh == 'l' || nextCh == 'L') {
                         if (len < MaxTokenLength)
@@ -608,7 +604,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                     if (len < MaxTokenLength)
                         ppToken->name[len++] = (char)ch;
                     isInt16 = true;
-#endif
                 } else
                     ungetch();
                 ppToken->name[len] = '\0';
@@ -639,6 +634,108 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                     ppToken->ival = (int)ival;
                     return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
                 }
+            } else if ((ch == 'b' || ch == 'B') && pp->parseContext.intermediate.getSource() == EShSourceHlsl) {
+                // must be binary
+                bool isUnsigned = false;
+                bool isInt64 = false;
+                bool isInt16 = false;
+                ppToken->name[len++] = (char)ch;
+                ch = getch();
+
+                // Check value
+                if ((ch == '0' || ch == '1'))
+                {
+                    ival = 0;
+                    do {
+                        if (len < MaxTokenLength && ival <= 0x7fffffffffffffffull) {
+                            ppToken->name[len++] = (char)ch;
+                            if (ch == '0' || ch == '1') {
+                                ii = ch - '0';
+                            } else {
+                                pp->parseContext.ppError(ppToken->loc, "bad digit in binary literal", "", "");
+                            }
+                            ival = (ival << 1) | ii;
+                        }
+                        else
+                        {
+                            if (! AlreadyComplained) {
+                                if(len < MaxTokenLength)
+                                    pp->parseContext.ppError(ppToken->loc, "binary literal too big", "", "");
+                                else
+                                    pp->parseContext.ppError(ppToken->loc, "binary literal too long", "", "");
+                                AlreadyComplained = 1;
+                            }
+                            ival = 0xffffffffffffffffull;
+                        }
+                        ch = getch();
+                    } while (ch == '0' || ch == '1');
+                }
+                else
+                {
+                   pp->parseContext.ppError(ppToken->loc, "bad digit in binary literal", "", "");
+                }
+
+                // check type
+                if (ch == 'u' || ch == 'U') {
+                    if (len < MaxTokenLength)
+                        ppToken->name[len++] = (char)ch;
+                    isUnsigned = true;
+
+                    int nextCh = getch();
+                    if (nextCh == 'l' || nextCh == 'L') {
+                        if (len < MaxTokenLength)
+                            ppToken->name[len++] = (char)nextCh;
+                        isInt64 = true;
+                    } else
+                        ungetch();
+
+                    nextCh = getch();
+                    if ((nextCh == 's' || nextCh == 'S') &&
+                                pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
+                        if (len < MaxTokenLength)
+                            ppToken->name[len++] = (char)nextCh;
+                        isInt16 = true;
+                    } else
+                        ungetch();
+                } else if (ch == 'l' || ch == 'L') {
+                    if (len < MaxTokenLength)
+                        ppToken->name[len++] = (char)ch;
+                    isInt64 = true;
+                } else if ((ch == 's' || ch == 'S') &&
+                                pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
+                    if (len < MaxTokenLength)
+                        ppToken->name[len++] = (char)ch;
+                    isInt16 = true;
+                } else {
+                    ungetch();
+                }
+                ppToken->name[len] = '\0';
+
+                // Assign value
+                if (isInt64 && pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
+                    if (pp->ifdepth == 0) {
+                        pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
+                                                        "64-bit binary literal");
+                        pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
+                            Num_Int64_Extensions, Int64_Extensions, "64-bit binary literal");
+                    }
+                    ppToken->i64val = ival;
+                    return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64;
+                } else if (isInt16) {
+                    if (pp->ifdepth == 0) {
+                        if (pp->parseContext.intermediate.getSource() == EShSourceGlsl) {
+                            pp->parseContext.requireProfile(ppToken->loc, ~EEsProfile,
+                                                            "16-bit binary literal");
+                            pp->parseContext.profileRequires(ppToken->loc, ~EEsProfile, 0,
+                                Num_Int16_Extensions, Int16_Extensions, "16-bit binary literal");
+                        }
+                    }
+                    ppToken->ival = (int)ival;
+                    return isUnsigned ? PpAtomConstUint16 : PpAtomConstInt16;
+                } else {
+                    ppToken->ival = (int)ival;
+                    return isUnsigned ? PpAtomConstUint : PpAtomConstInt;
+                }
             } else {
                 // could be octal integer or floating point, speculative pursue octal until it must be floating point
 
@@ -690,7 +787,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                         ppToken->name[len++] = (char)ch;
                     isUnsigned = true;
 
-#ifndef GLSLANG_WEB
                     int nextCh = getch();
                     if (nextCh == 'l' || nextCh == 'L') {
                         if (len < MaxTokenLength)
@@ -716,7 +812,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                     if (len < MaxTokenLength)
                         ppToken->name[len++] = (char)ch;
                     isInt16 = true;
-#endif
                 } else
                     ungetch();
                 ppToken->name[len] = '\0';
@@ -779,7 +874,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                         ppToken->name[len++] = (char)ch;
                     isUnsigned = true;
 
-#ifndef GLSLANG_WEB
                     int nextCh = getch();
                     if (nextCh == 'l' || nextCh == 'L') {
                         if (len < MaxTokenLength)
@@ -805,7 +899,6 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken)
                     if (len < MaxTokenLength)
                         ppToken->name[len++] = (char)ch;
                     isInt16 = true;
-#endif
                 } else
                     ungetch();
 

+ 0 - 2
3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp

@@ -113,7 +113,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
     int atom = stream[currentPos++].get(*ppToken);
     ppToken->loc = parseContext.getCurrentLoc();
 
-#ifndef GLSLANG_WEB
     // Check for ##, unless the current # is the last character
     if (atom == '#') {
         if (peekToken('#')) {
@@ -123,7 +122,6 @@ int TPpContext::TokenStream::getToken(TParseContextBase& parseContext, TPpToken
             atom = PpAtomPaste;
         }
     }
-#endif
 
     return atom;
 }

+ 1 - 5
3rdparty/glslang/glslang/MachineIndependent/propagateNoContraction.cpp

@@ -37,8 +37,6 @@
 // propagate the 'noContraction' qualifier.
 //
 
-#ifndef GLSLANG_WEB
-
 #include "propagateNoContraction.h"
 
 #include <cstdlib>
@@ -865,6 +863,4 @@ void PropagateNoContraction(const glslang::TIntermediate& intermediate)
         precise_object_accesschains.erase(precise_object_accesschain);
     }
 }
-};
-
-#endif // GLSLANG_WEB
+}

+ 0 - 4
3rdparty/glslang/glslang/MachineIndependent/reflection.cpp

@@ -33,8 +33,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if !defined(GLSLANG_WEB)
-
 #include "../Include/Common.h"
 #include "reflection.h"
 #include "LiveTraverser.h"
@@ -1270,5 +1268,3 @@ void TReflection::dump()
 }
 
 } // end namespace glslang
-
-#endif // !GLSLANG_WEB

+ 0 - 4
3rdparty/glslang/glslang/MachineIndependent/reflection.h

@@ -33,8 +33,6 @@
 // POSSIBILITY OF SUCH DAMAGE.
 //
 
-#if !defined(GLSLANG_WEB)
-
 #ifndef _REFLECTION_INCLUDED
 #define _REFLECTION_INCLUDED
 
@@ -219,5 +217,3 @@ protected:
 } // end namespace glslang
 
 #endif // _REFLECTION_INCLUDED
-
-#endif // !GLSLANG_WEB

+ 0 - 70
3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp

@@ -52,76 +52,6 @@
 
 namespace glslang {
 
-//
-// Thread cleanup
-//
-
-//
-// Thread Local Storage Operations
-//
-inline OS_TLSIndex PthreadKeyToTLSIndex(pthread_key_t key)
-{
-    return (OS_TLSIndex)((uintptr_t)key + 1);
-}
-
-inline pthread_key_t TLSIndexToPthreadKey(OS_TLSIndex nIndex)
-{
-    return (pthread_key_t)((uintptr_t)nIndex - 1);
-}
-
-OS_TLSIndex OS_AllocTLSIndex()
-{
-    pthread_key_t pPoolIndex;
-
-    //
-    // Create global pool key.
-    //
-    if ((pthread_key_create(&pPoolIndex, nullptr)) != 0) {
-        assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
-        return OS_INVALID_TLS_INDEX;
-    }
-    else
-        return PthreadKeyToTLSIndex(pPoolIndex);
-}
-
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
-{
-    if (nIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
-        return false;
-    }
-
-    if (pthread_setspecific(TLSIndexToPthreadKey(nIndex), lpvValue) == 0)
-        return true;
-    else
-        return false;
-}
-
-void* OS_GetTLSValue(OS_TLSIndex nIndex)
-{
-    //
-    // This function should return 0 if nIndex is invalid.
-    //
-    assert(nIndex != OS_INVALID_TLS_INDEX);
-    return pthread_getspecific(TLSIndexToPthreadKey(nIndex));
-}
-
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
-{
-    if (nIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
-        return false;
-    }
-
-    //
-    // Delete the global pool key.
-    //
-    if (pthread_key_delete(TLSIndexToPthreadKey(nIndex)) == 0)
-        return true;
-    else
-        return false;
-}
-
 namespace {
     pthread_mutex_t gMutex;
 }

+ 0 - 56
3rdparty/glslang/glslang/OSDependent/Windows/ossource.cpp

@@ -53,62 +53,6 @@
 
 namespace glslang {
 
-inline OS_TLSIndex ToGenericTLSIndex (DWORD handle)
-{
-    return (OS_TLSIndex)((uintptr_t)handle + 1);
-}
-
-inline DWORD ToNativeTLSIndex (OS_TLSIndex nIndex)
-{
-    return (DWORD)((uintptr_t)nIndex - 1);
-}
-
-//
-// Thread Local Storage Operations
-//
-OS_TLSIndex OS_AllocTLSIndex()
-{
-    DWORD dwIndex = TlsAlloc();
-    if (dwIndex == TLS_OUT_OF_INDEXES) {
-        assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
-        return OS_INVALID_TLS_INDEX;
-    }
-
-    return ToGenericTLSIndex(dwIndex);
-}
-
-bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
-{
-    if (nIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
-        return false;
-    }
-
-    if (TlsSetValue(ToNativeTLSIndex(nIndex), lpvValue))
-        return true;
-    else
-        return false;
-}
-
-void* OS_GetTLSValue(OS_TLSIndex nIndex)
-{
-    assert(nIndex != OS_INVALID_TLS_INDEX);
-    return TlsGetValue(ToNativeTLSIndex(nIndex));
-}
-
-bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
-{
-    if (nIndex == OS_INVALID_TLS_INDEX) {
-        assert(0 && "OS_SetTLSValue(): Invalid TLS Index");
-        return false;
-    }
-
-    if (TlsFree(ToNativeTLSIndex(nIndex)))
-        return true;
-    else
-        return false;
-}
-
 HANDLE GlobalLock;
 
 void InitGlobalLock()

+ 0 - 11
3rdparty/glslang/glslang/OSDependent/osinclude.h

@@ -37,17 +37,6 @@
 
 namespace glslang {
 
-//
-// Thread Local Storage Operations
-//
-typedef void* OS_TLSIndex;
-#define OS_INVALID_TLS_INDEX nullptr
-
-OS_TLSIndex OS_AllocTLSIndex();
-bool        OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
-bool        OS_FreeTLSIndex(OS_TLSIndex nIndex);
-void*       OS_GetTLSValue(OS_TLSIndex nIndex);
-
 void InitGlobalLock();
 void GetGlobalLock();
 void ReleaseGlobalLock();

+ 0 - 9
3rdparty/glslang/glslang/Public/ShaderLang.h

@@ -728,8 +728,6 @@ private:
     TShader& operator=(TShader&);
 };
 
-#if !defined(GLSLANG_WEB)
-
 //
 // A reflection database and its interface, consistent with the OpenGL API reflection queries.
 //
@@ -846,8 +844,6 @@ public:
     virtual void addStage(EShLanguage stage, TIntermediate& stageIntermediate) = 0;
 };
 
-#endif // !GLSLANG_WEB
-
 // Make one TProgram per set of shaders that will get linked together.  Add all
 // the shaders that are to be linked together.  After calling shader.parse()
 // for all shaders, call link().
@@ -867,8 +863,6 @@ public:
 
     TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
 
-#if !defined(GLSLANG_WEB)
-
     // Reflection Interface
 
     // call first, to do liveness analysis, index mapping, etc.; returns false on failure
@@ -961,7 +955,6 @@ public:
     // 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);
-#endif // !GLSLANG_WEB
 
 protected:
     GLSLANG_EXPORT bool linkStage(EShLanguage, EShMessages);
@@ -972,9 +965,7 @@ protected:
     TIntermediate* intermediate[EShLangCount];
     bool newedIntermediate[EShLangCount];      // track which intermediate were "new" versus reusing a singleton unit in a stage
     TInfoSink* infoSink;
-#if !defined(GLSLANG_WEB)
     TReflection* reflection;
-#endif
     bool linked;
 
 private:

+ 1 - 14
3rdparty/glslang/glslang/updateGrammar

@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # Copyright (C) 2020 The Khronos Group Inc.
 #
@@ -33,17 +33,4 @@
 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-if [ "$1" = 'web' ]
-then
-    m4 -P -DGLSLANG_WEB MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
-elif [ "$#" -eq 0 ]
-then
-    m4 -P MachineIndependent/glslang.m4 > MachineIndependent/glslang.y
-else
-    echo usage:
-    echo $0 web
-    echo $0
-    exit
-fi
-
 bison --defines=MachineIndependent/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o MachineIndependent/glslang_tab.cpp

Some files were not shown because too many files changed in this diff