Browse Source

Update glslang

Alex Szpakowski 3 years ago
parent
commit
be6736cba5
48 changed files with 5660 additions and 3380 deletions
  1. 2 1
      CMakeLists.txt
  2. 17 11
      platform/xcode/liblove.xcodeproj/project.pbxproj
  3. 2 0
      src/libraries/glslang/SPIRV/GLSL.ext.EXT.h
  4. 1 0
      src/libraries/glslang/SPIRV/GLSL.ext.KHR.h
  5. 3 0
      src/libraries/glslang/SPIRV/GLSL.ext.NV.h
  6. 508 48
      src/libraries/glslang/SPIRV/GlslangToSpv.cpp
  7. 3 0
      src/libraries/glslang/SPIRV/SPVRemapper.cpp
  8. 104 27
      src/libraries/glslang/SPIRV/SpvBuilder.cpp
  9. 2 0
      src/libraries/glslang/SPIRV/SpvBuilder.h
  10. 26 13
      src/libraries/glslang/SPIRV/SpvPostProcess.cpp
  11. 21 0
      src/libraries/glslang/SPIRV/SpvTools.cpp
  12. 40 0
      src/libraries/glslang/SPIRV/doc.cpp
  13. 2314 2293
      src/libraries/glslang/SPIRV/spirv.hpp
  14. 12 0
      src/libraries/glslang/glslang/Include/BaseTypes.h
  15. 51 2
      src/libraries/glslang/glslang/Include/Common.h
  16. 2 0
      src/libraries/glslang/glslang/Include/PoolAlloc.h
  17. 128 0
      src/libraries/glslang/glslang/Include/SpirvIntrinsics.h
  18. 136 6
      src/libraries/glslang/glslang/Include/Types.h
  19. 4 0
      src/libraries/glslang/glslang/Include/glslang_c_interface.h
  20. 22 1
      src/libraries/glslang/glslang/Include/glslang_c_shader_types.h
  21. 22 0
      src/libraries/glslang/glslang/Include/intermediate.h
  22. 0 3
      src/libraries/glslang/glslang/Include/revision.h
  23. 8 32
      src/libraries/glslang/glslang/MachineIndependent/Constant.cpp
  24. 408 156
      src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp
  25. 49 17
      src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp
  26. 13 0
      src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp
  27. 278 38
      src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp
  28. 17 0
      src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h
  29. 27 0
      src/libraries/glslang/glslang/MachineIndependent/Scan.cpp
  30. 6 3
      src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp
  31. 350 0
      src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
  32. 30 3
      src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp
  33. 41 3
      src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h
  34. 44 3
      src/libraries/glslang/glslang/MachineIndependent/Versions.cpp
  35. 7 0
      src/libraries/glslang/glslang/MachineIndependent/Versions.h
  36. 25 0
      src/libraries/glslang/glslang/MachineIndependent/attribute.cpp
  37. 2 1
      src/libraries/glslang/glslang/MachineIndependent/attribute.h
  38. 592 503
      src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp
  39. 142 129
      src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
  40. 12 31
      src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp
  41. 69 19
      src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp
  42. 16 2
      src/libraries/glslang/glslang/MachineIndependent/iomapper.h
  43. 26 8
      src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp
  44. 42 1
      src/libraries/glslang/glslang/MachineIndependent/localintermediate.h
  45. 18 19
      src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp
  46. 5 3
      src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp
  47. 7 1
      src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp
  48. 6 3
      src/libraries/glslang/glslang/Public/ShaderLang.h

+ 2 - 1
CMakeLists.txt

@@ -1246,8 +1246,8 @@ set(LOVE_SRC_3P_GLSLANG_GLSLANG_INCLUDE
 	src/libraries/glslang/glslang/Include/intermediate.h
 	src/libraries/glslang/glslang/Include/PoolAlloc.h
 	src/libraries/glslang/glslang/Include/ResourceLimits.h
-	src/libraries/glslang/glslang/Include/revision.h
 	src/libraries/glslang/glslang/Include/ShHandle.h
+	src/libraries/glslang/glslang/Include/SpirvIntrinsics.h
 	src/libraries/glslang/glslang/Include/Types.h
 )
 
@@ -1298,6 +1298,7 @@ set(LOVE_SRC_3P_GLSLANG_GLSLANG_MACHINEINDEPENDENT
 	src/libraries/glslang/glslang/MachineIndependent/Scan.h
 	src/libraries/glslang/glslang/MachineIndependent/ScanContext.h
 	src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp
+	src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
 	src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp
 	src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h
 	src/libraries/glslang/glslang/MachineIndependent/Versions.cpp

+ 17 - 11
platform/xcode/liblove.xcodeproj/project.pbxproj

@@ -626,6 +626,9 @@
 		FA15DFB01F9B8D6A0042AB22 /* wrap_Data.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA6A2B651F5F7B6B0074C308 /* wrap_Data.cpp */; };
 		FA15DFB11F9B8D820042AB22 /* OggDemuxer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAA54AC91F91660400A8FA7B /* OggDemuxer.cpp */; };
 		FA15DFB21F9B8D840042AB22 /* TheoraVideoStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAA54AC81F91660400A8FA7B /* TheoraVideoStream.cpp */; };
+		FA18CEC523D3AE6700263725 /* wrap_Buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */; };
+		FA18CEC623D3AE6800263725 /* wrap_Buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */; };
+		FA18CEC723D3AE6800263725 /* wrap_Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEC423D3AE6700263725 /* wrap_Buffer.h */; };
 		FA18CED723DBC6E000263725 /* Shader.h in Headers */ = {isa = PBXBuildFile; fileRef = FA18CECD23DBC6E000263725 /* Shader.h */; };
 		FA18CED823DBC6E000263725 /* StreamBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA18CECE23DBC6E000263725 /* StreamBuffer.mm */; };
 		FA18CED923DBC6E000263725 /* StreamBuffer.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA18CECE23DBC6E000263725 /* StreamBuffer.mm */; };
@@ -652,7 +655,6 @@
 		FA18CF1C23DCF67900263725 /* internal_interface.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEF923DCF67800263725 /* internal_interface.hpp */; };
 		FA18CF1D23DCF67900263725 /* sampler.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEFA23DCF67800263725 /* sampler.hpp */; };
 		FA18CF1E23DCF67900263725 /* external_interface.h in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEFB23DCF67800263725 /* external_interface.h */; };
-		FA18CF1F23DCF67900263725 /* image.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEFC23DCF67800263725 /* image.hpp */; };
 		FA18CF2023DCF67900263725 /* spirv_hlsl.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEFD23DCF67800263725 /* spirv_hlsl.hpp */; };
 		FA18CF2123DCF67900263725 /* spirv.hpp in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEFE23DCF67800263725 /* spirv.hpp */; };
 		FA18CF2223DCF67900263725 /* spirv_cfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA18CEFF23DCF67800263725 /* spirv_cfg.cpp */; };
@@ -691,9 +693,6 @@
 		FA18CF4523DD1A8100263725 /* ShaderStage.h in Headers */ = {isa = PBXBuildFile; fileRef = FA18CF4323DD1A8000263725 /* ShaderStage.h */; };
 		FA18CF4623DD1A8100263725 /* ShaderStage.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA18CF4423DD1A8000263725 /* ShaderStage.mm */; };
 		FA18CF4723DD1A8100263725 /* ShaderStage.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA18CF4423DD1A8000263725 /* ShaderStage.mm */; };
-		FA18CEC523D3AE6700263725 /* wrap_Buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */; };
-		FA18CEC623D3AE6800263725 /* wrap_Buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */; };
-		FA18CEC723D3AE6800263725 /* wrap_Buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = FA18CEC423D3AE6700263725 /* wrap_Buffer.h */; };
 		FA1BA09D1E16CFCE00AA2803 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA1BA09B1E16CFCE00AA2803 /* Font.cpp */; };
 		FA1BA09E1E16CFCE00AA2803 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA1BA09B1E16CFCE00AA2803 /* Font.cpp */; };
 		FA1BA09F1E16CFCE00AA2803 /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = FA1BA09C1E16CFCE00AA2803 /* Font.h */; };
@@ -836,6 +835,8 @@
 		FA76344A1E28722A0066EF9E /* StreamBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7634481E28722A0066EF9E /* StreamBuffer.cpp */; };
 		FA76344B1E28722A0066EF9E /* StreamBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7634481E28722A0066EF9E /* StreamBuffer.cpp */; };
 		FA76344C1E28722A0066EF9E /* StreamBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7634491E28722A0066EF9E /* StreamBuffer.h */; };
+		FA84DE612778D7F3002674C6 /* SpirvIntrinsics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA84DE602778D7F3002674C6 /* SpirvIntrinsics.cpp */; };
+		FA84DE622778D7F3002674C6 /* SpirvIntrinsics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA84DE602778D7F3002674C6 /* SpirvIntrinsics.cpp */; };
 		FA8951A21AA2EDF300EC385A /* wrap_Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */; };
 		FA8951A31AA2EDF300EC385A /* wrap_Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */; };
 		FA8951A41AA2EDF300EC385A /* wrap_Event.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8951A11AA2EDF300EC385A /* wrap_Event.h */; };
@@ -963,7 +964,6 @@
 		FABDA9C22552448300B5C523 /* b2_rope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FABDA9432552448200B5C523 /* b2_rope.cpp */; };
 		FABDA9C32552448300B5C523 /* b2_settings.h in Headers */ = {isa = PBXBuildFile; fileRef = FABDA9442552448200B5C523 /* b2_settings.h */; };
 		FABDA9C42552448300B5C523 /* b2_revolute_joint.h in Headers */ = {isa = PBXBuildFile; fileRef = FABDA9452552448200B5C523 /* b2_revolute_joint.h */; };
-		FABDA9C52552448300B5C523 /* README.MODIFIED in Resources */ = {isa = PBXBuildFile; fileRef = FABDA9462552448200B5C523 /* README.MODIFIED */; };
 		FABDA9C62552448300B5C523 /* b2_rope.h in Headers */ = {isa = PBXBuildFile; fileRef = FABDA9472552448200B5C523 /* b2_rope.h */; };
 		FABDA9C72552448300B5C523 /* b2_distance_joint.h in Headers */ = {isa = PBXBuildFile; fileRef = FABDA9482552448200B5C523 /* b2_distance_joint.h */; };
 		FABDA9C82552448300B5C523 /* b2_body.h in Headers */ = {isa = PBXBuildFile; fileRef = FABDA9492552448200B5C523 /* b2_body.h */; };
@@ -1172,7 +1172,6 @@
 		FAF1405D1E20934C00F898D2 /* intermediate.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FCB1E20934C00F898D2 /* intermediate.h */; };
 		FAF1405E1E20934C00F898D2 /* PoolAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FCC1E20934C00F898D2 /* PoolAlloc.h */; };
 		FAF1405F1E20934C00F898D2 /* ResourceLimits.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FCD1E20934C00F898D2 /* ResourceLimits.h */; };
-		FAF140601E20934C00F898D2 /* revision.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FCE1E20934C00F898D2 /* revision.h */; };
 		FAF140621E20934C00F898D2 /* ShHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FD01E20934C00F898D2 /* ShHandle.h */; };
 		FAF140631E20934C00F898D2 /* Types.h in Headers */ = {isa = PBXBuildFile; fileRef = FAF13FD11E20934C00F898D2 /* Types.h */; };
 		FAF140641E20934C00F898D2 /* Constant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAF13FD31E20934C00F898D2 /* Constant.cpp */; };
@@ -1746,6 +1745,8 @@
 		FA1557C11CE90BD200AFF582 /* EXRHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXRHandler.cpp; sourceTree = "<group>"; };
 		FA1557C21CE90BD200AFF582 /* EXRHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXRHandler.h; sourceTree = "<group>"; };
 		FA15DFAB1F9B8C850042AB22 /* StringMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringMap.cpp; sourceTree = "<group>"; };
+		FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Buffer.cpp; sourceTree = "<group>"; };
+		FA18CEC423D3AE6700263725 /* wrap_Buffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrap_Buffer.h; sourceTree = "<group>"; };
 		FA18CECD23DBC6E000263725 /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = "<group>"; };
 		FA18CECE23DBC6E000263725 /* StreamBuffer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StreamBuffer.mm; sourceTree = "<group>"; };
 		FA18CED023DBC6E000263725 /* Metal.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Metal.mm; sourceTree = "<group>"; };
@@ -1795,8 +1796,6 @@
 		FA18CF1523DCF67800263725 /* spirv_glsl.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = spirv_glsl.hpp; sourceTree = "<group>"; };
 		FA18CF4323DD1A8000263725 /* ShaderStage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShaderStage.h; sourceTree = "<group>"; };
 		FA18CF4423DD1A8000263725 /* ShaderStage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShaderStage.mm; sourceTree = "<group>"; };
-		FA18CEC323D3AE6700263725 /* wrap_Buffer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Buffer.cpp; sourceTree = "<group>"; };
-		FA18CEC423D3AE6700263725 /* wrap_Buffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = wrap_Buffer.h; sourceTree = "<group>"; };
 		FA1BA09B1E16CFCE00AA2803 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Font.cpp; sourceTree = "<group>"; };
 		FA1BA09C1E16CFCE00AA2803 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Font.h; sourceTree = "<group>"; };
 		FA1BA0A01E16D97500AA2803 /* wrap_Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Font.cpp; sourceTree = "<group>"; };
@@ -1899,6 +1898,10 @@
 		FA7634481E28722A0066EF9E /* StreamBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamBuffer.cpp; sourceTree = "<group>"; };
 		FA7634491E28722A0066EF9E /* StreamBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamBuffer.h; sourceTree = "<group>"; };
 		FA7DA04C1C16874A0056B200 /* wrap_Math.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = wrap_Math.lua; sourceTree = "<group>"; };
+		FA84DE5D2778D7DB002674C6 /* SpirvIntrinsics.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpirvIntrinsics.h; sourceTree = "<group>"; };
+		FA84DE5E2778D7DC002674C6 /* glslang_c_interface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = glslang_c_interface.h; sourceTree = "<group>"; };
+		FA84DE5F2778D7DC002674C6 /* glslang_c_shader_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = glslang_c_shader_types.h; sourceTree = "<group>"; };
+		FA84DE602778D7F3002674C6 /* SpirvIntrinsics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpirvIntrinsics.cpp; sourceTree = "<group>"; };
 		FA8951A01AA2EDF300EC385A /* wrap_Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Event.cpp; sourceTree = "<group>"; };
 		FA8951A11AA2EDF300EC385A /* wrap_Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Event.h; sourceTree = "<group>"; };
 		FA91DA891F377C3900C80E33 /* deprecation.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = deprecation.cpp; sourceTree = "<group>"; };
@@ -2134,7 +2137,6 @@
 		FAF13FCB1E20934C00F898D2 /* intermediate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = intermediate.h; sourceTree = "<group>"; };
 		FAF13FCC1E20934C00F898D2 /* PoolAlloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PoolAlloc.h; sourceTree = "<group>"; };
 		FAF13FCD1E20934C00F898D2 /* ResourceLimits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLimits.h; sourceTree = "<group>"; };
-		FAF13FCE1E20934C00F898D2 /* revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = revision.h; sourceTree = "<group>"; };
 		FAF13FD01E20934C00F898D2 /* ShHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShHandle.h; sourceTree = "<group>"; };
 		FAF13FD11E20934C00F898D2 /* Types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Types.h; sourceTree = "<group>"; };
 		FAF13FD31E20934C00F898D2 /* Constant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Constant.cpp; sourceTree = "<group>"; };
@@ -3794,13 +3796,15 @@
 				FAF13FC61E20934C00F898D2 /* BaseTypes.h */,
 				FAF13FC71E20934C00F898D2 /* Common.h */,
 				FAF13FC81E20934C00F898D2 /* ConstantUnion.h */,
+				FA84DE5E2778D7DC002674C6 /* glslang_c_interface.h */,
+				FA84DE5F2778D7DC002674C6 /* glslang_c_shader_types.h */,
 				FAF13FC91E20934C00F898D2 /* InfoSink.h */,
 				FAF13FCA1E20934C00F898D2 /* InitializeGlobals.h */,
 				FAF13FCB1E20934C00F898D2 /* intermediate.h */,
 				FAF13FCC1E20934C00F898D2 /* PoolAlloc.h */,
 				FAF13FCD1E20934C00F898D2 /* ResourceLimits.h */,
-				FAF13FCE1E20934C00F898D2 /* revision.h */,
 				FAF13FD01E20934C00F898D2 /* ShHandle.h */,
+				FA84DE5D2778D7DB002674C6 /* SpirvIntrinsics.h */,
 				FAF13FD11E20934C00F898D2 /* Types.h */,
 			);
 			path = Include;
@@ -3845,6 +3849,7 @@
 				FAF13FFB1E20934C00F898D2 /* Scan.h */,
 				FAF13FFC1E20934C00F898D2 /* ScanContext.h */,
 				FAF13FFD1E20934C00F898D2 /* ShaderLang.cpp */,
+				FA84DE602778D7F3002674C6 /* SpirvIntrinsics.cpp */,
 				FAF13FFE1E20934C00F898D2 /* SymbolTable.cpp */,
 				FAF13FFF1E20934C00F898D2 /* SymbolTable.h */,
 				FAF140001E20934C00F898D2 /* Versions.cpp */,
@@ -4287,7 +4292,6 @@
 				FA0B7CF91A95902C000E1D17 /* FileData.h in Headers */,
 				FA0B7DA71A95902C000E1D17 /* PNGHandler.h in Headers */,
 				FA0B7AC41A958EA3000E1D17 /* protocol.h in Headers */,
-				FAF140601E20934C00F898D2 /* revision.h in Headers */,
 				FABDA97F2552448200B5C523 /* b2_polygon_circle_contact.h in Headers */,
 				FAF140A21E20934C00F898D2 /* RemoveTree.h in Headers */,
 				FAF6C9DE23C2DE2900D7B5BC /* SpvTools.h in Headers */,
@@ -4592,6 +4596,7 @@
 				FAF140941E20934C00F898D2 /* PpScanner.cpp in Sources */,
 				FABDA9EC2552448300B5C523 /* b2_collide_circle.cpp in Sources */,
 				FA9D53AD1F5307E900125C6B /* Deprecations.cpp in Sources */,
+				FA84DE622778D7F3002674C6 /* SpirvIntrinsics.cpp in Sources */,
 				FA0B7E431A95902C000E1D17 /* wrap_CircleShape.cpp in Sources */,
 				FAE64A912071364800BC7981 /* physfs.c in Sources */,
 				FAE64A852071363100BC7981 /* physfs_archiver_mvl.c in Sources */,
@@ -5005,6 +5010,7 @@
 				FA0B7D3C1A95902C000E1D17 /* Texture.cpp in Sources */,
 				FABDA9EB2552448300B5C523 /* b2_collide_circle.cpp in Sources */,
 				FADF53FD1E3D74F200012CC0 /* Text.cpp in Sources */,
+				FA84DE612778D7F3002674C6 /* SpirvIntrinsics.cpp in Sources */,
 				FA6A2B741F60B6710074C308 /* ByteData.cpp in Sources */,
 				217DFBE91D9F6D490055D849 /* io.c in Sources */,
 				FA0B7E421A95902C000E1D17 /* wrap_CircleShape.cpp in Sources */,

+ 2 - 0
src/libraries/glslang/SPIRV/GLSL.ext.EXT.h

@@ -36,6 +36,8 @@ static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fu
 static const char* const E_SPV_EXT_fragment_invocation_density = "SPV_EXT_fragment_invocation_density";
 static const char* const E_SPV_EXT_demote_to_helper_invocation = "SPV_EXT_demote_to_helper_invocation";
 static const char* const E_SPV_EXT_shader_atomic_float_add = "SPV_EXT_shader_atomic_float_add";
+static const char* const E_SPV_EXT_shader_atomic_float16_add = "SPV_EXT_shader_atomic_float16_add";
+static const char* const E_SPV_EXT_shader_atomic_float_min_max = "SPV_EXT_shader_atomic_float_min_max";
 static const char* const E_SPV_EXT_shader_image_int64 = "SPV_EXT_shader_image_int64";
 
 #endif  // #ifndef GLSLextEXT_H

+ 1 - 0
src/libraries/glslang/SPIRV/GLSL.ext.KHR.h

@@ -51,5 +51,6 @@ static const char* const E_SPV_KHR_ray_query                    = "SPV_KHR_ray_q
 static const char* const E_SPV_KHR_fragment_shading_rate        = "SPV_KHR_fragment_shading_rate";
 static const char* const E_SPV_KHR_terminate_invocation         = "SPV_KHR_terminate_invocation";
 static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_workgroup_memory_explicit_layout";
+static const char* const E_SPV_KHR_subgroup_uniform_control_flow = "SPV_KHR_subgroup_uniform_control_flow";
 
 #endif  // #ifndef GLSLextKHR_H

+ 3 - 0
src/libraries/glslang/SPIRV/GLSL.ext.NV.h

@@ -69,6 +69,9 @@ const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader";
 //SPV_NV_raytracing
 const char* const E_SPV_NV_ray_tracing = "SPV_NV_ray_tracing";
 
+//SPV_NV_ray_tracing_motion_blur
+const char* const E_SPV_NV_ray_tracing_motion_blur = "SPV_NV_ray_tracing_motion_blur";
+
 //SPV_NV_shading_rate
 const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate";
 

+ 508 - 48
src/libraries/glslang/SPIRV/GlslangToSpv.cpp

@@ -160,6 +160,7 @@ protected:
     spv::SelectionControlMask TranslateSwitchControl(const glslang::TIntermSwitch&) const;
     spv::LoopControlMask TranslateLoopControl(const glslang::TIntermLoop&, std::vector<unsigned int>& operands) const;
     spv::StorageClass TranslateStorageClass(const glslang::TType&);
+    void TranslateLiterals(const glslang::TVector<const glslang::TIntermConstantUnion*>&, std::vector<unsigned>&) const;
     void addIndirectionIndexCapabilities(const glslang::TType& baseType, const glslang::TType& indexType);
     spv::Id createSpvVariable(const glslang::TIntermSymbol*, spv::Id forcedType);
     spv::Id getSampledType(const glslang::TSampler&);
@@ -178,6 +179,7 @@ protected:
     spv::Id accessChainLoad(const glslang::TType& type);
     void    accessChainStore(const glslang::TType& type, spv::Id rvalue);
     void multiTypeStore(const glslang::TType&, spv::Id rValue);
+    spv::Id convertLoadedBoolInUniformToUint(const glslang::TType& type, spv::Id nominalTypeId, spv::Id loadedId);
     glslang::TLayoutPacking getExplicitLayout(const glslang::TType& type) const;
     int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
     int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix);
@@ -1031,6 +1033,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
         return spv::BuiltInIncomingRayFlagsKHR;
     case glslang::EbvGeometryIndex:
         return spv::BuiltInRayGeometryIndexKHR;
+    case glslang::EbvCurrentRayTimeNV:
+        builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur);
+        builder.addCapability(spv::CapabilityRayTracingMotionBlurNV);
+        return spv::BuiltInCurrentRayTimeNV;
 
     // barycentrics
     case glslang::EbvBaryCoordNV:
@@ -1249,6 +1255,12 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
 {
     if (type.getBasicType() == glslang::EbtRayQuery)
         return spv::StorageClassPrivate;
+#ifndef GLSLANG_WEB
+    if (type.getQualifier().isSpirvByReference()) {
+        if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput())
+            return spv::StorageClassFunction;
+    }
+#endif
     if (type.getQualifier().isPipeInput())
         return spv::StorageClassInput;
     if (type.getQualifier().isPipeOutput())
@@ -1297,6 +1309,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
     case glslang::EvqHitAttr:        return spv::StorageClassHitAttributeKHR;
     case glslang::EvqCallableData:   return spv::StorageClassCallableDataKHR;
     case glslang::EvqCallableDataIn: return spv::StorageClassIncomingCallableDataKHR;
+    case glslang::EvqSpirvStorageClass: return static_cast<spv::StorageClass>(type.getQualifier().spirvStorageClass);
 #endif
     default:
         assert(0);
@@ -1306,6 +1319,52 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
     return spv::StorageClassFunction;
 }
 
+// Translate glslang constants to SPIR-V literals
+void TGlslangToSpvTraverser::TranslateLiterals(const glslang::TVector<const glslang::TIntermConstantUnion*>& constants,
+                                               std::vector<unsigned>& literals) const
+{
+    for (auto constant : constants) {
+        if (constant->getBasicType() == glslang::EbtFloat) {
+            float floatValue = static_cast<float>(constant->getConstArray()[0].getDConst());
+            unsigned literal = *reinterpret_cast<unsigned*>(&floatValue);
+            literals.push_back(literal);
+        } else if (constant->getBasicType() == glslang::EbtInt) {
+            unsigned literal = constant->getConstArray()[0].getIConst();
+            literals.push_back(literal);
+        } else if (constant->getBasicType() == glslang::EbtUint) {
+            unsigned literal = constant->getConstArray()[0].getUConst();
+            literals.push_back(literal);
+        } else if (constant->getBasicType() == glslang::EbtBool) {
+            unsigned literal = constant->getConstArray()[0].getBConst();
+            literals.push_back(literal);
+        } else if (constant->getBasicType() == glslang::EbtString) {
+            auto str = constant->getConstArray()[0].getSConst()->c_str();
+            unsigned literal = 0;
+            char* literalPtr = reinterpret_cast<char*>(&literal);
+            unsigned charCount = 0;
+            char ch = 0;
+            do {
+                ch = *(str++);
+                *(literalPtr++) = ch;
+                ++charCount;
+                if (charCount == 4) {
+                    literals.push_back(literal);
+                    literalPtr = reinterpret_cast<char*>(&literal);
+                    charCount = 0;
+                }
+            } while (ch != 0);
+
+            // Partial literal is padded with 0
+            if (charCount > 0) {
+                for (; charCount < 4; ++charCount)
+                    *(literalPtr++) = 0;
+                literals.push_back(literal);
+            }
+        } else
+            assert(0); // Unexpected type
+    }
+}
+
 // Add capabilities pertaining to how an array is indexed.
 void TGlslangToSpvTraverser::addIndirectionIndexCapabilities(const glslang::TType& baseType,
                                                              const glslang::TType& indexType)
@@ -1526,6 +1585,13 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
         builder.addCapability(spv::CapabilityRayTraversalPrimitiveCullingKHR);
     }
 
+#ifndef GLSLANG_WEB
+    if (glslangIntermediate->getSubgroupUniformControlFlow()) {
+        builder.addExtension(spv::E_SPV_KHR_subgroup_uniform_control_flow);
+        builder.addExecutionMode(shaderEntry, spv::ExecutionModeSubgroupUniformControlFlowKHR);
+    }
+#endif
+
     unsigned int mode;
     switch (glslangIntermediate->getStage()) {
     case EShLangVertex:
@@ -1598,9 +1664,22 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
 
     case EShLangCompute:
         builder.addCapability(spv::CapabilityShader);
-        builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
-                                                                           glslangIntermediate->getLocalSize(1),
-                                                                           glslangIntermediate->getLocalSize(2));
+        if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+          std::vector<spv::Id> dimConstId;
+          for (int dim = 0; dim < 3; ++dim) {
+            bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet);
+            dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst));
+            if (specConst) {
+                builder.addDecoration(dimConstId.back(), spv::DecorationSpecId,
+                                      glslangIntermediate->getLocalSizeSpecId(dim));
+            }
+          }
+          builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId);
+        } else {
+          builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
+                                                                             glslangIntermediate->getLocalSize(1),
+                                                                             glslangIntermediate->getLocalSize(2));
+        }
         if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) {
             builder.addCapability(spv::CapabilityComputeDerivativeGroupQuadsNV);
             builder.addExecutionMode(shaderEntry, spv::ExecutionModeDerivativeGroupQuadsNV);
@@ -1704,9 +1783,22 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
     case EShLangMeshNV:
         builder.addCapability(spv::CapabilityMeshShadingNV);
         builder.addExtension(spv::E_SPV_NV_mesh_shader);
-        builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
-                                                                           glslangIntermediate->getLocalSize(1),
-                                                                           glslangIntermediate->getLocalSize(2));
+        if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+            std::vector<spv::Id> dimConstId;
+            for (int dim = 0; dim < 3; ++dim) {
+                bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet);
+                dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst));
+                if (specConst) {
+                    builder.addDecoration(dimConstId.back(), spv::DecorationSpecId,
+                                          glslangIntermediate->getLocalSizeSpecId(dim));
+                }
+            }
+            builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId);
+        } else {
+            builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
+                                                                               glslangIntermediate->getLocalSize(1),
+                                                                               glslangIntermediate->getLocalSize(2));
+        }
         if (glslangIntermediate->getStage() == EShLangMeshNV) {
             builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices,
                 glslangIntermediate->getVertices());
@@ -1728,6 +1820,53 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
     default:
         break;
     }
+
+#ifndef GLSLANG_WEB
+    //
+    // Add SPIR-V requirements (GL_EXT_spirv_intrinsics)
+    //
+    if (glslangIntermediate->hasSpirvRequirement()) {
+        const glslang::TSpirvRequirement& spirvRequirement = glslangIntermediate->getSpirvRequirement();
+
+        // Add SPIR-V extension requirement
+        for (auto& extension : spirvRequirement.extensions)
+            builder.addExtension(extension.c_str());
+
+        // Add SPIR-V capability requirement
+        for (auto capability : spirvRequirement.capabilities)
+            builder.addCapability(static_cast<spv::Capability>(capability));
+    }
+
+    //
+    // Add SPIR-V execution mode qualifiers (GL_EXT_spirv_intrinsics)
+    //
+    if (glslangIntermediate->hasSpirvExecutionMode()) {
+        const glslang::TSpirvExecutionMode spirvExecutionMode = glslangIntermediate->getSpirvExecutionMode();
+
+        // Add spirv_execution_mode
+        for (auto& mode : spirvExecutionMode.modes) {
+            if (!mode.second.empty()) {
+                std::vector<unsigned> literals;
+                TranslateLiterals(mode.second, literals);
+                builder.addExecutionMode(shaderEntry, static_cast<spv::ExecutionMode>(mode.first), literals);
+            } else
+                builder.addExecutionMode(shaderEntry, static_cast<spv::ExecutionMode>(mode.first));
+        }
+
+        // Add spirv_execution_mode_id
+        for (auto& modeId : spirvExecutionMode.modeIds) {
+            std::vector<spv::Id> operandIds;
+            assert(!modeId.second.empty());
+            for (auto extraOperand : modeId.second) {
+                if (extraOperand->getType().getQualifier().isSpecConstant())
+                    operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
+                else
+                    operandIds.push_back(createSpvConstant(*extraOperand));
+            }
+            builder.addExecutionModeId(shaderEntry, static_cast<spv::ExecutionMode>(modeId.first), operandIds);
+        }
+    }
+#endif
 }
 
 // Finish creating SPV, after the traversal is complete.
@@ -2125,6 +2264,49 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T
     }
 }
 
+spv::Id TGlslangToSpvTraverser::convertLoadedBoolInUniformToUint(const glslang::TType& type,
+                                                                 spv::Id nominalTypeId,
+                                                                 spv::Id loadedId)
+{
+    if (builder.isScalarType(nominalTypeId)) {
+        // Conversion for bool
+        spv::Id boolType = builder.makeBoolType();
+        if (nominalTypeId != boolType)
+            return builder.createBinOp(spv::OpINotEqual, boolType, loadedId, builder.makeUintConstant(0));
+    } else if (builder.isVectorType(nominalTypeId)) {
+        // Conversion for bvec
+        int vecSize = builder.getNumTypeComponents(nominalTypeId);
+        spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize);
+        if (nominalTypeId != bvecType)
+            loadedId = builder.createBinOp(spv::OpINotEqual, bvecType, loadedId,
+                makeSmearedConstant(builder.makeUintConstant(0), vecSize));
+    } else if (builder.isArrayType(nominalTypeId)) {
+        // Conversion for bool array
+        spv::Id boolArrayTypeId = convertGlslangToSpvType(type);
+        if (nominalTypeId != boolArrayTypeId)
+        {
+            // Use OpCopyLogical from SPIR-V 1.4 if available.
+            if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4)
+                return builder.createUnaryOp(spv::OpCopyLogical, boolArrayTypeId, loadedId);
+
+            glslang::TType glslangElementType(type, 0);
+            spv::Id elementNominalTypeId = builder.getContainedTypeId(nominalTypeId);
+            std::vector<spv::Id> constituents;
+            for (int index = 0; index < type.getOuterArraySize(); ++index) {
+                // get the element
+                spv::Id elementValue = builder.createCompositeExtract(loadedId, elementNominalTypeId, index);
+
+                // recursively convert it
+                spv::Id elementConvertedValue = convertLoadedBoolInUniformToUint(glslangElementType, elementNominalTypeId, elementValue);
+                constituents.push_back(elementConvertedValue);
+            }
+            return builder.createCompositeConstruct(boolArrayTypeId, constituents);
+        }
+    }
+
+    return loadedId;
+}
+
 // Figure out what, if any, type changes are needed when accessing a specific built-in.
 // Returns <the type SPIR-V requires for declarion, the type to translate to on use>.
 // Also see comment for 'forceType', regarding tracking SPIR-V-required types.
@@ -2301,7 +2483,8 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
     if (node->getOp() == glslang::EOpAtomicCounterIncrement ||
         node->getOp() == glslang::EOpAtomicCounterDecrement ||
         node->getOp() == glslang::EOpAtomicCounter          ||
-        node->getOp() == glslang::EOpInterpolateAtCentroid  ||
+        (node->getOp() == glslang::EOpInterpolateAtCentroid &&
+          glslangIntermediate->getSource() != glslang::EShSourceHlsl)  ||
         node->getOp() == glslang::EOpRayQueryProceed        ||
         node->getOp() == glslang::EOpRayQueryGetRayTMin     ||
         node->getOp() == glslang::EOpRayQueryGetRayFlags    ||
@@ -2309,10 +2492,14 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
         node->getOp() == glslang::EOpRayQueryGetWorldRayDirection ||
         node->getOp() == glslang::EOpRayQueryGetIntersectionCandidateAABBOpaque ||
         node->getOp() == glslang::EOpRayQueryTerminate ||
-        node->getOp() == glslang::EOpRayQueryConfirmIntersection) {
+        node->getOp() == glslang::EOpRayQueryConfirmIntersection ||
+        (node->getOp() == glslang::EOpSpirvInst && operandNode->getAsTyped()->getQualifier().isSpirvByReference())) {
         operand = builder.accessChainGetLValue(); // Special case l-value operands
         lvalueCoherentFlags = builder.getAccessChain().coherentFlags;
         lvalueCoherentFlags |= TranslateCoherent(operandNode->getAsTyped()->getType());
+    } else if (operandNode->getAsTyped()->getQualifier().isSpirvLiteral()) {
+        // Will be translated to a literal value, make a placeholder here
+        operand = spv::NoResult;
     } else
 #endif
     {
@@ -2333,6 +2520,38 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
         result = createUnaryOperation(node->getOp(), decorations, resultType(), operand,
             node->getOperand()->getBasicType(), lvalueCoherentFlags);
 
+#ifndef GLSLANG_WEB
+    // it could be attached to a SPIR-V intruction
+    if (!result) {
+        if (node->getOp() == glslang::EOpSpirvInst) {
+            const auto& spirvInst = node->getSpirvInstruction();
+            if (spirvInst.set == "") {
+                spv::IdImmediate idImmOp = {true, operand};
+                if (operandNode->getAsTyped()->getQualifier().isSpirvLiteral()) {
+                    // Translate the constant to a literal value
+                    std::vector<unsigned> literals;
+                    glslang::TVector<const glslang::TIntermConstantUnion*> constants;
+                    constants.push_back(operandNode->getAsConstantUnion());
+                    TranslateLiterals(constants, literals);
+                    idImmOp = {false, literals[0]};
+                }
+
+                if (node->getBasicType() == glslang::EbtVoid)
+                    builder.createNoResultOp(static_cast<spv::Op>(spirvInst.id), {idImmOp});
+                else
+                    result = builder.createOp(static_cast<spv::Op>(spirvInst.id), resultType(), {idImmOp});
+            } else {
+                result = builder.createBuiltinCall(
+                    resultType(), spirvInst.set == "GLSL.std.450" ? stdBuiltins : getExtBuiltins(spirvInst.set.c_str()),
+                    spirvInst.id, {operand});
+            }
+
+            if (node->getBasicType() == glslang::EbtVoid)
+                return false; // done with this node
+        }
+    }
+#endif
+
     if (result) {
         if (invertedType) {
             result = createInvertedSwizzle(decorations.precision, *node->getOperand(), result);
@@ -2831,6 +3050,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
     case glslang::EOpIgnoreIntersectionNV:
     case glslang::EOpTerminateRayNV:
     case glslang::EOpTraceNV:
+    case glslang::EOpTraceRayMotionNV:
     case glslang::EOpTraceKHR:
     case glslang::EOpExecuteCallableNV:
     case glslang::EOpExecuteCallableKHR:
@@ -2977,7 +3197,13 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
         case glslang::EOpInterpolateAtOffset:
         case glslang::EOpInterpolateAtVertex:
             if (arg == 0) {
-                lvalue = true;
+                // If GLSL, use the address of the interpolant argument.
+                // If HLSL, use an internal version of OpInterolates that takes
+                // the rvalue of the interpolant. A fixup pass in spirv-opt
+                // legalization will remove the OpLoad and convert to an lvalue.
+                // Had to do this because legalization will only propagate a
+                // builtin into an rvalue.
+                lvalue = glslangIntermediate->getSource() != glslang::EShSourceHlsl;
 
                 // Does it need a swizzle inversion?  If so, evaluation is inverted;
                 // operate first on the swizzle base, then apply the swizzle.
@@ -3023,6 +3249,10 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
             if (arg == 1)
                 lvalue = true;
             break;
+        case glslang::EOpSpirvInst:
+            if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvByReference())
+                lvalue = true;
+            break;
 #endif
         default:
             break;
@@ -3120,15 +3350,22 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
                 bool cond = glslangOperands[arg]->getAsConstantUnion()->getConstArray()[0].getBConst();
                 operands.push_back(builder.makeIntConstant(cond ? 1 : 0));
              } else if ((arg == 10 && glslangOp == glslang::EOpTraceKHR) ||
+                        (arg == 11 && glslangOp == glslang::EOpTraceRayMotionNV) ||
                         (arg == 1  && glslangOp == glslang::EOpExecuteCallableKHR)) {
-                 const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : 1;
-                 const int set = glslangOp == glslang::EOpTraceKHR ? 0 : 1;
+                 const int opdNum = glslangOp == glslang::EOpTraceKHR ? 10 : (glslangOp == glslang::EOpTraceRayMotionNV ? 11 : 1);
+                 const int set = glslangOp == glslang::EOpExecuteCallableKHR ? 1 : 0;
+
                  const int location = glslangOperands[opdNum]->getAsConstantUnion()->getConstArray()[0].getUConst();
                  auto itNode = locationToSymbol[set].find(location);
                  visitSymbol(itNode->second);
                  spv::Id symId = getSymbolId(itNode->second);
                  operands.push_back(symId);
-             } else {
+#ifndef GLSLANG_WEB
+             } else if (glslangOperands[arg]->getAsTyped()->getQualifier().isSpirvLiteral()) {
+                 // Will be translated to a literal value, make a placeholder here
+                 operands.push_back(spv::NoResult);
+#endif
+             } else  {
                 operands.push_back(accessChainLoad(glslangOperands[arg]->getAsTyped()->getType()));
              }
         }
@@ -3170,6 +3407,34 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
             ? node->getSequence()[0]->getAsTyped()->getBasicType() : node->getBasicType();
         result = createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy,
             lvalueCoherentFlags);
+#ifndef GLSLANG_WEB
+    } else if (node->getOp() == glslang::EOpSpirvInst) {
+        const auto& spirvInst = node->getSpirvInstruction();
+        if (spirvInst.set == "") {
+            std::vector<spv::IdImmediate> idImmOps;
+            for (unsigned int i = 0; i < glslangOperands.size(); ++i) {
+                if (glslangOperands[i]->getAsTyped()->getQualifier().isSpirvLiteral()) {
+                    // Translate the constant to a literal value
+                    std::vector<unsigned> literals;
+                    glslang::TVector<const glslang::TIntermConstantUnion*> constants;
+                    constants.push_back(glslangOperands[i]->getAsConstantUnion());
+                    TranslateLiterals(constants, literals);
+                    idImmOps.push_back({false, literals[0]});
+                } else
+                    idImmOps.push_back({true, operands[i]});
+            }
+
+            if (node->getBasicType() == glslang::EbtVoid)
+                builder.createNoResultOp(static_cast<spv::Op>(spirvInst.id), idImmOps);
+            else
+                result = builder.createOp(static_cast<spv::Op>(spirvInst.id), resultType(), idImmOps);
+        } else {
+            result = builder.createBuiltinCall(
+                resultType(), spirvInst.set == "GLSL.std.450" ? stdBuiltins : getExtBuiltins(spirvInst.set.c_str()),
+                spirvInst.id, operands);
+        }
+        noReturnValue = node->getBasicType() == glslang::EbtVoid;
+#endif
     } else if (node->getOp() == glslang::EOpDebugPrintf) {
         if (!nonSemanticDebugPrintf) {
             nonSemanticDebugPrintf = builder.import("NonSemantic.DebugPrintf");
@@ -3450,6 +3715,11 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T
 
 void TGlslangToSpvTraverser::visitConstantUnion(glslang::TIntermConstantUnion* node)
 {
+#ifndef GLSLANG_WEB
+    if (node->getQualifier().isSpirvLiteral())
+        return; // Translated to a literal value, skip further processing
+#endif
+
     int nextConst = 0;
     spv::Id constant = createSpvConstantFromConstUnionArray(node->getType(), node->getConstArray(), nextConst, false);
 
@@ -3535,7 +3805,16 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
 
     switch (node->getFlowOp()) {
     case glslang::EOpKill:
-        builder.makeStatementTerminator(spv::OpKill, "post-discard");
+        if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+            if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) {
+              builder.addCapability(spv::CapabilityDemoteToHelperInvocation);
+              builder.createNoResultOp(spv::OpDemoteToHelperInvocationEXT);
+            } else {
+                builder.makeStatementTerminator(spv::OpTerminateInvocation, "post-terminate-invocation");
+            }
+        } else {
+            builder.makeStatementTerminator(spv::OpKill, "post-discard");
+        }
         break;
     case glslang::EOpTerminateInvocation:
         builder.addExtension(spv::E_SPV_KHR_terminate_invocation);
@@ -3698,12 +3977,14 @@ spv::Id TGlslangToSpvTraverser::getSampledType(const glslang::TSampler& sampler)
             builder.addExtension(spv::E_SPV_AMD_gpu_shader_half_float_fetch);
             builder.addCapability(spv::CapabilityFloat16ImageAMD);
             return builder.makeFloatType(16);
-        case glslang::EbtInt64:      return builder.makeIntType(64);
+        case glslang::EbtInt64:
             builder.addExtension(spv::E_SPV_EXT_shader_image_int64);
-            builder.addCapability(spv::CapabilityFloat16ImageAMD);
-        case glslang::EbtUint64:     return builder.makeUintType(64);
+            builder.addCapability(spv::CapabilityInt64ImageEXT);
+            return builder.makeIntType(64);
+        case glslang::EbtUint64:
             builder.addExtension(spv::E_SPV_EXT_shader_image_int64);
-            builder.addCapability(spv::CapabilityFloat16ImageAMD);
+            builder.addCapability(spv::CapabilityInt64ImageEXT);
+            return builder.makeUintType(64);
 #endif
         default:
             assert(0);
@@ -3898,6 +4179,64 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
     case glslang::EbtString:
         // no type used for OpString
         return 0;
+#ifndef GLSLANG_WEB
+    case glslang::EbtSpirvType: {
+        // GL_EXT_spirv_intrinsics
+        const auto& spirvType = type.getSpirvType();
+        const auto& spirvInst = spirvType.spirvInst;
+
+        std::vector<spv::IdImmediate> operands;
+        for (const auto& typeParam : spirvType.typeParams) {
+            // Constant expression
+            if (typeParam.constant->isLiteral()) {
+                if (typeParam.constant->getBasicType() == glslang::EbtFloat) {
+                    float floatValue = static_cast<float>(typeParam.constant->getConstArray()[0].getDConst());
+                    unsigned literal = *reinterpret_cast<unsigned*>(&floatValue);
+                    operands.push_back({false, literal});
+                } else if (typeParam.constant->getBasicType() == glslang::EbtInt) {
+                    unsigned literal = typeParam.constant->getConstArray()[0].getIConst();
+                    operands.push_back({false, literal});
+                } else if (typeParam.constant->getBasicType() == glslang::EbtUint) {
+                    unsigned literal = typeParam.constant->getConstArray()[0].getUConst();
+                    operands.push_back({false, literal});
+                } else if (typeParam.constant->getBasicType() == glslang::EbtBool) {
+                    unsigned literal = typeParam.constant->getConstArray()[0].getBConst();
+                    operands.push_back({false, literal});
+                } else if (typeParam.constant->getBasicType() == glslang::EbtString) {
+                    auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str();
+                    unsigned literal = 0;
+                    char* literalPtr = reinterpret_cast<char*>(&literal);
+                    unsigned charCount = 0;
+                    char ch = 0;
+                    do {
+                        ch = *(str++);
+                        *(literalPtr++) = ch;
+                        ++charCount;
+                        if (charCount == 4) {
+                            operands.push_back({false, literal});
+                            literalPtr = reinterpret_cast<char*>(&literal);
+                            charCount = 0;
+                        }
+                    } while (ch != 0);
+
+                    // Partial literal is padded with 0
+                    if (charCount > 0) {
+                        for (; charCount < 4; ++charCount)
+                            *(literalPtr++) = 0;
+                        operands.push_back({false, literal});
+                    }
+                } else
+                    assert(0); // Unexpected type
+            } else
+                operands.push_back({true, createSpvConstant(*typeParam.constant)});
+        }
+
+        assert(spirvInst.set == ""); // Currently, couldn't be extended instructions.
+        spvType = builder.makeGenericType(static_cast<spv::Op>(spirvInst.id), operands);
+
+        break;
+    }
+#endif
     default:
         assert(0);
         break;
@@ -4094,7 +4433,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
 {
     // Name and decorate the non-hidden members
     int offset = -1;
-    int locationOffset = 0;  // for use within the members of this struct
     bool memberLocationInvalid = type.isArrayOfArrays() ||
         (type.isArray() && (type.getQualifier().isArrayedIo(glslangIntermediate->getStage()) == false));
     for (int i = 0; i < (int)glslangMembers->size(); i++) {
@@ -4152,10 +4490,6 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
         if (!memberLocationInvalid && memberQualifier.hasLocation())
             builder.addMemberDecoration(spvType, member, spv::DecorationLocation, memberQualifier.layoutLocation);
 
-        if (qualifier.hasLocation())      // track for upcoming inheritance
-            locationOffset += glslangIntermediate->computeTypeLocationSize(
-                                            glslangMember, glslangIntermediate->getStage());
-
         // component, XFB, others
         if (glslangMember.getQualifier().hasComponent())
             builder.addMemberDecoration(spvType, member, spv::DecorationComponent,
@@ -4211,6 +4545,38 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
             builder.addCapability(spv::CapabilityGeometryShaderPassthroughNV);
             builder.addExtension(spv::E_SPV_NV_geometry_shader_passthrough);
         }
+
+        //
+        // Add SPIR-V decorations for members (GL_EXT_spirv_intrinsics)
+        //
+        if (glslangMember.getQualifier().hasSprivDecorate()) {
+            const glslang::TSpirvDecorate& spirvDecorate = glslangMember.getQualifier().getSpirvDecorate();
+
+            // Add spirv_decorate
+            for (auto& decorate : spirvDecorate.decorates) {
+                if (!decorate.second.empty()) {
+                    std::vector<unsigned> literals;
+                    TranslateLiterals(decorate.second, literals);
+                    builder.addMemberDecoration(spvType, member, static_cast<spv::Decoration>(decorate.first), literals);
+                }
+                else
+                    builder.addMemberDecoration(spvType, member, static_cast<spv::Decoration>(decorate.first));
+            }
+
+            // spirv_decorate_id not applied to members
+            assert(spirvDecorate.decorateIds.empty());
+
+            // Add spirv_decorate_string
+            for (auto& decorateString : spirvDecorate.decorateStrings) {
+                std::vector<const char*> strings;
+                assert(!decorateString.second.empty());
+                for (auto extraOperand : decorateString.second) {
+                    const char* string = extraOperand->getConstArray()[0].getSConst()->c_str();
+                    strings.push_back(string);
+                }
+                builder.addDecoration(spvType, static_cast<spv::Decoration>(decorateString.first), strings);
+            }
+        }
 #endif
     }
 
@@ -4229,6 +4595,8 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra
     glslang::TIntermTyped* specNode = arraySizes.getDimNode(dim);
     if (specNode != nullptr) {
         builder.clearAccessChain();
+        SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder);
+        spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
         specNode->traverse(this);
         return accessChainLoad(specNode->getAsTyped()->getType());
     }
@@ -4264,19 +4632,7 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type)
 
     // Need to convert to abstract types when necessary
     if (type.getBasicType() == glslang::EbtBool) {
-        if (builder.isScalarType(nominalTypeId)) {
-            // Conversion for bool
-            spv::Id boolType = builder.makeBoolType();
-            if (nominalTypeId != boolType)
-                loadedId = builder.createBinOp(spv::OpINotEqual, boolType, loadedId, builder.makeUintConstant(0));
-        } else if (builder.isVectorType(nominalTypeId)) {
-            // Conversion for bvec
-            int vecSize = builder.getNumTypeComponents(nominalTypeId);
-            spv::Id bvecType = builder.makeVectorType(builder.makeBoolType(), vecSize);
-            if (nominalTypeId != bvecType)
-                loadedId = builder.createBinOp(spv::OpINotEqual, bvecType, loadedId,
-                    makeSmearedConstant(builder.makeUintConstant(0), vecSize));
-        }
+        loadedId = convertLoadedBoolInUniformToUint(type, nominalTypeId, loadedId);
     }
 
     return loadedId;
@@ -4598,6 +4954,9 @@ bool TGlslangToSpvTraverser::originalParam(glslang::TStorageQualifier qualifier,
     if (glslangIntermediate->getSource() == glslang::EShSourceHlsl)
         return paramType.getBasicType() == glslang::EbtBlock;
     return paramType.containsOpaque() ||                                                       // sampler, etc.
+#ifndef GLSLANG_WEB
+           paramType.getQualifier().isSpirvByReference() ||                                    // spirv_by_reference
+#endif
            (paramType.getBasicType() == glslang::EbtBlock && qualifier == glslang::EvqBuffer); // SSBO
 }
 
@@ -4991,7 +5350,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
 
     int components = node->getType().getVectorSize();
 
-    if (node->getOp() == glslang::EOpTextureFetch) {
+    if (node->getOp() == glslang::EOpImageLoad ||
+        node->getOp() == glslang::EOpImageLoadLod ||
+        node->getOp() == glslang::EOpTextureFetch ||
+        node->getOp() == glslang::EOpTextureFetchOffset) {
         // These must produce 4 components, per SPIR-V spec.  We'll add a conversion constructor if needed.
         // This will only happen through the HLSL path for operator[], so we do not have to handle e.g.
         // the EOpTexture/Proj/Lod/etc family.  It would be harmless to do so, but would need more logic
@@ -5553,7 +5915,7 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg
             ++lValueCount;
         } else {
             // process r-value, which involves a copy for a type mismatch
-            if (function->getParamType(a) != convertGlslangToSpvType(*argTypes[a]) ||
+            if (function->getParamType(a) != builder.getTypeId(rValues[rValueCount]) ||
                 TranslatePrecisionDecoration(*argTypes[a]) != function->getParamPrecision(a))
             {
                 spv::Id argCopy = builder.createVariable(function->getParamPrecision(a), spv::StorageClassFunction, function->getParamType(a), "arg");
@@ -6884,13 +7246,17 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
     case glslang::EOpImageAtomicAdd:
     case glslang::EOpAtomicCounterAdd:
         opCode = spv::OpAtomicIAdd;
-        if (typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) {
+        if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) {
             opCode = spv::OpAtomicFAddEXT;
             builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_add);
-            if (typeProxy == glslang::EbtFloat)
+            if (typeProxy == glslang::EbtFloat16) {
+                builder.addExtension(spv::E_SPV_EXT_shader_atomic_float16_add);
+                builder.addCapability(spv::CapabilityAtomicFloat16AddEXT);
+            } else if (typeProxy == glslang::EbtFloat) {
                 builder.addCapability(spv::CapabilityAtomicFloat32AddEXT);
-            else
+            } else {
                 builder.addCapability(spv::CapabilityAtomicFloat64AddEXT);
+            }
         }
         break;
     case glslang::EOpAtomicSubtract:
@@ -6900,14 +7266,38 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
     case glslang::EOpAtomicMin:
     case glslang::EOpImageAtomicMin:
     case glslang::EOpAtomicCounterMin:
-        opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ?
-            spv::OpAtomicUMin : spv::OpAtomicSMin;
+        if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) {
+            opCode = spv::OpAtomicFMinEXT;
+            builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max);
+            if (typeProxy == glslang::EbtFloat16)
+                builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT);
+            else if (typeProxy == glslang::EbtFloat)
+                builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT);
+            else
+                builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT);
+        } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) {
+            opCode = spv::OpAtomicUMin;
+        } else {
+            opCode = spv::OpAtomicSMin;
+        }
         break;
     case glslang::EOpAtomicMax:
     case glslang::EOpImageAtomicMax:
     case glslang::EOpAtomicCounterMax:
-        opCode = (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) ?
-            spv::OpAtomicUMax : spv::OpAtomicSMax;
+        if (typeProxy == glslang::EbtFloat16 || typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble) {
+            opCode = spv::OpAtomicFMaxEXT;
+            builder.addExtension(spv::E_SPV_EXT_shader_atomic_float_min_max);
+            if (typeProxy == glslang::EbtFloat16)
+                builder.addCapability(spv::CapabilityAtomicFloat16MinMaxEXT);
+            else if (typeProxy == glslang::EbtFloat)
+                builder.addCapability(spv::CapabilityAtomicFloat32MinMaxEXT);
+            else
+                builder.addCapability(spv::CapabilityAtomicFloat64MinMaxEXT);
+        } else if (typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64) {
+            opCode = spv::OpAtomicUMax;
+        } else {
+            opCode = spv::OpAtomicSMax;
+        }
         break;
     case glslang::EOpAtomicAnd:
     case glslang::EOpImageAtomicAnd:
@@ -7142,6 +7532,8 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
         break;
     case glslang::EOpReadFirstInvocation:
         opCode = spv::OpSubgroupFirstInvocationKHR;
+        if (builder.isVectorType(typeId))
+            return CreateInvocationsVectorOperation(opCode, groupOperation, typeId, operands);
         break;
     case glslang::EOpBallot:
     {
@@ -7266,7 +7658,7 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv
     assert(op == spv::OpGroupFMin || op == spv::OpGroupUMin || op == spv::OpGroupSMin ||
            op == spv::OpGroupFMax || op == spv::OpGroupUMax || op == spv::OpGroupSMax ||
            op == spv::OpGroupFAdd || op == spv::OpGroupIAdd || op == spv::OpGroupBroadcast ||
-           op == spv::OpSubgroupReadInvocationKHR ||
+           op == spv::OpSubgroupReadInvocationKHR || op == spv::OpSubgroupFirstInvocationKHR ||
            op == spv::OpGroupFMinNonUniformAMD || op == spv::OpGroupUMinNonUniformAMD ||
            op == spv::OpGroupSMinNonUniformAMD ||
            op == spv::OpGroupFMaxNonUniformAMD || op == spv::OpGroupUMaxNonUniformAMD ||
@@ -7295,6 +7687,8 @@ spv::Id TGlslangToSpvTraverser::CreateInvocationsVectorOperation(spv::Op op, spv
             spvGroupOperands.push_back(scalar);
             spv::IdImmediate operand = { true, operands[1] };
             spvGroupOperands.push_back(operand);
+        } else if (op == spv::OpSubgroupFirstInvocationKHR) {
+            spvGroupOperands.push_back(scalar);
         } else if (op == spv::OpGroupBroadcast) {
             spv::IdImmediate scope = { true, builder.makeUintConstant(spv::ScopeSubgroup) };
             spvGroupOperands.push_back(scope);
@@ -7965,6 +8359,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
     case glslang::EOpTraceNV:
         builder.createNoResultOp(spv::OpTraceNV, operands);
         return 0;
+    case glslang::EOpTraceRayMotionNV:
+        builder.addExtension(spv::E_SPV_NV_ray_tracing_motion_blur);
+        builder.addCapability(spv::CapabilityRayTracingMotionBlurNV);
+        builder.createNoResultOp(spv::OpTraceRayMotionNV, operands);
+        return 0;
     case glslang::EOpTraceKHR:
         builder.createNoResultOp(spv::OpTraceRayKHR, operands);
         return 0;
@@ -8352,8 +8751,18 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
             builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset);
     }
 
-    if (symbol->getQualifier().hasLocation())
-        builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
+    if (symbol->getQualifier().hasLocation()) {
+        if (!(glslangIntermediate->isRayTracingStage() && glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing)
+              && (builder.getStorageClass(id) == spv::StorageClassRayPayloadKHR ||
+                  builder.getStorageClass(id) == spv::StorageClassIncomingRayPayloadKHR ||
+                  builder.getStorageClass(id) == spv::StorageClassCallableDataKHR ||
+                  builder.getStorageClass(id) == spv::StorageClassIncomingCallableDataKHR))) {
+            // Location values are used to link TraceRayKHR and ExecuteCallableKHR to corresponding variables
+            // but are not valid in SPIRV since they are supported only for Input/Output Storage classes.
+            builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
+        }
+    }
+
     builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier()));
     if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
         builder.addCapability(spv::CapabilityGeometryStreams);
@@ -8387,7 +8796,16 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
 
     // add built-in variable decoration
     if (builtIn != spv::BuiltInMax) {
-        builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
+        // WorkgroupSize deprecated in spirv1.6
+        if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6 ||
+            builtIn != spv::BuiltInWorkgroupSize)
+            builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
+    }
+
+    // Add volatile decoration to HelperInvocation for spirv1.6 and beyond
+    if (builtIn == spv::BuiltInHelperInvocation &&
+        glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+        builder.addDecoration(id, spv::DecorationVolatile);
     }
 
 #ifndef GLSLANG_WEB
@@ -8449,6 +8867,48 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
         builder.addDecoration(id, symbol->getType().getQualifier().restrict ?
             spv::DecorationRestrictPointerEXT : spv::DecorationAliasedPointerEXT);
     }
+
+    //
+    // Add SPIR-V decorations for structure (GL_EXT_spirv_intrinsics)
+    //
+    if (symbol->getType().getQualifier().hasSprivDecorate()) {
+        const glslang::TSpirvDecorate& spirvDecorate = symbol->getType().getQualifier().getSpirvDecorate();
+
+        // Add spirv_decorate
+        for (auto& decorate : spirvDecorate.decorates) {
+            if (!decorate.second.empty()) {
+                std::vector<unsigned> literals;
+                TranslateLiterals(decorate.second, literals);
+                builder.addDecoration(id, static_cast<spv::Decoration>(decorate.first), literals);
+            }
+            else
+                builder.addDecoration(id, static_cast<spv::Decoration>(decorate.first));
+        }
+
+        // Add spirv_decorate_id
+        for (auto& decorateId : spirvDecorate.decorateIds) {
+            std::vector<spv::Id> operandIds;
+            assert(!decorateId.second.empty());
+            for (auto extraOperand : decorateId.second) {
+                if (extraOperand->getQualifier().isSpecConstant())
+                    operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
+                else
+                    operandIds.push_back(createSpvConstant(*extraOperand));
+            }
+            builder.addDecorationId(id, static_cast<spv::Decoration>(decorateId.first), operandIds);
+        }
+
+        // Add spirv_decorate_string
+        for (auto& decorateString : spirvDecorate.decorateStrings) {
+            std::vector<const char*> strings;
+            assert(!decorateString.second.empty());
+            for (auto extraOperand : decorateString.second) {
+                const char* string = extraOperand->getConstArray()[0].getSConst()->c_str();
+                strings.push_back(string);
+            }
+            builder.addDecoration(id, static_cast<spv::Decoration>(decorateString.first), strings);
+        }
+    }
 #endif
 
     return id;

+ 3 - 0
src/libraries/glslang/SPIRV/SPVRemapper.cpp

@@ -544,6 +544,9 @@ namespace spv {
         // Extended instructions: currently, assume everything is an ID.
         // TODO: add whatever data we need for exceptions to that
         if (opCode == spv::OpExtInst) {
+
+            idFn(asId(word)); // Instruction set is an ID that also needs to be mapped
+
             word        += 2; // instruction set, and instruction from set
             numOperands -= 2;
 

+ 104 - 27
src/libraries/glslang/SPIRV/SpvBuilder.cpp

@@ -427,6 +427,37 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
     return type->getResultId();
 }
 
+Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
+{
+    // try to find it
+    Instruction* type;
+    for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) {
+        type = groupedTypes[opcode][t];
+        if (type->getNumOperands() != operands.size())
+            continue; // Number mismatch, find next
+
+        bool match = true;
+        for (int op = 0; match && op < operands.size(); ++op) {
+            match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word;
+        }
+        if (match)
+            return type->getResultId();
+    }
+
+    // not found, make it
+    type = new Instruction(getUniqueId(), NoType, opcode);
+    for (int op = 0; op < operands.size(); ++op) {
+        if (operands[op].isId)
+            type->addIdOperand(operands[op].word);
+        else
+            type->addImmediateOperand(operands[op].word);
+    }
+    groupedTypes[opcode].push_back(type);
+    constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+    module.mapInstruction(type);
+
+    return type->getResultId();
+}
 
 // TODO: performance: track arrays per stride
 // If a stride is supplied (non-zero) make an array.
@@ -743,6 +774,26 @@ Id Builder::getContainedTypeId(Id typeId, int member) const
     }
 }
 
+// Figure out the final resulting type of the access chain.
+Id Builder::getResultingAccessChainType() const
+{
+    assert(accessChain.base != NoResult);
+    Id typeId = getTypeId(accessChain.base);
+
+    assert(isPointerType(typeId));
+    typeId = getContainedTypeId(typeId);
+
+    for (int i = 0; i < (int)accessChain.indexChain.size(); ++i) {
+        if (isStructType(typeId)) {
+            assert(isConstantScalar(accessChain.indexChain[i]));
+            typeId = getContainedTypeId(typeId, getConstantScalar(accessChain.indexChain[i]));
+        } else
+            typeId = getContainedTypeId(typeId, accessChain.indexChain[i]);
+    }
+
+    return typeId;
+}
+
 // Return the immediately contained type of a given composite type.
 Id Builder::getContainedTypeId(Id typeId) const
 {
@@ -1585,16 +1636,7 @@ Id Builder::createLoad(Id lValue, spv::Decoration precision, spv::MemoryAccessMa
 Id Builder::createAccessChain(StorageClass storageClass, Id base, const std::vector<Id>& offsets)
 {
     // Figure out the final resulting type.
-    spv::Id typeId = getTypeId(base);
-    assert(isPointerType(typeId) && offsets.size() > 0);
-    typeId = getContainedTypeId(typeId);
-    for (int i = 0; i < (int)offsets.size(); ++i) {
-        if (isStructType(typeId)) {
-            assert(isConstantScalar(offsets[i]));
-            typeId = getContainedTypeId(typeId, getConstantScalar(offsets[i]));
-        } else
-            typeId = getContainedTypeId(typeId, offsets[i]);
-    }
+    Id typeId = getResultingAccessChainType();
     typeId = makePointer(storageClass, typeId);
 
     // Make the instruction
@@ -2543,7 +2585,7 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
         int row = 0;
         int col = 0;
 
-        for (int arg = 0; arg < (int)sources.size(); ++arg) {
+        for (int arg = 0; arg < (int)sources.size() && col < numCols; ++arg) {
             Id argComp = sources[arg];
             for (int comp = 0; comp < getNumComponents(sources[arg]); ++comp) {
                 if (getNumComponents(sources[arg]) > 1) {
@@ -2555,6 +2597,10 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector<Id>&
                     row = 0;
                     col++;
                 }
+                if (col == numCols) {
+                    // If more components are provided than fit the matrix, discard the rest.
+                    break;
+                }
             }
         }
     }
@@ -2790,28 +2836,59 @@ void Builder::accessChainStore(Id rvalue, Decoration nonUniform, spv::MemoryAcce
     assert(accessChain.isRValue == false);
 
     transferAccessChainSwizzle(true);
-    Id base = collapseAccessChain();
-    addDecoration(base, nonUniform);
 
-    Id source = rvalue;
+    // If a swizzle exists and is not full and is not dynamic, then the swizzle will be broken into individual stores.
+    if (accessChain.swizzle.size() > 0 &&
+        getNumTypeComponents(getResultingAccessChainType()) != (int)accessChain.swizzle.size() &&
+        accessChain.component == NoResult) {
+        for (unsigned int i = 0; i < accessChain.swizzle.size(); ++i) {
+            accessChain.indexChain.push_back(makeUintConstant(accessChain.swizzle[i]));
+            accessChain.instr = NoResult;
 
-    // dynamic component should be gone
-    assert(accessChain.component == NoResult);
+            Id base = collapseAccessChain();
+            addDecoration(base, nonUniform);
 
-    // If swizzle still exists, it is out-of-order or not full, we must load the target vector,
-    // extract and insert elements to perform writeMask and/or swizzle.
-    if (accessChain.swizzle.size() > 0) {
-        Id tempBaseId = createLoad(base, spv::NoPrecision);
-        source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle);
-    }
+            accessChain.indexChain.pop_back();
+            accessChain.instr = NoResult;
+
+            // dynamic component should be gone
+            assert(accessChain.component == NoResult);
+
+            Id source = createCompositeExtract(rvalue, getContainedTypeId(getTypeId(rvalue)), i);
+
+            // take LSB of alignment
+            alignment = alignment & ~(alignment & (alignment-1));
+            if (getStorageClass(base) == StorageClassPhysicalStorageBufferEXT) {
+                memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask);
+            }
 
-    // take LSB of alignment
-    alignment = alignment & ~(alignment & (alignment-1));
-    if (getStorageClass(base) == StorageClassPhysicalStorageBufferEXT) {
-        memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask);
+            createStore(source, base, memoryAccess, scope, alignment);
+        }
     }
+    else {
+        Id base = collapseAccessChain();
+        addDecoration(base, nonUniform);
+
+        Id source = rvalue;
+
+        // dynamic component should be gone
+        assert(accessChain.component == NoResult);
+
+        // If swizzle still exists, it may be out-of-order, we must load the target vector,
+        // extract and insert elements to perform writeMask and/or swizzle.
+        if (accessChain.swizzle.size() > 0) {
+            Id tempBaseId = createLoad(base, spv::NoPrecision);
+            source = createLvalueSwizzle(getTypeId(tempBaseId), tempBaseId, source, accessChain.swizzle);
+        }
 
-    createStore(source, base, memoryAccess, scope, alignment);
+        // take LSB of alignment
+        alignment = alignment & ~(alignment & (alignment-1));
+        if (getStorageClass(base) == StorageClassPhysicalStorageBufferEXT) {
+            memoryAccess = (spv::MemoryAccessMask)(memoryAccess | spv::MemoryAccessAlignedMask);
+        }
+
+        createStore(source, base, memoryAccess, scope, alignment);
+    }
 }
 
 // Comments in header

+ 2 - 0
src/libraries/glslang/SPIRV/SpvBuilder.h

@@ -181,6 +181,7 @@ public:
     Id makeSamplerType();
     Id makeSampledImageType(Id imageType);
     Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
+    Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
 
     // accelerationStructureNV type
     Id makeAccelerationStructureType();
@@ -202,6 +203,7 @@ public:
     StorageClass getTypeStorageClass(Id typeId) const { return module.getStorageClass(typeId); }
     ImageFormat getImageTypeFormat(Id typeId) const
         { return (ImageFormat)module.getInstruction(typeId)->getImmediateOperand(6); }
+    Id getResultingAccessChainType() const;
 
     bool isPointer(Id resultId)      const { return isPointerType(getTypeId(resultId)); }
     bool isScalar(Id resultId)       const { return isScalarType(getTypeId(resultId)); }

+ 26 - 13
src/libraries/glslang/SPIRV/SpvPostProcess.cpp

@@ -44,10 +44,8 @@
 #include <algorithm>
 
 #include "SpvBuilder.h"
-
 #include "spirv.hpp"
-#include "GlslangToSpv.h"
-#include "SpvBuilder.h"
+
 namespace spv {
     #include "GLSL.std.450.h"
     #include "GLSL.ext.KHR.h"
@@ -113,8 +111,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
             }
         }
         break;
-    case OpAccessChain:
-    case OpPtrAccessChain:
     case OpCopyObject:
         break;
     case OpFConvert:
@@ -161,26 +157,43 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
         switch (inst.getImmediateOperand(1)) {
         case GLSLstd450Frexp:
         case GLSLstd450FrexpStruct:
-            if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeInt, 16))
+            if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeInt, 16))
                 addExtension(spv::E_SPV_AMD_gpu_shader_int16);
             break;
         case GLSLstd450InterpolateAtCentroid:
         case GLSLstd450InterpolateAtSample:
         case GLSLstd450InterpolateAtOffset:
-            if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeFloat, 16))
+            if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeFloat, 16))
                 addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
             break;
         default:
             break;
         }
         break;
+    case OpAccessChain:
+    case OpPtrAccessChain:
+        if (isPointerType(typeId))
+            break;
+        if (basicTypeOp == OpTypeInt) {
+            if (width == 16)
+                addCapability(CapabilityInt16);
+            else if (width == 8)
+                addCapability(CapabilityInt8);
+        }
     default:
-        if (basicTypeOp == OpTypeFloat && width == 16)
-            addCapability(CapabilityFloat16);
-        if (basicTypeOp == OpTypeInt && width == 16)
-            addCapability(CapabilityInt16);
-        if (basicTypeOp == OpTypeInt && width == 8)
-            addCapability(CapabilityInt8);
+        if (basicTypeOp == OpTypeInt) {
+            if (width == 16)
+                addCapability(CapabilityInt16);
+            else if (width == 8)
+                addCapability(CapabilityInt8);
+            else if (width == 64)
+                addCapability(CapabilityInt64);
+        } else if (basicTypeOp == OpTypeFloat) {
+            if (width == 16)
+                addCapability(CapabilityFloat16);
+            else if (width == 64)
+                addCapability(CapabilityFloat64);
+        }
         break;
     }
 }

+ 21 - 0
src/libraries/glslang/SPIRV/SpvTools.cpp

@@ -68,6 +68,26 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog
         }
     case glslang::EShTargetVulkan_1_2:
         return spv_target_env::SPV_ENV_VULKAN_1_2;
+    case glslang::EShTargetUniversal:
+        switch (spvVersion.spv) {
+        case EShTargetSpv_1_0:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_0;
+        case EShTargetSpv_1_1:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_1;
+        case EShTargetSpv_1_2:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_2;
+        case EShTargetSpv_1_3:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_3;
+        case EShTargetSpv_1_4:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_4;
+        case EShTargetSpv_1_5:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_5;
+        case EShTargetSpv_1_6:
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_6;
+        default:
+            logger->missingFunctionality("Target version for SPIRV-Tools validator");
+            return spv_target_env::SPV_ENV_UNIVERSAL_1_6;
+        }
     default:
         break;
     }
@@ -207,6 +227,7 @@ void SpirvToolsTransform(const glslang::TIntermediate& intermediate, std::vector
     optimizer.RegisterPass(spvtools::CreateAggressiveDCEPass());
     optimizer.RegisterPass(spvtools::CreateVectorDCEPass());
     optimizer.RegisterPass(spvtools::CreateDeadInsertElimPass());
+    optimizer.RegisterPass(spvtools::CreateInterpolateFixupPass());
     if (options->optimizeSize) {
         optimizer.RegisterPass(spvtools::CreateRedundancyEliminationPass());
     }

+ 40 - 0
src/libraries/glslang/SPIRV/doc.cpp

@@ -188,6 +188,7 @@ const char* ExecutionModeString(int mode)
     case ExecutionModeRoundingModeRTE:          return "RoundingModeRTE";
     case ExecutionModeRoundingModeRTZ:          return "RoundingModeRTZ";
     case ExecutionModeStencilRefReplacingEXT:   return "StencilRefReplacingEXT";
+    case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlow";
 
     case ExecutionModeOutputLinesNV:            return "OutputLinesNV";
     case ExecutionModeOutputPrimitivesNV:       return "OutputPrimitivesNV";
@@ -425,6 +426,7 @@ const char* BuiltInString(int builtIn)
     case BuiltInSMCountNV:              return "SMCountNV";
     case BuiltInWarpIDNV:               return "WarpIDNV";
     case BuiltInSMIDNV:                 return "SMIDNV";
+    case BuiltInCurrentRayTimeNV:       return "CurrentRayTimeNV";
 
     default: return "Bad";
     }
@@ -898,6 +900,12 @@ const char* CapabilityString(int info)
     case CapabilityDeviceGroup: return "DeviceGroup";
     case CapabilityMultiView:   return "MultiView";
 
+    case CapabilityDenormPreserve:           return "DenormPreserve";
+    case CapabilityDenormFlushToZero:        return "DenormFlushToZero";
+    case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+    case CapabilityRoundingModeRTE:          return "RoundingModeRTE";
+    case CapabilityRoundingModeRTZ:          return "RoundingModeRTZ";
+
     case CapabilityStencilExportEXT: return "StencilExportEXT";
 
     case CapabilityFloat16ImageAMD:       return "Float16ImageAMD";
@@ -915,6 +923,7 @@ const char* CapabilityString(int info)
     case CapabilityPerViewAttributesNV:             return "PerViewAttributesNV";
     case CapabilityGroupNonUniformPartitionedNV:    return "GroupNonUniformPartitionedNV";
     case CapabilityRayTracingNV:                    return "RayTracingNV";
+    case CapabilityRayTracingMotionBlurNV:          return "RayTracingMotionBlurNV";
     case CapabilityRayTracingKHR:                   return "RayTracingKHR";
     case CapabilityRayQueryKHR:                     return "RayQueryKHR";
     case CapabilityRayTracingProvisionalKHR:        return "RayTracingProvisionalKHR";
@@ -965,8 +974,12 @@ const char* CapabilityString(int info)
 
     case CapabilityIntegerFunctions2INTEL:              return "CapabilityIntegerFunctions2INTEL";
 
+    case CapabilityAtomicFloat16AddEXT:                     return "AtomicFloat16AddEXT";
     case CapabilityAtomicFloat32AddEXT:                     return "AtomicFloat32AddEXT";
     case CapabilityAtomicFloat64AddEXT:                     return "AtomicFloat64AddEXT";
+    case CapabilityAtomicFloat16MinMaxEXT:                  return "AtomicFloat16MinMaxEXT";
+    case CapabilityAtomicFloat32MinMaxEXT:                  return "AtomicFloat32MinMaxEXT";
+    case CapabilityAtomicFloat64MinMaxEXT:                  return "AtomicFloat64MinMaxEXT";
 
     case CapabilityWorkgroupMemoryExplicitLayoutKHR:            return "CapabilityWorkgroupMemoryExplicitLayoutKHR";
     case CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR:  return "CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR";
@@ -1351,6 +1364,8 @@ const char* OpcodeString(int op)
     case 4432: return "OpSubgroupReadInvocationKHR";
 
     case OpAtomicFAddEXT: return "OpAtomicFAddEXT";
+    case OpAtomicFMinEXT: return "OpAtomicFMinEXT";
+    case OpAtomicFMaxEXT: return "OpAtomicFMaxEXT";
 
     case 5000: return "OpGroupIAddNonUniformAMD";
     case 5001: return "OpGroupFAddNonUniformAMD";
@@ -1375,6 +1390,7 @@ const char* OpcodeString(int op)
     case OpTerminateRayNV:                    return "OpTerminateRayNV";
     case OpTerminateRayKHR:                   return "OpTerminateRayKHR";
     case OpTraceNV:                           return "OpTraceNV";
+    case OpTraceRayMotionNV:                  return "OpTraceRayMotionNV";
     case OpTraceRayKHR:                       return "OpTraceRayKHR";
     case OpTypeAccelerationStructureKHR:      return "OpTypeAccelerationStructureKHR";
     case OpExecuteCallableNV:                 return "OpExecuteCallableNV";
@@ -2341,6 +2357,16 @@ void Parameterize()
     InstructionDesc[OpAtomicSMax].operands.push(OperandMemorySemantics, "'Semantics'");
     InstructionDesc[OpAtomicSMax].operands.push(OperandId, "'Value'");
 
+    InstructionDesc[OpAtomicFMinEXT].operands.push(OperandId, "'Pointer'");
+    InstructionDesc[OpAtomicFMinEXT].operands.push(OperandScope, "'Scope'");
+    InstructionDesc[OpAtomicFMinEXT].operands.push(OperandMemorySemantics, "'Semantics'");
+    InstructionDesc[OpAtomicFMinEXT].operands.push(OperandId, "'Value'");
+
+    InstructionDesc[OpAtomicFMaxEXT].operands.push(OperandId, "'Pointer'");
+    InstructionDesc[OpAtomicFMaxEXT].operands.push(OperandScope, "'Scope'");
+    InstructionDesc[OpAtomicFMaxEXT].operands.push(OperandMemorySemantics, "'Semantics'");
+    InstructionDesc[OpAtomicFMaxEXT].operands.push(OperandId, "'Value'");
+
     InstructionDesc[OpAtomicAnd].operands.push(OperandId, "'Pointer'");
     InstructionDesc[OpAtomicAnd].operands.push(OperandScope, "'Scope'");
     InstructionDesc[OpAtomicAnd].operands.push(OperandMemorySemantics, "'Semantics'");
@@ -2795,6 +2821,20 @@ void Parameterize()
     InstructionDesc[OpTraceNV].operands.push(OperandId, "'Payload'");
     InstructionDesc[OpTraceNV].setResultAndType(false, false);
 
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Acceleration Structure'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Flags'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Cull Mask'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Offset'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'SBT Record Stride'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Miss Index'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Origin'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMin'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Ray Direction'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'TMax'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Time'");
+    InstructionDesc[OpTraceRayMotionNV].operands.push(OperandId, "'Payload'");
+    InstructionDesc[OpTraceRayMotionNV].setResultAndType(false, false);
+
     InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Acceleration Structure'");
     InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Ray Flags'");
     InstructionDesc[OpTraceRayKHR].operands.push(OperandId, "'Cull Mask'");

+ 2314 - 2293
src/libraries/glslang/SPIRV/spirv.hpp

@@ -1,2293 +1,2314 @@
-// Copyright (c) 2014-2020 The Khronos Group Inc.
-// 
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and/or associated documentation files (the "Materials"),
-// to deal in the Materials without restriction, including without limitation
-// the rights to use, copy, modify, merge, publish, distribute, sublicense,
-// and/or sell copies of the Materials, and to permit persons to whom the
-// Materials are furnished to do so, subject to the following conditions:
-// 
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Materials.
-// 
-// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
-// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
-// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ 
-// 
-// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
-// IN THE MATERIALS.
-
-// This header is automatically generated by the same tool that creates
-// the Binary Section of the SPIR-V specification.
-
-// Enumeration tokens for SPIR-V, in various styles:
-//   C, C++, C++11, JSON, Lua, Python, C#, D
-// 
-// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
-// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
-// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
-// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
-// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
-// - C# will use enum classes in the Specification class located in the "Spv" namespace,
-//     e.g.: Spv.Specification.SourceLanguage.GLSL
-// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
-// 
-// Some tokens act like mask values, which can be OR'd together,
-// while others are mutually exclusive.  The mask-like ones have
-// "Mask" in their name, and a parallel enum that has the shift
-// amount (1 << x) for each corresponding enumerant.
-
-#ifndef spirv_HPP
-#define spirv_HPP
-
-namespace spv {
-
-typedef unsigned int Id;
-
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
-
-static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
-static const unsigned int OpCodeMask = 0xffff;
-static const unsigned int WordCountShift = 16;
-
-enum SourceLanguage {
-    SourceLanguageUnknown = 0,
-    SourceLanguageESSL = 1,
-    SourceLanguageGLSL = 2,
-    SourceLanguageOpenCL_C = 3,
-    SourceLanguageOpenCL_CPP = 4,
-    SourceLanguageHLSL = 5,
-    SourceLanguageMax = 0x7fffffff,
-};
-
-enum ExecutionModel {
-    ExecutionModelVertex = 0,
-    ExecutionModelTessellationControl = 1,
-    ExecutionModelTessellationEvaluation = 2,
-    ExecutionModelGeometry = 3,
-    ExecutionModelFragment = 4,
-    ExecutionModelGLCompute = 5,
-    ExecutionModelKernel = 6,
-    ExecutionModelTaskNV = 5267,
-    ExecutionModelMeshNV = 5268,
-    ExecutionModelRayGenerationKHR = 5313,
-    ExecutionModelRayGenerationNV = 5313,
-    ExecutionModelIntersectionKHR = 5314,
-    ExecutionModelIntersectionNV = 5314,
-    ExecutionModelAnyHitKHR = 5315,
-    ExecutionModelAnyHitNV = 5315,
-    ExecutionModelClosestHitKHR = 5316,
-    ExecutionModelClosestHitNV = 5316,
-    ExecutionModelMissKHR = 5317,
-    ExecutionModelMissNV = 5317,
-    ExecutionModelCallableKHR = 5318,
-    ExecutionModelCallableNV = 5318,
-    ExecutionModelMax = 0x7fffffff,
-};
-
-enum AddressingModel {
-    AddressingModelLogical = 0,
-    AddressingModelPhysical32 = 1,
-    AddressingModelPhysical64 = 2,
-    AddressingModelPhysicalStorageBuffer64 = 5348,
-    AddressingModelPhysicalStorageBuffer64EXT = 5348,
-    AddressingModelMax = 0x7fffffff,
-};
-
-enum MemoryModel {
-    MemoryModelSimple = 0,
-    MemoryModelGLSL450 = 1,
-    MemoryModelOpenCL = 2,
-    MemoryModelVulkan = 3,
-    MemoryModelVulkanKHR = 3,
-    MemoryModelMax = 0x7fffffff,
-};
-
-enum ExecutionMode {
-    ExecutionModeInvocations = 0,
-    ExecutionModeSpacingEqual = 1,
-    ExecutionModeSpacingFractionalEven = 2,
-    ExecutionModeSpacingFractionalOdd = 3,
-    ExecutionModeVertexOrderCw = 4,
-    ExecutionModeVertexOrderCcw = 5,
-    ExecutionModePixelCenterInteger = 6,
-    ExecutionModeOriginUpperLeft = 7,
-    ExecutionModeOriginLowerLeft = 8,
-    ExecutionModeEarlyFragmentTests = 9,
-    ExecutionModePointMode = 10,
-    ExecutionModeXfb = 11,
-    ExecutionModeDepthReplacing = 12,
-    ExecutionModeDepthGreater = 14,
-    ExecutionModeDepthLess = 15,
-    ExecutionModeDepthUnchanged = 16,
-    ExecutionModeLocalSize = 17,
-    ExecutionModeLocalSizeHint = 18,
-    ExecutionModeInputPoints = 19,
-    ExecutionModeInputLines = 20,
-    ExecutionModeInputLinesAdjacency = 21,
-    ExecutionModeTriangles = 22,
-    ExecutionModeInputTrianglesAdjacency = 23,
-    ExecutionModeQuads = 24,
-    ExecutionModeIsolines = 25,
-    ExecutionModeOutputVertices = 26,
-    ExecutionModeOutputPoints = 27,
-    ExecutionModeOutputLineStrip = 28,
-    ExecutionModeOutputTriangleStrip = 29,
-    ExecutionModeVecTypeHint = 30,
-    ExecutionModeContractionOff = 31,
-    ExecutionModeInitializer = 33,
-    ExecutionModeFinalizer = 34,
-    ExecutionModeSubgroupSize = 35,
-    ExecutionModeSubgroupsPerWorkgroup = 36,
-    ExecutionModeSubgroupsPerWorkgroupId = 37,
-    ExecutionModeLocalSizeId = 38,
-    ExecutionModeLocalSizeHintId = 39,
-    ExecutionModePostDepthCoverage = 4446,
-    ExecutionModeDenormPreserve = 4459,
-    ExecutionModeDenormFlushToZero = 4460,
-    ExecutionModeSignedZeroInfNanPreserve = 4461,
-    ExecutionModeRoundingModeRTE = 4462,
-    ExecutionModeRoundingModeRTZ = 4463,
-    ExecutionModeStencilRefReplacingEXT = 5027,
-    ExecutionModeOutputLinesNV = 5269,
-    ExecutionModeOutputPrimitivesNV = 5270,
-    ExecutionModeDerivativeGroupQuadsNV = 5289,
-    ExecutionModeDerivativeGroupLinearNV = 5290,
-    ExecutionModeOutputTrianglesNV = 5298,
-    ExecutionModePixelInterlockOrderedEXT = 5366,
-    ExecutionModePixelInterlockUnorderedEXT = 5367,
-    ExecutionModeSampleInterlockOrderedEXT = 5368,
-    ExecutionModeSampleInterlockUnorderedEXT = 5369,
-    ExecutionModeShadingRateInterlockOrderedEXT = 5370,
-    ExecutionModeShadingRateInterlockUnorderedEXT = 5371,
-    ExecutionModeSharedLocalMemorySizeINTEL = 5618,
-    ExecutionModeRoundingModeRTPINTEL = 5620,
-    ExecutionModeRoundingModeRTNINTEL = 5621,
-    ExecutionModeFloatingPointModeALTINTEL = 5622,
-    ExecutionModeFloatingPointModeIEEEINTEL = 5623,
-    ExecutionModeMaxWorkgroupSizeINTEL = 5893,
-    ExecutionModeMaxWorkDimINTEL = 5894,
-    ExecutionModeNoGlobalOffsetINTEL = 5895,
-    ExecutionModeNumSIMDWorkitemsINTEL = 5896,
-    ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
-    ExecutionModeMax = 0x7fffffff,
-};
-
-enum StorageClass {
-    StorageClassUniformConstant = 0,
-    StorageClassInput = 1,
-    StorageClassUniform = 2,
-    StorageClassOutput = 3,
-    StorageClassWorkgroup = 4,
-    StorageClassCrossWorkgroup = 5,
-    StorageClassPrivate = 6,
-    StorageClassFunction = 7,
-    StorageClassGeneric = 8,
-    StorageClassPushConstant = 9,
-    StorageClassAtomicCounter = 10,
-    StorageClassImage = 11,
-    StorageClassStorageBuffer = 12,
-    StorageClassCallableDataKHR = 5328,
-    StorageClassCallableDataNV = 5328,
-    StorageClassIncomingCallableDataKHR = 5329,
-    StorageClassIncomingCallableDataNV = 5329,
-    StorageClassRayPayloadKHR = 5338,
-    StorageClassRayPayloadNV = 5338,
-    StorageClassHitAttributeKHR = 5339,
-    StorageClassHitAttributeNV = 5339,
-    StorageClassIncomingRayPayloadKHR = 5342,
-    StorageClassIncomingRayPayloadNV = 5342,
-    StorageClassShaderRecordBufferKHR = 5343,
-    StorageClassShaderRecordBufferNV = 5343,
-    StorageClassPhysicalStorageBuffer = 5349,
-    StorageClassPhysicalStorageBufferEXT = 5349,
-    StorageClassCodeSectionINTEL = 5605,
-    StorageClassDeviceOnlyINTEL = 5936,
-    StorageClassHostOnlyINTEL = 5937,
-    StorageClassMax = 0x7fffffff,
-};
-
-enum Dim {
-    Dim1D = 0,
-    Dim2D = 1,
-    Dim3D = 2,
-    DimCube = 3,
-    DimRect = 4,
-    DimBuffer = 5,
-    DimSubpassData = 6,
-    DimMax = 0x7fffffff,
-};
-
-enum SamplerAddressingMode {
-    SamplerAddressingModeNone = 0,
-    SamplerAddressingModeClampToEdge = 1,
-    SamplerAddressingModeClamp = 2,
-    SamplerAddressingModeRepeat = 3,
-    SamplerAddressingModeRepeatMirrored = 4,
-    SamplerAddressingModeMax = 0x7fffffff,
-};
-
-enum SamplerFilterMode {
-    SamplerFilterModeNearest = 0,
-    SamplerFilterModeLinear = 1,
-    SamplerFilterModeMax = 0x7fffffff,
-};
-
-enum ImageFormat {
-    ImageFormatUnknown = 0,
-    ImageFormatRgba32f = 1,
-    ImageFormatRgba16f = 2,
-    ImageFormatR32f = 3,
-    ImageFormatRgba8 = 4,
-    ImageFormatRgba8Snorm = 5,
-    ImageFormatRg32f = 6,
-    ImageFormatRg16f = 7,
-    ImageFormatR11fG11fB10f = 8,
-    ImageFormatR16f = 9,
-    ImageFormatRgba16 = 10,
-    ImageFormatRgb10A2 = 11,
-    ImageFormatRg16 = 12,
-    ImageFormatRg8 = 13,
-    ImageFormatR16 = 14,
-    ImageFormatR8 = 15,
-    ImageFormatRgba16Snorm = 16,
-    ImageFormatRg16Snorm = 17,
-    ImageFormatRg8Snorm = 18,
-    ImageFormatR16Snorm = 19,
-    ImageFormatR8Snorm = 20,
-    ImageFormatRgba32i = 21,
-    ImageFormatRgba16i = 22,
-    ImageFormatRgba8i = 23,
-    ImageFormatR32i = 24,
-    ImageFormatRg32i = 25,
-    ImageFormatRg16i = 26,
-    ImageFormatRg8i = 27,
-    ImageFormatR16i = 28,
-    ImageFormatR8i = 29,
-    ImageFormatRgba32ui = 30,
-    ImageFormatRgba16ui = 31,
-    ImageFormatRgba8ui = 32,
-    ImageFormatR32ui = 33,
-    ImageFormatRgb10a2ui = 34,
-    ImageFormatRg32ui = 35,
-    ImageFormatRg16ui = 36,
-    ImageFormatRg8ui = 37,
-    ImageFormatR16ui = 38,
-    ImageFormatR8ui = 39,
-    ImageFormatR64ui = 40,
-    ImageFormatR64i = 41,
-    ImageFormatMax = 0x7fffffff,
-};
-
-enum ImageChannelOrder {
-    ImageChannelOrderR = 0,
-    ImageChannelOrderA = 1,
-    ImageChannelOrderRG = 2,
-    ImageChannelOrderRA = 3,
-    ImageChannelOrderRGB = 4,
-    ImageChannelOrderRGBA = 5,
-    ImageChannelOrderBGRA = 6,
-    ImageChannelOrderARGB = 7,
-    ImageChannelOrderIntensity = 8,
-    ImageChannelOrderLuminance = 9,
-    ImageChannelOrderRx = 10,
-    ImageChannelOrderRGx = 11,
-    ImageChannelOrderRGBx = 12,
-    ImageChannelOrderDepth = 13,
-    ImageChannelOrderDepthStencil = 14,
-    ImageChannelOrdersRGB = 15,
-    ImageChannelOrdersRGBx = 16,
-    ImageChannelOrdersRGBA = 17,
-    ImageChannelOrdersBGRA = 18,
-    ImageChannelOrderABGR = 19,
-    ImageChannelOrderMax = 0x7fffffff,
-};
-
-enum ImageChannelDataType {
-    ImageChannelDataTypeSnormInt8 = 0,
-    ImageChannelDataTypeSnormInt16 = 1,
-    ImageChannelDataTypeUnormInt8 = 2,
-    ImageChannelDataTypeUnormInt16 = 3,
-    ImageChannelDataTypeUnormShort565 = 4,
-    ImageChannelDataTypeUnormShort555 = 5,
-    ImageChannelDataTypeUnormInt101010 = 6,
-    ImageChannelDataTypeSignedInt8 = 7,
-    ImageChannelDataTypeSignedInt16 = 8,
-    ImageChannelDataTypeSignedInt32 = 9,
-    ImageChannelDataTypeUnsignedInt8 = 10,
-    ImageChannelDataTypeUnsignedInt16 = 11,
-    ImageChannelDataTypeUnsignedInt32 = 12,
-    ImageChannelDataTypeHalfFloat = 13,
-    ImageChannelDataTypeFloat = 14,
-    ImageChannelDataTypeUnormInt24 = 15,
-    ImageChannelDataTypeUnormInt101010_2 = 16,
-    ImageChannelDataTypeMax = 0x7fffffff,
-};
-
-enum ImageOperandsShift {
-    ImageOperandsBiasShift = 0,
-    ImageOperandsLodShift = 1,
-    ImageOperandsGradShift = 2,
-    ImageOperandsConstOffsetShift = 3,
-    ImageOperandsOffsetShift = 4,
-    ImageOperandsConstOffsetsShift = 5,
-    ImageOperandsSampleShift = 6,
-    ImageOperandsMinLodShift = 7,
-    ImageOperandsMakeTexelAvailableShift = 8,
-    ImageOperandsMakeTexelAvailableKHRShift = 8,
-    ImageOperandsMakeTexelVisibleShift = 9,
-    ImageOperandsMakeTexelVisibleKHRShift = 9,
-    ImageOperandsNonPrivateTexelShift = 10,
-    ImageOperandsNonPrivateTexelKHRShift = 10,
-    ImageOperandsVolatileTexelShift = 11,
-    ImageOperandsVolatileTexelKHRShift = 11,
-    ImageOperandsSignExtendShift = 12,
-    ImageOperandsZeroExtendShift = 13,
-    ImageOperandsMax = 0x7fffffff,
-};
-
-enum ImageOperandsMask {
-    ImageOperandsMaskNone = 0,
-    ImageOperandsBiasMask = 0x00000001,
-    ImageOperandsLodMask = 0x00000002,
-    ImageOperandsGradMask = 0x00000004,
-    ImageOperandsConstOffsetMask = 0x00000008,
-    ImageOperandsOffsetMask = 0x00000010,
-    ImageOperandsConstOffsetsMask = 0x00000020,
-    ImageOperandsSampleMask = 0x00000040,
-    ImageOperandsMinLodMask = 0x00000080,
-    ImageOperandsMakeTexelAvailableMask = 0x00000100,
-    ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
-    ImageOperandsMakeTexelVisibleMask = 0x00000200,
-    ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
-    ImageOperandsNonPrivateTexelMask = 0x00000400,
-    ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
-    ImageOperandsVolatileTexelMask = 0x00000800,
-    ImageOperandsVolatileTexelKHRMask = 0x00000800,
-    ImageOperandsSignExtendMask = 0x00001000,
-    ImageOperandsZeroExtendMask = 0x00002000,
-};
-
-enum FPFastMathModeShift {
-    FPFastMathModeNotNaNShift = 0,
-    FPFastMathModeNotInfShift = 1,
-    FPFastMathModeNSZShift = 2,
-    FPFastMathModeAllowRecipShift = 3,
-    FPFastMathModeFastShift = 4,
-    FPFastMathModeAllowContractFastINTELShift = 16,
-    FPFastMathModeAllowReassocINTELShift = 17,
-    FPFastMathModeMax = 0x7fffffff,
-};
-
-enum FPFastMathModeMask {
-    FPFastMathModeMaskNone = 0,
-    FPFastMathModeNotNaNMask = 0x00000001,
-    FPFastMathModeNotInfMask = 0x00000002,
-    FPFastMathModeNSZMask = 0x00000004,
-    FPFastMathModeAllowRecipMask = 0x00000008,
-    FPFastMathModeFastMask = 0x00000010,
-    FPFastMathModeAllowContractFastINTELMask = 0x00010000,
-    FPFastMathModeAllowReassocINTELMask = 0x00020000,
-};
-
-enum FPRoundingMode {
-    FPRoundingModeRTE = 0,
-    FPRoundingModeRTZ = 1,
-    FPRoundingModeRTP = 2,
-    FPRoundingModeRTN = 3,
-    FPRoundingModeMax = 0x7fffffff,
-};
-
-enum LinkageType {
-    LinkageTypeExport = 0,
-    LinkageTypeImport = 1,
-    LinkageTypeMax = 0x7fffffff,
-};
-
-enum AccessQualifier {
-    AccessQualifierReadOnly = 0,
-    AccessQualifierWriteOnly = 1,
-    AccessQualifierReadWrite = 2,
-    AccessQualifierMax = 0x7fffffff,
-};
-
-enum FunctionParameterAttribute {
-    FunctionParameterAttributeZext = 0,
-    FunctionParameterAttributeSext = 1,
-    FunctionParameterAttributeByVal = 2,
-    FunctionParameterAttributeSret = 3,
-    FunctionParameterAttributeNoAlias = 4,
-    FunctionParameterAttributeNoCapture = 5,
-    FunctionParameterAttributeNoWrite = 6,
-    FunctionParameterAttributeNoReadWrite = 7,
-    FunctionParameterAttributeMax = 0x7fffffff,
-};
-
-enum Decoration {
-    DecorationRelaxedPrecision = 0,
-    DecorationSpecId = 1,
-    DecorationBlock = 2,
-    DecorationBufferBlock = 3,
-    DecorationRowMajor = 4,
-    DecorationColMajor = 5,
-    DecorationArrayStride = 6,
-    DecorationMatrixStride = 7,
-    DecorationGLSLShared = 8,
-    DecorationGLSLPacked = 9,
-    DecorationCPacked = 10,
-    DecorationBuiltIn = 11,
-    DecorationNoPerspective = 13,
-    DecorationFlat = 14,
-    DecorationPatch = 15,
-    DecorationCentroid = 16,
-    DecorationSample = 17,
-    DecorationInvariant = 18,
-    DecorationRestrict = 19,
-    DecorationAliased = 20,
-    DecorationVolatile = 21,
-    DecorationConstant = 22,
-    DecorationCoherent = 23,
-    DecorationNonWritable = 24,
-    DecorationNonReadable = 25,
-    DecorationUniform = 26,
-    DecorationUniformId = 27,
-    DecorationSaturatedConversion = 28,
-    DecorationStream = 29,
-    DecorationLocation = 30,
-    DecorationComponent = 31,
-    DecorationIndex = 32,
-    DecorationBinding = 33,
-    DecorationDescriptorSet = 34,
-    DecorationOffset = 35,
-    DecorationXfbBuffer = 36,
-    DecorationXfbStride = 37,
-    DecorationFuncParamAttr = 38,
-    DecorationFPRoundingMode = 39,
-    DecorationFPFastMathMode = 40,
-    DecorationLinkageAttributes = 41,
-    DecorationNoContraction = 42,
-    DecorationInputAttachmentIndex = 43,
-    DecorationAlignment = 44,
-    DecorationMaxByteOffset = 45,
-    DecorationAlignmentId = 46,
-    DecorationMaxByteOffsetId = 47,
-    DecorationNoSignedWrap = 4469,
-    DecorationNoUnsignedWrap = 4470,
-    DecorationExplicitInterpAMD = 4999,
-    DecorationOverrideCoverageNV = 5248,
-    DecorationPassthroughNV = 5250,
-    DecorationViewportRelativeNV = 5252,
-    DecorationSecondaryViewportRelativeNV = 5256,
-    DecorationPerPrimitiveNV = 5271,
-    DecorationPerViewNV = 5272,
-    DecorationPerTaskNV = 5273,
-    DecorationPerVertexNV = 5285,
-    DecorationNonUniform = 5300,
-    DecorationNonUniformEXT = 5300,
-    DecorationRestrictPointer = 5355,
-    DecorationRestrictPointerEXT = 5355,
-    DecorationAliasedPointer = 5356,
-    DecorationAliasedPointerEXT = 5356,
-    DecorationSIMTCallINTEL = 5599,
-    DecorationReferencedIndirectlyINTEL = 5602,
-    DecorationClobberINTEL = 5607,
-    DecorationSideEffectsINTEL = 5608,
-    DecorationVectorComputeVariableINTEL = 5624,
-    DecorationFuncParamIOKindINTEL = 5625,
-    DecorationVectorComputeFunctionINTEL = 5626,
-    DecorationStackCallINTEL = 5627,
-    DecorationGlobalVariableOffsetINTEL = 5628,
-    DecorationCounterBuffer = 5634,
-    DecorationHlslCounterBufferGOOGLE = 5634,
-    DecorationHlslSemanticGOOGLE = 5635,
-    DecorationUserSemantic = 5635,
-    DecorationUserTypeGOOGLE = 5636,
-    DecorationFunctionRoundingModeINTEL = 5822,
-    DecorationFunctionDenormModeINTEL = 5823,
-    DecorationRegisterINTEL = 5825,
-    DecorationMemoryINTEL = 5826,
-    DecorationNumbanksINTEL = 5827,
-    DecorationBankwidthINTEL = 5828,
-    DecorationMaxPrivateCopiesINTEL = 5829,
-    DecorationSinglepumpINTEL = 5830,
-    DecorationDoublepumpINTEL = 5831,
-    DecorationMaxReplicatesINTEL = 5832,
-    DecorationSimpleDualPortINTEL = 5833,
-    DecorationMergeINTEL = 5834,
-    DecorationBankBitsINTEL = 5835,
-    DecorationForcePow2DepthINTEL = 5836,
-    DecorationBurstCoalesceINTEL = 5899,
-    DecorationCacheSizeINTEL = 5900,
-    DecorationDontStaticallyCoalesceINTEL = 5901,
-    DecorationPrefetchINTEL = 5902,
-    DecorationStallEnableINTEL = 5905,
-    DecorationFuseLoopsInFunctionINTEL = 5907,
-    DecorationBufferLocationINTEL = 5921,
-    DecorationIOPipeStorageINTEL = 5944,
-    DecorationFunctionFloatingPointModeINTEL = 6080,
-    DecorationSingleElementVectorINTEL = 6085,
-    DecorationVectorComputeCallableFunctionINTEL = 6087,
-    DecorationMax = 0x7fffffff,
-};
-
-enum BuiltIn {
-    BuiltInPosition = 0,
-    BuiltInPointSize = 1,
-    BuiltInClipDistance = 3,
-    BuiltInCullDistance = 4,
-    BuiltInVertexId = 5,
-    BuiltInInstanceId = 6,
-    BuiltInPrimitiveId = 7,
-    BuiltInInvocationId = 8,
-    BuiltInLayer = 9,
-    BuiltInViewportIndex = 10,
-    BuiltInTessLevelOuter = 11,
-    BuiltInTessLevelInner = 12,
-    BuiltInTessCoord = 13,
-    BuiltInPatchVertices = 14,
-    BuiltInFragCoord = 15,
-    BuiltInPointCoord = 16,
-    BuiltInFrontFacing = 17,
-    BuiltInSampleId = 18,
-    BuiltInSamplePosition = 19,
-    BuiltInSampleMask = 20,
-    BuiltInFragDepth = 22,
-    BuiltInHelperInvocation = 23,
-    BuiltInNumWorkgroups = 24,
-    BuiltInWorkgroupSize = 25,
-    BuiltInWorkgroupId = 26,
-    BuiltInLocalInvocationId = 27,
-    BuiltInGlobalInvocationId = 28,
-    BuiltInLocalInvocationIndex = 29,
-    BuiltInWorkDim = 30,
-    BuiltInGlobalSize = 31,
-    BuiltInEnqueuedWorkgroupSize = 32,
-    BuiltInGlobalOffset = 33,
-    BuiltInGlobalLinearId = 34,
-    BuiltInSubgroupSize = 36,
-    BuiltInSubgroupMaxSize = 37,
-    BuiltInNumSubgroups = 38,
-    BuiltInNumEnqueuedSubgroups = 39,
-    BuiltInSubgroupId = 40,
-    BuiltInSubgroupLocalInvocationId = 41,
-    BuiltInVertexIndex = 42,
-    BuiltInInstanceIndex = 43,
-    BuiltInSubgroupEqMask = 4416,
-    BuiltInSubgroupEqMaskKHR = 4416,
-    BuiltInSubgroupGeMask = 4417,
-    BuiltInSubgroupGeMaskKHR = 4417,
-    BuiltInSubgroupGtMask = 4418,
-    BuiltInSubgroupGtMaskKHR = 4418,
-    BuiltInSubgroupLeMask = 4419,
-    BuiltInSubgroupLeMaskKHR = 4419,
-    BuiltInSubgroupLtMask = 4420,
-    BuiltInSubgroupLtMaskKHR = 4420,
-    BuiltInBaseVertex = 4424,
-    BuiltInBaseInstance = 4425,
-    BuiltInDrawIndex = 4426,
-    BuiltInPrimitiveShadingRateKHR = 4432,
-    BuiltInDeviceIndex = 4438,
-    BuiltInViewIndex = 4440,
-    BuiltInShadingRateKHR = 4444,
-    BuiltInBaryCoordNoPerspAMD = 4992,
-    BuiltInBaryCoordNoPerspCentroidAMD = 4993,
-    BuiltInBaryCoordNoPerspSampleAMD = 4994,
-    BuiltInBaryCoordSmoothAMD = 4995,
-    BuiltInBaryCoordSmoothCentroidAMD = 4996,
-    BuiltInBaryCoordSmoothSampleAMD = 4997,
-    BuiltInBaryCoordPullModelAMD = 4998,
-    BuiltInFragStencilRefEXT = 5014,
-    BuiltInViewportMaskNV = 5253,
-    BuiltInSecondaryPositionNV = 5257,
-    BuiltInSecondaryViewportMaskNV = 5258,
-    BuiltInPositionPerViewNV = 5261,
-    BuiltInViewportMaskPerViewNV = 5262,
-    BuiltInFullyCoveredEXT = 5264,
-    BuiltInTaskCountNV = 5274,
-    BuiltInPrimitiveCountNV = 5275,
-    BuiltInPrimitiveIndicesNV = 5276,
-    BuiltInClipDistancePerViewNV = 5277,
-    BuiltInCullDistancePerViewNV = 5278,
-    BuiltInLayerPerViewNV = 5279,
-    BuiltInMeshViewCountNV = 5280,
-    BuiltInMeshViewIndicesNV = 5281,
-    BuiltInBaryCoordNV = 5286,
-    BuiltInBaryCoordNoPerspNV = 5287,
-    BuiltInFragSizeEXT = 5292,
-    BuiltInFragmentSizeNV = 5292,
-    BuiltInFragInvocationCountEXT = 5293,
-    BuiltInInvocationsPerPixelNV = 5293,
-    BuiltInLaunchIdKHR = 5319,
-    BuiltInLaunchIdNV = 5319,
-    BuiltInLaunchSizeKHR = 5320,
-    BuiltInLaunchSizeNV = 5320,
-    BuiltInWorldRayOriginKHR = 5321,
-    BuiltInWorldRayOriginNV = 5321,
-    BuiltInWorldRayDirectionKHR = 5322,
-    BuiltInWorldRayDirectionNV = 5322,
-    BuiltInObjectRayOriginKHR = 5323,
-    BuiltInObjectRayOriginNV = 5323,
-    BuiltInObjectRayDirectionKHR = 5324,
-    BuiltInObjectRayDirectionNV = 5324,
-    BuiltInRayTminKHR = 5325,
-    BuiltInRayTminNV = 5325,
-    BuiltInRayTmaxKHR = 5326,
-    BuiltInRayTmaxNV = 5326,
-    BuiltInInstanceCustomIndexKHR = 5327,
-    BuiltInInstanceCustomIndexNV = 5327,
-    BuiltInObjectToWorldKHR = 5330,
-    BuiltInObjectToWorldNV = 5330,
-    BuiltInWorldToObjectKHR = 5331,
-    BuiltInWorldToObjectNV = 5331,
-    BuiltInHitTNV = 5332,
-    BuiltInHitKindKHR = 5333,
-    BuiltInHitKindNV = 5333,
-    BuiltInIncomingRayFlagsKHR = 5351,
-    BuiltInIncomingRayFlagsNV = 5351,
-    BuiltInRayGeometryIndexKHR = 5352,
-    BuiltInWarpsPerSMNV = 5374,
-    BuiltInSMCountNV = 5375,
-    BuiltInWarpIDNV = 5376,
-    BuiltInSMIDNV = 5377,
-    BuiltInMax = 0x7fffffff,
-};
-
-enum SelectionControlShift {
-    SelectionControlFlattenShift = 0,
-    SelectionControlDontFlattenShift = 1,
-    SelectionControlMax = 0x7fffffff,
-};
-
-enum SelectionControlMask {
-    SelectionControlMaskNone = 0,
-    SelectionControlFlattenMask = 0x00000001,
-    SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
-    LoopControlUnrollShift = 0,
-    LoopControlDontUnrollShift = 1,
-    LoopControlDependencyInfiniteShift = 2,
-    LoopControlDependencyLengthShift = 3,
-    LoopControlMinIterationsShift = 4,
-    LoopControlMaxIterationsShift = 5,
-    LoopControlIterationMultipleShift = 6,
-    LoopControlPeelCountShift = 7,
-    LoopControlPartialCountShift = 8,
-    LoopControlInitiationIntervalINTELShift = 16,
-    LoopControlMaxConcurrencyINTELShift = 17,
-    LoopControlDependencyArrayINTELShift = 18,
-    LoopControlPipelineEnableINTELShift = 19,
-    LoopControlLoopCoalesceINTELShift = 20,
-    LoopControlMaxInterleavingINTELShift = 21,
-    LoopControlSpeculatedIterationsINTELShift = 22,
-    LoopControlNoFusionINTELShift = 23,
-    LoopControlMax = 0x7fffffff,
-};
-
-enum LoopControlMask {
-    LoopControlMaskNone = 0,
-    LoopControlUnrollMask = 0x00000001,
-    LoopControlDontUnrollMask = 0x00000002,
-    LoopControlDependencyInfiniteMask = 0x00000004,
-    LoopControlDependencyLengthMask = 0x00000008,
-    LoopControlMinIterationsMask = 0x00000010,
-    LoopControlMaxIterationsMask = 0x00000020,
-    LoopControlIterationMultipleMask = 0x00000040,
-    LoopControlPeelCountMask = 0x00000080,
-    LoopControlPartialCountMask = 0x00000100,
-    LoopControlInitiationIntervalINTELMask = 0x00010000,
-    LoopControlMaxConcurrencyINTELMask = 0x00020000,
-    LoopControlDependencyArrayINTELMask = 0x00040000,
-    LoopControlPipelineEnableINTELMask = 0x00080000,
-    LoopControlLoopCoalesceINTELMask = 0x00100000,
-    LoopControlMaxInterleavingINTELMask = 0x00200000,
-    LoopControlSpeculatedIterationsINTELMask = 0x00400000,
-    LoopControlNoFusionINTELMask = 0x00800000,
-};
-
-enum FunctionControlShift {
-    FunctionControlInlineShift = 0,
-    FunctionControlDontInlineShift = 1,
-    FunctionControlPureShift = 2,
-    FunctionControlConstShift = 3,
-    FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
-    FunctionControlMaskNone = 0,
-    FunctionControlInlineMask = 0x00000001,
-    FunctionControlDontInlineMask = 0x00000002,
-    FunctionControlPureMask = 0x00000004,
-    FunctionControlConstMask = 0x00000008,
-};
-
-enum MemorySemanticsShift {
-    MemorySemanticsAcquireShift = 1,
-    MemorySemanticsReleaseShift = 2,
-    MemorySemanticsAcquireReleaseShift = 3,
-    MemorySemanticsSequentiallyConsistentShift = 4,
-    MemorySemanticsUniformMemoryShift = 6,
-    MemorySemanticsSubgroupMemoryShift = 7,
-    MemorySemanticsWorkgroupMemoryShift = 8,
-    MemorySemanticsCrossWorkgroupMemoryShift = 9,
-    MemorySemanticsAtomicCounterMemoryShift = 10,
-    MemorySemanticsImageMemoryShift = 11,
-    MemorySemanticsOutputMemoryShift = 12,
-    MemorySemanticsOutputMemoryKHRShift = 12,
-    MemorySemanticsMakeAvailableShift = 13,
-    MemorySemanticsMakeAvailableKHRShift = 13,
-    MemorySemanticsMakeVisibleShift = 14,
-    MemorySemanticsMakeVisibleKHRShift = 14,
-    MemorySemanticsVolatileShift = 15,
-    MemorySemanticsMax = 0x7fffffff,
-};
-
-enum MemorySemanticsMask {
-    MemorySemanticsMaskNone = 0,
-    MemorySemanticsAcquireMask = 0x00000002,
-    MemorySemanticsReleaseMask = 0x00000004,
-    MemorySemanticsAcquireReleaseMask = 0x00000008,
-    MemorySemanticsSequentiallyConsistentMask = 0x00000010,
-    MemorySemanticsUniformMemoryMask = 0x00000040,
-    MemorySemanticsSubgroupMemoryMask = 0x00000080,
-    MemorySemanticsWorkgroupMemoryMask = 0x00000100,
-    MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
-    MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
-    MemorySemanticsImageMemoryMask = 0x00000800,
-    MemorySemanticsOutputMemoryMask = 0x00001000,
-    MemorySemanticsOutputMemoryKHRMask = 0x00001000,
-    MemorySemanticsMakeAvailableMask = 0x00002000,
-    MemorySemanticsMakeAvailableKHRMask = 0x00002000,
-    MemorySemanticsMakeVisibleMask = 0x00004000,
-    MemorySemanticsMakeVisibleKHRMask = 0x00004000,
-    MemorySemanticsVolatileMask = 0x00008000,
-};
-
-enum MemoryAccessShift {
-    MemoryAccessVolatileShift = 0,
-    MemoryAccessAlignedShift = 1,
-    MemoryAccessNontemporalShift = 2,
-    MemoryAccessMakePointerAvailableShift = 3,
-    MemoryAccessMakePointerAvailableKHRShift = 3,
-    MemoryAccessMakePointerVisibleShift = 4,
-    MemoryAccessMakePointerVisibleKHRShift = 4,
-    MemoryAccessNonPrivatePointerShift = 5,
-    MemoryAccessNonPrivatePointerKHRShift = 5,
-    MemoryAccessMax = 0x7fffffff,
-};
-
-enum MemoryAccessMask {
-    MemoryAccessMaskNone = 0,
-    MemoryAccessVolatileMask = 0x00000001,
-    MemoryAccessAlignedMask = 0x00000002,
-    MemoryAccessNontemporalMask = 0x00000004,
-    MemoryAccessMakePointerAvailableMask = 0x00000008,
-    MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
-    MemoryAccessMakePointerVisibleMask = 0x00000010,
-    MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
-    MemoryAccessNonPrivatePointerMask = 0x00000020,
-    MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
-};
-
-enum Scope {
-    ScopeCrossDevice = 0,
-    ScopeDevice = 1,
-    ScopeWorkgroup = 2,
-    ScopeSubgroup = 3,
-    ScopeInvocation = 4,
-    ScopeQueueFamily = 5,
-    ScopeQueueFamilyKHR = 5,
-    ScopeShaderCallKHR = 6,
-    ScopeMax = 0x7fffffff,
-};
-
-enum GroupOperation {
-    GroupOperationReduce = 0,
-    GroupOperationInclusiveScan = 1,
-    GroupOperationExclusiveScan = 2,
-    GroupOperationClusteredReduce = 3,
-    GroupOperationPartitionedReduceNV = 6,
-    GroupOperationPartitionedInclusiveScanNV = 7,
-    GroupOperationPartitionedExclusiveScanNV = 8,
-    GroupOperationMax = 0x7fffffff,
-};
-
-enum KernelEnqueueFlags {
-    KernelEnqueueFlagsNoWait = 0,
-    KernelEnqueueFlagsWaitKernel = 1,
-    KernelEnqueueFlagsWaitWorkGroup = 2,
-    KernelEnqueueFlagsMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoShift {
-    KernelProfilingInfoCmdExecTimeShift = 0,
-    KernelProfilingInfoMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoMask {
-    KernelProfilingInfoMaskNone = 0,
-    KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
-    CapabilityMatrix = 0,
-    CapabilityShader = 1,
-    CapabilityGeometry = 2,
-    CapabilityTessellation = 3,
-    CapabilityAddresses = 4,
-    CapabilityLinkage = 5,
-    CapabilityKernel = 6,
-    CapabilityVector16 = 7,
-    CapabilityFloat16Buffer = 8,
-    CapabilityFloat16 = 9,
-    CapabilityFloat64 = 10,
-    CapabilityInt64 = 11,
-    CapabilityInt64Atomics = 12,
-    CapabilityImageBasic = 13,
-    CapabilityImageReadWrite = 14,
-    CapabilityImageMipmap = 15,
-    CapabilityPipes = 17,
-    CapabilityGroups = 18,
-    CapabilityDeviceEnqueue = 19,
-    CapabilityLiteralSampler = 20,
-    CapabilityAtomicStorage = 21,
-    CapabilityInt16 = 22,
-    CapabilityTessellationPointSize = 23,
-    CapabilityGeometryPointSize = 24,
-    CapabilityImageGatherExtended = 25,
-    CapabilityStorageImageMultisample = 27,
-    CapabilityUniformBufferArrayDynamicIndexing = 28,
-    CapabilitySampledImageArrayDynamicIndexing = 29,
-    CapabilityStorageBufferArrayDynamicIndexing = 30,
-    CapabilityStorageImageArrayDynamicIndexing = 31,
-    CapabilityClipDistance = 32,
-    CapabilityCullDistance = 33,
-    CapabilityImageCubeArray = 34,
-    CapabilitySampleRateShading = 35,
-    CapabilityImageRect = 36,
-    CapabilitySampledRect = 37,
-    CapabilityGenericPointer = 38,
-    CapabilityInt8 = 39,
-    CapabilityInputAttachment = 40,
-    CapabilitySparseResidency = 41,
-    CapabilityMinLod = 42,
-    CapabilitySampled1D = 43,
-    CapabilityImage1D = 44,
-    CapabilitySampledCubeArray = 45,
-    CapabilitySampledBuffer = 46,
-    CapabilityImageBuffer = 47,
-    CapabilityImageMSArray = 48,
-    CapabilityStorageImageExtendedFormats = 49,
-    CapabilityImageQuery = 50,
-    CapabilityDerivativeControl = 51,
-    CapabilityInterpolationFunction = 52,
-    CapabilityTransformFeedback = 53,
-    CapabilityGeometryStreams = 54,
-    CapabilityStorageImageReadWithoutFormat = 55,
-    CapabilityStorageImageWriteWithoutFormat = 56,
-    CapabilityMultiViewport = 57,
-    CapabilitySubgroupDispatch = 58,
-    CapabilityNamedBarrier = 59,
-    CapabilityPipeStorage = 60,
-    CapabilityGroupNonUniform = 61,
-    CapabilityGroupNonUniformVote = 62,
-    CapabilityGroupNonUniformArithmetic = 63,
-    CapabilityGroupNonUniformBallot = 64,
-    CapabilityGroupNonUniformShuffle = 65,
-    CapabilityGroupNonUniformShuffleRelative = 66,
-    CapabilityGroupNonUniformClustered = 67,
-    CapabilityGroupNonUniformQuad = 68,
-    CapabilityShaderLayer = 69,
-    CapabilityShaderViewportIndex = 70,
-    CapabilityFragmentShadingRateKHR = 4422,
-    CapabilitySubgroupBallotKHR = 4423,
-    CapabilityDrawParameters = 4427,
-    CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428,
-    CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
-    CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
-    CapabilitySubgroupVoteKHR = 4431,
-    CapabilityStorageBuffer16BitAccess = 4433,
-    CapabilityStorageUniformBufferBlock16 = 4433,
-    CapabilityStorageUniform16 = 4434,
-    CapabilityUniformAndStorageBuffer16BitAccess = 4434,
-    CapabilityStoragePushConstant16 = 4435,
-    CapabilityStorageInputOutput16 = 4436,
-    CapabilityDeviceGroup = 4437,
-    CapabilityMultiView = 4439,
-    CapabilityVariablePointersStorageBuffer = 4441,
-    CapabilityVariablePointers = 4442,
-    CapabilityAtomicStorageOps = 4445,
-    CapabilitySampleMaskPostDepthCoverage = 4447,
-    CapabilityStorageBuffer8BitAccess = 4448,
-    CapabilityUniformAndStorageBuffer8BitAccess = 4449,
-    CapabilityStoragePushConstant8 = 4450,
-    CapabilityDenormPreserve = 4464,
-    CapabilityDenormFlushToZero = 4465,
-    CapabilitySignedZeroInfNanPreserve = 4466,
-    CapabilityRoundingModeRTE = 4467,
-    CapabilityRoundingModeRTZ = 4468,
-    CapabilityRayQueryProvisionalKHR = 4471,
-    CapabilityRayQueryKHR = 4472,
-    CapabilityRayTraversalPrimitiveCullingKHR = 4478,
-    CapabilityRayTracingKHR = 4479,
-    CapabilityFloat16ImageAMD = 5008,
-    CapabilityImageGatherBiasLodAMD = 5009,
-    CapabilityFragmentMaskAMD = 5010,
-    CapabilityStencilExportEXT = 5013,
-    CapabilityImageReadWriteLodAMD = 5015,
-    CapabilityInt64ImageEXT = 5016,
-    CapabilityShaderClockKHR = 5055,
-    CapabilitySampleMaskOverrideCoverageNV = 5249,
-    CapabilityGeometryShaderPassthroughNV = 5251,
-    CapabilityShaderViewportIndexLayerEXT = 5254,
-    CapabilityShaderViewportIndexLayerNV = 5254,
-    CapabilityShaderViewportMaskNV = 5255,
-    CapabilityShaderStereoViewNV = 5259,
-    CapabilityPerViewAttributesNV = 5260,
-    CapabilityFragmentFullyCoveredEXT = 5265,
-    CapabilityMeshShadingNV = 5266,
-    CapabilityImageFootprintNV = 5282,
-    CapabilityFragmentBarycentricNV = 5284,
-    CapabilityComputeDerivativeGroupQuadsNV = 5288,
-    CapabilityFragmentDensityEXT = 5291,
-    CapabilityShadingRateNV = 5291,
-    CapabilityGroupNonUniformPartitionedNV = 5297,
-    CapabilityShaderNonUniform = 5301,
-    CapabilityShaderNonUniformEXT = 5301,
-    CapabilityRuntimeDescriptorArray = 5302,
-    CapabilityRuntimeDescriptorArrayEXT = 5302,
-    CapabilityInputAttachmentArrayDynamicIndexing = 5303,
-    CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
-    CapabilityUniformTexelBufferArrayDynamicIndexing = 5304,
-    CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
-    CapabilityStorageTexelBufferArrayDynamicIndexing = 5305,
-    CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
-    CapabilityUniformBufferArrayNonUniformIndexing = 5306,
-    CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
-    CapabilitySampledImageArrayNonUniformIndexing = 5307,
-    CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
-    CapabilityStorageBufferArrayNonUniformIndexing = 5308,
-    CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
-    CapabilityStorageImageArrayNonUniformIndexing = 5309,
-    CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
-    CapabilityInputAttachmentArrayNonUniformIndexing = 5310,
-    CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
-    CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311,
-    CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
-    CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
-    CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
-    CapabilityRayTracingNV = 5340,
-    CapabilityVulkanMemoryModel = 5345,
-    CapabilityVulkanMemoryModelKHR = 5345,
-    CapabilityVulkanMemoryModelDeviceScope = 5346,
-    CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
-    CapabilityPhysicalStorageBufferAddresses = 5347,
-    CapabilityPhysicalStorageBufferAddressesEXT = 5347,
-    CapabilityComputeDerivativeGroupLinearNV = 5350,
-    CapabilityRayTracingProvisionalKHR = 5353,
-    CapabilityCooperativeMatrixNV = 5357,
-    CapabilityFragmentShaderSampleInterlockEXT = 5363,
-    CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
-    CapabilityShaderSMBuiltinsNV = 5373,
-    CapabilityFragmentShaderPixelInterlockEXT = 5378,
-    CapabilityDemoteToHelperInvocationEXT = 5379,
-    CapabilitySubgroupShuffleINTEL = 5568,
-    CapabilitySubgroupBufferBlockIOINTEL = 5569,
-    CapabilitySubgroupImageBlockIOINTEL = 5570,
-    CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
-    CapabilityRoundToInfinityINTEL = 5582,
-    CapabilityFloatingPointModeINTEL = 5583,
-    CapabilityIntegerFunctions2INTEL = 5584,
-    CapabilityFunctionPointersINTEL = 5603,
-    CapabilityIndirectReferencesINTEL = 5604,
-    CapabilityAsmINTEL = 5606,
-    CapabilityVectorComputeINTEL = 5617,
-    CapabilityVectorAnyINTEL = 5619,
-    CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
-    CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
-    CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
-    CapabilityVariableLengthArrayINTEL = 5817,
-    CapabilityFunctionFloatControlINTEL = 5821,
-    CapabilityFPGAMemoryAttributesINTEL = 5824,
-    CapabilityFPFastMathModeINTEL = 5837,
-    CapabilityArbitraryPrecisionIntegersINTEL = 5844,
-    CapabilityUnstructuredLoopControlsINTEL = 5886,
-    CapabilityFPGALoopControlsINTEL = 5888,
-    CapabilityKernelAttributesINTEL = 5892,
-    CapabilityFPGAKernelAttributesINTEL = 5897,
-    CapabilityFPGAMemoryAccessesINTEL = 5898,
-    CapabilityFPGAClusterAttributesINTEL = 5904,
-    CapabilityLoopFuseINTEL = 5906,
-    CapabilityFPGABufferLocationINTEL = 5920,
-    CapabilityUSMStorageClassesINTEL = 5935,
-    CapabilityIOPipesINTEL = 5943,
-    CapabilityBlockingPipesINTEL = 5945,
-    CapabilityFPGARegINTEL = 5948,
-    CapabilityAtomicFloat32AddEXT = 6033,
-    CapabilityAtomicFloat64AddEXT = 6034,
-    CapabilityLongConstantCompositeINTEL = 6089,
-    CapabilityMax = 0x7fffffff,
-};
-
-enum RayFlagsShift {
-    RayFlagsOpaqueKHRShift = 0,
-    RayFlagsNoOpaqueKHRShift = 1,
-    RayFlagsTerminateOnFirstHitKHRShift = 2,
-    RayFlagsSkipClosestHitShaderKHRShift = 3,
-    RayFlagsCullBackFacingTrianglesKHRShift = 4,
-    RayFlagsCullFrontFacingTrianglesKHRShift = 5,
-    RayFlagsCullOpaqueKHRShift = 6,
-    RayFlagsCullNoOpaqueKHRShift = 7,
-    RayFlagsSkipTrianglesKHRShift = 8,
-    RayFlagsSkipAABBsKHRShift = 9,
-    RayFlagsMax = 0x7fffffff,
-};
-
-enum RayFlagsMask {
-    RayFlagsMaskNone = 0,
-    RayFlagsOpaqueKHRMask = 0x00000001,
-    RayFlagsNoOpaqueKHRMask = 0x00000002,
-    RayFlagsTerminateOnFirstHitKHRMask = 0x00000004,
-    RayFlagsSkipClosestHitShaderKHRMask = 0x00000008,
-    RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010,
-    RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020,
-    RayFlagsCullOpaqueKHRMask = 0x00000040,
-    RayFlagsCullNoOpaqueKHRMask = 0x00000080,
-    RayFlagsSkipTrianglesKHRMask = 0x00000100,
-    RayFlagsSkipAABBsKHRMask = 0x00000200,
-};
-
-enum RayQueryIntersection {
-    RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0,
-    RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1,
-    RayQueryIntersectionMax = 0x7fffffff,
-};
-
-enum RayQueryCommittedIntersectionType {
-    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0,
-    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1,
-    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2,
-    RayQueryCommittedIntersectionTypeMax = 0x7fffffff,
-};
-
-enum RayQueryCandidateIntersectionType {
-    RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0,
-    RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1,
-    RayQueryCandidateIntersectionTypeMax = 0x7fffffff,
-};
-
-enum FragmentShadingRateShift {
-    FragmentShadingRateVertical2PixelsShift = 0,
-    FragmentShadingRateVertical4PixelsShift = 1,
-    FragmentShadingRateHorizontal2PixelsShift = 2,
-    FragmentShadingRateHorizontal4PixelsShift = 3,
-    FragmentShadingRateMax = 0x7fffffff,
-};
-
-enum FragmentShadingRateMask {
-    FragmentShadingRateMaskNone = 0,
-    FragmentShadingRateVertical2PixelsMask = 0x00000001,
-    FragmentShadingRateVertical4PixelsMask = 0x00000002,
-    FragmentShadingRateHorizontal2PixelsMask = 0x00000004,
-    FragmentShadingRateHorizontal4PixelsMask = 0x00000008,
-};
-
-enum FPDenormMode {
-  FPDenormModePreserve = 0,
-  FPDenormModeFlushToZero = 1,
-  FPDenormModeMax = 0x7fffffff,
-};
-
-enum FPOperationMode {
-  FPOperationModeIEEE = 0,
-  FPOperationModeALT = 1,
-  FPOperationModeMax = 0x7fffffff,
-};
-
-enum Op {
-    OpNop = 0,
-    OpUndef = 1,
-    OpSourceContinued = 2,
-    OpSource = 3,
-    OpSourceExtension = 4,
-    OpName = 5,
-    OpMemberName = 6,
-    OpString = 7,
-    OpLine = 8,
-    OpExtension = 10,
-    OpExtInstImport = 11,
-    OpExtInst = 12,
-    OpMemoryModel = 14,
-    OpEntryPoint = 15,
-    OpExecutionMode = 16,
-    OpCapability = 17,
-    OpTypeVoid = 19,
-    OpTypeBool = 20,
-    OpTypeInt = 21,
-    OpTypeFloat = 22,
-    OpTypeVector = 23,
-    OpTypeMatrix = 24,
-    OpTypeImage = 25,
-    OpTypeSampler = 26,
-    OpTypeSampledImage = 27,
-    OpTypeArray = 28,
-    OpTypeRuntimeArray = 29,
-    OpTypeStruct = 30,
-    OpTypeOpaque = 31,
-    OpTypePointer = 32,
-    OpTypeFunction = 33,
-    OpTypeEvent = 34,
-    OpTypeDeviceEvent = 35,
-    OpTypeReserveId = 36,
-    OpTypeQueue = 37,
-    OpTypePipe = 38,
-    OpTypeForwardPointer = 39,
-    OpConstantTrue = 41,
-    OpConstantFalse = 42,
-    OpConstant = 43,
-    OpConstantComposite = 44,
-    OpConstantSampler = 45,
-    OpConstantNull = 46,
-    OpSpecConstantTrue = 48,
-    OpSpecConstantFalse = 49,
-    OpSpecConstant = 50,
-    OpSpecConstantComposite = 51,
-    OpSpecConstantOp = 52,
-    OpFunction = 54,
-    OpFunctionParameter = 55,
-    OpFunctionEnd = 56,
-    OpFunctionCall = 57,
-    OpVariable = 59,
-    OpImageTexelPointer = 60,
-    OpLoad = 61,
-    OpStore = 62,
-    OpCopyMemory = 63,
-    OpCopyMemorySized = 64,
-    OpAccessChain = 65,
-    OpInBoundsAccessChain = 66,
-    OpPtrAccessChain = 67,
-    OpArrayLength = 68,
-    OpGenericPtrMemSemantics = 69,
-    OpInBoundsPtrAccessChain = 70,
-    OpDecorate = 71,
-    OpMemberDecorate = 72,
-    OpDecorationGroup = 73,
-    OpGroupDecorate = 74,
-    OpGroupMemberDecorate = 75,
-    OpVectorExtractDynamic = 77,
-    OpVectorInsertDynamic = 78,
-    OpVectorShuffle = 79,
-    OpCompositeConstruct = 80,
-    OpCompositeExtract = 81,
-    OpCompositeInsert = 82,
-    OpCopyObject = 83,
-    OpTranspose = 84,
-    OpSampledImage = 86,
-    OpImageSampleImplicitLod = 87,
-    OpImageSampleExplicitLod = 88,
-    OpImageSampleDrefImplicitLod = 89,
-    OpImageSampleDrefExplicitLod = 90,
-    OpImageSampleProjImplicitLod = 91,
-    OpImageSampleProjExplicitLod = 92,
-    OpImageSampleProjDrefImplicitLod = 93,
-    OpImageSampleProjDrefExplicitLod = 94,
-    OpImageFetch = 95,
-    OpImageGather = 96,
-    OpImageDrefGather = 97,
-    OpImageRead = 98,
-    OpImageWrite = 99,
-    OpImage = 100,
-    OpImageQueryFormat = 101,
-    OpImageQueryOrder = 102,
-    OpImageQuerySizeLod = 103,
-    OpImageQuerySize = 104,
-    OpImageQueryLod = 105,
-    OpImageQueryLevels = 106,
-    OpImageQuerySamples = 107,
-    OpConvertFToU = 109,
-    OpConvertFToS = 110,
-    OpConvertSToF = 111,
-    OpConvertUToF = 112,
-    OpUConvert = 113,
-    OpSConvert = 114,
-    OpFConvert = 115,
-    OpQuantizeToF16 = 116,
-    OpConvertPtrToU = 117,
-    OpSatConvertSToU = 118,
-    OpSatConvertUToS = 119,
-    OpConvertUToPtr = 120,
-    OpPtrCastToGeneric = 121,
-    OpGenericCastToPtr = 122,
-    OpGenericCastToPtrExplicit = 123,
-    OpBitcast = 124,
-    OpSNegate = 126,
-    OpFNegate = 127,
-    OpIAdd = 128,
-    OpFAdd = 129,
-    OpISub = 130,
-    OpFSub = 131,
-    OpIMul = 132,
-    OpFMul = 133,
-    OpUDiv = 134,
-    OpSDiv = 135,
-    OpFDiv = 136,
-    OpUMod = 137,
-    OpSRem = 138,
-    OpSMod = 139,
-    OpFRem = 140,
-    OpFMod = 141,
-    OpVectorTimesScalar = 142,
-    OpMatrixTimesScalar = 143,
-    OpVectorTimesMatrix = 144,
-    OpMatrixTimesVector = 145,
-    OpMatrixTimesMatrix = 146,
-    OpOuterProduct = 147,
-    OpDot = 148,
-    OpIAddCarry = 149,
-    OpISubBorrow = 150,
-    OpUMulExtended = 151,
-    OpSMulExtended = 152,
-    OpAny = 154,
-    OpAll = 155,
-    OpIsNan = 156,
-    OpIsInf = 157,
-    OpIsFinite = 158,
-    OpIsNormal = 159,
-    OpSignBitSet = 160,
-    OpLessOrGreater = 161,
-    OpOrdered = 162,
-    OpUnordered = 163,
-    OpLogicalEqual = 164,
-    OpLogicalNotEqual = 165,
-    OpLogicalOr = 166,
-    OpLogicalAnd = 167,
-    OpLogicalNot = 168,
-    OpSelect = 169,
-    OpIEqual = 170,
-    OpINotEqual = 171,
-    OpUGreaterThan = 172,
-    OpSGreaterThan = 173,
-    OpUGreaterThanEqual = 174,
-    OpSGreaterThanEqual = 175,
-    OpULessThan = 176,
-    OpSLessThan = 177,
-    OpULessThanEqual = 178,
-    OpSLessThanEqual = 179,
-    OpFOrdEqual = 180,
-    OpFUnordEqual = 181,
-    OpFOrdNotEqual = 182,
-    OpFUnordNotEqual = 183,
-    OpFOrdLessThan = 184,
-    OpFUnordLessThan = 185,
-    OpFOrdGreaterThan = 186,
-    OpFUnordGreaterThan = 187,
-    OpFOrdLessThanEqual = 188,
-    OpFUnordLessThanEqual = 189,
-    OpFOrdGreaterThanEqual = 190,
-    OpFUnordGreaterThanEqual = 191,
-    OpShiftRightLogical = 194,
-    OpShiftRightArithmetic = 195,
-    OpShiftLeftLogical = 196,
-    OpBitwiseOr = 197,
-    OpBitwiseXor = 198,
-    OpBitwiseAnd = 199,
-    OpNot = 200,
-    OpBitFieldInsert = 201,
-    OpBitFieldSExtract = 202,
-    OpBitFieldUExtract = 203,
-    OpBitReverse = 204,
-    OpBitCount = 205,
-    OpDPdx = 207,
-    OpDPdy = 208,
-    OpFwidth = 209,
-    OpDPdxFine = 210,
-    OpDPdyFine = 211,
-    OpFwidthFine = 212,
-    OpDPdxCoarse = 213,
-    OpDPdyCoarse = 214,
-    OpFwidthCoarse = 215,
-    OpEmitVertex = 218,
-    OpEndPrimitive = 219,
-    OpEmitStreamVertex = 220,
-    OpEndStreamPrimitive = 221,
-    OpControlBarrier = 224,
-    OpMemoryBarrier = 225,
-    OpAtomicLoad = 227,
-    OpAtomicStore = 228,
-    OpAtomicExchange = 229,
-    OpAtomicCompareExchange = 230,
-    OpAtomicCompareExchangeWeak = 231,
-    OpAtomicIIncrement = 232,
-    OpAtomicIDecrement = 233,
-    OpAtomicIAdd = 234,
-    OpAtomicISub = 235,
-    OpAtomicSMin = 236,
-    OpAtomicUMin = 237,
-    OpAtomicSMax = 238,
-    OpAtomicUMax = 239,
-    OpAtomicAnd = 240,
-    OpAtomicOr = 241,
-    OpAtomicXor = 242,
-    OpPhi = 245,
-    OpLoopMerge = 246,
-    OpSelectionMerge = 247,
-    OpLabel = 248,
-    OpBranch = 249,
-    OpBranchConditional = 250,
-    OpSwitch = 251,
-    OpKill = 252,
-    OpReturn = 253,
-    OpReturnValue = 254,
-    OpUnreachable = 255,
-    OpLifetimeStart = 256,
-    OpLifetimeStop = 257,
-    OpGroupAsyncCopy = 259,
-    OpGroupWaitEvents = 260,
-    OpGroupAll = 261,
-    OpGroupAny = 262,
-    OpGroupBroadcast = 263,
-    OpGroupIAdd = 264,
-    OpGroupFAdd = 265,
-    OpGroupFMin = 266,
-    OpGroupUMin = 267,
-    OpGroupSMin = 268,
-    OpGroupFMax = 269,
-    OpGroupUMax = 270,
-    OpGroupSMax = 271,
-    OpReadPipe = 274,
-    OpWritePipe = 275,
-    OpReservedReadPipe = 276,
-    OpReservedWritePipe = 277,
-    OpReserveReadPipePackets = 278,
-    OpReserveWritePipePackets = 279,
-    OpCommitReadPipe = 280,
-    OpCommitWritePipe = 281,
-    OpIsValidReserveId = 282,
-    OpGetNumPipePackets = 283,
-    OpGetMaxPipePackets = 284,
-    OpGroupReserveReadPipePackets = 285,
-    OpGroupReserveWritePipePackets = 286,
-    OpGroupCommitReadPipe = 287,
-    OpGroupCommitWritePipe = 288,
-    OpEnqueueMarker = 291,
-    OpEnqueueKernel = 292,
-    OpGetKernelNDrangeSubGroupCount = 293,
-    OpGetKernelNDrangeMaxSubGroupSize = 294,
-    OpGetKernelWorkGroupSize = 295,
-    OpGetKernelPreferredWorkGroupSizeMultiple = 296,
-    OpRetainEvent = 297,
-    OpReleaseEvent = 298,
-    OpCreateUserEvent = 299,
-    OpIsValidEvent = 300,
-    OpSetUserEventStatus = 301,
-    OpCaptureEventProfilingInfo = 302,
-    OpGetDefaultQueue = 303,
-    OpBuildNDRange = 304,
-    OpImageSparseSampleImplicitLod = 305,
-    OpImageSparseSampleExplicitLod = 306,
-    OpImageSparseSampleDrefImplicitLod = 307,
-    OpImageSparseSampleDrefExplicitLod = 308,
-    OpImageSparseSampleProjImplicitLod = 309,
-    OpImageSparseSampleProjExplicitLod = 310,
-    OpImageSparseSampleProjDrefImplicitLod = 311,
-    OpImageSparseSampleProjDrefExplicitLod = 312,
-    OpImageSparseFetch = 313,
-    OpImageSparseGather = 314,
-    OpImageSparseDrefGather = 315,
-    OpImageSparseTexelsResident = 316,
-    OpNoLine = 317,
-    OpAtomicFlagTestAndSet = 318,
-    OpAtomicFlagClear = 319,
-    OpImageSparseRead = 320,
-    OpSizeOf = 321,
-    OpTypePipeStorage = 322,
-    OpConstantPipeStorage = 323,
-    OpCreatePipeFromPipeStorage = 324,
-    OpGetKernelLocalSizeForSubgroupCount = 325,
-    OpGetKernelMaxNumSubgroups = 326,
-    OpTypeNamedBarrier = 327,
-    OpNamedBarrierInitialize = 328,
-    OpMemoryNamedBarrier = 329,
-    OpModuleProcessed = 330,
-    OpExecutionModeId = 331,
-    OpDecorateId = 332,
-    OpGroupNonUniformElect = 333,
-    OpGroupNonUniformAll = 334,
-    OpGroupNonUniformAny = 335,
-    OpGroupNonUniformAllEqual = 336,
-    OpGroupNonUniformBroadcast = 337,
-    OpGroupNonUniformBroadcastFirst = 338,
-    OpGroupNonUniformBallot = 339,
-    OpGroupNonUniformInverseBallot = 340,
-    OpGroupNonUniformBallotBitExtract = 341,
-    OpGroupNonUniformBallotBitCount = 342,
-    OpGroupNonUniformBallotFindLSB = 343,
-    OpGroupNonUniformBallotFindMSB = 344,
-    OpGroupNonUniformShuffle = 345,
-    OpGroupNonUniformShuffleXor = 346,
-    OpGroupNonUniformShuffleUp = 347,
-    OpGroupNonUniformShuffleDown = 348,
-    OpGroupNonUniformIAdd = 349,
-    OpGroupNonUniformFAdd = 350,
-    OpGroupNonUniformIMul = 351,
-    OpGroupNonUniformFMul = 352,
-    OpGroupNonUniformSMin = 353,
-    OpGroupNonUniformUMin = 354,
-    OpGroupNonUniformFMin = 355,
-    OpGroupNonUniformSMax = 356,
-    OpGroupNonUniformUMax = 357,
-    OpGroupNonUniformFMax = 358,
-    OpGroupNonUniformBitwiseAnd = 359,
-    OpGroupNonUniformBitwiseOr = 360,
-    OpGroupNonUniformBitwiseXor = 361,
-    OpGroupNonUniformLogicalAnd = 362,
-    OpGroupNonUniformLogicalOr = 363,
-    OpGroupNonUniformLogicalXor = 364,
-    OpGroupNonUniformQuadBroadcast = 365,
-    OpGroupNonUniformQuadSwap = 366,
-    OpCopyLogical = 400,
-    OpPtrEqual = 401,
-    OpPtrNotEqual = 402,
-    OpPtrDiff = 403,
-    OpTerminateInvocation = 4416,
-    OpSubgroupBallotKHR = 4421,
-    OpSubgroupFirstInvocationKHR = 4422,
-    OpSubgroupAllKHR = 4428,
-    OpSubgroupAnyKHR = 4429,
-    OpSubgroupAllEqualKHR = 4430,
-    OpSubgroupReadInvocationKHR = 4432,
-    OpTraceRayKHR = 4445,
-    OpExecuteCallableKHR = 4446,
-    OpConvertUToAccelerationStructureKHR = 4447,
-    OpIgnoreIntersectionKHR = 4448,
-    OpTerminateRayKHR = 4449,
-    OpTypeRayQueryKHR = 4472,
-    OpRayQueryInitializeKHR = 4473,
-    OpRayQueryTerminateKHR = 4474,
-    OpRayQueryGenerateIntersectionKHR = 4475,
-    OpRayQueryConfirmIntersectionKHR = 4476,
-    OpRayQueryProceedKHR = 4477,
-    OpRayQueryGetIntersectionTypeKHR = 4479,
-    OpGroupIAddNonUniformAMD = 5000,
-    OpGroupFAddNonUniformAMD = 5001,
-    OpGroupFMinNonUniformAMD = 5002,
-    OpGroupUMinNonUniformAMD = 5003,
-    OpGroupSMinNonUniformAMD = 5004,
-    OpGroupFMaxNonUniformAMD = 5005,
-    OpGroupUMaxNonUniformAMD = 5006,
-    OpGroupSMaxNonUniformAMD = 5007,
-    OpFragmentMaskFetchAMD = 5011,
-    OpFragmentFetchAMD = 5012,
-    OpReadClockKHR = 5056,
-    OpImageSampleFootprintNV = 5283,
-    OpGroupNonUniformPartitionNV = 5296,
-    OpWritePackedPrimitiveIndices4x8NV = 5299,
-    OpReportIntersectionKHR = 5334,
-    OpReportIntersectionNV = 5334,
-    OpIgnoreIntersectionNV = 5335,
-    OpTerminateRayNV = 5336,
-    OpTraceNV = 5337,
-    OpTypeAccelerationStructureKHR = 5341,
-    OpTypeAccelerationStructureNV = 5341,
-    OpExecuteCallableNV = 5344,
-    OpTypeCooperativeMatrixNV = 5358,
-    OpCooperativeMatrixLoadNV = 5359,
-    OpCooperativeMatrixStoreNV = 5360,
-    OpCooperativeMatrixMulAddNV = 5361,
-    OpCooperativeMatrixLengthNV = 5362,
-    OpBeginInvocationInterlockEXT = 5364,
-    OpEndInvocationInterlockEXT = 5365,
-    OpDemoteToHelperInvocationEXT = 5380,
-    OpIsHelperInvocationEXT = 5381,
-    OpSubgroupShuffleINTEL = 5571,
-    OpSubgroupShuffleDownINTEL = 5572,
-    OpSubgroupShuffleUpINTEL = 5573,
-    OpSubgroupShuffleXorINTEL = 5574,
-    OpSubgroupBlockReadINTEL = 5575,
-    OpSubgroupBlockWriteINTEL = 5576,
-    OpSubgroupImageBlockReadINTEL = 5577,
-    OpSubgroupImageBlockWriteINTEL = 5578,
-    OpSubgroupImageMediaBlockReadINTEL = 5580,
-    OpSubgroupImageMediaBlockWriteINTEL = 5581,
-    OpUCountLeadingZerosINTEL = 5585,
-    OpUCountTrailingZerosINTEL = 5586,
-    OpAbsISubINTEL = 5587,
-    OpAbsUSubINTEL = 5588,
-    OpIAddSatINTEL = 5589,
-    OpUAddSatINTEL = 5590,
-    OpIAverageINTEL = 5591,
-    OpUAverageINTEL = 5592,
-    OpIAverageRoundedINTEL = 5593,
-    OpUAverageRoundedINTEL = 5594,
-    OpISubSatINTEL = 5595,
-    OpUSubSatINTEL = 5596,
-    OpIMul32x16INTEL = 5597,
-    OpUMul32x16INTEL = 5598,
-    OpConstFunctionPointerINTEL = 5600,
-    OpFunctionPointerCallINTEL = 5601,
-    OpAsmTargetINTEL = 5609,
-    OpAsmINTEL = 5610,
-    OpAsmCallINTEL = 5611,
-    OpDecorateString = 5632,
-    OpDecorateStringGOOGLE = 5632,
-    OpMemberDecorateString = 5633,
-    OpMemberDecorateStringGOOGLE = 5633,
-    OpVmeImageINTEL = 5699,
-    OpTypeVmeImageINTEL = 5700,
-    OpTypeAvcImePayloadINTEL = 5701,
-    OpTypeAvcRefPayloadINTEL = 5702,
-    OpTypeAvcSicPayloadINTEL = 5703,
-    OpTypeAvcMcePayloadINTEL = 5704,
-    OpTypeAvcMceResultINTEL = 5705,
-    OpTypeAvcImeResultINTEL = 5706,
-    OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
-    OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
-    OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
-    OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
-    OpTypeAvcRefResultINTEL = 5711,
-    OpTypeAvcSicResultINTEL = 5712,
-    OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
-    OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
-    OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
-    OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
-    OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
-    OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
-    OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
-    OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
-    OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
-    OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
-    OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
-    OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
-    OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
-    OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
-    OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
-    OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
-    OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
-    OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
-    OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
-    OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
-    OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
-    OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
-    OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
-    OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
-    OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
-    OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
-    OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
-    OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
-    OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
-    OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
-    OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
-    OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
-    OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
-    OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
-    OpSubgroupAvcImeInitializeINTEL = 5747,
-    OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
-    OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
-    OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
-    OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
-    OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
-    OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
-    OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
-    OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
-    OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
-    OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
-    OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
-    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
-    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
-    OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
-    OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
-    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
-    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
-    OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
-    OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
-    OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
-    OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
-    OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
-    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
-    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
-    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
-    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
-    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
-    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
-    OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
-    OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
-    OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
-    OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
-    OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
-    OpSubgroupAvcFmeInitializeINTEL = 5781,
-    OpSubgroupAvcBmeInitializeINTEL = 5782,
-    OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
-    OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
-    OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
-    OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
-    OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
-    OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
-    OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
-    OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
-    OpSubgroupAvcSicInitializeINTEL = 5791,
-    OpSubgroupAvcSicConfigureSkcINTEL = 5792,
-    OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
-    OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
-    OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
-    OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
-    OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
-    OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
-    OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
-    OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
-    OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
-    OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
-    OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
-    OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
-    OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
-    OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
-    OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
-    OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
-    OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
-    OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
-    OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
-    OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
-    OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
-    OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
-    OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
-    OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
-    OpVariableLengthArrayINTEL = 5818,
-    OpSaveMemoryINTEL = 5819,
-    OpRestoreMemoryINTEL = 5820,
-    OpLoopControlINTEL = 5887,
-    OpPtrCastToCrossWorkgroupINTEL = 5934,
-    OpCrossWorkgroupCastToPtrINTEL = 5938,
-    OpReadPipeBlockingINTEL = 5946,
-    OpWritePipeBlockingINTEL = 5947,
-    OpFPGARegINTEL = 5949,
-    OpRayQueryGetRayTMinKHR = 6016,
-    OpRayQueryGetRayFlagsKHR = 6017,
-    OpRayQueryGetIntersectionTKHR = 6018,
-    OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
-    OpRayQueryGetIntersectionInstanceIdKHR = 6020,
-    OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
-    OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
-    OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
-    OpRayQueryGetIntersectionBarycentricsKHR = 6024,
-    OpRayQueryGetIntersectionFrontFaceKHR = 6025,
-    OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
-    OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
-    OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
-    OpRayQueryGetWorldRayDirectionKHR = 6029,
-    OpRayQueryGetWorldRayOriginKHR = 6030,
-    OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
-    OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
-    OpAtomicFAddEXT = 6035,
-    OpTypeBufferSurfaceINTEL = 6086,
-    OpTypeStructContinuedINTEL = 6090,
-    OpConstantCompositeContinuedINTEL = 6091,
-    OpSpecConstantCompositeContinuedINTEL = 6092,
-    OpMax = 0x7fffffff,
-};
-
-#ifdef SPV_ENABLE_UTILITY_CODE
-inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
-    *hasResult = *hasResultType = false;
-    switch (opcode) {
-    default: /* unknown opcode */ break;
-    case OpNop: *hasResult = false; *hasResultType = false; break;
-    case OpUndef: *hasResult = true; *hasResultType = true; break;
-    case OpSourceContinued: *hasResult = false; *hasResultType = false; break;
-    case OpSource: *hasResult = false; *hasResultType = false; break;
-    case OpSourceExtension: *hasResult = false; *hasResultType = false; break;
-    case OpName: *hasResult = false; *hasResultType = false; break;
-    case OpMemberName: *hasResult = false; *hasResultType = false; break;
-    case OpString: *hasResult = true; *hasResultType = false; break;
-    case OpLine: *hasResult = false; *hasResultType = false; break;
-    case OpExtension: *hasResult = false; *hasResultType = false; break;
-    case OpExtInstImport: *hasResult = true; *hasResultType = false; break;
-    case OpExtInst: *hasResult = true; *hasResultType = true; break;
-    case OpMemoryModel: *hasResult = false; *hasResultType = false; break;
-    case OpEntryPoint: *hasResult = false; *hasResultType = false; break;
-    case OpExecutionMode: *hasResult = false; *hasResultType = false; break;
-    case OpCapability: *hasResult = false; *hasResultType = false; break;
-    case OpTypeVoid: *hasResult = true; *hasResultType = false; break;
-    case OpTypeBool: *hasResult = true; *hasResultType = false; break;
-    case OpTypeInt: *hasResult = true; *hasResultType = false; break;
-    case OpTypeFloat: *hasResult = true; *hasResultType = false; break;
-    case OpTypeVector: *hasResult = true; *hasResultType = false; break;
-    case OpTypeMatrix: *hasResult = true; *hasResultType = false; break;
-    case OpTypeImage: *hasResult = true; *hasResultType = false; break;
-    case OpTypeSampler: *hasResult = true; *hasResultType = false; break;
-    case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break;
-    case OpTypeArray: *hasResult = true; *hasResultType = false; break;
-    case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break;
-    case OpTypeStruct: *hasResult = true; *hasResultType = false; break;
-    case OpTypeOpaque: *hasResult = true; *hasResultType = false; break;
-    case OpTypePointer: *hasResult = true; *hasResultType = false; break;
-    case OpTypeFunction: *hasResult = true; *hasResultType = false; break;
-    case OpTypeEvent: *hasResult = true; *hasResultType = false; break;
-    case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break;
-    case OpTypeReserveId: *hasResult = true; *hasResultType = false; break;
-    case OpTypeQueue: *hasResult = true; *hasResultType = false; break;
-    case OpTypePipe: *hasResult = true; *hasResultType = false; break;
-    case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break;
-    case OpConstantTrue: *hasResult = true; *hasResultType = true; break;
-    case OpConstantFalse: *hasResult = true; *hasResultType = true; break;
-    case OpConstant: *hasResult = true; *hasResultType = true; break;
-    case OpConstantComposite: *hasResult = true; *hasResultType = true; break;
-    case OpConstantSampler: *hasResult = true; *hasResultType = true; break;
-    case OpConstantNull: *hasResult = true; *hasResultType = true; break;
-    case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break;
-    case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break;
-    case OpSpecConstant: *hasResult = true; *hasResultType = true; break;
-    case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break;
-    case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break;
-    case OpFunction: *hasResult = true; *hasResultType = true; break;
-    case OpFunctionParameter: *hasResult = true; *hasResultType = true; break;
-    case OpFunctionEnd: *hasResult = false; *hasResultType = false; break;
-    case OpFunctionCall: *hasResult = true; *hasResultType = true; break;
-    case OpVariable: *hasResult = true; *hasResultType = true; break;
-    case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break;
-    case OpLoad: *hasResult = true; *hasResultType = true; break;
-    case OpStore: *hasResult = false; *hasResultType = false; break;
-    case OpCopyMemory: *hasResult = false; *hasResultType = false; break;
-    case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break;
-    case OpAccessChain: *hasResult = true; *hasResultType = true; break;
-    case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break;
-    case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break;
-    case OpArrayLength: *hasResult = true; *hasResultType = true; break;
-    case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break;
-    case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break;
-    case OpDecorate: *hasResult = false; *hasResultType = false; break;
-    case OpMemberDecorate: *hasResult = false; *hasResultType = false; break;
-    case OpDecorationGroup: *hasResult = true; *hasResultType = false; break;
-    case OpGroupDecorate: *hasResult = false; *hasResultType = false; break;
-    case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break;
-    case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break;
-    case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break;
-    case OpVectorShuffle: *hasResult = true; *hasResultType = true; break;
-    case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break;
-    case OpCompositeExtract: *hasResult = true; *hasResultType = true; break;
-    case OpCompositeInsert: *hasResult = true; *hasResultType = true; break;
-    case OpCopyObject: *hasResult = true; *hasResultType = true; break;
-    case OpTranspose: *hasResult = true; *hasResultType = true; break;
-    case OpSampledImage: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageFetch: *hasResult = true; *hasResultType = true; break;
-    case OpImageGather: *hasResult = true; *hasResultType = true; break;
-    case OpImageDrefGather: *hasResult = true; *hasResultType = true; break;
-    case OpImageRead: *hasResult = true; *hasResultType = true; break;
-    case OpImageWrite: *hasResult = false; *hasResultType = false; break;
-    case OpImage: *hasResult = true; *hasResultType = true; break;
-    case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break;
-    case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break;
-    case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageQuerySize: *hasResult = true; *hasResultType = true; break;
-    case OpImageQueryLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break;
-    case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break;
-    case OpConvertFToU: *hasResult = true; *hasResultType = true; break;
-    case OpConvertFToS: *hasResult = true; *hasResultType = true; break;
-    case OpConvertSToF: *hasResult = true; *hasResultType = true; break;
-    case OpConvertUToF: *hasResult = true; *hasResultType = true; break;
-    case OpUConvert: *hasResult = true; *hasResultType = true; break;
-    case OpSConvert: *hasResult = true; *hasResultType = true; break;
-    case OpFConvert: *hasResult = true; *hasResultType = true; break;
-    case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break;
-    case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break;
-    case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break;
-    case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break;
-    case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break;
-    case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break;
-    case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break;
-    case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break;
-    case OpBitcast: *hasResult = true; *hasResultType = true; break;
-    case OpSNegate: *hasResult = true; *hasResultType = true; break;
-    case OpFNegate: *hasResult = true; *hasResultType = true; break;
-    case OpIAdd: *hasResult = true; *hasResultType = true; break;
-    case OpFAdd: *hasResult = true; *hasResultType = true; break;
-    case OpISub: *hasResult = true; *hasResultType = true; break;
-    case OpFSub: *hasResult = true; *hasResultType = true; break;
-    case OpIMul: *hasResult = true; *hasResultType = true; break;
-    case OpFMul: *hasResult = true; *hasResultType = true; break;
-    case OpUDiv: *hasResult = true; *hasResultType = true; break;
-    case OpSDiv: *hasResult = true; *hasResultType = true; break;
-    case OpFDiv: *hasResult = true; *hasResultType = true; break;
-    case OpUMod: *hasResult = true; *hasResultType = true; break;
-    case OpSRem: *hasResult = true; *hasResultType = true; break;
-    case OpSMod: *hasResult = true; *hasResultType = true; break;
-    case OpFRem: *hasResult = true; *hasResultType = true; break;
-    case OpFMod: *hasResult = true; *hasResultType = true; break;
-    case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break;
-    case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break;
-    case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break;
-    case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break;
-    case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break;
-    case OpOuterProduct: *hasResult = true; *hasResultType = true; break;
-    case OpDot: *hasResult = true; *hasResultType = true; break;
-    case OpIAddCarry: *hasResult = true; *hasResultType = true; break;
-    case OpISubBorrow: *hasResult = true; *hasResultType = true; break;
-    case OpUMulExtended: *hasResult = true; *hasResultType = true; break;
-    case OpSMulExtended: *hasResult = true; *hasResultType = true; break;
-    case OpAny: *hasResult = true; *hasResultType = true; break;
-    case OpAll: *hasResult = true; *hasResultType = true; break;
-    case OpIsNan: *hasResult = true; *hasResultType = true; break;
-    case OpIsInf: *hasResult = true; *hasResultType = true; break;
-    case OpIsFinite: *hasResult = true; *hasResultType = true; break;
-    case OpIsNormal: *hasResult = true; *hasResultType = true; break;
-    case OpSignBitSet: *hasResult = true; *hasResultType = true; break;
-    case OpLessOrGreater: *hasResult = true; *hasResultType = true; break;
-    case OpOrdered: *hasResult = true; *hasResultType = true; break;
-    case OpUnordered: *hasResult = true; *hasResultType = true; break;
-    case OpLogicalEqual: *hasResult = true; *hasResultType = true; break;
-    case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break;
-    case OpLogicalOr: *hasResult = true; *hasResultType = true; break;
-    case OpLogicalAnd: *hasResult = true; *hasResultType = true; break;
-    case OpLogicalNot: *hasResult = true; *hasResultType = true; break;
-    case OpSelect: *hasResult = true; *hasResultType = true; break;
-    case OpIEqual: *hasResult = true; *hasResultType = true; break;
-    case OpINotEqual: *hasResult = true; *hasResultType = true; break;
-    case OpUGreaterThan: *hasResult = true; *hasResultType = true; break;
-    case OpSGreaterThan: *hasResult = true; *hasResultType = true; break;
-    case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpULessThan: *hasResult = true; *hasResultType = true; break;
-    case OpSLessThan: *hasResult = true; *hasResultType = true; break;
-    case OpULessThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
-    case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break;
-    case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break;
-    case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break;
-    case OpBitwiseOr: *hasResult = true; *hasResultType = true; break;
-    case OpBitwiseXor: *hasResult = true; *hasResultType = true; break;
-    case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break;
-    case OpNot: *hasResult = true; *hasResultType = true; break;
-    case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break;
-    case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break;
-    case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break;
-    case OpBitReverse: *hasResult = true; *hasResultType = true; break;
-    case OpBitCount: *hasResult = true; *hasResultType = true; break;
-    case OpDPdx: *hasResult = true; *hasResultType = true; break;
-    case OpDPdy: *hasResult = true; *hasResultType = true; break;
-    case OpFwidth: *hasResult = true; *hasResultType = true; break;
-    case OpDPdxFine: *hasResult = true; *hasResultType = true; break;
-    case OpDPdyFine: *hasResult = true; *hasResultType = true; break;
-    case OpFwidthFine: *hasResult = true; *hasResultType = true; break;
-    case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break;
-    case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break;
-    case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break;
-    case OpEmitVertex: *hasResult = false; *hasResultType = false; break;
-    case OpEndPrimitive: *hasResult = false; *hasResultType = false; break;
-    case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break;
-    case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break;
-    case OpControlBarrier: *hasResult = false; *hasResultType = false; break;
-    case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break;
-    case OpAtomicLoad: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicStore: *hasResult = false; *hasResultType = false; break;
-    case OpAtomicExchange: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicISub: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicSMin: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicUMin: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicSMax: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicUMax: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicAnd: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicOr: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicXor: *hasResult = true; *hasResultType = true; break;
-    case OpPhi: *hasResult = true; *hasResultType = true; break;
-    case OpLoopMerge: *hasResult = false; *hasResultType = false; break;
-    case OpSelectionMerge: *hasResult = false; *hasResultType = false; break;
-    case OpLabel: *hasResult = true; *hasResultType = false; break;
-    case OpBranch: *hasResult = false; *hasResultType = false; break;
-    case OpBranchConditional: *hasResult = false; *hasResultType = false; break;
-    case OpSwitch: *hasResult = false; *hasResultType = false; break;
-    case OpKill: *hasResult = false; *hasResultType = false; break;
-    case OpReturn: *hasResult = false; *hasResultType = false; break;
-    case OpReturnValue: *hasResult = false; *hasResultType = false; break;
-    case OpUnreachable: *hasResult = false; *hasResultType = false; break;
-    case OpLifetimeStart: *hasResult = false; *hasResultType = false; break;
-    case OpLifetimeStop: *hasResult = false; *hasResultType = false; break;
-    case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break;
-    case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break;
-    case OpGroupAll: *hasResult = true; *hasResultType = true; break;
-    case OpGroupAny: *hasResult = true; *hasResultType = true; break;
-    case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break;
-    case OpGroupIAdd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFAdd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupUMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupSMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFMax: *hasResult = true; *hasResultType = true; break;
-    case OpGroupUMax: *hasResult = true; *hasResultType = true; break;
-    case OpGroupSMax: *hasResult = true; *hasResultType = true; break;
-    case OpReadPipe: *hasResult = true; *hasResultType = true; break;
-    case OpWritePipe: *hasResult = true; *hasResultType = true; break;
-    case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break;
-    case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break;
-    case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break;
-    case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break;
-    case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break;
-    case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
-    case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break;
-    case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break;
-    case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break;
-    case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break;
-    case OpRetainEvent: *hasResult = false; *hasResultType = false; break;
-    case OpReleaseEvent: *hasResult = false; *hasResultType = false; break;
-    case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break;
-    case OpIsValidEvent: *hasResult = true; *hasResultType = true; break;
-    case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break;
-    case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break;
-    case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break;
-    case OpBuildNDRange: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseGather: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break;
-    case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break;
-    case OpNoLine: *hasResult = false; *hasResultType = false; break;
-    case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break;
-    case OpImageSparseRead: *hasResult = true; *hasResultType = true; break;
-    case OpSizeOf: *hasResult = true; *hasResultType = true; break;
-    case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break;
-    case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break;
-    case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break;
-    case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break;
-    case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break;
-    case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break;
-    case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break;
-    case OpModuleProcessed: *hasResult = false; *hasResultType = false; break;
-    case OpExecutionModeId: *hasResult = false; *hasResultType = false; break;
-    case OpDecorateId: *hasResult = false; *hasResultType = false; break;
-    case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break;
-    case OpCopyLogical: *hasResult = true; *hasResultType = true; break;
-    case OpPtrEqual: *hasResult = true; *hasResultType = true; break;
-    case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break;
-    case OpPtrDiff: *hasResult = true; *hasResultType = true; break;
-    case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
-    case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
-    case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
-    case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
-    case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
-    case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
-    case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
-    case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
-    case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
-    case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
-    case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break;
-    case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break;
-    case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break;
-    case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
-    case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
-    case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
-    case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
-    case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
-    case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
-    case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
-    case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
-    case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
-    case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
-    case OpTraceNV: *hasResult = false; *hasResultType = false; break;
-    case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
-    case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
-    case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
-    case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
-    case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
-    case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
-    case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
-    case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
-    case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
-    case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
-    case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpDecorateString: *hasResult = false; *hasResultType = false; break;
-    case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
-    case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break;
-    case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break;
-    case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break;
-    case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break;
-    case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
-    }
-}
-#endif /* SPV_ENABLE_UTILITY_CODE */
-
-// Overload operator| for mask bit combining
-
-inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
-inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
-inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
-inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
-inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
-inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
-inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
-inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
-inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
-inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
-
-}  // end namespace spv
-
-#endif  // #ifndef spirv_HPP
-
+// Copyright (c) 2014-2020 The Khronos Group Inc.
+// 
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and/or associated documentation files (the "Materials"),
+// to deal in the Materials without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Materials, and to permit persons to whom the
+// Materials are furnished to do so, subject to the following conditions:
+// 
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Materials.
+// 
+// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
+// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
+// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ 
+// 
+// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
+// IN THE MATERIALS.
+
+// This header is automatically generated by the same tool that creates
+// the Binary Section of the SPIR-V specification.
+
+// Enumeration tokens for SPIR-V, in various styles:
+//   C, C++, C++11, JSON, Lua, Python, C#, D
+// 
+// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
+// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
+// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
+// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
+// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
+// - C# will use enum classes in the Specification class located in the "Spv" namespace,
+//     e.g.: Spv.Specification.SourceLanguage.GLSL
+// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
+// 
+// Some tokens act like mask values, which can be OR'd together,
+// while others are mutually exclusive.  The mask-like ones have
+// "Mask" in their name, and a parallel enum that has the shift
+// amount (1 << x) for each corresponding enumerant.
+
+#ifndef spirv_HPP
+#define spirv_HPP
+
+namespace spv {
+
+typedef unsigned int Id;
+
+#define SPV_VERSION 0x10500
+#define SPV_REVISION 4
+
+static const unsigned int MagicNumber = 0x07230203;
+static const unsigned int Version = 0x00010500;
+static const unsigned int Revision = 4;
+static const unsigned int OpCodeMask = 0xffff;
+static const unsigned int WordCountShift = 16;
+
+enum SourceLanguage {
+    SourceLanguageUnknown = 0,
+    SourceLanguageESSL = 1,
+    SourceLanguageGLSL = 2,
+    SourceLanguageOpenCL_C = 3,
+    SourceLanguageOpenCL_CPP = 4,
+    SourceLanguageHLSL = 5,
+    SourceLanguageMax = 0x7fffffff,
+};
+
+enum ExecutionModel {
+    ExecutionModelVertex = 0,
+    ExecutionModelTessellationControl = 1,
+    ExecutionModelTessellationEvaluation = 2,
+    ExecutionModelGeometry = 3,
+    ExecutionModelFragment = 4,
+    ExecutionModelGLCompute = 5,
+    ExecutionModelKernel = 6,
+    ExecutionModelTaskNV = 5267,
+    ExecutionModelMeshNV = 5268,
+    ExecutionModelRayGenerationKHR = 5313,
+    ExecutionModelRayGenerationNV = 5313,
+    ExecutionModelIntersectionKHR = 5314,
+    ExecutionModelIntersectionNV = 5314,
+    ExecutionModelAnyHitKHR = 5315,
+    ExecutionModelAnyHitNV = 5315,
+    ExecutionModelClosestHitKHR = 5316,
+    ExecutionModelClosestHitNV = 5316,
+    ExecutionModelMissKHR = 5317,
+    ExecutionModelMissNV = 5317,
+    ExecutionModelCallableKHR = 5318,
+    ExecutionModelCallableNV = 5318,
+    ExecutionModelMax = 0x7fffffff,
+};
+
+enum AddressingModel {
+    AddressingModelLogical = 0,
+    AddressingModelPhysical32 = 1,
+    AddressingModelPhysical64 = 2,
+    AddressingModelPhysicalStorageBuffer64 = 5348,
+    AddressingModelPhysicalStorageBuffer64EXT = 5348,
+    AddressingModelMax = 0x7fffffff,
+};
+
+enum MemoryModel {
+    MemoryModelSimple = 0,
+    MemoryModelGLSL450 = 1,
+    MemoryModelOpenCL = 2,
+    MemoryModelVulkan = 3,
+    MemoryModelVulkanKHR = 3,
+    MemoryModelMax = 0x7fffffff,
+};
+
+enum ExecutionMode {
+    ExecutionModeInvocations = 0,
+    ExecutionModeSpacingEqual = 1,
+    ExecutionModeSpacingFractionalEven = 2,
+    ExecutionModeSpacingFractionalOdd = 3,
+    ExecutionModeVertexOrderCw = 4,
+    ExecutionModeVertexOrderCcw = 5,
+    ExecutionModePixelCenterInteger = 6,
+    ExecutionModeOriginUpperLeft = 7,
+    ExecutionModeOriginLowerLeft = 8,
+    ExecutionModeEarlyFragmentTests = 9,
+    ExecutionModePointMode = 10,
+    ExecutionModeXfb = 11,
+    ExecutionModeDepthReplacing = 12,
+    ExecutionModeDepthGreater = 14,
+    ExecutionModeDepthLess = 15,
+    ExecutionModeDepthUnchanged = 16,
+    ExecutionModeLocalSize = 17,
+    ExecutionModeLocalSizeHint = 18,
+    ExecutionModeInputPoints = 19,
+    ExecutionModeInputLines = 20,
+    ExecutionModeInputLinesAdjacency = 21,
+    ExecutionModeTriangles = 22,
+    ExecutionModeInputTrianglesAdjacency = 23,
+    ExecutionModeQuads = 24,
+    ExecutionModeIsolines = 25,
+    ExecutionModeOutputVertices = 26,
+    ExecutionModeOutputPoints = 27,
+    ExecutionModeOutputLineStrip = 28,
+    ExecutionModeOutputTriangleStrip = 29,
+    ExecutionModeVecTypeHint = 30,
+    ExecutionModeContractionOff = 31,
+    ExecutionModeInitializer = 33,
+    ExecutionModeFinalizer = 34,
+    ExecutionModeSubgroupSize = 35,
+    ExecutionModeSubgroupsPerWorkgroup = 36,
+    ExecutionModeSubgroupsPerWorkgroupId = 37,
+    ExecutionModeLocalSizeId = 38,
+    ExecutionModeLocalSizeHintId = 39,
+    ExecutionModeSubgroupUniformControlFlowKHR = 4421,
+    ExecutionModePostDepthCoverage = 4446,
+    ExecutionModeDenormPreserve = 4459,
+    ExecutionModeDenormFlushToZero = 4460,
+    ExecutionModeSignedZeroInfNanPreserve = 4461,
+    ExecutionModeRoundingModeRTE = 4462,
+    ExecutionModeRoundingModeRTZ = 4463,
+    ExecutionModeStencilRefReplacingEXT = 5027,
+    ExecutionModeOutputLinesNV = 5269,
+    ExecutionModeOutputPrimitivesNV = 5270,
+    ExecutionModeDerivativeGroupQuadsNV = 5289,
+    ExecutionModeDerivativeGroupLinearNV = 5290,
+    ExecutionModeOutputTrianglesNV = 5298,
+    ExecutionModePixelInterlockOrderedEXT = 5366,
+    ExecutionModePixelInterlockUnorderedEXT = 5367,
+    ExecutionModeSampleInterlockOrderedEXT = 5368,
+    ExecutionModeSampleInterlockUnorderedEXT = 5369,
+    ExecutionModeShadingRateInterlockOrderedEXT = 5370,
+    ExecutionModeShadingRateInterlockUnorderedEXT = 5371,
+    ExecutionModeSharedLocalMemorySizeINTEL = 5618,
+    ExecutionModeRoundingModeRTPINTEL = 5620,
+    ExecutionModeRoundingModeRTNINTEL = 5621,
+    ExecutionModeFloatingPointModeALTINTEL = 5622,
+    ExecutionModeFloatingPointModeIEEEINTEL = 5623,
+    ExecutionModeMaxWorkgroupSizeINTEL = 5893,
+    ExecutionModeMaxWorkDimINTEL = 5894,
+    ExecutionModeNoGlobalOffsetINTEL = 5895,
+    ExecutionModeNumSIMDWorkitemsINTEL = 5896,
+    ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+    ExecutionModeMax = 0x7fffffff,
+};
+
+enum StorageClass {
+    StorageClassUniformConstant = 0,
+    StorageClassInput = 1,
+    StorageClassUniform = 2,
+    StorageClassOutput = 3,
+    StorageClassWorkgroup = 4,
+    StorageClassCrossWorkgroup = 5,
+    StorageClassPrivate = 6,
+    StorageClassFunction = 7,
+    StorageClassGeneric = 8,
+    StorageClassPushConstant = 9,
+    StorageClassAtomicCounter = 10,
+    StorageClassImage = 11,
+    StorageClassStorageBuffer = 12,
+    StorageClassCallableDataKHR = 5328,
+    StorageClassCallableDataNV = 5328,
+    StorageClassIncomingCallableDataKHR = 5329,
+    StorageClassIncomingCallableDataNV = 5329,
+    StorageClassRayPayloadKHR = 5338,
+    StorageClassRayPayloadNV = 5338,
+    StorageClassHitAttributeKHR = 5339,
+    StorageClassHitAttributeNV = 5339,
+    StorageClassIncomingRayPayloadKHR = 5342,
+    StorageClassIncomingRayPayloadNV = 5342,
+    StorageClassShaderRecordBufferKHR = 5343,
+    StorageClassShaderRecordBufferNV = 5343,
+    StorageClassPhysicalStorageBuffer = 5349,
+    StorageClassPhysicalStorageBufferEXT = 5349,
+    StorageClassCodeSectionINTEL = 5605,
+    StorageClassDeviceOnlyINTEL = 5936,
+    StorageClassHostOnlyINTEL = 5937,
+    StorageClassMax = 0x7fffffff,
+};
+
+enum Dim {
+    Dim1D = 0,
+    Dim2D = 1,
+    Dim3D = 2,
+    DimCube = 3,
+    DimRect = 4,
+    DimBuffer = 5,
+    DimSubpassData = 6,
+    DimMax = 0x7fffffff,
+};
+
+enum SamplerAddressingMode {
+    SamplerAddressingModeNone = 0,
+    SamplerAddressingModeClampToEdge = 1,
+    SamplerAddressingModeClamp = 2,
+    SamplerAddressingModeRepeat = 3,
+    SamplerAddressingModeRepeatMirrored = 4,
+    SamplerAddressingModeMax = 0x7fffffff,
+};
+
+enum SamplerFilterMode {
+    SamplerFilterModeNearest = 0,
+    SamplerFilterModeLinear = 1,
+    SamplerFilterModeMax = 0x7fffffff,
+};
+
+enum ImageFormat {
+    ImageFormatUnknown = 0,
+    ImageFormatRgba32f = 1,
+    ImageFormatRgba16f = 2,
+    ImageFormatR32f = 3,
+    ImageFormatRgba8 = 4,
+    ImageFormatRgba8Snorm = 5,
+    ImageFormatRg32f = 6,
+    ImageFormatRg16f = 7,
+    ImageFormatR11fG11fB10f = 8,
+    ImageFormatR16f = 9,
+    ImageFormatRgba16 = 10,
+    ImageFormatRgb10A2 = 11,
+    ImageFormatRg16 = 12,
+    ImageFormatRg8 = 13,
+    ImageFormatR16 = 14,
+    ImageFormatR8 = 15,
+    ImageFormatRgba16Snorm = 16,
+    ImageFormatRg16Snorm = 17,
+    ImageFormatRg8Snorm = 18,
+    ImageFormatR16Snorm = 19,
+    ImageFormatR8Snorm = 20,
+    ImageFormatRgba32i = 21,
+    ImageFormatRgba16i = 22,
+    ImageFormatRgba8i = 23,
+    ImageFormatR32i = 24,
+    ImageFormatRg32i = 25,
+    ImageFormatRg16i = 26,
+    ImageFormatRg8i = 27,
+    ImageFormatR16i = 28,
+    ImageFormatR8i = 29,
+    ImageFormatRgba32ui = 30,
+    ImageFormatRgba16ui = 31,
+    ImageFormatRgba8ui = 32,
+    ImageFormatR32ui = 33,
+    ImageFormatRgb10a2ui = 34,
+    ImageFormatRg32ui = 35,
+    ImageFormatRg16ui = 36,
+    ImageFormatRg8ui = 37,
+    ImageFormatR16ui = 38,
+    ImageFormatR8ui = 39,
+    ImageFormatR64ui = 40,
+    ImageFormatR64i = 41,
+    ImageFormatMax = 0x7fffffff,
+};
+
+enum ImageChannelOrder {
+    ImageChannelOrderR = 0,
+    ImageChannelOrderA = 1,
+    ImageChannelOrderRG = 2,
+    ImageChannelOrderRA = 3,
+    ImageChannelOrderRGB = 4,
+    ImageChannelOrderRGBA = 5,
+    ImageChannelOrderBGRA = 6,
+    ImageChannelOrderARGB = 7,
+    ImageChannelOrderIntensity = 8,
+    ImageChannelOrderLuminance = 9,
+    ImageChannelOrderRx = 10,
+    ImageChannelOrderRGx = 11,
+    ImageChannelOrderRGBx = 12,
+    ImageChannelOrderDepth = 13,
+    ImageChannelOrderDepthStencil = 14,
+    ImageChannelOrdersRGB = 15,
+    ImageChannelOrdersRGBx = 16,
+    ImageChannelOrdersRGBA = 17,
+    ImageChannelOrdersBGRA = 18,
+    ImageChannelOrderABGR = 19,
+    ImageChannelOrderMax = 0x7fffffff,
+};
+
+enum ImageChannelDataType {
+    ImageChannelDataTypeSnormInt8 = 0,
+    ImageChannelDataTypeSnormInt16 = 1,
+    ImageChannelDataTypeUnormInt8 = 2,
+    ImageChannelDataTypeUnormInt16 = 3,
+    ImageChannelDataTypeUnormShort565 = 4,
+    ImageChannelDataTypeUnormShort555 = 5,
+    ImageChannelDataTypeUnormInt101010 = 6,
+    ImageChannelDataTypeSignedInt8 = 7,
+    ImageChannelDataTypeSignedInt16 = 8,
+    ImageChannelDataTypeSignedInt32 = 9,
+    ImageChannelDataTypeUnsignedInt8 = 10,
+    ImageChannelDataTypeUnsignedInt16 = 11,
+    ImageChannelDataTypeUnsignedInt32 = 12,
+    ImageChannelDataTypeHalfFloat = 13,
+    ImageChannelDataTypeFloat = 14,
+    ImageChannelDataTypeUnormInt24 = 15,
+    ImageChannelDataTypeUnormInt101010_2 = 16,
+    ImageChannelDataTypeMax = 0x7fffffff,
+};
+
+enum ImageOperandsShift {
+    ImageOperandsBiasShift = 0,
+    ImageOperandsLodShift = 1,
+    ImageOperandsGradShift = 2,
+    ImageOperandsConstOffsetShift = 3,
+    ImageOperandsOffsetShift = 4,
+    ImageOperandsConstOffsetsShift = 5,
+    ImageOperandsSampleShift = 6,
+    ImageOperandsMinLodShift = 7,
+    ImageOperandsMakeTexelAvailableShift = 8,
+    ImageOperandsMakeTexelAvailableKHRShift = 8,
+    ImageOperandsMakeTexelVisibleShift = 9,
+    ImageOperandsMakeTexelVisibleKHRShift = 9,
+    ImageOperandsNonPrivateTexelShift = 10,
+    ImageOperandsNonPrivateTexelKHRShift = 10,
+    ImageOperandsVolatileTexelShift = 11,
+    ImageOperandsVolatileTexelKHRShift = 11,
+    ImageOperandsSignExtendShift = 12,
+    ImageOperandsZeroExtendShift = 13,
+    ImageOperandsMax = 0x7fffffff,
+};
+
+enum ImageOperandsMask {
+    ImageOperandsMaskNone = 0,
+    ImageOperandsBiasMask = 0x00000001,
+    ImageOperandsLodMask = 0x00000002,
+    ImageOperandsGradMask = 0x00000004,
+    ImageOperandsConstOffsetMask = 0x00000008,
+    ImageOperandsOffsetMask = 0x00000010,
+    ImageOperandsConstOffsetsMask = 0x00000020,
+    ImageOperandsSampleMask = 0x00000040,
+    ImageOperandsMinLodMask = 0x00000080,
+    ImageOperandsMakeTexelAvailableMask = 0x00000100,
+    ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
+    ImageOperandsMakeTexelVisibleMask = 0x00000200,
+    ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
+    ImageOperandsNonPrivateTexelMask = 0x00000400,
+    ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
+    ImageOperandsVolatileTexelMask = 0x00000800,
+    ImageOperandsVolatileTexelKHRMask = 0x00000800,
+    ImageOperandsSignExtendMask = 0x00001000,
+    ImageOperandsZeroExtendMask = 0x00002000,
+};
+
+enum FPFastMathModeShift {
+    FPFastMathModeNotNaNShift = 0,
+    FPFastMathModeNotInfShift = 1,
+    FPFastMathModeNSZShift = 2,
+    FPFastMathModeAllowRecipShift = 3,
+    FPFastMathModeFastShift = 4,
+    FPFastMathModeAllowContractFastINTELShift = 16,
+    FPFastMathModeAllowReassocINTELShift = 17,
+    FPFastMathModeMax = 0x7fffffff,
+};
+
+enum FPFastMathModeMask {
+    FPFastMathModeMaskNone = 0,
+    FPFastMathModeNotNaNMask = 0x00000001,
+    FPFastMathModeNotInfMask = 0x00000002,
+    FPFastMathModeNSZMask = 0x00000004,
+    FPFastMathModeAllowRecipMask = 0x00000008,
+    FPFastMathModeFastMask = 0x00000010,
+    FPFastMathModeAllowContractFastINTELMask = 0x00010000,
+    FPFastMathModeAllowReassocINTELMask = 0x00020000,
+};
+
+enum FPRoundingMode {
+    FPRoundingModeRTE = 0,
+    FPRoundingModeRTZ = 1,
+    FPRoundingModeRTP = 2,
+    FPRoundingModeRTN = 3,
+    FPRoundingModeMax = 0x7fffffff,
+};
+
+enum LinkageType {
+    LinkageTypeExport = 0,
+    LinkageTypeImport = 1,
+    LinkageTypeLinkOnceODR = 2,
+    LinkageTypeMax = 0x7fffffff,
+};
+
+enum AccessQualifier {
+    AccessQualifierReadOnly = 0,
+    AccessQualifierWriteOnly = 1,
+    AccessQualifierReadWrite = 2,
+    AccessQualifierMax = 0x7fffffff,
+};
+
+enum FunctionParameterAttribute {
+    FunctionParameterAttributeZext = 0,
+    FunctionParameterAttributeSext = 1,
+    FunctionParameterAttributeByVal = 2,
+    FunctionParameterAttributeSret = 3,
+    FunctionParameterAttributeNoAlias = 4,
+    FunctionParameterAttributeNoCapture = 5,
+    FunctionParameterAttributeNoWrite = 6,
+    FunctionParameterAttributeNoReadWrite = 7,
+    FunctionParameterAttributeMax = 0x7fffffff,
+};
+
+enum Decoration {
+    DecorationRelaxedPrecision = 0,
+    DecorationSpecId = 1,
+    DecorationBlock = 2,
+    DecorationBufferBlock = 3,
+    DecorationRowMajor = 4,
+    DecorationColMajor = 5,
+    DecorationArrayStride = 6,
+    DecorationMatrixStride = 7,
+    DecorationGLSLShared = 8,
+    DecorationGLSLPacked = 9,
+    DecorationCPacked = 10,
+    DecorationBuiltIn = 11,
+    DecorationNoPerspective = 13,
+    DecorationFlat = 14,
+    DecorationPatch = 15,
+    DecorationCentroid = 16,
+    DecorationSample = 17,
+    DecorationInvariant = 18,
+    DecorationRestrict = 19,
+    DecorationAliased = 20,
+    DecorationVolatile = 21,
+    DecorationConstant = 22,
+    DecorationCoherent = 23,
+    DecorationNonWritable = 24,
+    DecorationNonReadable = 25,
+    DecorationUniform = 26,
+    DecorationUniformId = 27,
+    DecorationSaturatedConversion = 28,
+    DecorationStream = 29,
+    DecorationLocation = 30,
+    DecorationComponent = 31,
+    DecorationIndex = 32,
+    DecorationBinding = 33,
+    DecorationDescriptorSet = 34,
+    DecorationOffset = 35,
+    DecorationXfbBuffer = 36,
+    DecorationXfbStride = 37,
+    DecorationFuncParamAttr = 38,
+    DecorationFPRoundingMode = 39,
+    DecorationFPFastMathMode = 40,
+    DecorationLinkageAttributes = 41,
+    DecorationNoContraction = 42,
+    DecorationInputAttachmentIndex = 43,
+    DecorationAlignment = 44,
+    DecorationMaxByteOffset = 45,
+    DecorationAlignmentId = 46,
+    DecorationMaxByteOffsetId = 47,
+    DecorationNoSignedWrap = 4469,
+    DecorationNoUnsignedWrap = 4470,
+    DecorationExplicitInterpAMD = 4999,
+    DecorationOverrideCoverageNV = 5248,
+    DecorationPassthroughNV = 5250,
+    DecorationViewportRelativeNV = 5252,
+    DecorationSecondaryViewportRelativeNV = 5256,
+    DecorationPerPrimitiveNV = 5271,
+    DecorationPerViewNV = 5272,
+    DecorationPerTaskNV = 5273,
+    DecorationPerVertexNV = 5285,
+    DecorationNonUniform = 5300,
+    DecorationNonUniformEXT = 5300,
+    DecorationRestrictPointer = 5355,
+    DecorationRestrictPointerEXT = 5355,
+    DecorationAliasedPointer = 5356,
+    DecorationAliasedPointerEXT = 5356,
+    DecorationSIMTCallINTEL = 5599,
+    DecorationReferencedIndirectlyINTEL = 5602,
+    DecorationClobberINTEL = 5607,
+    DecorationSideEffectsINTEL = 5608,
+    DecorationVectorComputeVariableINTEL = 5624,
+    DecorationFuncParamIOKindINTEL = 5625,
+    DecorationVectorComputeFunctionINTEL = 5626,
+    DecorationStackCallINTEL = 5627,
+    DecorationGlobalVariableOffsetINTEL = 5628,
+    DecorationCounterBuffer = 5634,
+    DecorationHlslCounterBufferGOOGLE = 5634,
+    DecorationHlslSemanticGOOGLE = 5635,
+    DecorationUserSemantic = 5635,
+    DecorationUserTypeGOOGLE = 5636,
+    DecorationFunctionRoundingModeINTEL = 5822,
+    DecorationFunctionDenormModeINTEL = 5823,
+    DecorationRegisterINTEL = 5825,
+    DecorationMemoryINTEL = 5826,
+    DecorationNumbanksINTEL = 5827,
+    DecorationBankwidthINTEL = 5828,
+    DecorationMaxPrivateCopiesINTEL = 5829,
+    DecorationSinglepumpINTEL = 5830,
+    DecorationDoublepumpINTEL = 5831,
+    DecorationMaxReplicatesINTEL = 5832,
+    DecorationSimpleDualPortINTEL = 5833,
+    DecorationMergeINTEL = 5834,
+    DecorationBankBitsINTEL = 5835,
+    DecorationForcePow2DepthINTEL = 5836,
+    DecorationBurstCoalesceINTEL = 5899,
+    DecorationCacheSizeINTEL = 5900,
+    DecorationDontStaticallyCoalesceINTEL = 5901,
+    DecorationPrefetchINTEL = 5902,
+    DecorationStallEnableINTEL = 5905,
+    DecorationFuseLoopsInFunctionINTEL = 5907,
+    DecorationBufferLocationINTEL = 5921,
+    DecorationIOPipeStorageINTEL = 5944,
+    DecorationFunctionFloatingPointModeINTEL = 6080,
+    DecorationSingleElementVectorINTEL = 6085,
+    DecorationVectorComputeCallableFunctionINTEL = 6087,
+    DecorationMax = 0x7fffffff,
+};
+
+enum BuiltIn {
+    BuiltInPosition = 0,
+    BuiltInPointSize = 1,
+    BuiltInClipDistance = 3,
+    BuiltInCullDistance = 4,
+    BuiltInVertexId = 5,
+    BuiltInInstanceId = 6,
+    BuiltInPrimitiveId = 7,
+    BuiltInInvocationId = 8,
+    BuiltInLayer = 9,
+    BuiltInViewportIndex = 10,
+    BuiltInTessLevelOuter = 11,
+    BuiltInTessLevelInner = 12,
+    BuiltInTessCoord = 13,
+    BuiltInPatchVertices = 14,
+    BuiltInFragCoord = 15,
+    BuiltInPointCoord = 16,
+    BuiltInFrontFacing = 17,
+    BuiltInSampleId = 18,
+    BuiltInSamplePosition = 19,
+    BuiltInSampleMask = 20,
+    BuiltInFragDepth = 22,
+    BuiltInHelperInvocation = 23,
+    BuiltInNumWorkgroups = 24,
+    BuiltInWorkgroupSize = 25,
+    BuiltInWorkgroupId = 26,
+    BuiltInLocalInvocationId = 27,
+    BuiltInGlobalInvocationId = 28,
+    BuiltInLocalInvocationIndex = 29,
+    BuiltInWorkDim = 30,
+    BuiltInGlobalSize = 31,
+    BuiltInEnqueuedWorkgroupSize = 32,
+    BuiltInGlobalOffset = 33,
+    BuiltInGlobalLinearId = 34,
+    BuiltInSubgroupSize = 36,
+    BuiltInSubgroupMaxSize = 37,
+    BuiltInNumSubgroups = 38,
+    BuiltInNumEnqueuedSubgroups = 39,
+    BuiltInSubgroupId = 40,
+    BuiltInSubgroupLocalInvocationId = 41,
+    BuiltInVertexIndex = 42,
+    BuiltInInstanceIndex = 43,
+    BuiltInSubgroupEqMask = 4416,
+    BuiltInSubgroupEqMaskKHR = 4416,
+    BuiltInSubgroupGeMask = 4417,
+    BuiltInSubgroupGeMaskKHR = 4417,
+    BuiltInSubgroupGtMask = 4418,
+    BuiltInSubgroupGtMaskKHR = 4418,
+    BuiltInSubgroupLeMask = 4419,
+    BuiltInSubgroupLeMaskKHR = 4419,
+    BuiltInSubgroupLtMask = 4420,
+    BuiltInSubgroupLtMaskKHR = 4420,
+    BuiltInBaseVertex = 4424,
+    BuiltInBaseInstance = 4425,
+    BuiltInDrawIndex = 4426,
+    BuiltInPrimitiveShadingRateKHR = 4432,
+    BuiltInDeviceIndex = 4438,
+    BuiltInViewIndex = 4440,
+    BuiltInShadingRateKHR = 4444,
+    BuiltInBaryCoordNoPerspAMD = 4992,
+    BuiltInBaryCoordNoPerspCentroidAMD = 4993,
+    BuiltInBaryCoordNoPerspSampleAMD = 4994,
+    BuiltInBaryCoordSmoothAMD = 4995,
+    BuiltInBaryCoordSmoothCentroidAMD = 4996,
+    BuiltInBaryCoordSmoothSampleAMD = 4997,
+    BuiltInBaryCoordPullModelAMD = 4998,
+    BuiltInFragStencilRefEXT = 5014,
+    BuiltInViewportMaskNV = 5253,
+    BuiltInSecondaryPositionNV = 5257,
+    BuiltInSecondaryViewportMaskNV = 5258,
+    BuiltInPositionPerViewNV = 5261,
+    BuiltInViewportMaskPerViewNV = 5262,
+    BuiltInFullyCoveredEXT = 5264,
+    BuiltInTaskCountNV = 5274,
+    BuiltInPrimitiveCountNV = 5275,
+    BuiltInPrimitiveIndicesNV = 5276,
+    BuiltInClipDistancePerViewNV = 5277,
+    BuiltInCullDistancePerViewNV = 5278,
+    BuiltInLayerPerViewNV = 5279,
+    BuiltInMeshViewCountNV = 5280,
+    BuiltInMeshViewIndicesNV = 5281,
+    BuiltInBaryCoordNV = 5286,
+    BuiltInBaryCoordNoPerspNV = 5287,
+    BuiltInFragSizeEXT = 5292,
+    BuiltInFragmentSizeNV = 5292,
+    BuiltInFragInvocationCountEXT = 5293,
+    BuiltInInvocationsPerPixelNV = 5293,
+    BuiltInLaunchIdKHR = 5319,
+    BuiltInLaunchIdNV = 5319,
+    BuiltInLaunchSizeKHR = 5320,
+    BuiltInLaunchSizeNV = 5320,
+    BuiltInWorldRayOriginKHR = 5321,
+    BuiltInWorldRayOriginNV = 5321,
+    BuiltInWorldRayDirectionKHR = 5322,
+    BuiltInWorldRayDirectionNV = 5322,
+    BuiltInObjectRayOriginKHR = 5323,
+    BuiltInObjectRayOriginNV = 5323,
+    BuiltInObjectRayDirectionKHR = 5324,
+    BuiltInObjectRayDirectionNV = 5324,
+    BuiltInRayTminKHR = 5325,
+    BuiltInRayTminNV = 5325,
+    BuiltInRayTmaxKHR = 5326,
+    BuiltInRayTmaxNV = 5326,
+    BuiltInInstanceCustomIndexKHR = 5327,
+    BuiltInInstanceCustomIndexNV = 5327,
+    BuiltInObjectToWorldKHR = 5330,
+    BuiltInObjectToWorldNV = 5330,
+    BuiltInWorldToObjectKHR = 5331,
+    BuiltInWorldToObjectNV = 5331,
+    BuiltInHitTNV = 5332,
+    BuiltInHitKindKHR = 5333,
+    BuiltInHitKindNV = 5333,
+    BuiltInCurrentRayTimeNV = 5334,
+    BuiltInIncomingRayFlagsKHR = 5351,
+    BuiltInIncomingRayFlagsNV = 5351,
+    BuiltInRayGeometryIndexKHR = 5352,
+    BuiltInWarpsPerSMNV = 5374,
+    BuiltInSMCountNV = 5375,
+    BuiltInWarpIDNV = 5376,
+    BuiltInSMIDNV = 5377,
+    BuiltInMax = 0x7fffffff,
+};
+
+enum SelectionControlShift {
+    SelectionControlFlattenShift = 0,
+    SelectionControlDontFlattenShift = 1,
+    SelectionControlMax = 0x7fffffff,
+};
+
+enum SelectionControlMask {
+    SelectionControlMaskNone = 0,
+    SelectionControlFlattenMask = 0x00000001,
+    SelectionControlDontFlattenMask = 0x00000002,
+};
+
+enum LoopControlShift {
+    LoopControlUnrollShift = 0,
+    LoopControlDontUnrollShift = 1,
+    LoopControlDependencyInfiniteShift = 2,
+    LoopControlDependencyLengthShift = 3,
+    LoopControlMinIterationsShift = 4,
+    LoopControlMaxIterationsShift = 5,
+    LoopControlIterationMultipleShift = 6,
+    LoopControlPeelCountShift = 7,
+    LoopControlPartialCountShift = 8,
+    LoopControlInitiationIntervalINTELShift = 16,
+    LoopControlMaxConcurrencyINTELShift = 17,
+    LoopControlDependencyArrayINTELShift = 18,
+    LoopControlPipelineEnableINTELShift = 19,
+    LoopControlLoopCoalesceINTELShift = 20,
+    LoopControlMaxInterleavingINTELShift = 21,
+    LoopControlSpeculatedIterationsINTELShift = 22,
+    LoopControlNoFusionINTELShift = 23,
+    LoopControlMax = 0x7fffffff,
+};
+
+enum LoopControlMask {
+    LoopControlMaskNone = 0,
+    LoopControlUnrollMask = 0x00000001,
+    LoopControlDontUnrollMask = 0x00000002,
+    LoopControlDependencyInfiniteMask = 0x00000004,
+    LoopControlDependencyLengthMask = 0x00000008,
+    LoopControlMinIterationsMask = 0x00000010,
+    LoopControlMaxIterationsMask = 0x00000020,
+    LoopControlIterationMultipleMask = 0x00000040,
+    LoopControlPeelCountMask = 0x00000080,
+    LoopControlPartialCountMask = 0x00000100,
+    LoopControlInitiationIntervalINTELMask = 0x00010000,
+    LoopControlMaxConcurrencyINTELMask = 0x00020000,
+    LoopControlDependencyArrayINTELMask = 0x00040000,
+    LoopControlPipelineEnableINTELMask = 0x00080000,
+    LoopControlLoopCoalesceINTELMask = 0x00100000,
+    LoopControlMaxInterleavingINTELMask = 0x00200000,
+    LoopControlSpeculatedIterationsINTELMask = 0x00400000,
+    LoopControlNoFusionINTELMask = 0x00800000,
+};
+
+enum FunctionControlShift {
+    FunctionControlInlineShift = 0,
+    FunctionControlDontInlineShift = 1,
+    FunctionControlPureShift = 2,
+    FunctionControlConstShift = 3,
+    FunctionControlMax = 0x7fffffff,
+};
+
+enum FunctionControlMask {
+    FunctionControlMaskNone = 0,
+    FunctionControlInlineMask = 0x00000001,
+    FunctionControlDontInlineMask = 0x00000002,
+    FunctionControlPureMask = 0x00000004,
+    FunctionControlConstMask = 0x00000008,
+};
+
+enum MemorySemanticsShift {
+    MemorySemanticsAcquireShift = 1,
+    MemorySemanticsReleaseShift = 2,
+    MemorySemanticsAcquireReleaseShift = 3,
+    MemorySemanticsSequentiallyConsistentShift = 4,
+    MemorySemanticsUniformMemoryShift = 6,
+    MemorySemanticsSubgroupMemoryShift = 7,
+    MemorySemanticsWorkgroupMemoryShift = 8,
+    MemorySemanticsCrossWorkgroupMemoryShift = 9,
+    MemorySemanticsAtomicCounterMemoryShift = 10,
+    MemorySemanticsImageMemoryShift = 11,
+    MemorySemanticsOutputMemoryShift = 12,
+    MemorySemanticsOutputMemoryKHRShift = 12,
+    MemorySemanticsMakeAvailableShift = 13,
+    MemorySemanticsMakeAvailableKHRShift = 13,
+    MemorySemanticsMakeVisibleShift = 14,
+    MemorySemanticsMakeVisibleKHRShift = 14,
+    MemorySemanticsVolatileShift = 15,
+    MemorySemanticsMax = 0x7fffffff,
+};
+
+enum MemorySemanticsMask {
+    MemorySemanticsMaskNone = 0,
+    MemorySemanticsAcquireMask = 0x00000002,
+    MemorySemanticsReleaseMask = 0x00000004,
+    MemorySemanticsAcquireReleaseMask = 0x00000008,
+    MemorySemanticsSequentiallyConsistentMask = 0x00000010,
+    MemorySemanticsUniformMemoryMask = 0x00000040,
+    MemorySemanticsSubgroupMemoryMask = 0x00000080,
+    MemorySemanticsWorkgroupMemoryMask = 0x00000100,
+    MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
+    MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
+    MemorySemanticsImageMemoryMask = 0x00000800,
+    MemorySemanticsOutputMemoryMask = 0x00001000,
+    MemorySemanticsOutputMemoryKHRMask = 0x00001000,
+    MemorySemanticsMakeAvailableMask = 0x00002000,
+    MemorySemanticsMakeAvailableKHRMask = 0x00002000,
+    MemorySemanticsMakeVisibleMask = 0x00004000,
+    MemorySemanticsMakeVisibleKHRMask = 0x00004000,
+    MemorySemanticsVolatileMask = 0x00008000,
+};
+
+enum MemoryAccessShift {
+    MemoryAccessVolatileShift = 0,
+    MemoryAccessAlignedShift = 1,
+    MemoryAccessNontemporalShift = 2,
+    MemoryAccessMakePointerAvailableShift = 3,
+    MemoryAccessMakePointerAvailableKHRShift = 3,
+    MemoryAccessMakePointerVisibleShift = 4,
+    MemoryAccessMakePointerVisibleKHRShift = 4,
+    MemoryAccessNonPrivatePointerShift = 5,
+    MemoryAccessNonPrivatePointerKHRShift = 5,
+    MemoryAccessMax = 0x7fffffff,
+};
+
+enum MemoryAccessMask {
+    MemoryAccessMaskNone = 0,
+    MemoryAccessVolatileMask = 0x00000001,
+    MemoryAccessAlignedMask = 0x00000002,
+    MemoryAccessNontemporalMask = 0x00000004,
+    MemoryAccessMakePointerAvailableMask = 0x00000008,
+    MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
+    MemoryAccessMakePointerVisibleMask = 0x00000010,
+    MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
+    MemoryAccessNonPrivatePointerMask = 0x00000020,
+    MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+};
+
+enum Scope {
+    ScopeCrossDevice = 0,
+    ScopeDevice = 1,
+    ScopeWorkgroup = 2,
+    ScopeSubgroup = 3,
+    ScopeInvocation = 4,
+    ScopeQueueFamily = 5,
+    ScopeQueueFamilyKHR = 5,
+    ScopeShaderCallKHR = 6,
+    ScopeMax = 0x7fffffff,
+};
+
+enum GroupOperation {
+    GroupOperationReduce = 0,
+    GroupOperationInclusiveScan = 1,
+    GroupOperationExclusiveScan = 2,
+    GroupOperationClusteredReduce = 3,
+    GroupOperationPartitionedReduceNV = 6,
+    GroupOperationPartitionedInclusiveScanNV = 7,
+    GroupOperationPartitionedExclusiveScanNV = 8,
+    GroupOperationMax = 0x7fffffff,
+};
+
+enum KernelEnqueueFlags {
+    KernelEnqueueFlagsNoWait = 0,
+    KernelEnqueueFlagsWaitKernel = 1,
+    KernelEnqueueFlagsWaitWorkGroup = 2,
+    KernelEnqueueFlagsMax = 0x7fffffff,
+};
+
+enum KernelProfilingInfoShift {
+    KernelProfilingInfoCmdExecTimeShift = 0,
+    KernelProfilingInfoMax = 0x7fffffff,
+};
+
+enum KernelProfilingInfoMask {
+    KernelProfilingInfoMaskNone = 0,
+    KernelProfilingInfoCmdExecTimeMask = 0x00000001,
+};
+
+enum Capability {
+    CapabilityMatrix = 0,
+    CapabilityShader = 1,
+    CapabilityGeometry = 2,
+    CapabilityTessellation = 3,
+    CapabilityAddresses = 4,
+    CapabilityLinkage = 5,
+    CapabilityKernel = 6,
+    CapabilityVector16 = 7,
+    CapabilityFloat16Buffer = 8,
+    CapabilityFloat16 = 9,
+    CapabilityFloat64 = 10,
+    CapabilityInt64 = 11,
+    CapabilityInt64Atomics = 12,
+    CapabilityImageBasic = 13,
+    CapabilityImageReadWrite = 14,
+    CapabilityImageMipmap = 15,
+    CapabilityPipes = 17,
+    CapabilityGroups = 18,
+    CapabilityDeviceEnqueue = 19,
+    CapabilityLiteralSampler = 20,
+    CapabilityAtomicStorage = 21,
+    CapabilityInt16 = 22,
+    CapabilityTessellationPointSize = 23,
+    CapabilityGeometryPointSize = 24,
+    CapabilityImageGatherExtended = 25,
+    CapabilityStorageImageMultisample = 27,
+    CapabilityUniformBufferArrayDynamicIndexing = 28,
+    CapabilitySampledImageArrayDynamicIndexing = 29,
+    CapabilityStorageBufferArrayDynamicIndexing = 30,
+    CapabilityStorageImageArrayDynamicIndexing = 31,
+    CapabilityClipDistance = 32,
+    CapabilityCullDistance = 33,
+    CapabilityImageCubeArray = 34,
+    CapabilitySampleRateShading = 35,
+    CapabilityImageRect = 36,
+    CapabilitySampledRect = 37,
+    CapabilityGenericPointer = 38,
+    CapabilityInt8 = 39,
+    CapabilityInputAttachment = 40,
+    CapabilitySparseResidency = 41,
+    CapabilityMinLod = 42,
+    CapabilitySampled1D = 43,
+    CapabilityImage1D = 44,
+    CapabilitySampledCubeArray = 45,
+    CapabilitySampledBuffer = 46,
+    CapabilityImageBuffer = 47,
+    CapabilityImageMSArray = 48,
+    CapabilityStorageImageExtendedFormats = 49,
+    CapabilityImageQuery = 50,
+    CapabilityDerivativeControl = 51,
+    CapabilityInterpolationFunction = 52,
+    CapabilityTransformFeedback = 53,
+    CapabilityGeometryStreams = 54,
+    CapabilityStorageImageReadWithoutFormat = 55,
+    CapabilityStorageImageWriteWithoutFormat = 56,
+    CapabilityMultiViewport = 57,
+    CapabilitySubgroupDispatch = 58,
+    CapabilityNamedBarrier = 59,
+    CapabilityPipeStorage = 60,
+    CapabilityGroupNonUniform = 61,
+    CapabilityGroupNonUniformVote = 62,
+    CapabilityGroupNonUniformArithmetic = 63,
+    CapabilityGroupNonUniformBallot = 64,
+    CapabilityGroupNonUniformShuffle = 65,
+    CapabilityGroupNonUniformShuffleRelative = 66,
+    CapabilityGroupNonUniformClustered = 67,
+    CapabilityGroupNonUniformQuad = 68,
+    CapabilityShaderLayer = 69,
+    CapabilityShaderViewportIndex = 70,
+    CapabilityFragmentShadingRateKHR = 4422,
+    CapabilitySubgroupBallotKHR = 4423,
+    CapabilityDrawParameters = 4427,
+    CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428,
+    CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
+    CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
+    CapabilitySubgroupVoteKHR = 4431,
+    CapabilityStorageBuffer16BitAccess = 4433,
+    CapabilityStorageUniformBufferBlock16 = 4433,
+    CapabilityStorageUniform16 = 4434,
+    CapabilityUniformAndStorageBuffer16BitAccess = 4434,
+    CapabilityStoragePushConstant16 = 4435,
+    CapabilityStorageInputOutput16 = 4436,
+    CapabilityDeviceGroup = 4437,
+    CapabilityMultiView = 4439,
+    CapabilityVariablePointersStorageBuffer = 4441,
+    CapabilityVariablePointers = 4442,
+    CapabilityAtomicStorageOps = 4445,
+    CapabilitySampleMaskPostDepthCoverage = 4447,
+    CapabilityStorageBuffer8BitAccess = 4448,
+    CapabilityUniformAndStorageBuffer8BitAccess = 4449,
+    CapabilityStoragePushConstant8 = 4450,
+    CapabilityDenormPreserve = 4464,
+    CapabilityDenormFlushToZero = 4465,
+    CapabilitySignedZeroInfNanPreserve = 4466,
+    CapabilityRoundingModeRTE = 4467,
+    CapabilityRoundingModeRTZ = 4468,
+    CapabilityRayQueryProvisionalKHR = 4471,
+    CapabilityRayQueryKHR = 4472,
+    CapabilityRayTraversalPrimitiveCullingKHR = 4478,
+    CapabilityRayTracingKHR = 4479,
+    CapabilityFloat16ImageAMD = 5008,
+    CapabilityImageGatherBiasLodAMD = 5009,
+    CapabilityFragmentMaskAMD = 5010,
+    CapabilityStencilExportEXT = 5013,
+    CapabilityImageReadWriteLodAMD = 5015,
+    CapabilityInt64ImageEXT = 5016,
+    CapabilityShaderClockKHR = 5055,
+    CapabilitySampleMaskOverrideCoverageNV = 5249,
+    CapabilityGeometryShaderPassthroughNV = 5251,
+    CapabilityShaderViewportIndexLayerEXT = 5254,
+    CapabilityShaderViewportIndexLayerNV = 5254,
+    CapabilityShaderViewportMaskNV = 5255,
+    CapabilityShaderStereoViewNV = 5259,
+    CapabilityPerViewAttributesNV = 5260,
+    CapabilityFragmentFullyCoveredEXT = 5265,
+    CapabilityMeshShadingNV = 5266,
+    CapabilityImageFootprintNV = 5282,
+    CapabilityFragmentBarycentricNV = 5284,
+    CapabilityComputeDerivativeGroupQuadsNV = 5288,
+    CapabilityFragmentDensityEXT = 5291,
+    CapabilityShadingRateNV = 5291,
+    CapabilityGroupNonUniformPartitionedNV = 5297,
+    CapabilityShaderNonUniform = 5301,
+    CapabilityShaderNonUniformEXT = 5301,
+    CapabilityRuntimeDescriptorArray = 5302,
+    CapabilityRuntimeDescriptorArrayEXT = 5302,
+    CapabilityInputAttachmentArrayDynamicIndexing = 5303,
+    CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
+    CapabilityUniformTexelBufferArrayDynamicIndexing = 5304,
+    CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
+    CapabilityStorageTexelBufferArrayDynamicIndexing = 5305,
+    CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
+    CapabilityUniformBufferArrayNonUniformIndexing = 5306,
+    CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
+    CapabilitySampledImageArrayNonUniformIndexing = 5307,
+    CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
+    CapabilityStorageBufferArrayNonUniformIndexing = 5308,
+    CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
+    CapabilityStorageImageArrayNonUniformIndexing = 5309,
+    CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
+    CapabilityInputAttachmentArrayNonUniformIndexing = 5310,
+    CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
+    CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311,
+    CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
+    CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
+    CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
+    CapabilityRayTracingNV = 5340,
+    CapabilityRayTracingMotionBlurNV = 5341,
+    CapabilityVulkanMemoryModel = 5345,
+    CapabilityVulkanMemoryModelKHR = 5345,
+    CapabilityVulkanMemoryModelDeviceScope = 5346,
+    CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
+    CapabilityPhysicalStorageBufferAddresses = 5347,
+    CapabilityPhysicalStorageBufferAddressesEXT = 5347,
+    CapabilityComputeDerivativeGroupLinearNV = 5350,
+    CapabilityRayTracingProvisionalKHR = 5353,
+    CapabilityCooperativeMatrixNV = 5357,
+    CapabilityFragmentShaderSampleInterlockEXT = 5363,
+    CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
+    CapabilityShaderSMBuiltinsNV = 5373,
+    CapabilityFragmentShaderPixelInterlockEXT = 5378,
+    CapabilityDemoteToHelperInvocation = 5379,
+    CapabilityDemoteToHelperInvocationEXT = 5379,
+    CapabilitySubgroupShuffleINTEL = 5568,
+    CapabilitySubgroupBufferBlockIOINTEL = 5569,
+    CapabilitySubgroupImageBlockIOINTEL = 5570,
+    CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
+    CapabilityRoundToInfinityINTEL = 5582,
+    CapabilityFloatingPointModeINTEL = 5583,
+    CapabilityIntegerFunctions2INTEL = 5584,
+    CapabilityFunctionPointersINTEL = 5603,
+    CapabilityIndirectReferencesINTEL = 5604,
+    CapabilityAsmINTEL = 5606,
+    CapabilityAtomicFloat32MinMaxEXT = 5612,
+    CapabilityAtomicFloat64MinMaxEXT = 5613,
+    CapabilityAtomicFloat16MinMaxEXT = 5616,
+    CapabilityVectorComputeINTEL = 5617,
+    CapabilityVectorAnyINTEL = 5619,
+    CapabilityExpectAssumeKHR = 5629,
+    CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
+    CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
+    CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
+    CapabilityVariableLengthArrayINTEL = 5817,
+    CapabilityFunctionFloatControlINTEL = 5821,
+    CapabilityFPGAMemoryAttributesINTEL = 5824,
+    CapabilityFPFastMathModeINTEL = 5837,
+    CapabilityArbitraryPrecisionIntegersINTEL = 5844,
+    CapabilityUnstructuredLoopControlsINTEL = 5886,
+    CapabilityFPGALoopControlsINTEL = 5888,
+    CapabilityKernelAttributesINTEL = 5892,
+    CapabilityFPGAKernelAttributesINTEL = 5897,
+    CapabilityFPGAMemoryAccessesINTEL = 5898,
+    CapabilityFPGAClusterAttributesINTEL = 5904,
+    CapabilityLoopFuseINTEL = 5906,
+    CapabilityFPGABufferLocationINTEL = 5920,
+    CapabilityUSMStorageClassesINTEL = 5935,
+    CapabilityIOPipesINTEL = 5943,
+    CapabilityBlockingPipesINTEL = 5945,
+    CapabilityFPGARegINTEL = 5948,
+    CapabilityAtomicFloat32AddEXT = 6033,
+    CapabilityAtomicFloat64AddEXT = 6034,
+    CapabilityLongConstantCompositeINTEL = 6089,
+    CapabilityAtomicFloat16AddEXT = 6095,
+    CapabilityMax = 0x7fffffff,
+};
+
+enum RayFlagsShift {
+    RayFlagsOpaqueKHRShift = 0,
+    RayFlagsNoOpaqueKHRShift = 1,
+    RayFlagsTerminateOnFirstHitKHRShift = 2,
+    RayFlagsSkipClosestHitShaderKHRShift = 3,
+    RayFlagsCullBackFacingTrianglesKHRShift = 4,
+    RayFlagsCullFrontFacingTrianglesKHRShift = 5,
+    RayFlagsCullOpaqueKHRShift = 6,
+    RayFlagsCullNoOpaqueKHRShift = 7,
+    RayFlagsSkipTrianglesKHRShift = 8,
+    RayFlagsSkipAABBsKHRShift = 9,
+    RayFlagsMax = 0x7fffffff,
+};
+
+enum RayFlagsMask {
+    RayFlagsMaskNone = 0,
+    RayFlagsOpaqueKHRMask = 0x00000001,
+    RayFlagsNoOpaqueKHRMask = 0x00000002,
+    RayFlagsTerminateOnFirstHitKHRMask = 0x00000004,
+    RayFlagsSkipClosestHitShaderKHRMask = 0x00000008,
+    RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010,
+    RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020,
+    RayFlagsCullOpaqueKHRMask = 0x00000040,
+    RayFlagsCullNoOpaqueKHRMask = 0x00000080,
+    RayFlagsSkipTrianglesKHRMask = 0x00000100,
+    RayFlagsSkipAABBsKHRMask = 0x00000200,
+};
+
+enum RayQueryIntersection {
+    RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0,
+    RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1,
+    RayQueryIntersectionMax = 0x7fffffff,
+};
+
+enum RayQueryCommittedIntersectionType {
+    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0,
+    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1,
+    RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2,
+    RayQueryCommittedIntersectionTypeMax = 0x7fffffff,
+};
+
+enum RayQueryCandidateIntersectionType {
+    RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0,
+    RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1,
+    RayQueryCandidateIntersectionTypeMax = 0x7fffffff,
+};
+
+enum FragmentShadingRateShift {
+    FragmentShadingRateVertical2PixelsShift = 0,
+    FragmentShadingRateVertical4PixelsShift = 1,
+    FragmentShadingRateHorizontal2PixelsShift = 2,
+    FragmentShadingRateHorizontal4PixelsShift = 3,
+    FragmentShadingRateMax = 0x7fffffff,
+};
+
+enum FragmentShadingRateMask {
+    FragmentShadingRateMaskNone = 0,
+    FragmentShadingRateVertical2PixelsMask = 0x00000001,
+    FragmentShadingRateVertical4PixelsMask = 0x00000002,
+    FragmentShadingRateHorizontal2PixelsMask = 0x00000004,
+    FragmentShadingRateHorizontal4PixelsMask = 0x00000008,
+};
+
+enum FPDenormMode {
+    FPDenormModePreserve = 0,
+    FPDenormModeFlushToZero = 1,
+    FPDenormModeMax = 0x7fffffff,
+};
+
+enum FPOperationMode {
+    FPOperationModeIEEE = 0,
+    FPOperationModeALT = 1,
+    FPOperationModeMax = 0x7fffffff,
+};
+
+enum Op {
+    OpNop = 0,
+    OpUndef = 1,
+    OpSourceContinued = 2,
+    OpSource = 3,
+    OpSourceExtension = 4,
+    OpName = 5,
+    OpMemberName = 6,
+    OpString = 7,
+    OpLine = 8,
+    OpExtension = 10,
+    OpExtInstImport = 11,
+    OpExtInst = 12,
+    OpMemoryModel = 14,
+    OpEntryPoint = 15,
+    OpExecutionMode = 16,
+    OpCapability = 17,
+    OpTypeVoid = 19,
+    OpTypeBool = 20,
+    OpTypeInt = 21,
+    OpTypeFloat = 22,
+    OpTypeVector = 23,
+    OpTypeMatrix = 24,
+    OpTypeImage = 25,
+    OpTypeSampler = 26,
+    OpTypeSampledImage = 27,
+    OpTypeArray = 28,
+    OpTypeRuntimeArray = 29,
+    OpTypeStruct = 30,
+    OpTypeOpaque = 31,
+    OpTypePointer = 32,
+    OpTypeFunction = 33,
+    OpTypeEvent = 34,
+    OpTypeDeviceEvent = 35,
+    OpTypeReserveId = 36,
+    OpTypeQueue = 37,
+    OpTypePipe = 38,
+    OpTypeForwardPointer = 39,
+    OpConstantTrue = 41,
+    OpConstantFalse = 42,
+    OpConstant = 43,
+    OpConstantComposite = 44,
+    OpConstantSampler = 45,
+    OpConstantNull = 46,
+    OpSpecConstantTrue = 48,
+    OpSpecConstantFalse = 49,
+    OpSpecConstant = 50,
+    OpSpecConstantComposite = 51,
+    OpSpecConstantOp = 52,
+    OpFunction = 54,
+    OpFunctionParameter = 55,
+    OpFunctionEnd = 56,
+    OpFunctionCall = 57,
+    OpVariable = 59,
+    OpImageTexelPointer = 60,
+    OpLoad = 61,
+    OpStore = 62,
+    OpCopyMemory = 63,
+    OpCopyMemorySized = 64,
+    OpAccessChain = 65,
+    OpInBoundsAccessChain = 66,
+    OpPtrAccessChain = 67,
+    OpArrayLength = 68,
+    OpGenericPtrMemSemantics = 69,
+    OpInBoundsPtrAccessChain = 70,
+    OpDecorate = 71,
+    OpMemberDecorate = 72,
+    OpDecorationGroup = 73,
+    OpGroupDecorate = 74,
+    OpGroupMemberDecorate = 75,
+    OpVectorExtractDynamic = 77,
+    OpVectorInsertDynamic = 78,
+    OpVectorShuffle = 79,
+    OpCompositeConstruct = 80,
+    OpCompositeExtract = 81,
+    OpCompositeInsert = 82,
+    OpCopyObject = 83,
+    OpTranspose = 84,
+    OpSampledImage = 86,
+    OpImageSampleImplicitLod = 87,
+    OpImageSampleExplicitLod = 88,
+    OpImageSampleDrefImplicitLod = 89,
+    OpImageSampleDrefExplicitLod = 90,
+    OpImageSampleProjImplicitLod = 91,
+    OpImageSampleProjExplicitLod = 92,
+    OpImageSampleProjDrefImplicitLod = 93,
+    OpImageSampleProjDrefExplicitLod = 94,
+    OpImageFetch = 95,
+    OpImageGather = 96,
+    OpImageDrefGather = 97,
+    OpImageRead = 98,
+    OpImageWrite = 99,
+    OpImage = 100,
+    OpImageQueryFormat = 101,
+    OpImageQueryOrder = 102,
+    OpImageQuerySizeLod = 103,
+    OpImageQuerySize = 104,
+    OpImageQueryLod = 105,
+    OpImageQueryLevels = 106,
+    OpImageQuerySamples = 107,
+    OpConvertFToU = 109,
+    OpConvertFToS = 110,
+    OpConvertSToF = 111,
+    OpConvertUToF = 112,
+    OpUConvert = 113,
+    OpSConvert = 114,
+    OpFConvert = 115,
+    OpQuantizeToF16 = 116,
+    OpConvertPtrToU = 117,
+    OpSatConvertSToU = 118,
+    OpSatConvertUToS = 119,
+    OpConvertUToPtr = 120,
+    OpPtrCastToGeneric = 121,
+    OpGenericCastToPtr = 122,
+    OpGenericCastToPtrExplicit = 123,
+    OpBitcast = 124,
+    OpSNegate = 126,
+    OpFNegate = 127,
+    OpIAdd = 128,
+    OpFAdd = 129,
+    OpISub = 130,
+    OpFSub = 131,
+    OpIMul = 132,
+    OpFMul = 133,
+    OpUDiv = 134,
+    OpSDiv = 135,
+    OpFDiv = 136,
+    OpUMod = 137,
+    OpSRem = 138,
+    OpSMod = 139,
+    OpFRem = 140,
+    OpFMod = 141,
+    OpVectorTimesScalar = 142,
+    OpMatrixTimesScalar = 143,
+    OpVectorTimesMatrix = 144,
+    OpMatrixTimesVector = 145,
+    OpMatrixTimesMatrix = 146,
+    OpOuterProduct = 147,
+    OpDot = 148,
+    OpIAddCarry = 149,
+    OpISubBorrow = 150,
+    OpUMulExtended = 151,
+    OpSMulExtended = 152,
+    OpAny = 154,
+    OpAll = 155,
+    OpIsNan = 156,
+    OpIsInf = 157,
+    OpIsFinite = 158,
+    OpIsNormal = 159,
+    OpSignBitSet = 160,
+    OpLessOrGreater = 161,
+    OpOrdered = 162,
+    OpUnordered = 163,
+    OpLogicalEqual = 164,
+    OpLogicalNotEqual = 165,
+    OpLogicalOr = 166,
+    OpLogicalAnd = 167,
+    OpLogicalNot = 168,
+    OpSelect = 169,
+    OpIEqual = 170,
+    OpINotEqual = 171,
+    OpUGreaterThan = 172,
+    OpSGreaterThan = 173,
+    OpUGreaterThanEqual = 174,
+    OpSGreaterThanEqual = 175,
+    OpULessThan = 176,
+    OpSLessThan = 177,
+    OpULessThanEqual = 178,
+    OpSLessThanEqual = 179,
+    OpFOrdEqual = 180,
+    OpFUnordEqual = 181,
+    OpFOrdNotEqual = 182,
+    OpFUnordNotEqual = 183,
+    OpFOrdLessThan = 184,
+    OpFUnordLessThan = 185,
+    OpFOrdGreaterThan = 186,
+    OpFUnordGreaterThan = 187,
+    OpFOrdLessThanEqual = 188,
+    OpFUnordLessThanEqual = 189,
+    OpFOrdGreaterThanEqual = 190,
+    OpFUnordGreaterThanEqual = 191,
+    OpShiftRightLogical = 194,
+    OpShiftRightArithmetic = 195,
+    OpShiftLeftLogical = 196,
+    OpBitwiseOr = 197,
+    OpBitwiseXor = 198,
+    OpBitwiseAnd = 199,
+    OpNot = 200,
+    OpBitFieldInsert = 201,
+    OpBitFieldSExtract = 202,
+    OpBitFieldUExtract = 203,
+    OpBitReverse = 204,
+    OpBitCount = 205,
+    OpDPdx = 207,
+    OpDPdy = 208,
+    OpFwidth = 209,
+    OpDPdxFine = 210,
+    OpDPdyFine = 211,
+    OpFwidthFine = 212,
+    OpDPdxCoarse = 213,
+    OpDPdyCoarse = 214,
+    OpFwidthCoarse = 215,
+    OpEmitVertex = 218,
+    OpEndPrimitive = 219,
+    OpEmitStreamVertex = 220,
+    OpEndStreamPrimitive = 221,
+    OpControlBarrier = 224,
+    OpMemoryBarrier = 225,
+    OpAtomicLoad = 227,
+    OpAtomicStore = 228,
+    OpAtomicExchange = 229,
+    OpAtomicCompareExchange = 230,
+    OpAtomicCompareExchangeWeak = 231,
+    OpAtomicIIncrement = 232,
+    OpAtomicIDecrement = 233,
+    OpAtomicIAdd = 234,
+    OpAtomicISub = 235,
+    OpAtomicSMin = 236,
+    OpAtomicUMin = 237,
+    OpAtomicSMax = 238,
+    OpAtomicUMax = 239,
+    OpAtomicAnd = 240,
+    OpAtomicOr = 241,
+    OpAtomicXor = 242,
+    OpPhi = 245,
+    OpLoopMerge = 246,
+    OpSelectionMerge = 247,
+    OpLabel = 248,
+    OpBranch = 249,
+    OpBranchConditional = 250,
+    OpSwitch = 251,
+    OpKill = 252,
+    OpReturn = 253,
+    OpReturnValue = 254,
+    OpUnreachable = 255,
+    OpLifetimeStart = 256,
+    OpLifetimeStop = 257,
+    OpGroupAsyncCopy = 259,
+    OpGroupWaitEvents = 260,
+    OpGroupAll = 261,
+    OpGroupAny = 262,
+    OpGroupBroadcast = 263,
+    OpGroupIAdd = 264,
+    OpGroupFAdd = 265,
+    OpGroupFMin = 266,
+    OpGroupUMin = 267,
+    OpGroupSMin = 268,
+    OpGroupFMax = 269,
+    OpGroupUMax = 270,
+    OpGroupSMax = 271,
+    OpReadPipe = 274,
+    OpWritePipe = 275,
+    OpReservedReadPipe = 276,
+    OpReservedWritePipe = 277,
+    OpReserveReadPipePackets = 278,
+    OpReserveWritePipePackets = 279,
+    OpCommitReadPipe = 280,
+    OpCommitWritePipe = 281,
+    OpIsValidReserveId = 282,
+    OpGetNumPipePackets = 283,
+    OpGetMaxPipePackets = 284,
+    OpGroupReserveReadPipePackets = 285,
+    OpGroupReserveWritePipePackets = 286,
+    OpGroupCommitReadPipe = 287,
+    OpGroupCommitWritePipe = 288,
+    OpEnqueueMarker = 291,
+    OpEnqueueKernel = 292,
+    OpGetKernelNDrangeSubGroupCount = 293,
+    OpGetKernelNDrangeMaxSubGroupSize = 294,
+    OpGetKernelWorkGroupSize = 295,
+    OpGetKernelPreferredWorkGroupSizeMultiple = 296,
+    OpRetainEvent = 297,
+    OpReleaseEvent = 298,
+    OpCreateUserEvent = 299,
+    OpIsValidEvent = 300,
+    OpSetUserEventStatus = 301,
+    OpCaptureEventProfilingInfo = 302,
+    OpGetDefaultQueue = 303,
+    OpBuildNDRange = 304,
+    OpImageSparseSampleImplicitLod = 305,
+    OpImageSparseSampleExplicitLod = 306,
+    OpImageSparseSampleDrefImplicitLod = 307,
+    OpImageSparseSampleDrefExplicitLod = 308,
+    OpImageSparseSampleProjImplicitLod = 309,
+    OpImageSparseSampleProjExplicitLod = 310,
+    OpImageSparseSampleProjDrefImplicitLod = 311,
+    OpImageSparseSampleProjDrefExplicitLod = 312,
+    OpImageSparseFetch = 313,
+    OpImageSparseGather = 314,
+    OpImageSparseDrefGather = 315,
+    OpImageSparseTexelsResident = 316,
+    OpNoLine = 317,
+    OpAtomicFlagTestAndSet = 318,
+    OpAtomicFlagClear = 319,
+    OpImageSparseRead = 320,
+    OpSizeOf = 321,
+    OpTypePipeStorage = 322,
+    OpConstantPipeStorage = 323,
+    OpCreatePipeFromPipeStorage = 324,
+    OpGetKernelLocalSizeForSubgroupCount = 325,
+    OpGetKernelMaxNumSubgroups = 326,
+    OpTypeNamedBarrier = 327,
+    OpNamedBarrierInitialize = 328,
+    OpMemoryNamedBarrier = 329,
+    OpModuleProcessed = 330,
+    OpExecutionModeId = 331,
+    OpDecorateId = 332,
+    OpGroupNonUniformElect = 333,
+    OpGroupNonUniformAll = 334,
+    OpGroupNonUniformAny = 335,
+    OpGroupNonUniformAllEqual = 336,
+    OpGroupNonUniformBroadcast = 337,
+    OpGroupNonUniformBroadcastFirst = 338,
+    OpGroupNonUniformBallot = 339,
+    OpGroupNonUniformInverseBallot = 340,
+    OpGroupNonUniformBallotBitExtract = 341,
+    OpGroupNonUniformBallotBitCount = 342,
+    OpGroupNonUniformBallotFindLSB = 343,
+    OpGroupNonUniformBallotFindMSB = 344,
+    OpGroupNonUniformShuffle = 345,
+    OpGroupNonUniformShuffleXor = 346,
+    OpGroupNonUniformShuffleUp = 347,
+    OpGroupNonUniformShuffleDown = 348,
+    OpGroupNonUniformIAdd = 349,
+    OpGroupNonUniformFAdd = 350,
+    OpGroupNonUniformIMul = 351,
+    OpGroupNonUniformFMul = 352,
+    OpGroupNonUniformSMin = 353,
+    OpGroupNonUniformUMin = 354,
+    OpGroupNonUniformFMin = 355,
+    OpGroupNonUniformSMax = 356,
+    OpGroupNonUniformUMax = 357,
+    OpGroupNonUniformFMax = 358,
+    OpGroupNonUniformBitwiseAnd = 359,
+    OpGroupNonUniformBitwiseOr = 360,
+    OpGroupNonUniformBitwiseXor = 361,
+    OpGroupNonUniformLogicalAnd = 362,
+    OpGroupNonUniformLogicalOr = 363,
+    OpGroupNonUniformLogicalXor = 364,
+    OpGroupNonUniformQuadBroadcast = 365,
+    OpGroupNonUniformQuadSwap = 366,
+    OpCopyLogical = 400,
+    OpPtrEqual = 401,
+    OpPtrNotEqual = 402,
+    OpPtrDiff = 403,
+    OpTerminateInvocation = 4416,
+    OpSubgroupBallotKHR = 4421,
+    OpSubgroupFirstInvocationKHR = 4422,
+    OpSubgroupAllKHR = 4428,
+    OpSubgroupAnyKHR = 4429,
+    OpSubgroupAllEqualKHR = 4430,
+    OpSubgroupReadInvocationKHR = 4432,
+    OpTraceRayKHR = 4445,
+    OpExecuteCallableKHR = 4446,
+    OpConvertUToAccelerationStructureKHR = 4447,
+    OpIgnoreIntersectionKHR = 4448,
+    OpTerminateRayKHR = 4449,
+    OpTypeRayQueryKHR = 4472,
+    OpRayQueryInitializeKHR = 4473,
+    OpRayQueryTerminateKHR = 4474,
+    OpRayQueryGenerateIntersectionKHR = 4475,
+    OpRayQueryConfirmIntersectionKHR = 4476,
+    OpRayQueryProceedKHR = 4477,
+    OpRayQueryGetIntersectionTypeKHR = 4479,
+    OpGroupIAddNonUniformAMD = 5000,
+    OpGroupFAddNonUniformAMD = 5001,
+    OpGroupFMinNonUniformAMD = 5002,
+    OpGroupUMinNonUniformAMD = 5003,
+    OpGroupSMinNonUniformAMD = 5004,
+    OpGroupFMaxNonUniformAMD = 5005,
+    OpGroupUMaxNonUniformAMD = 5006,
+    OpGroupSMaxNonUniformAMD = 5007,
+    OpFragmentMaskFetchAMD = 5011,
+    OpFragmentFetchAMD = 5012,
+    OpReadClockKHR = 5056,
+    OpImageSampleFootprintNV = 5283,
+    OpGroupNonUniformPartitionNV = 5296,
+    OpWritePackedPrimitiveIndices4x8NV = 5299,
+    OpReportIntersectionKHR = 5334,
+    OpReportIntersectionNV = 5334,
+    OpIgnoreIntersectionNV = 5335,
+    OpTerminateRayNV = 5336,
+    OpTraceNV = 5337,
+    OpTraceMotionNV = 5338,
+    OpTraceRayMotionNV = 5339,
+    OpTypeAccelerationStructureKHR = 5341,
+    OpTypeAccelerationStructureNV = 5341,
+    OpExecuteCallableNV = 5344,
+    OpTypeCooperativeMatrixNV = 5358,
+    OpCooperativeMatrixLoadNV = 5359,
+    OpCooperativeMatrixStoreNV = 5360,
+    OpCooperativeMatrixMulAddNV = 5361,
+    OpCooperativeMatrixLengthNV = 5362,
+    OpBeginInvocationInterlockEXT = 5364,
+    OpEndInvocationInterlockEXT = 5365,
+    OpDemoteToHelperInvocationEXT = 5380,
+    OpIsHelperInvocationEXT = 5381,
+    OpSubgroupShuffleINTEL = 5571,
+    OpSubgroupShuffleDownINTEL = 5572,
+    OpSubgroupShuffleUpINTEL = 5573,
+    OpSubgroupShuffleXorINTEL = 5574,
+    OpSubgroupBlockReadINTEL = 5575,
+    OpSubgroupBlockWriteINTEL = 5576,
+    OpSubgroupImageBlockReadINTEL = 5577,
+    OpSubgroupImageBlockWriteINTEL = 5578,
+    OpSubgroupImageMediaBlockReadINTEL = 5580,
+    OpSubgroupImageMediaBlockWriteINTEL = 5581,
+    OpUCountLeadingZerosINTEL = 5585,
+    OpUCountTrailingZerosINTEL = 5586,
+    OpAbsISubINTEL = 5587,
+    OpAbsUSubINTEL = 5588,
+    OpIAddSatINTEL = 5589,
+    OpUAddSatINTEL = 5590,
+    OpIAverageINTEL = 5591,
+    OpUAverageINTEL = 5592,
+    OpIAverageRoundedINTEL = 5593,
+    OpUAverageRoundedINTEL = 5594,
+    OpISubSatINTEL = 5595,
+    OpUSubSatINTEL = 5596,
+    OpIMul32x16INTEL = 5597,
+    OpUMul32x16INTEL = 5598,
+    OpConstFunctionPointerINTEL = 5600,
+    OpFunctionPointerCallINTEL = 5601,
+    OpAsmTargetINTEL = 5609,
+    OpAsmINTEL = 5610,
+    OpAsmCallINTEL = 5611,
+    OpAtomicFMinEXT = 5614,
+    OpAtomicFMaxEXT = 5615,
+    OpAssumeTrueKHR = 5630,
+    OpExpectKHR = 5631,
+    OpDecorateString = 5632,
+    OpDecorateStringGOOGLE = 5632,
+    OpMemberDecorateString = 5633,
+    OpMemberDecorateStringGOOGLE = 5633,
+    OpVmeImageINTEL = 5699,
+    OpTypeVmeImageINTEL = 5700,
+    OpTypeAvcImePayloadINTEL = 5701,
+    OpTypeAvcRefPayloadINTEL = 5702,
+    OpTypeAvcSicPayloadINTEL = 5703,
+    OpTypeAvcMcePayloadINTEL = 5704,
+    OpTypeAvcMceResultINTEL = 5705,
+    OpTypeAvcImeResultINTEL = 5706,
+    OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
+    OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
+    OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
+    OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
+    OpTypeAvcRefResultINTEL = 5711,
+    OpTypeAvcSicResultINTEL = 5712,
+    OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
+    OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
+    OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
+    OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
+    OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
+    OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
+    OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
+    OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
+    OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
+    OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
+    OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
+    OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
+    OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
+    OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
+    OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
+    OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
+    OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
+    OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
+    OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
+    OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
+    OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
+    OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
+    OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
+    OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
+    OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
+    OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
+    OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
+    OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
+    OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
+    OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
+    OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
+    OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
+    OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
+    OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
+    OpSubgroupAvcImeInitializeINTEL = 5747,
+    OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
+    OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
+    OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
+    OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
+    OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
+    OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
+    OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
+    OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
+    OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
+    OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
+    OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
+    OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
+    OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
+    OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
+    OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
+    OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
+    OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
+    OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
+    OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
+    OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
+    OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
+    OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
+    OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
+    OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
+    OpSubgroupAvcFmeInitializeINTEL = 5781,
+    OpSubgroupAvcBmeInitializeINTEL = 5782,
+    OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
+    OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
+    OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
+    OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
+    OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
+    OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
+    OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
+    OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
+    OpSubgroupAvcSicInitializeINTEL = 5791,
+    OpSubgroupAvcSicConfigureSkcINTEL = 5792,
+    OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
+    OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
+    OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
+    OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
+    OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
+    OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
+    OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
+    OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
+    OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
+    OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
+    OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
+    OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
+    OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
+    OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
+    OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
+    OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
+    OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
+    OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
+    OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
+    OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
+    OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
+    OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
+    OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
+    OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
+    OpVariableLengthArrayINTEL = 5818,
+    OpSaveMemoryINTEL = 5819,
+    OpRestoreMemoryINTEL = 5820,
+    OpLoopControlINTEL = 5887,
+    OpPtrCastToCrossWorkgroupINTEL = 5934,
+    OpCrossWorkgroupCastToPtrINTEL = 5938,
+    OpReadPipeBlockingINTEL = 5946,
+    OpWritePipeBlockingINTEL = 5947,
+    OpFPGARegINTEL = 5949,
+    OpRayQueryGetRayTMinKHR = 6016,
+    OpRayQueryGetRayFlagsKHR = 6017,
+    OpRayQueryGetIntersectionTKHR = 6018,
+    OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
+    OpRayQueryGetIntersectionInstanceIdKHR = 6020,
+    OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
+    OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
+    OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
+    OpRayQueryGetIntersectionBarycentricsKHR = 6024,
+    OpRayQueryGetIntersectionFrontFaceKHR = 6025,
+    OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
+    OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
+    OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
+    OpRayQueryGetWorldRayDirectionKHR = 6029,
+    OpRayQueryGetWorldRayOriginKHR = 6030,
+    OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
+    OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
+    OpAtomicFAddEXT = 6035,
+    OpTypeBufferSurfaceINTEL = 6086,
+    OpTypeStructContinuedINTEL = 6090,
+    OpConstantCompositeContinuedINTEL = 6091,
+    OpSpecConstantCompositeContinuedINTEL = 6092,
+    OpMax = 0x7fffffff,
+};
+
+#ifdef SPV_ENABLE_UTILITY_CODE
+inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
+    *hasResult = *hasResultType = false;
+    switch (opcode) {
+    default: /* unknown opcode */ break;
+    case OpNop: *hasResult = false; *hasResultType = false; break;
+    case OpUndef: *hasResult = true; *hasResultType = true; break;
+    case OpSourceContinued: *hasResult = false; *hasResultType = false; break;
+    case OpSource: *hasResult = false; *hasResultType = false; break;
+    case OpSourceExtension: *hasResult = false; *hasResultType = false; break;
+    case OpName: *hasResult = false; *hasResultType = false; break;
+    case OpMemberName: *hasResult = false; *hasResultType = false; break;
+    case OpString: *hasResult = true; *hasResultType = false; break;
+    case OpLine: *hasResult = false; *hasResultType = false; break;
+    case OpExtension: *hasResult = false; *hasResultType = false; break;
+    case OpExtInstImport: *hasResult = true; *hasResultType = false; break;
+    case OpExtInst: *hasResult = true; *hasResultType = true; break;
+    case OpMemoryModel: *hasResult = false; *hasResultType = false; break;
+    case OpEntryPoint: *hasResult = false; *hasResultType = false; break;
+    case OpExecutionMode: *hasResult = false; *hasResultType = false; break;
+    case OpCapability: *hasResult = false; *hasResultType = false; break;
+    case OpTypeVoid: *hasResult = true; *hasResultType = false; break;
+    case OpTypeBool: *hasResult = true; *hasResultType = false; break;
+    case OpTypeInt: *hasResult = true; *hasResultType = false; break;
+    case OpTypeFloat: *hasResult = true; *hasResultType = false; break;
+    case OpTypeVector: *hasResult = true; *hasResultType = false; break;
+    case OpTypeMatrix: *hasResult = true; *hasResultType = false; break;
+    case OpTypeImage: *hasResult = true; *hasResultType = false; break;
+    case OpTypeSampler: *hasResult = true; *hasResultType = false; break;
+    case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break;
+    case OpTypeArray: *hasResult = true; *hasResultType = false; break;
+    case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break;
+    case OpTypeStruct: *hasResult = true; *hasResultType = false; break;
+    case OpTypeOpaque: *hasResult = true; *hasResultType = false; break;
+    case OpTypePointer: *hasResult = true; *hasResultType = false; break;
+    case OpTypeFunction: *hasResult = true; *hasResultType = false; break;
+    case OpTypeEvent: *hasResult = true; *hasResultType = false; break;
+    case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break;
+    case OpTypeReserveId: *hasResult = true; *hasResultType = false; break;
+    case OpTypeQueue: *hasResult = true; *hasResultType = false; break;
+    case OpTypePipe: *hasResult = true; *hasResultType = false; break;
+    case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break;
+    case OpConstantTrue: *hasResult = true; *hasResultType = true; break;
+    case OpConstantFalse: *hasResult = true; *hasResultType = true; break;
+    case OpConstant: *hasResult = true; *hasResultType = true; break;
+    case OpConstantComposite: *hasResult = true; *hasResultType = true; break;
+    case OpConstantSampler: *hasResult = true; *hasResultType = true; break;
+    case OpConstantNull: *hasResult = true; *hasResultType = true; break;
+    case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break;
+    case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break;
+    case OpSpecConstant: *hasResult = true; *hasResultType = true; break;
+    case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break;
+    case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break;
+    case OpFunction: *hasResult = true; *hasResultType = true; break;
+    case OpFunctionParameter: *hasResult = true; *hasResultType = true; break;
+    case OpFunctionEnd: *hasResult = false; *hasResultType = false; break;
+    case OpFunctionCall: *hasResult = true; *hasResultType = true; break;
+    case OpVariable: *hasResult = true; *hasResultType = true; break;
+    case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break;
+    case OpLoad: *hasResult = true; *hasResultType = true; break;
+    case OpStore: *hasResult = false; *hasResultType = false; break;
+    case OpCopyMemory: *hasResult = false; *hasResultType = false; break;
+    case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break;
+    case OpAccessChain: *hasResult = true; *hasResultType = true; break;
+    case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break;
+    case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break;
+    case OpArrayLength: *hasResult = true; *hasResultType = true; break;
+    case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break;
+    case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break;
+    case OpDecorate: *hasResult = false; *hasResultType = false; break;
+    case OpMemberDecorate: *hasResult = false; *hasResultType = false; break;
+    case OpDecorationGroup: *hasResult = true; *hasResultType = false; break;
+    case OpGroupDecorate: *hasResult = false; *hasResultType = false; break;
+    case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break;
+    case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break;
+    case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break;
+    case OpVectorShuffle: *hasResult = true; *hasResultType = true; break;
+    case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break;
+    case OpCompositeExtract: *hasResult = true; *hasResultType = true; break;
+    case OpCompositeInsert: *hasResult = true; *hasResultType = true; break;
+    case OpCopyObject: *hasResult = true; *hasResultType = true; break;
+    case OpTranspose: *hasResult = true; *hasResultType = true; break;
+    case OpSampledImage: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageFetch: *hasResult = true; *hasResultType = true; break;
+    case OpImageGather: *hasResult = true; *hasResultType = true; break;
+    case OpImageDrefGather: *hasResult = true; *hasResultType = true; break;
+    case OpImageRead: *hasResult = true; *hasResultType = true; break;
+    case OpImageWrite: *hasResult = false; *hasResultType = false; break;
+    case OpImage: *hasResult = true; *hasResultType = true; break;
+    case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break;
+    case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break;
+    case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageQuerySize: *hasResult = true; *hasResultType = true; break;
+    case OpImageQueryLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break;
+    case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break;
+    case OpConvertFToU: *hasResult = true; *hasResultType = true; break;
+    case OpConvertFToS: *hasResult = true; *hasResultType = true; break;
+    case OpConvertSToF: *hasResult = true; *hasResultType = true; break;
+    case OpConvertUToF: *hasResult = true; *hasResultType = true; break;
+    case OpUConvert: *hasResult = true; *hasResultType = true; break;
+    case OpSConvert: *hasResult = true; *hasResultType = true; break;
+    case OpFConvert: *hasResult = true; *hasResultType = true; break;
+    case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break;
+    case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break;
+    case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break;
+    case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break;
+    case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break;
+    case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break;
+    case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break;
+    case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break;
+    case OpBitcast: *hasResult = true; *hasResultType = true; break;
+    case OpSNegate: *hasResult = true; *hasResultType = true; break;
+    case OpFNegate: *hasResult = true; *hasResultType = true; break;
+    case OpIAdd: *hasResult = true; *hasResultType = true; break;
+    case OpFAdd: *hasResult = true; *hasResultType = true; break;
+    case OpISub: *hasResult = true; *hasResultType = true; break;
+    case OpFSub: *hasResult = true; *hasResultType = true; break;
+    case OpIMul: *hasResult = true; *hasResultType = true; break;
+    case OpFMul: *hasResult = true; *hasResultType = true; break;
+    case OpUDiv: *hasResult = true; *hasResultType = true; break;
+    case OpSDiv: *hasResult = true; *hasResultType = true; break;
+    case OpFDiv: *hasResult = true; *hasResultType = true; break;
+    case OpUMod: *hasResult = true; *hasResultType = true; break;
+    case OpSRem: *hasResult = true; *hasResultType = true; break;
+    case OpSMod: *hasResult = true; *hasResultType = true; break;
+    case OpFRem: *hasResult = true; *hasResultType = true; break;
+    case OpFMod: *hasResult = true; *hasResultType = true; break;
+    case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break;
+    case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break;
+    case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break;
+    case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break;
+    case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break;
+    case OpOuterProduct: *hasResult = true; *hasResultType = true; break;
+    case OpDot: *hasResult = true; *hasResultType = true; break;
+    case OpIAddCarry: *hasResult = true; *hasResultType = true; break;
+    case OpISubBorrow: *hasResult = true; *hasResultType = true; break;
+    case OpUMulExtended: *hasResult = true; *hasResultType = true; break;
+    case OpSMulExtended: *hasResult = true; *hasResultType = true; break;
+    case OpAny: *hasResult = true; *hasResultType = true; break;
+    case OpAll: *hasResult = true; *hasResultType = true; break;
+    case OpIsNan: *hasResult = true; *hasResultType = true; break;
+    case OpIsInf: *hasResult = true; *hasResultType = true; break;
+    case OpIsFinite: *hasResult = true; *hasResultType = true; break;
+    case OpIsNormal: *hasResult = true; *hasResultType = true; break;
+    case OpSignBitSet: *hasResult = true; *hasResultType = true; break;
+    case OpLessOrGreater: *hasResult = true; *hasResultType = true; break;
+    case OpOrdered: *hasResult = true; *hasResultType = true; break;
+    case OpUnordered: *hasResult = true; *hasResultType = true; break;
+    case OpLogicalEqual: *hasResult = true; *hasResultType = true; break;
+    case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break;
+    case OpLogicalOr: *hasResult = true; *hasResultType = true; break;
+    case OpLogicalAnd: *hasResult = true; *hasResultType = true; break;
+    case OpLogicalNot: *hasResult = true; *hasResultType = true; break;
+    case OpSelect: *hasResult = true; *hasResultType = true; break;
+    case OpIEqual: *hasResult = true; *hasResultType = true; break;
+    case OpINotEqual: *hasResult = true; *hasResultType = true; break;
+    case OpUGreaterThan: *hasResult = true; *hasResultType = true; break;
+    case OpSGreaterThan: *hasResult = true; *hasResultType = true; break;
+    case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpULessThan: *hasResult = true; *hasResultType = true; break;
+    case OpSLessThan: *hasResult = true; *hasResultType = true; break;
+    case OpULessThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
+    case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break;
+    case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break;
+    case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break;
+    case OpBitwiseOr: *hasResult = true; *hasResultType = true; break;
+    case OpBitwiseXor: *hasResult = true; *hasResultType = true; break;
+    case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break;
+    case OpNot: *hasResult = true; *hasResultType = true; break;
+    case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break;
+    case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break;
+    case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break;
+    case OpBitReverse: *hasResult = true; *hasResultType = true; break;
+    case OpBitCount: *hasResult = true; *hasResultType = true; break;
+    case OpDPdx: *hasResult = true; *hasResultType = true; break;
+    case OpDPdy: *hasResult = true; *hasResultType = true; break;
+    case OpFwidth: *hasResult = true; *hasResultType = true; break;
+    case OpDPdxFine: *hasResult = true; *hasResultType = true; break;
+    case OpDPdyFine: *hasResult = true; *hasResultType = true; break;
+    case OpFwidthFine: *hasResult = true; *hasResultType = true; break;
+    case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break;
+    case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break;
+    case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break;
+    case OpEmitVertex: *hasResult = false; *hasResultType = false; break;
+    case OpEndPrimitive: *hasResult = false; *hasResultType = false; break;
+    case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break;
+    case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break;
+    case OpControlBarrier: *hasResult = false; *hasResultType = false; break;
+    case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break;
+    case OpAtomicLoad: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicStore: *hasResult = false; *hasResultType = false; break;
+    case OpAtomicExchange: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicISub: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicSMin: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicUMin: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicSMax: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicUMax: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicAnd: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicOr: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicXor: *hasResult = true; *hasResultType = true; break;
+    case OpPhi: *hasResult = true; *hasResultType = true; break;
+    case OpLoopMerge: *hasResult = false; *hasResultType = false; break;
+    case OpSelectionMerge: *hasResult = false; *hasResultType = false; break;
+    case OpLabel: *hasResult = true; *hasResultType = false; break;
+    case OpBranch: *hasResult = false; *hasResultType = false; break;
+    case OpBranchConditional: *hasResult = false; *hasResultType = false; break;
+    case OpSwitch: *hasResult = false; *hasResultType = false; break;
+    case OpKill: *hasResult = false; *hasResultType = false; break;
+    case OpReturn: *hasResult = false; *hasResultType = false; break;
+    case OpReturnValue: *hasResult = false; *hasResultType = false; break;
+    case OpUnreachable: *hasResult = false; *hasResultType = false; break;
+    case OpLifetimeStart: *hasResult = false; *hasResultType = false; break;
+    case OpLifetimeStop: *hasResult = false; *hasResultType = false; break;
+    case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break;
+    case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break;
+    case OpGroupAll: *hasResult = true; *hasResultType = true; break;
+    case OpGroupAny: *hasResult = true; *hasResultType = true; break;
+    case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break;
+    case OpGroupIAdd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFAdd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupUMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupSMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFMax: *hasResult = true; *hasResultType = true; break;
+    case OpGroupUMax: *hasResult = true; *hasResultType = true; break;
+    case OpGroupSMax: *hasResult = true; *hasResultType = true; break;
+    case OpReadPipe: *hasResult = true; *hasResultType = true; break;
+    case OpWritePipe: *hasResult = true; *hasResultType = true; break;
+    case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break;
+    case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break;
+    case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break;
+    case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break;
+    case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break;
+    case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
+    case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break;
+    case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break;
+    case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break;
+    case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break;
+    case OpRetainEvent: *hasResult = false; *hasResultType = false; break;
+    case OpReleaseEvent: *hasResult = false; *hasResultType = false; break;
+    case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break;
+    case OpIsValidEvent: *hasResult = true; *hasResultType = true; break;
+    case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break;
+    case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break;
+    case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break;
+    case OpBuildNDRange: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseGather: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break;
+    case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break;
+    case OpNoLine: *hasResult = false; *hasResultType = false; break;
+    case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break;
+    case OpImageSparseRead: *hasResult = true; *hasResultType = true; break;
+    case OpSizeOf: *hasResult = true; *hasResultType = true; break;
+    case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break;
+    case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break;
+    case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break;
+    case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break;
+    case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break;
+    case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break;
+    case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break;
+    case OpModuleProcessed: *hasResult = false; *hasResultType = false; break;
+    case OpExecutionModeId: *hasResult = false; *hasResultType = false; break;
+    case OpDecorateId: *hasResult = false; *hasResultType = false; break;
+    case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break;
+    case OpCopyLogical: *hasResult = true; *hasResultType = true; break;
+    case OpPtrEqual: *hasResult = true; *hasResultType = true; break;
+    case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break;
+    case OpPtrDiff: *hasResult = true; *hasResultType = true; break;
+    case OpTerminateInvocation: *hasResult = false; *hasResultType = false; break;
+    case OpSubgroupBallotKHR: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupFirstInvocationKHR: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
+    case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
+    case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
+    case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
+    case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
+    case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+    case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
+    case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
+    case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
+    case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break;
+    case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break;
+    case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
+    case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
+    case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
+    case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
+    case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
+    case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
+    case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
+    case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
+    case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
+    case OpTraceNV: *hasResult = false; *hasResultType = false; break;
+    case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+    case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
+    case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
+    case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
+    case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
+    case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
+    case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
+    case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
+    case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
+    case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
+    case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
+    case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+    case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
+    case OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
+    case OpExpectKHR: *hasResult = true; *hasResultType = true; break;
+    case OpDecorateString: *hasResult = false; *hasResultType = false; break;
+    case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
+    case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break;
+    case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break;
+    case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break;
+    case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    }
+}
+#endif /* SPV_ENABLE_UTILITY_CODE */
+
+// Overload operator| for mask bit combining
+
+inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
+inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
+inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
+inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
+inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
+inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
+inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
+inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
+inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
+inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
+
+}  // end namespace spv
+
+#endif  // #ifndef spirv_HPP

+ 12 - 0
src/libraries/glslang/glslang/Include/BaseTypes.h

@@ -65,6 +65,10 @@ enum TBasicType {
     EbtAccStruct,
     EbtReference,
     EbtRayQuery,
+#ifndef GLSLANG_WEB
+    // SPIR-V type defined by spirv_type
+    EbtSpirvType,
+#endif
 
     // HLSL types that live only temporarily.
     EbtString,
@@ -91,6 +95,9 @@ 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,
@@ -263,6 +270,7 @@ enum TBuiltInVariable {
     EbvWorldToObject,
     EbvWorldToObject3x4,
     EbvIncomingRayFlags,
+    EbvCurrentRayTimeNV,
     // barycentrics
     EbvBaryCoordNV,
     EbvBaryCoordNoPerspNV,
@@ -321,6 +329,9 @@ __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;
@@ -465,6 +476,7 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
     case EbvIncomingRayFlags:           return "IncomingRayFlagsNV";
     case EbvObjectToWorld:              return "ObjectToWorldNV";
     case EbvWorldToObject:              return "WorldToObjectNV";
+    case EbvCurrentRayTimeNV:           return "CurrentRayTimeNV";
 
     case EbvBaryCoordNV:                return "BaryCoordNV";
     case EbvBaryCoordNoPerspNV:         return "BaryCoordNoPerspNV";

+ 51 - 2
src/libraries/glslang/glslang/Include/Common.h

@@ -39,6 +39,11 @@
 
 #include <algorithm>
 #include <cassert>
+#ifdef _MSC_VER
+#include <cfloat>
+#else
+#include <cmath>
+#endif
 #include <cstdio>
 #include <cstdlib>
 #include <list>
@@ -61,7 +66,7 @@ std::string to_string(const T& val) {
 }
 #endif
 
-#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
+#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || MINGW_HAS_SECURE_API
     #include <basetsd.h>
     #ifndef snprintf
     #define snprintf sprintf_s
@@ -194,6 +199,10 @@ template <class K, class D, class HASH = std::hash<K>, class PRED = std::equal_t
 class TUnorderedMap : public std::unordered_map<K, D, HASH, PRED, pool_allocator<std::pair<K const, D> > > {
 };
 
+template <class K, class CMP = std::less<K> >
+class TSet : public std::set<K, CMP, pool_allocator<K> > {
+};
+
 //
 // Persistent string memory.  Should only be used for strings that survive
 // across compiles/links.
@@ -209,7 +218,7 @@ template <class T> T Max(const T a, const T b) { return a > b ? a : b; }
 //
 // Create a TString object from an integer.
 //
-#if defined _MSC_VER || defined MINGW_HAS_SECURE_API
+#if defined _MSC_VER || MINGW_HAS_SECURE_API
 inline const TString String(const int i, const int base = 10)
 {
     char text[16];     // 32 bit ints are at most 10 digits in base 10
@@ -286,6 +295,46 @@ template <class T> bool IsMultipleOfPow2(T number, int powerOf2)
     return ! (number & (powerOf2 - 1));
 }
 
+// Returns log2 of an integer power of 2.
+// T should be integral.
+template <class T> int IntLog2(T n)
+{
+    assert(IsPow2(n));
+    int result = 0;
+    while ((T(1) << result) != n) {
+      result++;
+    }
+    return result;
+}
+
+inline bool IsInfinity(double x) {
+#ifdef _MSC_VER
+    switch (_fpclass(x)) {
+    case _FPCLASS_NINF:
+    case _FPCLASS_PINF:
+        return true;
+    default:
+        return false;
+    }
+#else
+    return std::isinf(x);
+#endif
+}
+
+inline bool IsNan(double x) {
+#ifdef _MSC_VER
+    switch (_fpclass(x)) {
+    case _FPCLASS_SNAN:
+    case _FPCLASS_QNAN:
+        return true;
+    default:
+        return false;
+    }
+#else
+  return std::isnan(x);
+#endif
+}
+
 } // end namespace glslang
 
 #endif // _COMMON_INCLUDED_

+ 2 - 0
src/libraries/glslang/glslang/Include/PoolAlloc.h

@@ -306,6 +306,8 @@ public:
 
     TPoolAllocator& getAllocator() const { return allocator; }
 
+    pool_allocator select_on_container_copy_construction() const { return pool_allocator{}; }
+
 protected:
     pool_allocator& operator=(const pool_allocator&) { return *this; }
     TPoolAllocator& allocator;

+ 128 - 0
src/libraries/glslang/glslang/Include/SpirvIntrinsics.h

@@ -0,0 +1,128 @@
+//
+// Copyright(C) 2021 Advanced Micro Devices, Inc.
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//    Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//
+//    Redistributions in binary form must reproduce the above
+//    copyright notice, this list of conditions and the following
+//    disclaimer in the documentation and/or other materials provided
+//    with the distribution.
+//
+//    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+
+#pragma once
+
+#ifndef GLSLANG_WEB
+
+//
+// GL_EXT_spirv_intrinsics
+//
+#include "Common.h"
+
+namespace glslang {
+
+class TIntermTyped;
+class TIntermConstantUnion;
+class TType;
+
+// SPIR-V requirements
+struct TSpirvRequirement {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    // capability = [..]
+    TSet<TString> extensions;
+    // extension = [..]
+    TSet<int> capabilities;
+};
+
+// SPIR-V execution modes
+struct TSpirvExecutionMode {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    // spirv_execution_mode
+    TMap<int, TVector<const TIntermConstantUnion*>> modes;
+    // spirv_execution_mode_id
+    TMap<int, TVector<const TIntermTyped*> > modeIds;
+};
+
+// SPIR-V decorations
+struct TSpirvDecorate {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    // spirv_decorate
+    TMap<int, TVector<const TIntermConstantUnion*> > decorates;
+    // spirv_decorate_id
+    TMap<int, TVector<const TIntermTyped*>> decorateIds;
+    // spirv_decorate_string
+    TMap<int, TVector<const TIntermConstantUnion*> > decorateStrings;
+};
+
+// SPIR-V instruction
+struct TSpirvInstruction {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    TSpirvInstruction() { set = ""; id = -1; }
+
+    bool operator==(const TSpirvInstruction& rhs) const { return set == rhs.set && id == rhs.id; }
+    bool operator!=(const TSpirvInstruction& rhs) const { return !operator==(rhs); }
+
+    // spirv_instruction
+    TString set;
+    int     id;
+};
+
+// SPIR-V type parameter
+struct TSpirvTypeParameter {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; }
+
+    bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; }
+    bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); }
+
+    const TIntermConstantUnion* constant;
+};
+
+typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters;
+
+// SPIR-V type
+struct TSpirvType {
+    POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
+
+    bool operator==(const TSpirvType& rhs) const
+    {
+        return spirvInst == rhs.spirvInst && typeParams == rhs.typeParams;
+    }
+    bool operator!=(const TSpirvType& rhs) const { return !operator==(rhs); }
+
+    // spirv_type
+    TSpirvInstruction spirvInst;
+    TSpirvTypeParameters typeParams;
+};
+
+} // end namespace glslang
+
+#endif // GLSLANG_WEB

+ 136 - 6
src/libraries/glslang/glslang/Include/Types.h

@@ -44,11 +44,14 @@
 #include "../Include/BaseTypes.h"
 #include "../Public/ShaderLang.h"
 #include "arrays.h"
+#include "SpirvIntrinsics.h"
 
 #include <algorithm>
 
 namespace glslang {
 
+class TIntermAggregate;
+
 const int GlslangMaxTypeLength = 200;  // TODO: need to print block/struct one member per line, so this can stay bounded
 
 const char* const AnonymousPrefix = "anon@"; // for something like a block whose members can be directly accessed
@@ -115,6 +118,7 @@ struct TSampler {   // misnomer now; includes images, textures without sampler,
 #endif
 
     bool is1D()          const { return dim == Esd1D; }
+    bool is2D()          const { return dim == Esd2D; }
     bool isBuffer()      const { return dim == EsdBuffer; }
     bool isRect()        const { return dim == EsdRect; }
     bool isSubpass()     const { return dim == EsdSubpass; }
@@ -486,7 +490,6 @@ enum TShaderInterface
     EsiCount
 };
 
-
 class TQualifier {
 public:
     static const int layoutNotSet = -1;
@@ -500,6 +503,8 @@ public:
 #ifndef GLSLANG_WEB
         noContraction = false;
         nullInit = false;
+        spirvByReference = false;
+        spirvLiteral = false;
 #endif
         defaultBlock = false;
     }
@@ -517,6 +522,12 @@ public:
         nullInit = false;
         defaultBlock = false;
         clearLayout();
+#ifndef GLSLANG_WEB
+        spirvStorageClass = -1;
+        spirvDecorate = nullptr;
+        spirvByReference = false;
+        spirvLiteral = false;
+#endif
     }
 
     void clearInterstage()
@@ -595,6 +606,10 @@ public:
     bool isPervertexNV() const { return false; }
     void setNullInit() { }
     bool isNullInit() const { return false; }
+    void setSpirvByReference() { }
+    bool isSpirvByReference() { return false; }
+    void setSpirvLiteral() { }
+    bool isSpirvLiteral() { return false; }
 #else
     bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects
     bool nopersp      : 1;
@@ -617,6 +632,8 @@ public:
     bool shadercallcoherent : 1;
     bool nonprivate   : 1;
     bool nullInit : 1;
+    bool spirvByReference : 1;
+    bool spirvLiteral : 1;
     bool isWriteOnly() const { return writeonly; }
     bool isReadOnly() const { return readonly; }
     bool isRestrict() const { return restrict; }
@@ -654,6 +671,10 @@ public:
     bool isPervertexNV() const { return pervertexNV; }
     void setNullInit() { nullInit = true; }
     bool isNullInit() const { return nullInit; }
+    void setSpirvByReference() { spirvByReference = true; }
+    bool isSpirvByReference() const { return spirvByReference; }
+    void setSpirvLiteral() { spirvLiteral = true; }
+    bool isSpirvLiteral() const { return spirvLiteral; }
 #endif
 
     bool isPipeInput() const
@@ -720,6 +741,16 @@ public:
         }
     }
 
+    bool isUniform() const
+    {
+        switch (storage) {
+        case EvqUniform:
+            return true;
+        default:
+            return false;
+        }
+    }
+
     bool isIo() const
     {
         switch (storage) {
@@ -947,6 +978,10 @@ public:
     bool layoutViewportRelative;
     int layoutSecondaryViewportRelativeOffset;
     bool layoutShaderRecord;
+
+    // GL_EXT_spirv_intrinsics
+    int spirvStorageClass;
+    TSpirvDecorate* spirvDecorate;
 #endif
 
     bool hasUniformLayout() const
@@ -1078,6 +1113,15 @@ public:
     {
         return nonUniform;
     }
+
+    // GL_EXT_spirv_intrinsics
+    bool hasSprivDecorate() const { return spirvDecorate != nullptr; }
+    void setSpirvDecorate(int decoration, const TIntermAggregate* args = nullptr);
+    void setSpirvDecorateId(int decoration, const TIntermAggregate* args);
+    void setSpirvDecorateString(int decoration, const TIntermAggregate* args);
+    const TSpirvDecorate& getSpirvDecorate() const { assert(spirvDecorate); return *spirvDecorate; }
+    TSpirvDecorate& getSpirvDecorate() { assert(spirvDecorate); return *spirvDecorate; }
+    TString getSpirvDecorateQualifierString() const;
 #endif
     bool hasSpecConstantId() const
     {
@@ -1422,6 +1466,10 @@ public:
     const TType* userDef;
     TSourceLoc loc;
     TArraySizes* typeParameters;
+#ifndef GLSLANG_WEB
+    // SPIR-V type defined by spirv_type directive
+    TSpirvType* spirvType;
+#endif
 
 #ifdef GLSLANG_WEB
     bool isCoopmat() const { return false; }
@@ -1440,6 +1488,9 @@ public:
         loc = l;
         typeParameters = nullptr;
         coopmat = false;
+#ifndef GLSLANG_WEB
+        spirvType = nullptr;
+#endif
     }
 
     void initQualifiers(bool global = false)
@@ -1476,6 +1527,11 @@ public:
         return matrixCols == 0 && vectorSize == 1 && arraySizes == nullptr && userDef == nullptr;
     }
 
+#ifndef GLSLANG_WEB
+    // GL_EXT_spirv_intrinsics
+    void setSpirvType(const TSpirvInstruction& spirvInst, const TSpirvTypeParameters* typeParams = nullptr);
+#endif
+
     // "Image" is a superset of "Subpass"
     bool isImage()   const { return basicType == EbtSampler && sampler.isImage(); }
     bool isSubpass() const { return basicType == EbtSampler && sampler.isSubpass(); }
@@ -1493,6 +1549,9 @@ public:
                    bool isVector = false) :
                             basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
                             arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
+#ifndef GLSLANG_WEB
+                            , spirvType(nullptr)
+#endif
                             {
                                 sampler.clear();
                                 qualifier.clear();
@@ -1504,6 +1563,9 @@ public:
           bool isVector = false) :
                             basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(isVector && vs == 1), coopmat(false),
                             arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
+#ifndef GLSLANG_WEB
+                            , spirvType(nullptr)
+#endif
                             {
                                 sampler.clear();
                                 qualifier.clear();
@@ -1517,6 +1579,9 @@ public:
                             basicType(p.basicType),
                             vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), coopmat(p.coopmat),
                             arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(p.typeParameters)
+#ifndef GLSLANG_WEB
+                            , spirvType(p.spirvType)
+#endif
                             {
                                 if (basicType == EbtSampler)
                                     sampler = p.sampler;
@@ -1551,6 +1616,9 @@ public:
         basicType(EbtSampler), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
         arraySizes(as), structure(nullptr), fieldName(nullptr), typeName(nullptr),
         sampler(sampler), typeParameters(nullptr)
+#ifndef GLSLANG_WEB
+        , spirvType(nullptr)
+#endif
     {
         qualifier.clear();
         qualifier.storage = q;
@@ -1601,6 +1669,9 @@ public:
     TType(TTypeList* userDef, const TString& n) :
                             basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
                             arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
+#ifndef GLSLANG_WEB
+                            , spirvType(nullptr)
+#endif
                             {
                                 sampler.clear();
                                 qualifier.clear();
@@ -1610,6 +1681,9 @@ public:
     TType(TTypeList* userDef, const TString& n, const TQualifier& q) :
                             basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
                             qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr), typeParameters(nullptr)
+#ifndef GLSLANG_WEB
+                            , spirvType(nullptr)
+#endif
                             {
                                 sampler.clear();
                                 typeName = NewPoolTString(n.c_str());
@@ -1618,6 +1692,9 @@ public:
     explicit TType(TBasicType t, const TType &p, const TString& n) :
                             basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false),
                             arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr)
+#ifndef GLSLANG_WEB
+                            , spirvType(nullptr)
+#endif
                             {
                                 assert(t == EbtReference);
                                 typeName = NewPoolTString(n.c_str());
@@ -1648,6 +1725,9 @@ public:
             referentType = copyOf.referentType;
         }
         typeParameters = copyOf.typeParameters;
+#ifndef GLSLANG_WEB
+        spirvType = copyOf.spirvType;
+#endif
         coopmat = copyOf.isCoopMat();
     }
 
@@ -1738,6 +1818,7 @@ public:
 
     virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); }
     virtual bool isScalarOrVec1() const { return isScalar() || vector1; }
+    virtual bool isScalarOrVector() const { return !isMatrix() && !isStruct() && !isArray(); }
     virtual bool isVector() const { return vectorSize > 1 || vector1; }
     virtual bool isMatrix() const { return matrixCols ? true : false; }
     virtual bool isArray()  const { return arraySizes != nullptr; }
@@ -1768,7 +1849,7 @@ public:
     }
     virtual bool isOpaque() const { return basicType == EbtSampler
 #ifndef GLSLANG_WEB
-         || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
+            || basicType == EbtAtomicUint || basicType == EbtAccStruct || basicType == EbtRayQuery
 #endif
         ; }
     virtual bool isBuiltIn() const { return getQualifier().builtIn != EbvNone; }
@@ -1784,10 +1865,12 @@ public:
     bool isAtomic() const { return false; }
     bool isCoopMat() const { return false; }
     bool isReference() const { return false; }
+    bool isSpirvType() const { return false; }
 #else
     bool isAtomic() const { return basicType == EbtAtomicUint; }
     bool isCoopMat() const { return coopmat; }
     bool isReference() const { return getBasicType() == EbtReference; }
+    bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
 #endif
 
     // return true if this type contains any subtype which satisfies the given predicate.
@@ -2016,8 +2099,6 @@ public:
         }
     }
 
-
-
     const char* getBasicString() const
     {
         return TType::getBasicString(basicType);
@@ -2048,6 +2129,7 @@ public:
         case EbtRayQuery:          return "rayQueryEXT";
         case EbtReference:         return "reference";
         case EbtString:            return "string";
+        case EbtSpirvType:         return "spirv_type";
 #endif
         default:                   return "unknown type";
         }
@@ -2068,6 +2150,9 @@ public:
         const auto appendUint = [&](unsigned int u) { typeString.append(std::to_string(u).c_str()); };
         const auto appendInt  = [&](int i)          { typeString.append(std::to_string(i).c_str()); };
 
+        if (qualifier.hasSprivDecorate())
+            appendStr(qualifier.getSpirvDecorateQualifierString().c_str());
+
         if (qualifier.hasLayout()) {
             // To reduce noise, skip this if the only layout is an xfb_buffer
             // with no triggering xfb_offset.
@@ -2217,6 +2302,10 @@ public:
             appendStr(" nonuniform");
         if (qualifier.isNullInit())
             appendStr(" null-init");
+        if (qualifier.isSpirvByReference())
+            appendStr(" spirv_by_reference");
+        if (qualifier.isSpirvLiteral())
+            appendStr(" spirv_literal");
         appendStr(" ");
         appendStr(getStorageQualifierString());
         if (isArray()) {
@@ -2382,6 +2471,14 @@ public:
                     if (*(*structure)[li].type != *(*right.structure)[ri].type)
                         return false;
                 } else {
+                    // Skip hidden members
+                    if ((*structure)[li].type->hiddenMember()) {
+                        ri--;
+                        continue;
+                    } else if ((*right.structure)[ri].type->hiddenMember()) {
+                        li--;
+                        continue;
+                    }
                     // If one of the members is something that's inconsistently declared, skip over it
                     // for now.
                     if (isGLPerVertex) {
@@ -2398,10 +2495,10 @@ public:
                 }
             // If we get here, then there should only be inconsistently declared members left
             } else if (li < structure->size()) {
-                if (!isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName()))
+                if (!(*structure)[li].type->hiddenMember() && !isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName()))
                     return false;
             } else {
-                if (!isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName()))
+                if (!(*right.structure)[ri].type->hiddenMember() && !isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName()))
                     return false;
             }
         }
@@ -2453,6 +2550,15 @@ public:
                 (typeParameters != nullptr && right.typeParameters != nullptr && *typeParameters == *right.typeParameters));
     }
 
+#ifndef GLSLANG_WEB
+    // See if two type's SPIR-V type contents match
+    bool sameSpirvType(const TType& right) const
+    {
+        return ((spirvType == nullptr && right.spirvType == nullptr) ||
+                (spirvType != nullptr && right.spirvType != nullptr && *spirvType == *right.spirvType));
+    }
+#endif
+
     // See if two type's elements match in all ways except basic type
     bool sameElementShape(const TType& right) const
     {
@@ -2491,7 +2597,11 @@ public:
     // See if two types match in all ways (just the actual type, not qualification)
     bool operator==(const TType& right) const
     {
+#ifndef GLSLANG_WEB
+        return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right) && sameSpirvType(right);
+#else
         return sameElementType(right) && sameArrayness(right) && sameTypeParameters(right);
+#endif
     }
 
     bool operator!=(const TType& right) const
@@ -2510,6 +2620,10 @@ public:
         return 0;
     }
 
+#ifndef GLSLANG_WEB
+    const TSpirvType& getSpirvType() const { assert(spirvType); return *spirvType; }
+#endif
+
 protected:
     // Require consumer to pick between deep copy and shallow copy.
     TType(const TType& type);
@@ -2522,6 +2636,19 @@ protected:
     {
         shallowCopy(copyOf);
 
+#ifndef GLSLANG_WEB
+        // GL_EXT_spirv_intrinsics
+        if (copyOf.qualifier.spirvDecorate) {
+            qualifier.spirvDecorate = new TSpirvDecorate;
+            *qualifier.spirvDecorate = *copyOf.qualifier.spirvDecorate;
+        }
+
+        if (copyOf.spirvType) {
+            spirvType = new TSpirvType;
+            *spirvType = *copyOf.spirvType;
+        }
+#endif
+
         if (copyOf.arraySizes) {
             arraySizes = new TArraySizes;
             *arraySizes = *copyOf.arraySizes;
@@ -2581,6 +2708,9 @@ protected:
     TString *typeName;          // for structure type name
     TSampler sampler;
     TArraySizes* typeParameters;// nullptr unless a parameterized type; can be shared across types
+#ifndef GLSLANG_WEB
+    TSpirvType* spirvType;  // SPIR-V type defined by spirv_type directive
+#endif
 };
 
 } // end namespace glslang

+ 4 - 0
src/libraries/glslang/glslang/Include/glslang_c_interface.h

@@ -224,6 +224,9 @@ GLSLANG_EXPORT void glslang_finalize_process();
 
 GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input);
 GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader);
+GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base);
+GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set);
+GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t
 GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input);
 GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input);
 GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader);
@@ -234,6 +237,7 @@ GLSLANG_EXPORT glslang_program_t* glslang_program_create();
 GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program);
 GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader);
 GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t
+GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program);
 GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage);
 GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program);
 GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*);

+ 22 - 1
src/libraries/glslang/glslang/Include/glslang_c_shader_types.h

@@ -113,7 +113,8 @@ typedef enum {
     GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8),
     GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8),
     GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8),
-    LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 6),
+    GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8),
+    LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7),
 } glslang_target_language_version_t;
 
 /* EShExecutable counterpart */
@@ -181,6 +182,26 @@ typedef enum {
     LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT),
 } glslang_profile_t;
 
+/* Shader options */
+typedef enum {
+    GLSLANG_SHADER_DEFAULT_BIT = 0,
+    GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0),
+    GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1),
+    GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2),
+    LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT),
+} glslang_shader_options_t;
+
+/* TResourceType counterpart */
+typedef enum {
+    GLSLANG_RESOURCE_TYPE_SAMPLER,
+    GLSLANG_RESOURCE_TYPE_TEXTURE,
+    GLSLANG_RESOURCE_TYPE_IMAGE,
+    GLSLANG_RESOURCE_TYPE_UBO,
+    GLSLANG_RESOURCE_TYPE_SSBO,
+    GLSLANG_RESOURCE_TYPE_UAV,
+    LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT),
+} glslang_resource_type_t;
+
 #undef LAST_ELEMENT_MARKER
 
 #endif

+ 22 - 0
src/libraries/glslang/glslang/Include/intermediate.h

@@ -71,6 +71,9 @@ enum TOperator {
     EOpFunctionCall,
     EOpFunction,        // For function definition
     EOpParameters,      // an aggregate listing the parameters to a function
+#ifndef GLSLANG_WEB
+    EOpSpirvInst,
+#endif
 
     //
     // Unary operators
@@ -923,6 +926,7 @@ enum TOperator {
     EOpMul32x16,
 
     EOpTraceNV,
+    EOpTraceRayMotionNV,
     EOpTraceKHR,
     EOpReportIntersection,
     EOpIgnoreIntersectionNV,
@@ -1616,8 +1620,15 @@ 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;
@@ -1632,6 +1643,7 @@ public:
     ~TIntermAggregate() { delete pragmaTable; }
     virtual       TIntermAggregate* getAsAggregate()       { return this; }
     virtual const TIntermAggregate* getAsAggregate() const { return this; }
+    virtual void updatePrecision();
     virtual void setOperator(TOperator o) { op = o; }
     virtual       TIntermSequence& getSequence()       { return sequence; }
     virtual const TIntermSequence& getSequence() const { return sequence; }
@@ -1648,6 +1660,10 @@ 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
@@ -1658,6 +1674,9 @@ protected:
     bool optimize;
     bool debug;
     TPragmaTable* pragmaTable;
+#ifndef GLSLANG_WEB
+    TSpirvInstruction spirvInst;
+#endif
 };
 
 //
@@ -1675,8 +1694,11 @@ public:
         flatten(false), dontFlatten(false) {}
     virtual void traverse(TIntermTraverser*);
     virtual TIntermTyped* getCondition() const { return condition; }
+    virtual void setCondition(TIntermTyped* c) { condition = c; }
     virtual TIntermNode* getTrueBlock() const { return trueBlock; }
+    virtual void setTrueBlock(TIntermTyped* tb) { trueBlock = tb; }
     virtual TIntermNode* getFalseBlock() const { return falseBlock; }
+    virtual void setFalseBlock(TIntermTyped* fb) { falseBlock = fb; }
     virtual       TIntermSelection* getAsSelectionNode()       { return this; }
     virtual const TIntermSelection* getAsSelectionNode() const { return this; }
 

+ 0 - 3
src/libraries/glslang/glslang/Include/revision.h

@@ -1,3 +0,0 @@
-// This header is generated by the make-revision script.
-
-#define GLSLANG_PATCH_LEVEL 3766

+ 8 - 32
src/libraries/glslang/glslang/MachineIndependent/Constant.cpp

@@ -46,35 +46,6 @@ namespace {
 
 using namespace glslang;
 
-typedef union {
-    double d;
-    int i[2];
-} DoubleIntUnion;
-
-// Some helper functions
-
-bool isNan(double x)
-{
-    DoubleIntUnion u;
-    // tough to find a platform independent library function, do it directly
-    u.d = x;
-    int bitPatternL = u.i[0];
-    int bitPatternH = u.i[1];
-    return (bitPatternH & 0x7ff80000) == 0x7ff80000 &&
-           ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0);
-}
-
-bool isInf(double x)
-{
-    DoubleIntUnion u;
-    // tough to find a platform independent library function, do it directly
-    u.d = x;
-    int bitPatternL = u.i[0];
-    int bitPatternH = u.i[1];
-    return (bitPatternH & 0x7ff00000) == 0x7ff00000 &&
-           (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0;
-}
-
 const double pi = 3.1415926535897932384626433832795;
 
 } // end anonymous namespace
@@ -529,7 +500,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
             case EbtDouble:
             case EbtFloat16:
             case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break;
-            case EbtInt:   newConstArray[i].setIConst(-unionArray[i].getIConst()); break;
+            // Note: avoid UBSAN error regarding negating 0x80000000
+            case EbtInt:   newConstArray[i].setIConst(
+                                static_cast<unsigned int>(unionArray[i].getIConst()) == 0x80000000
+                                    ? -0x7FFFFFFF - 1
+                                    : -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;
@@ -658,12 +634,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
 
         case EOpIsNan:
         {
-            newConstArray[i].setBConst(isNan(unionArray[i].getDConst()));
+            newConstArray[i].setBConst(IsNan(unionArray[i].getDConst()));
             break;
         }
         case EOpIsInf:
         {
-            newConstArray[i].setBConst(isInf(unionArray[i].getDConst()));
+            newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst()));
             break;
         }
 

+ 408 - 156
src/libraries/glslang/glslang/MachineIndependent/Initialize.cpp

@@ -3,7 +3,7 @@
 // Copyright (C) 2012-2016 LunarG, Inc.
 // Copyright (C) 2015-2020 Google, Inc.
 // Copyright (C) 2017 ARM Limited.
-// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
+// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
 //
 // All rights reserved.
 //
@@ -316,6 +316,7 @@ const CustomFunction CustomFunctions[] = {
 
     { EOpTextureQuerySize,      "textureSize",           nullptr },
     { EOpTextureQueryLod,       "textureQueryLod",       nullptr },
+    { EOpTextureQueryLod,       "textureQueryLOD",       nullptr }, // extension GL_ARB_texture_query_lod
     { EOpTextureQueryLevels,    "textureQueryLevels",    nullptr },
     { EOpTextureQuerySamples,   "textureSamples",        nullptr },
     { EOpTexture,               "texture",               nullptr },
@@ -483,7 +484,8 @@ void TBuiltIns::relateTabledBuiltins(int /* version */, EProfile /* profile */,
 
 inline bool IncludeLegacy(int version, EProfile profile, const SpvVersion& spvVersion)
 {
-    return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && ARBCompatibility) || profile == ECompatibilityProfile);
+    return profile != EEsProfile && (version <= 130 || (spvVersion.spv == 0 && version == 140 && ARBCompatibility) ||
+           profile == ECompatibilityProfile);
 }
 
 // Construct TBuiltInParseables base class.  This can be used for language-common constructs.
@@ -931,7 +933,203 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-    if (profile != EEsProfile && version >= 450) {
+    if (profile == EEsProfile && version >= 310) {  // Explicit Types
+      commonBuiltins.append(
+
+        "float64_t sqrt(float64_t);"
+        "f64vec2  sqrt(f64vec2);"
+        "f64vec3  sqrt(f64vec3);"
+        "f64vec4  sqrt(f64vec4);"
+
+        "float64_t inversesqrt(float64_t);"
+        "f64vec2  inversesqrt(f64vec2);"
+        "f64vec3  inversesqrt(f64vec3);"
+        "f64vec4  inversesqrt(f64vec4);"
+
+        "float64_t abs(float64_t);"
+        "f64vec2  abs(f64vec2);"
+        "f64vec3  abs(f64vec3);"
+        "f64vec4  abs(f64vec4);"
+
+        "float64_t sign(float64_t);"
+        "f64vec2  sign(f64vec2);"
+        "f64vec3  sign(f64vec3);"
+        "f64vec4  sign(f64vec4);"
+
+        "float64_t floor(float64_t);"
+        "f64vec2  floor(f64vec2);"
+        "f64vec3  floor(f64vec3);"
+        "f64vec4  floor(f64vec4);"
+
+        "float64_t trunc(float64_t);"
+        "f64vec2  trunc(f64vec2);"
+        "f64vec3  trunc(f64vec3);"
+        "f64vec4  trunc(f64vec4);"
+
+        "float64_t round(float64_t);"
+        "f64vec2  round(f64vec2);"
+        "f64vec3  round(f64vec3);"
+        "f64vec4  round(f64vec4);"
+
+        "float64_t roundEven(float64_t);"
+        "f64vec2  roundEven(f64vec2);"
+        "f64vec3  roundEven(f64vec3);"
+        "f64vec4  roundEven(f64vec4);"
+
+        "float64_t ceil(float64_t);"
+        "f64vec2  ceil(f64vec2);"
+        "f64vec3  ceil(f64vec3);"
+        "f64vec4  ceil(f64vec4);"
+
+        "float64_t fract(float64_t);"
+        "f64vec2  fract(f64vec2);"
+        "f64vec3  fract(f64vec3);"
+        "f64vec4  fract(f64vec4);"
+
+        "float64_t mod(float64_t, float64_t);"
+        "f64vec2  mod(f64vec2 , float64_t);"
+        "f64vec3  mod(f64vec3 , float64_t);"
+        "f64vec4  mod(f64vec4 , float64_t);"
+        "f64vec2  mod(f64vec2 , f64vec2);"
+        "f64vec3  mod(f64vec3 , f64vec3);"
+        "f64vec4  mod(f64vec4 , f64vec4);"
+
+        "float64_t modf(float64_t, out float64_t);"
+        "f64vec2  modf(f64vec2,  out f64vec2);"
+        "f64vec3  modf(f64vec3,  out f64vec3);"
+        "f64vec4  modf(f64vec4,  out f64vec4);"
+
+        "float64_t min(float64_t, float64_t);"
+        "f64vec2  min(f64vec2,  float64_t);"
+        "f64vec3  min(f64vec3,  float64_t);"
+        "f64vec4  min(f64vec4,  float64_t);"
+        "f64vec2  min(f64vec2,  f64vec2);"
+        "f64vec3  min(f64vec3,  f64vec3);"
+        "f64vec4  min(f64vec4,  f64vec4);"
+
+        "float64_t max(float64_t, float64_t);"
+        "f64vec2  max(f64vec2 , float64_t);"
+        "f64vec3  max(f64vec3 , float64_t);"
+        "f64vec4  max(f64vec4 , float64_t);"
+        "f64vec2  max(f64vec2 , f64vec2);"
+        "f64vec3  max(f64vec3 , f64vec3);"
+        "f64vec4  max(f64vec4 , f64vec4);"
+
+        "float64_t clamp(float64_t, float64_t, float64_t);"
+        "f64vec2  clamp(f64vec2 , float64_t, float64_t);"
+        "f64vec3  clamp(f64vec3 , float64_t, float64_t);"
+        "f64vec4  clamp(f64vec4 , float64_t, float64_t);"
+        "f64vec2  clamp(f64vec2 , f64vec2 , f64vec2);"
+        "f64vec3  clamp(f64vec3 , f64vec3 , f64vec3);"
+        "f64vec4  clamp(f64vec4 , f64vec4 , f64vec4);"
+
+        "float64_t mix(float64_t, float64_t, float64_t);"
+        "f64vec2  mix(f64vec2,  f64vec2,  float64_t);"
+        "f64vec3  mix(f64vec3,  f64vec3,  float64_t);"
+        "f64vec4  mix(f64vec4,  f64vec4,  float64_t);"
+        "f64vec2  mix(f64vec2,  f64vec2,  f64vec2);"
+        "f64vec3  mix(f64vec3,  f64vec3,  f64vec3);"
+        "f64vec4  mix(f64vec4,  f64vec4,  f64vec4);"
+        "float64_t mix(float64_t, float64_t, bool);"
+        "f64vec2  mix(f64vec2,  f64vec2,  bvec2);"
+        "f64vec3  mix(f64vec3,  f64vec3,  bvec3);"
+        "f64vec4  mix(f64vec4,  f64vec4,  bvec4);"
+
+        "float64_t step(float64_t, float64_t);"
+        "f64vec2  step(f64vec2 , f64vec2);"
+        "f64vec3  step(f64vec3 , f64vec3);"
+        "f64vec4  step(f64vec4 , f64vec4);"
+        "f64vec2  step(float64_t, f64vec2);"
+        "f64vec3  step(float64_t, f64vec3);"
+        "f64vec4  step(float64_t, f64vec4);"
+
+        "float64_t smoothstep(float64_t, float64_t, float64_t);"
+        "f64vec2  smoothstep(f64vec2 , f64vec2 , f64vec2);"
+        "f64vec3  smoothstep(f64vec3 , f64vec3 , f64vec3);"
+        "f64vec4  smoothstep(f64vec4 , f64vec4 , f64vec4);"
+        "f64vec2  smoothstep(float64_t, float64_t, f64vec2);"
+        "f64vec3  smoothstep(float64_t, float64_t, f64vec3);"
+        "f64vec4  smoothstep(float64_t, float64_t, f64vec4);"
+
+        "float64_t length(float64_t);"
+        "float64_t length(f64vec2);"
+        "float64_t length(f64vec3);"
+        "float64_t length(f64vec4);"
+
+        "float64_t distance(float64_t, float64_t);"
+        "float64_t distance(f64vec2 , f64vec2);"
+        "float64_t distance(f64vec3 , f64vec3);"
+        "float64_t distance(f64vec4 , f64vec4);"
+
+        "float64_t dot(float64_t, float64_t);"
+        "float64_t dot(f64vec2 , f64vec2);"
+        "float64_t dot(f64vec3 , f64vec3);"
+        "float64_t dot(f64vec4 , f64vec4);"
+
+        "f64vec3 cross(f64vec3, f64vec3);"
+
+        "float64_t normalize(float64_t);"
+        "f64vec2  normalize(f64vec2);"
+        "f64vec3  normalize(f64vec3);"
+        "f64vec4  normalize(f64vec4);"
+
+        "float64_t faceforward(float64_t, float64_t, float64_t);"
+        "f64vec2  faceforward(f64vec2,  f64vec2,  f64vec2);"
+        "f64vec3  faceforward(f64vec3,  f64vec3,  f64vec3);"
+        "f64vec4  faceforward(f64vec4,  f64vec4,  f64vec4);"
+
+        "float64_t reflect(float64_t, float64_t);"
+        "f64vec2  reflect(f64vec2 , f64vec2 );"
+        "f64vec3  reflect(f64vec3 , f64vec3 );"
+        "f64vec4  reflect(f64vec4 , f64vec4 );"
+
+        "float64_t refract(float64_t, float64_t, float64_t);"
+        "f64vec2  refract(f64vec2 , f64vec2 , float64_t);"
+        "f64vec3  refract(f64vec3 , f64vec3 , float64_t);"
+        "f64vec4  refract(f64vec4 , f64vec4 , float64_t);"
+
+        "f64mat2 matrixCompMult(f64mat2, f64mat2);"
+        "f64mat3 matrixCompMult(f64mat3, f64mat3);"
+        "f64mat4 matrixCompMult(f64mat4, f64mat4);"
+        "f64mat2x3 matrixCompMult(f64mat2x3, f64mat2x3);"
+        "f64mat2x4 matrixCompMult(f64mat2x4, f64mat2x4);"
+        "f64mat3x2 matrixCompMult(f64mat3x2, f64mat3x2);"
+        "f64mat3x4 matrixCompMult(f64mat3x4, f64mat3x4);"
+        "f64mat4x2 matrixCompMult(f64mat4x2, f64mat4x2);"
+        "f64mat4x3 matrixCompMult(f64mat4x3, f64mat4x3);"
+
+        "f64mat2   outerProduct(f64vec2, f64vec2);"
+        "f64mat3   outerProduct(f64vec3, f64vec3);"
+        "f64mat4   outerProduct(f64vec4, f64vec4);"
+        "f64mat2x3 outerProduct(f64vec3, f64vec2);"
+        "f64mat3x2 outerProduct(f64vec2, f64vec3);"
+        "f64mat2x4 outerProduct(f64vec4, f64vec2);"
+        "f64mat4x2 outerProduct(f64vec2, f64vec4);"
+        "f64mat3x4 outerProduct(f64vec4, f64vec3);"
+        "f64mat4x3 outerProduct(f64vec3, f64vec4);"
+
+        "f64mat2   transpose(f64mat2);"
+        "f64mat3   transpose(f64mat3);"
+        "f64mat4   transpose(f64mat4);"
+        "f64mat2x3 transpose(f64mat3x2);"
+        "f64mat3x2 transpose(f64mat2x3);"
+        "f64mat2x4 transpose(f64mat4x2);"
+        "f64mat4x2 transpose(f64mat2x4);"
+        "f64mat3x4 transpose(f64mat4x3);"
+        "f64mat4x3 transpose(f64mat3x4);"
+
+        "float64_t determinant(f64mat2);"
+        "float64_t determinant(f64mat3);"
+        "float64_t determinant(f64mat4);"
+
+        "f64mat2 inverse(f64mat2);"
+        "f64mat3 inverse(f64mat3);"
+        "f64mat4 inverse(f64mat4);"
+
+        "\n");
+    }
+
+    if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
         commonBuiltins.append(
 
             "int64_t abs(int64_t);"
@@ -998,25 +1196,25 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "u64vec3  mix(u64vec3,  u64vec3,  bvec3);"
             "u64vec4  mix(u64vec4,  u64vec4,  bvec4);"
 
-            "int64_t doubleBitsToInt64(double);"
-            "i64vec2 doubleBitsToInt64(dvec2);"
-            "i64vec3 doubleBitsToInt64(dvec3);"
-            "i64vec4 doubleBitsToInt64(dvec4);"
+            "int64_t doubleBitsToInt64(float64_t);"
+            "i64vec2 doubleBitsToInt64(f64vec2);"
+            "i64vec3 doubleBitsToInt64(f64vec3);"
+            "i64vec4 doubleBitsToInt64(f64vec4);"
 
-            "uint64_t doubleBitsToUint64(double);"
-            "u64vec2  doubleBitsToUint64(dvec2);"
-            "u64vec3  doubleBitsToUint64(dvec3);"
-            "u64vec4  doubleBitsToUint64(dvec4);"
+            "uint64_t doubleBitsToUint64(float64_t);"
+            "u64vec2  doubleBitsToUint64(f64vec2);"
+            "u64vec3  doubleBitsToUint64(f64vec3);"
+            "u64vec4  doubleBitsToUint64(f64vec4);"
 
-            "double int64BitsToDouble(int64_t);"
-            "dvec2  int64BitsToDouble(i64vec2);"
-            "dvec3  int64BitsToDouble(i64vec3);"
-            "dvec4  int64BitsToDouble(i64vec4);"
+            "float64_t int64BitsToDouble(int64_t);"
+            "f64vec2  int64BitsToDouble(i64vec2);"
+            "f64vec3  int64BitsToDouble(i64vec3);"
+            "f64vec4  int64BitsToDouble(i64vec4);"
 
-            "double uint64BitsToDouble(uint64_t);"
-            "dvec2  uint64BitsToDouble(u64vec2);"
-            "dvec3  uint64BitsToDouble(u64vec3);"
-            "dvec4  uint64BitsToDouble(u64vec4);"
+            "float64_t uint64BitsToDouble(uint64_t);"
+            "f64vec2  uint64BitsToDouble(u64vec2);"
+            "f64vec3  uint64BitsToDouble(u64vec3);"
+            "f64vec4  uint64BitsToDouble(u64vec4);"
 
             "int64_t  packInt2x32(ivec2);"
             "uint64_t packUint2x32(uvec2);"
@@ -1065,6 +1263,16 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "bvec3 notEqual(u64vec3, u64vec3);"
             "bvec4 notEqual(u64vec4, u64vec4);"
 
+            "int64_t bitCount(int64_t);"
+            "i64vec2 bitCount(i64vec2);"
+            "i64vec3 bitCount(i64vec3);"
+            "i64vec4 bitCount(i64vec4);"
+
+            "int64_t bitCount(uint64_t);"
+            "i64vec2 bitCount(u64vec2);"
+            "i64vec3 bitCount(u64vec3);"
+            "i64vec4 bitCount(u64vec4);"
+
             "int64_t findLSB(int64_t);"
             "i64vec2 findLSB(i64vec2);"
             "i64vec3 findLSB(i64vec3);"
@@ -1230,11 +1438,23 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             " int64_t atomicMin(coherent volatile inout  int64_t,  int64_t);"
             "uint64_t atomicMin(coherent volatile inout uint64_t, uint64_t, int, int, int);"
             " int64_t atomicMin(coherent volatile inout  int64_t,  int64_t, int, int, int);"
+            "float16_t atomicMin(coherent volatile inout float16_t, float16_t);"
+            "float16_t atomicMin(coherent volatile inout float16_t, float16_t, int, int, int);"
+            "   float atomicMin(coherent volatile inout float, float);"
+            "   float atomicMin(coherent volatile inout float, float, int, int, int);"
+            "  double atomicMin(coherent volatile inout double, double);"
+            "  double atomicMin(coherent volatile inout double, double, int, int, int);"
 
             "uint64_t atomicMax(coherent volatile inout uint64_t, uint64_t);"
             " int64_t atomicMax(coherent volatile inout  int64_t,  int64_t);"
             "uint64_t atomicMax(coherent volatile inout uint64_t, uint64_t, int, int, int);"
             " int64_t atomicMax(coherent volatile inout  int64_t,  int64_t, int, int, int);"
+            "float16_t atomicMax(coherent volatile inout float16_t, float16_t);"
+            "float16_t atomicMax(coherent volatile inout float16_t, float16_t, int, int, int);"
+            "   float atomicMax(coherent volatile inout float, float);"
+            "   float atomicMax(coherent volatile inout float, float, int, int, int);"
+            "  double atomicMax(coherent volatile inout double, double);"
+            "  double atomicMax(coherent volatile inout double, double, int, int, int);"
 
             "uint64_t atomicAnd(coherent volatile inout uint64_t, uint64_t);"
             " int64_t atomicAnd(coherent volatile inout  int64_t,  int64_t);"
@@ -1255,6 +1475,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             " int64_t atomicAdd(coherent volatile inout  int64_t,  int64_t);"
             "uint64_t atomicAdd(coherent volatile inout uint64_t, uint64_t, int, int, int);"
             " int64_t atomicAdd(coherent volatile inout  int64_t,  int64_t, int, int, int);"
+            "float16_t atomicAdd(coherent volatile inout float16_t, float16_t);"
+            "float16_t atomicAdd(coherent volatile inout float16_t, float16_t, int, int, int);"
             "   float atomicAdd(coherent volatile inout float, float);"
             "   float atomicAdd(coherent volatile inout float, float, int, int, int);"
             "  double atomicAdd(coherent volatile inout double, double);"
@@ -1264,6 +1486,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             " int64_t atomicExchange(coherent volatile inout  int64_t,  int64_t);"
             "uint64_t atomicExchange(coherent volatile inout uint64_t, uint64_t, int, int, int);"
             " int64_t atomicExchange(coherent volatile inout  int64_t,  int64_t, int, int, int);"
+            "float16_t atomicExchange(coherent volatile inout float16_t, float16_t);"
+            "float16_t atomicExchange(coherent volatile inout float16_t, float16_t, int, int, int);"
             "   float atomicExchange(coherent volatile inout float, float);"
             "   float atomicExchange(coherent volatile inout float, float, int, int, int);"
             "  double atomicExchange(coherent volatile inout double, double);"
@@ -1276,11 +1500,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
             "uint64_t atomicLoad(coherent volatile in uint64_t, int, int, int);"
             " int64_t atomicLoad(coherent volatile in  int64_t, int, int, int);"
+            "float16_t atomicLoad(coherent volatile in float16_t, int, int, int);"
             "   float atomicLoad(coherent volatile in float, int, int, int);"
             "  double atomicLoad(coherent volatile in double, int, int, int);"
 
             "void atomicStore(coherent volatile out uint64_t, uint64_t, int, int, int);"
             "void atomicStore(coherent volatile out  int64_t,  int64_t, int, int, int);"
+            "void atomicStore(coherent volatile out float16_t, float16_t, int, int, int);"
             "void atomicStore(coherent volatile out float, float, int, int, int);"
             "void atomicStore(coherent volatile out double, double, int, int, int);"
             "\n");
@@ -1335,6 +1561,15 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "dvec4  fma(dvec4,  dvec4,  dvec4 );"
                 "\n");
     }
+
+    if (profile == EEsProfile && version >= 310) {  // ARB_gpu_shader_fp64
+            commonBuiltins.append(
+                "float64_t fma(float64_t, float64_t, float64_t);"
+                "f64vec2  fma(f64vec2,  f64vec2,  f64vec2 );"
+                "f64vec3  fma(f64vec3,  f64vec3,  f64vec3 );"
+                "f64vec4  fma(f64vec4,  f64vec4,  f64vec4 );"
+                "\n");
+    }
 #endif
 
     if ((profile == EEsProfile && version >= 310) ||
@@ -1371,6 +1606,21 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
             "\n");
     }
+
+    if (profile == EEsProfile && version >= 310) { // ARB_gpu_shader_fp64
+        commonBuiltins.append(
+            "float64_t frexp(float64_t, out int);"
+            "f64vec2  frexp( f64vec2, out ivec2);"
+            "f64vec3  frexp( f64vec3, out ivec3);"
+            "f64vec4  frexp( f64vec4, out ivec4);"
+
+            "float64_t ldexp(float64_t, int);"
+            "f64vec2  ldexp( f64vec2, ivec2);"
+            "f64vec3  ldexp( f64vec3, ivec3);"
+            "f64vec4  ldexp( f64vec4, ivec4);"
+
+            "\n");
+    }
 #endif
 #endif
 
@@ -1621,6 +1871,22 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
                 "\n");
         }
+        if (profile != EEsProfile && version == 450) {
+            commonBuiltins.append(
+                "uint atomicCounterAddARB(atomic_uint, uint);"
+                "uint atomicCounterSubtractARB(atomic_uint, uint);"
+                "uint atomicCounterMinARB(atomic_uint, uint);"
+                "uint atomicCounterMaxARB(atomic_uint, uint);"
+                "uint atomicCounterAndARB(atomic_uint, uint);"
+                "uint atomicCounterOrARB(atomic_uint, uint);"
+                "uint atomicCounterXorARB(atomic_uint, uint);"
+                "uint atomicCounterExchangeARB(atomic_uint, uint);"
+                "uint atomicCounterCompSwapARB(atomic_uint, uint, uint);"
+
+                "\n");
+        }
+
+
         if (profile != EEsProfile && version >= 460) {
             commonBuiltins.append(
                 "uint atomicCounterAdd(atomic_uint, uint);"
@@ -3152,7 +3418,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
 #ifndef GLSLANG_ANGLE
     // GL_AMD_gpu_shader_half_float/Explicit types
-    if (profile != EEsProfile && version >= 450) {
+    if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
         commonBuiltins.append(
             "float16_t radians(float16_t);"
             "f16vec2   radians(f16vec2);"
@@ -3500,7 +3766,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
     }
 
     // Explicit types
-    if (profile != EEsProfile && version >= 450) {
+    if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
         commonBuiltins.append(
             "int8_t abs(int8_t);"
             "i8vec2 abs(i8vec2);"
@@ -3900,106 +4166,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "u16vec4  unpack16(uint64_t);"
             "i32vec2  unpack32(int64_t);"
             "u32vec2  unpack32(uint64_t);"
-
-            "float64_t radians(float64_t);"
-            "f64vec2   radians(f64vec2);"
-            "f64vec3   radians(f64vec3);"
-            "f64vec4   radians(f64vec4);"
-
-            "float64_t degrees(float64_t);"
-            "f64vec2   degrees(f64vec2);"
-            "f64vec3   degrees(f64vec3);"
-            "f64vec4   degrees(f64vec4);"
-
-            "float64_t sin(float64_t);"
-            "f64vec2   sin(f64vec2);"
-            "f64vec3   sin(f64vec3);"
-            "f64vec4   sin(f64vec4);"
-
-            "float64_t cos(float64_t);"
-            "f64vec2   cos(f64vec2);"
-            "f64vec3   cos(f64vec3);"
-            "f64vec4   cos(f64vec4);"
-
-            "float64_t tan(float64_t);"
-            "f64vec2   tan(f64vec2);"
-            "f64vec3   tan(f64vec3);"
-            "f64vec4   tan(f64vec4);"
-
-            "float64_t asin(float64_t);"
-            "f64vec2   asin(f64vec2);"
-            "f64vec3   asin(f64vec3);"
-            "f64vec4   asin(f64vec4);"
-
-            "float64_t acos(float64_t);"
-            "f64vec2   acos(f64vec2);"
-            "f64vec3   acos(f64vec3);"
-            "f64vec4   acos(f64vec4);"
-
-            "float64_t atan(float64_t, float64_t);"
-            "f64vec2   atan(f64vec2,   f64vec2);"
-            "f64vec3   atan(f64vec3,   f64vec3);"
-            "f64vec4   atan(f64vec4,   f64vec4);"
-
-            "float64_t atan(float64_t);"
-            "f64vec2   atan(f64vec2);"
-            "f64vec3   atan(f64vec3);"
-            "f64vec4   atan(f64vec4);"
-
-            "float64_t sinh(float64_t);"
-            "f64vec2   sinh(f64vec2);"
-            "f64vec3   sinh(f64vec3);"
-            "f64vec4   sinh(f64vec4);"
-
-            "float64_t cosh(float64_t);"
-            "f64vec2   cosh(f64vec2);"
-            "f64vec3   cosh(f64vec3);"
-            "f64vec4   cosh(f64vec4);"
-
-            "float64_t tanh(float64_t);"
-            "f64vec2   tanh(f64vec2);"
-            "f64vec3   tanh(f64vec3);"
-            "f64vec4   tanh(f64vec4);"
-
-            "float64_t asinh(float64_t);"
-            "f64vec2   asinh(f64vec2);"
-            "f64vec3   asinh(f64vec3);"
-            "f64vec4   asinh(f64vec4);"
-
-            "float64_t acosh(float64_t);"
-            "f64vec2   acosh(f64vec2);"
-            "f64vec3   acosh(f64vec3);"
-            "f64vec4   acosh(f64vec4);"
-
-            "float64_t atanh(float64_t);"
-            "f64vec2   atanh(f64vec2);"
-            "f64vec3   atanh(f64vec3);"
-            "f64vec4   atanh(f64vec4);"
-
-            "float64_t pow(float64_t, float64_t);"
-            "f64vec2   pow(f64vec2,   f64vec2);"
-            "f64vec3   pow(f64vec3,   f64vec3);"
-            "f64vec4   pow(f64vec4,   f64vec4);"
-
-            "float64_t exp(float64_t);"
-            "f64vec2   exp(f64vec2);"
-            "f64vec3   exp(f64vec3);"
-            "f64vec4   exp(f64vec4);"
-
-            "float64_t log(float64_t);"
-            "f64vec2   log(f64vec2);"
-            "f64vec3   log(f64vec3);"
-            "f64vec4   log(f64vec4);"
-
-            "float64_t exp2(float64_t);"
-            "f64vec2   exp2(f64vec2);"
-            "f64vec3   exp2(f64vec3);"
-            "f64vec4   exp2(f64vec4);"
-
-            "float64_t log2(float64_t);"
-            "f64vec2   log2(f64vec2);"
-            "f64vec3   log2(f64vec3);"
-            "f64vec4   log2(f64vec4);"
             "\n");
     }
 
@@ -4403,7 +4569,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
     }
 
-    // GL_ARB_shader_clock & GL_EXT_shader_realtime_clock
+    // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock
     if (profile != EEsProfile && version >= 450) {
         commonBuiltins.append(
             "uvec2 clock2x32ARB();"
@@ -4427,7 +4593,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
         }
 
-    // Builtins for GL_NV_ray_tracing/GL_EXT_ray_tracing/GL_EXT_ray_query
+    // Builtins for GL_NV_ray_tracing/GL_NV_ray_tracing_motion_blur/GL_EXT_ray_tracing/GL_EXT_ray_query
     if (profile != EEsProfile && version >= 460) {
          commonBuiltins.append("void rayQueryInitializeEXT(rayQueryEXT, accelerationStructureEXT, uint, uint, vec3, float, vec3, float);"
             "void rayQueryTerminateEXT(rayQueryEXT);"
@@ -4456,6 +4622,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
 
         stageBuiltins[EShLangRayGen].append(
             "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
+            "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
             "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
             "void executeCallableNV(uint, int);"
             "void executeCallableEXT(uint, int);"
@@ -4470,12 +4637,14 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "\n");
         stageBuiltins[EShLangClosestHit].append(
             "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
+            "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
             "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
             "void executeCallableNV(uint, int);"
             "void executeCallableEXT(uint, int);"
             "\n");
         stageBuiltins[EShLangMiss].append(
             "void traceNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
+            "void traceRayMotionNV(accelerationStructureNV,uint,uint,uint,uint,uint,vec3,float,vec3,float,float,int);"
             "void traceRayEXT(accelerationStructureEXT,uint,uint,uint,uint,uint,vec3,float,vec3,float,int);"
             "void executeCallableNV(uint, int);"
             "void executeCallableEXT(uint, int);"
@@ -4921,9 +5090,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 );
         }
 
-        if (version >= 450)
+        if (version >= 430)
             stageBuiltins[EShLangVertex].append(
                 "out int gl_ViewportMask[];"             // GL_NV_viewport_array2
+                );
+
+        if (version >= 450)
+            stageBuiltins[EShLangVertex].append(
                 "out int gl_SecondaryViewportMaskNV[];"  // GL_NV_stereo_view_rendering
                 "out vec4 gl_SecondaryPositionNV;"       // GL_NV_stereo_view_rendering
                 "out vec4 gl_PositionPerViewNV[];"       // GL_NVX_multiview_per_view_attributes
@@ -5059,9 +5232,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "in int gl_InvocationID;"
             );
 
-        if (version >= 450)
+        if (version >= 430)
             stageBuiltins[EShLangGeometry].append(
                 "out int gl_ViewportMask[];"               // GL_NV_viewport_array2
+            );
+
+        if (version >= 450)
+            stageBuiltins[EShLangGeometry].append(
                 "out int gl_SecondaryViewportMaskNV[];"    // GL_NV_stereo_view_rendering
                 "out vec4 gl_SecondaryPositionNV;"         // GL_NV_stereo_view_rendering
                 "out vec4 gl_PositionPerViewNV[];"         // GL_NVX_multiview_per_view_attributes
@@ -5137,7 +5314,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
         if (version >= 450)
             stageBuiltins[EShLangTessControl].append(
                 "float gl_CullDistance[];"
+            );
+        if (version >= 430)
+            stageBuiltins[EShLangTessControl].append(
                 "int  gl_ViewportMask[];"             // GL_NV_viewport_array2
+            );
+        if (version >= 450)
+            stageBuiltins[EShLangTessControl].append(
                 "vec4 gl_SecondaryPositionNV;"        // GL_NV_stereo_view_rendering
                 "int  gl_SecondaryViewportMaskNV[];"  // GL_NV_stereo_view_rendering
                 "vec4 gl_PositionPerViewNV[];"        // GL_NVX_multiview_per_view_attributes
@@ -5240,9 +5423,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
                 "out int gl_Layer;"
                 "\n");
 
-        if (version >= 450)
+        if (version >= 430)
             stageBuiltins[EShLangTessEvaluation].append(
                 "out int  gl_ViewportMask[];"             // GL_NV_viewport_array2
+            );
+
+        if (version >= 450)
+            stageBuiltins[EShLangTessEvaluation].append(
                 "out vec4 gl_SecondaryPositionNV;"        // GL_NV_stereo_view_rendering
                 "out int  gl_SecondaryViewportMaskNV[];"  // GL_NV_stereo_view_rendering
                 "out vec4 gl_PositionPerViewNV[];"        // GL_NVX_multiview_per_view_attributes
@@ -5684,6 +5871,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "in    mat3x4 gl_WorldToObject3x4EXT;"
             "in    uint   gl_IncomingRayFlagsNV;"
             "in    uint   gl_IncomingRayFlagsEXT;"
+            "in    float  gl_CurrentRayTimeNV;"
             "\n";
         const char *hitDecls =
             "in    uvec3  gl_LaunchIDNV;"
@@ -5719,6 +5907,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "in    mat3x4 gl_WorldToObject3x4EXT;"
             "in    uint   gl_IncomingRayFlagsNV;"
             "in    uint   gl_IncomingRayFlagsEXT;"
+            "in    float  gl_CurrentRayTimeNV;"
             "\n";
         const char *missDecls =
             "in    uvec3  gl_LaunchIDNV;"
@@ -5737,6 +5926,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
             "in    float  gl_RayTmaxEXT;"
             "in    uint   gl_IncomingRayFlagsNV;"
             "in    uint   gl_IncomingRayFlagsEXT;"
+            "in    float  gl_CurrentRayTimeNV;"
             "\n";
 
         const char *callableDecls =
@@ -6073,38 +6263,44 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int
     //
     // textureQueryLod(), fragment stage only
     // Also enabled with extension GL_ARB_texture_query_lod
+    // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension.
 
     if (profile != EEsProfile && version >= 150 && sampler.isCombined() && sampler.dim != EsdRect &&
         ! sampler.isMultiSample() && ! sampler.isBuffer()) {
-        for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
-            if (f16TexAddr && sampler.type != EbtFloat16)
-                continue;
-            stageBuiltins[EShLangFragment].append("vec2 textureQueryLod(");
-            stageBuiltins[EShLangFragment].append(typeName);
+
+        const TString funcName[2] = {"vec2 textureQueryLod(", "vec2 textureQueryLOD("};
+
+        for (int i = 0; i < 2; ++i){
+            for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
+                if (f16TexAddr && sampler.type != EbtFloat16)
+                    continue;
+                stageBuiltins[EShLangFragment].append(funcName[i]);
+                stageBuiltins[EShLangFragment].append(typeName);
+                if (dimMap[sampler.dim] == 1)
+                    if (f16TexAddr)
+                        stageBuiltins[EShLangFragment].append(", float16_t");
+                    else
+                        stageBuiltins[EShLangFragment].append(", float");
+                else {
+                    if (f16TexAddr)
+                        stageBuiltins[EShLangFragment].append(", f16vec");
+                    else
+                        stageBuiltins[EShLangFragment].append(", vec");
+                    stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
+                }
+                stageBuiltins[EShLangFragment].append(");\n");
+            }
+
+            stageBuiltins[EShLangCompute].append(funcName[i]);
+            stageBuiltins[EShLangCompute].append(typeName);
             if (dimMap[sampler.dim] == 1)
-                if (f16TexAddr)
-                    stageBuiltins[EShLangFragment].append(", float16_t");
-                else
-                    stageBuiltins[EShLangFragment].append(", float");
+                stageBuiltins[EShLangCompute].append(", float");
             else {
-                if (f16TexAddr)
-                    stageBuiltins[EShLangFragment].append(", f16vec");
-                else
-                    stageBuiltins[EShLangFragment].append(", vec");
-                stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
+                stageBuiltins[EShLangCompute].append(", vec");
+                stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
             }
-            stageBuiltins[EShLangFragment].append(");\n");
-        }
-
-        stageBuiltins[EShLangCompute].append("vec2 textureQueryLod(");
-        stageBuiltins[EShLangCompute].append(typeName);
-        if (dimMap[sampler.dim] == 1)
-            stageBuiltins[EShLangCompute].append(", float");
-        else {
-            stageBuiltins[EShLangCompute].append(", vec");
-            stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
+            stageBuiltins[EShLangCompute].append(");\n");
         }
-        stageBuiltins[EShLangCompute].append(");\n");
     }
 
     //
@@ -6263,6 +6459,24 @@ void TBuiltIns::addImageFunctions(TSampler sampler, const TString& typeName, int
                 commonBuiltins.append(imageParams);
                 commonBuiltins.append(", float");
                 commonBuiltins.append(", int, int, int);\n");
+
+                commonBuiltins.append("float imageAtomicMin(volatile coherent ");
+                commonBuiltins.append(imageParams);
+                commonBuiltins.append(", float);\n");
+
+                commonBuiltins.append("float imageAtomicMin(volatile coherent ");
+                commonBuiltins.append(imageParams);
+                commonBuiltins.append(", float");
+                commonBuiltins.append(", int, int, int);\n");
+
+                commonBuiltins.append("float imageAtomicMax(volatile coherent ");
+                commonBuiltins.append(imageParams);
+                commonBuiltins.append(", float);\n");
+
+                commonBuiltins.append("float imageAtomicMax(volatile coherent ");
+                commonBuiltins.append(imageParams);
+                commonBuiltins.append(", float");
+                commonBuiltins.append(", int, int, int);\n");
             }
         }
     }
@@ -7031,6 +7245,9 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
 
             snprintf(builtInConstant, maxSize, "const int  gl_MaxFragmentUniformVectors = %d;", resources.maxFragmentUniformVectors);
             s.append(builtInConstant);
+
+            snprintf(builtInConstant, maxSize, "const int  gl_MaxVaryingVectors = %d;", resources.maxVaryingVectors);
+            s.append(builtInConstant);
         }
 
         snprintf(builtInConstant, maxSize, "const int  gl_MaxVertexAttribs = %d;", resources.maxVertexAttribs);
@@ -7063,7 +7280,8 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
         snprintf(builtInConstant, maxSize, "const int  gl_MaxVertexUniformComponents = %d;", resources.maxVertexUniformComponents);
         s.append(builtInConstant);
 
-        if (version < 150 || ARBCompatibility) {
+        // Moved from just being deprecated into compatibility profile only as of 4.20
+        if (version < 420 || profile == ECompatibilityProfile) {
             snprintf(builtInConstant, maxSize, "const int  gl_MaxVaryingFloats = %d;", resources.maxVaryingFloats);
             s.append(builtInConstant);
         }
@@ -7423,6 +7641,11 @@ static void BuiltInVariable(const char* name, TBuiltInVariable builtIn, TSymbolT
     symQualifier.builtIn = builtIn;
 }
 
+static void RetargetVariable(const char* from, const char* to, TSymbolTable& symbolTable)
+{
+    symbolTable.retargetSymbol(from, to);
+}
+
 //
 // For built-in variables inside a named block.
 // SpecialQualifier() won't ever go inside a block; their member's qualifier come
@@ -7490,8 +7713,8 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
 
         if (spvVersion.vulkan > 0 && spvVersion.vulkanRelaxed) {
             // treat these built-ins as aliases of VertexIndex and InstanceIndex
-            BuiltInVariable("gl_VertexID", EbvVertexIndex, symbolTable);
-            BuiltInVariable("gl_InstanceID", EbvInstanceIndex, symbolTable);
+            RetargetVariable("gl_InstanceID", "gl_InstanceIndex", symbolTable);
+            RetargetVariable("gl_VertexID", "gl_VertexIndex", symbolTable);
         }
 
         if (profile != EEsProfile) {
@@ -7862,7 +8085,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         }
 
         if (profile != EEsProfile && version < 400) {
-            symbolTable.setFunctionExtensions("textureQueryLod", 1, &E_GL_ARB_texture_query_lod);
+            symbolTable.setFunctionExtensions("textureQueryLOD", 1, &E_GL_ARB_texture_query_lod);
         }
 
         if (profile != EEsProfile && version >= 460) {
@@ -8026,6 +8249,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setFunctionExtensions("atomicCounter"         , 1, &E_GL_ARB_shader_atomic_counters);
         }
 
+        // E_GL_ARB_shader_atomic_counter_ops
+        if (profile != EEsProfile && version == 450) {
+            symbolTable.setFunctionExtensions("atomicCounterAddARB"     , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterSubtractARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterMinARB"     , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterMaxARB"     , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterAndARB"     , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterOrARB"      , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterXorARB"     , 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterExchangeARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
+            symbolTable.setFunctionExtensions("atomicCounterCompSwapARB", 1, &E_GL_ARB_shader_atomic_counter_ops);
+        }
+
         // E_GL_ARB_derivative_control
         if (profile != EEsProfile && version < 450) {
             symbolTable.setFunctionExtensions("dFdxFine",     1, &E_GL_ARB_derivative_control);
@@ -8133,7 +8369,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
         symbolTable.setFunctionExtensions("clockARB",     1, &E_GL_ARB_shader_clock);
         symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock);
 
-        symbolTable.setFunctionExtensions("clockRealtimeEXT",     1, &E_GL_EXT_shader_realtime_clock);
+        symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock);
         symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock);
 
         if (profile == EEsProfile && version < 320) {
@@ -8554,11 +8790,13 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             symbolTable.setVariableExtensions("gl_WorldToObject3x4EXT", 1, &E_GL_EXT_ray_tracing);
             symbolTable.setVariableExtensions("gl_IncomingRayFlagsNV", 1, &E_GL_NV_ray_tracing);
             symbolTable.setVariableExtensions("gl_IncomingRayFlagsEXT", 1, &E_GL_EXT_ray_tracing);
+            symbolTable.setVariableExtensions("gl_CurrentRayTimeNV", 1, &E_GL_NV_ray_tracing_motion_blur);
 
             symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
 
 
             symbolTable.setFunctionExtensions("traceNV", 1, &E_GL_NV_ray_tracing);
+            symbolTable.setFunctionExtensions("traceRayMotionNV", 1, &E_GL_NV_ray_tracing_motion_blur);
             symbolTable.setFunctionExtensions("traceRayEXT", 1, &E_GL_EXT_ray_tracing);
             symbolTable.setFunctionExtensions("reportIntersectionNV", 1, &E_GL_NV_ray_tracing);
             symbolTable.setFunctionExtensions("reportIntersectionEXT", 1, &E_GL_EXT_ray_tracing);
@@ -8602,6 +8840,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
             BuiltInVariable("gl_IncomingRayFlagsNV",     EbvIncomingRayFlags,   symbolTable);
             BuiltInVariable("gl_IncomingRayFlagsEXT",    EbvIncomingRayFlags,   symbolTable);
             BuiltInVariable("gl_DeviceIndex",            EbvDeviceIndex,        symbolTable);
+            BuiltInVariable("gl_CurrentRayTimeNV",       EbvCurrentRayTimeNV,   symbolTable);
 
             // GL_ARB_shader_ballot
             symbolTable.setVariableExtensions("gl_SubGroupSizeARB",       1, &E_GL_ARB_shader_ballot);
@@ -9026,6 +9265,18 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
     symbolTable.relateToOperator("clockRealtimeEXT",     EOpReadClockDeviceKHR);
     symbolTable.relateToOperator("clockRealtime2x32EXT", EOpReadClockDeviceKHR);
 
+    if (profile != EEsProfile && version == 450) {
+        symbolTable.relateToOperator("atomicCounterAddARB",      EOpAtomicCounterAdd);
+        symbolTable.relateToOperator("atomicCounterSubtractARB", EOpAtomicCounterSubtract);
+        symbolTable.relateToOperator("atomicCounterMinARB",      EOpAtomicCounterMin);
+        symbolTable.relateToOperator("atomicCounterMaxARB",      EOpAtomicCounterMax);
+        symbolTable.relateToOperator("atomicCounterAndARB",      EOpAtomicCounterAnd);
+        symbolTable.relateToOperator("atomicCounterOrARB",       EOpAtomicCounterOr);
+        symbolTable.relateToOperator("atomicCounterXorARB",      EOpAtomicCounterXor);
+        symbolTable.relateToOperator("atomicCounterExchangeARB", EOpAtomicCounterExchange);
+        symbolTable.relateToOperator("atomicCounterCompSwapARB", EOpAtomicCounterCompSwap);
+    }
+
     if (profile != EEsProfile && version >= 460) {
         symbolTable.relateToOperator("atomicCounterAdd",      EOpAtomicCounterAdd);
         symbolTable.relateToOperator("atomicCounterSubtract", EOpAtomicCounterSubtract);
@@ -9442,6 +9693,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
     case EShLangMiss:
         if (profile != EEsProfile && version >= 460) {
             symbolTable.relateToOperator("traceNV", EOpTraceNV);
+            symbolTable.relateToOperator("traceRayMotionNV", EOpTraceRayMotionNV);
             symbolTable.relateToOperator("traceRayEXT", EOpTraceKHR);
             symbolTable.relateToOperator("executeCallableNV", EOpExecuteCallableNV);
             symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR);

+ 49 - 17
src/libraries/glslang/glslang/MachineIndependent/Intermediate.cpp

@@ -416,20 +416,24 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child,
     // TODO: but, did this bypass constant folding?
     //
     switch (op) {
-    case EOpConstructInt8:
-    case EOpConstructUint8:
-    case EOpConstructInt16:
-    case EOpConstructUint16:
-    case EOpConstructInt:
-    case EOpConstructUint:
-    case EOpConstructInt64:
-    case EOpConstructUint64:
-    case EOpConstructBool:
-    case EOpConstructFloat:
-    case EOpConstructDouble:
-    case EOpConstructFloat16:
-        return child;
-    default: break; // some compilers want this
+        case EOpConstructInt8:
+        case EOpConstructUint8:
+        case EOpConstructInt16:
+        case EOpConstructUint16:
+        case EOpConstructInt:
+        case EOpConstructUint:
+        case EOpConstructInt64:
+        case EOpConstructUint64:
+        case EOpConstructBool:
+        case EOpConstructFloat:
+        case EOpConstructDouble:
+        case EOpConstructFloat16: {
+            TIntermUnary* unary_node = child->getAsUnaryNode();
+            if (unary_node != nullptr)
+                unary_node->updatePrecision();
+            return child;
+        }
+        default: break; // some compilers want this
     }
 
     //
@@ -1739,7 +1743,7 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to, TOperat
         case EbtUint:
             switch (from) {
             case EbtInt:
-                return version >= 400 || getSource() == EShSourceHlsl;
+                return version >= 400 || getSource() == EShSourceHlsl || IsRequestedExtension(E_GL_ARB_gpu_shader5);
             case EbtBool:
                 return getSource() == EShSourceHlsl;
             case EbtInt16:
@@ -2676,7 +2680,11 @@ TIntermTyped* TIntermediate::addSwizzle(TSwizzleSelectors<selectorType>& selecto
 // 'swizzleOkay' says whether or not it is okay to consider a swizzle
 // a valid part of the dereference chain.
 //
-const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool swizzleOkay)
+// 'BufferReferenceOk' says if type is buffer_reference, the routine stop to find the most left node.
+//
+//
+
+const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool swizzleOkay , bool bufferReferenceOk)
 {
     do {
         const TIntermBinary* binary = node->getAsBinaryNode();
@@ -2694,6 +2702,8 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool
                 return nullptr;
         }
         node = node->getAsBinaryNode()->getLeft();
+        if (bufferReferenceOk && node->isReference())
+            return node;
     } while (true);
 }
 
@@ -3770,6 +3780,28 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
     return false;
 }
 
+// Propagate precision qualifiers *up* from children to parent, and then
+// back *down* again to the children's subtrees.
+void TIntermAggregate::updatePrecision()
+{
+    if (getBasicType() == EbtInt || getBasicType() == EbtUint ||
+        getBasicType() == EbtFloat || getBasicType() == EbtFloat16) {
+        TPrecisionQualifier maxPrecision = EpqNone;
+        TIntermSequence operands = getSequence();
+        for (unsigned int i = 0; i < operands.size(); ++i) {
+            TIntermTyped* typedNode = operands[i]->getAsTyped();
+            assert(typedNode);
+            maxPrecision = std::max(maxPrecision, typedNode->getQualifier().precision);
+        }
+        getQualifier().precision = maxPrecision;
+        for (unsigned int i = 0; i < operands.size(); ++i) {
+          TIntermTyped* typedNode = operands[i]->getAsTyped();
+          assert(typedNode);
+          typedNode->propagatePrecision(maxPrecision);
+        }
+    }
+}
+
 // Propagate precision qualifiers *up* from children to parent, and then
 // back *down* again to the children's subtrees.
 void TIntermBinary::updatePrecision()
@@ -3870,7 +3902,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
         case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
         case EbtFloat: PROMOTE(setDConst, double, Get); break; \
         case EbtDouble: PROMOTE(setDConst, double, Get); break; \
-        case EbtInt8: PROMOTE(setI8Const, char, Get); break; \
+        case EbtInt8: PROMOTE(setI8Const, signed char, Get); break; \
         case EbtInt16: PROMOTE(setI16Const, short, Get); break; \
         case EbtInt: PROMOTE(setIConst, int, Get); break; \
         case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \

+ 13 - 0
src/libraries/glslang/glslang/MachineIndependent/ParseContextBase.cpp

@@ -622,6 +622,19 @@ void TParseContextBase::growGlobalUniformBlock(const TSourceLoc& loc, TType& mem
     globalUniformBlock->getWritableType().getQualifier().layoutBinding = globalUniformBinding;
     globalUniformBlock->getWritableType().getQualifier().layoutSet = globalUniformSet;
 
+    // Check for declarations of this default uniform that already exist due to other compilation units.
+    TSymbol* symbol = symbolTable.find(memberName);
+    if (symbol) {
+        if (memberType != symbol->getType()) {
+            TString err;
+            err += "\"" + memberType.getCompleteString() + "\"";
+            err += " versus ";
+            err += "\"" + symbol->getType().getCompleteString() + "\"";
+            error(loc, "Types must match:", memberType.getFieldName().c_str(), err.c_str());
+        }
+        return;
+    }
+
     // Add the requested member as a member to the global block.
     TType* type = new TType;
     type->shallowCopy(memberType);

+ 278 - 38
src/libraries/glslang/glslang/MachineIndependent/ParseHelper.cpp

@@ -327,6 +327,16 @@ void TParseContext::setAtomicCounterBlockDefaults(TType& block) const
     block.getQualifier().layoutMatrix = ElmRowMajor;
 }
 
+void TParseContext::setInvariant(const TSourceLoc& loc, const char* builtin) {
+    TSymbol* symbol = symbolTable.find(builtin);
+    if (symbol && symbol->getType().getQualifier().isPipeOutput()) {
+        if (intermediate.inIoAccessed(builtin))
+            warn(loc, "changing qualification after use", "invariant", builtin);
+        TSymbol* csymbol = symbolTable.copyUp(symbol);
+        csymbol->getWritableType().getQualifier().invariant = true;
+    }
+}
+
 void TParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>& tokens)
 {
 #ifndef GLSLANG_WEB
@@ -404,8 +414,33 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>&
         intermediate.setUseVariablePointers();
     } else if (tokens[0].compare("once") == 0) {
         warn(loc, "not implemented", "#pragma once", "");
-    } else if (tokens[0].compare("glslang_binary_double_output") == 0)
+    } else if (tokens[0].compare("glslang_binary_double_output") == 0) {
         intermediate.setBinaryDoubleOutput();
+    } else if (spvVersion.spv > 0 && tokens[0].compare("STDGL") == 0 &&
+               tokens[1].compare("invariant") == 0 && tokens[3].compare("all") == 0) {
+        intermediate.setInvariantAll();
+        // Set all builtin out variables invariant if declared
+        setInvariant(loc, "gl_Position");
+        setInvariant(loc, "gl_PointSize");
+        setInvariant(loc, "gl_ClipDistance");
+        setInvariant(loc, "gl_CullDistance");
+        setInvariant(loc, "gl_TessLevelOuter");
+        setInvariant(loc, "gl_TessLevelInner");
+        setInvariant(loc, "gl_PrimitiveID");
+        setInvariant(loc, "gl_Layer");
+        setInvariant(loc, "gl_ViewportIndex");
+        setInvariant(loc, "gl_FragDepth");
+        setInvariant(loc, "gl_SampleMask");
+        setInvariant(loc, "gl_ClipVertex");
+        setInvariant(loc, "gl_FrontColor");
+        setInvariant(loc, "gl_BackColor");
+        setInvariant(loc, "gl_FrontSecondaryColor");
+        setInvariant(loc, "gl_BackSecondaryColor");
+        setInvariant(loc, "gl_TexCoord");
+        setInvariant(loc, "gl_FogFragCoord");
+        setInvariant(loc, "gl_FragColor");
+        setInvariant(loc, "gl_FragData");
+    }
 #endif
 }
 
@@ -1092,12 +1127,31 @@ TFunction* TParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunct
     TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn);
     if (symbol && symbol->getAsFunction() && builtIn)
         requireProfile(loc, ~EEsProfile, "redefinition of built-in function");
+#ifndef GLSLANG_WEB
+    // Check the validity of using spirv_literal qualifier
+    for (int i = 0; i < function.getParamCount(); ++i) {
+        if (function[i].type->getQualifier().isSpirvLiteral() && function.getBuiltInOp() != EOpSpirvInst)
+            error(loc, "'spirv_literal' can only be used on functions defined with 'spirv_instruction' for argument",
+                  function.getName().c_str(), "%d", i + 1);
+    }
+
+    // For function declaration with SPIR-V instruction qualifier, always ignore the built-in function and
+    // respect this redeclared one.
+    if (symbol && builtIn && function.getBuiltInOp() == EOpSpirvInst)
+        symbol = nullptr;
+#endif
     const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0;
     if (prevDec) {
         if (prevDec->isPrototyped() && prototype)
             profileRequires(loc, EEsProfile, 300, nullptr, "multiple prototypes for same function");
         if (prevDec->getType() != function.getType())
             error(loc, "overloaded functions must have the same return type", function.getName().c_str(), "");
+#ifndef GLSLANG_WEB
+        if (prevDec->getSpirvInstruction() != function.getSpirvInstruction()) {
+            error(loc, "overloaded functions must have the same qualifiers", function.getName().c_str(),
+                  "spirv_instruction");
+        }
+#endif
         for (int i = 0; i < prevDec->getParamCount(); ++i) {
             if ((*prevDec)[i].type->getQualifier().storage != function[i].type->getQualifier().storage)
                 error(loc, "overloaded functions must have the same parameter storage qualifiers for argument", function[i].type->getStorageQualifierString(), "%d", i+1);
@@ -1299,6 +1353,15 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
                         if (lValueErrorCheck(arguments->getLoc(), "assign", arg->getAsTyped()))
                             error(arguments->getLoc(), "Non-L-value cannot be passed for 'out' or 'inout' parameters.", "out", "");
                     }
+#ifndef GLSLANG_WEB
+                    if (formalQualifier.isSpirvLiteral()) {
+                        if (!arg->getAsTyped()->getQualifier().isFrontEndConstant()) {
+                            error(arguments->getLoc(),
+                                  "Non front-end constant expressions cannot be passed for 'spirv_literal' parameters.",
+                                  "spirv_literal", "");
+                        }
+                    }
+#endif
                     const TType& argType = arg->getAsTyped()->getType();
                     const TQualifier& argQualifier = argType.getQualifier();
                     if (argQualifier.isMemory() && (argType.containsOpaque() || argType.isReference())) {
@@ -1353,6 +1416,11 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
             if (builtIn && fnCandidate->getBuiltInOp() != EOpNull) {
                 // A function call mapped to a built-in operation.
                 result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate);
+#ifndef GLSLANG_WEB
+            } else if (fnCandidate->getBuiltInOp() == EOpSpirvInst) {
+                // When SPIR-V instruction qualifier is specified, the function call is still mapped to a built-in operation.
+                result = handleBuiltInFunctionCall(loc, arguments, *fnCandidate);
+#endif
             } else {
                 // This is a function call not mapped to built-in operator.
                 // It could still be a built-in function, but only if PureOperatorBuiltins == false.
@@ -1430,6 +1498,35 @@ TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNo
     } else if (result->getAsOperator())
         builtInOpCheck(loc, function, *result->getAsOperator());
 
+#ifndef GLSLANG_WEB
+    // Special handling for function call with SPIR-V instruction qualifier specified
+    if (function.getBuiltInOp() == EOpSpirvInst) {
+        if (auto agg = result->getAsAggregate()) {
+            // Propogate spirv_by_reference/spirv_literal from parameters to arguments
+            auto& sequence = agg->getSequence();
+            for (unsigned i = 0; i < sequence.size(); ++i) {
+                if (function[i].type->getQualifier().isSpirvByReference())
+                    sequence[i]->getAsTyped()->getQualifier().setSpirvByReference();
+                if (function[i].type->getQualifier().isSpirvLiteral())
+                    sequence[i]->getAsTyped()->getQualifier().setSpirvLiteral();
+            }
+
+            // Attach the function call to SPIR-V intruction
+            agg->setSpirvInstruction(function.getSpirvInstruction());
+        } else if (auto unaryNode = result->getAsUnaryNode()) {
+            // Propogate spirv_by_reference/spirv_literal from parameters to arguments
+            if (function[0].type->getQualifier().isSpirvByReference())
+                unaryNode->getOperand()->getQualifier().setSpirvByReference();
+            if (function[0].type->getQualifier().isSpirvLiteral())
+                unaryNode->getOperand()->getQualifier().setSpirvLiteral();
+
+            // Attach the function call to SPIR-V intruction
+            unaryNode->setSpirvInstruction(function.getSpirvInstruction());
+        } else
+            assert(0);
+    }
+#endif
+
     return result;
 }
 
@@ -2096,7 +2193,13 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
             profileRequires(loc, ~EEsProfile, 450, nullptr, feature);
             requireExtensions(loc, 1, &E_GL_AMD_texture_gather_bias_lod, feature);
         }
-
+        // As per GL_ARB_sparse_texture2 extension "Offsets" parameter must be constant integral expression
+        // for sparseTextureGatherOffsetsARB just as textureGatherOffsets
+        if (callNode.getOp() == EOpSparseTextureGatherOffsets) {
+            int offsetsArg = arg0->getType().getSampler().shadow ? 3 : 2;
+            if (!(*argp)[offsetsArg]->getAsConstantUnion())
+                error(loc, "argument must be compile-time constant", "offsets", "");
+        }
         break;
     }
 
@@ -2185,6 +2288,16 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
                               "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]");
                 }
             }
+
+            if (callNode.getOp() == EOpTextureOffset) {
+                TSampler s = arg0->getType().getSampler();
+                if (s.is2D() && s.isArrayed() && s.isShadow()) {
+                    if (isEsProfile())
+                        error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "ES Profile");
+                    else if (version <= 420)
+                        error(loc, "TextureOffset does not support sampler2DArrayShadow : ", "sampler", "version <= 420");
+                }
+            }
         }
 
         break;
@@ -2195,6 +2308,10 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
         if (!(*argp)[10]->getAsConstantUnion())
             error(loc, "argument must be compile-time constant", "payload number", "a");
         break;
+    case EOpTraceRayMotionNV:
+        if (!(*argp)[11]->getAsConstantUnion())
+            error(loc, "argument must be compile-time constant", "payload number", "a");
+        break;
     case EOpTraceKHR:
         if (!(*argp)[10]->getAsConstantUnion())
             error(loc, "argument must be compile-time constant", "payload number", "a");
@@ -2263,18 +2380,23 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
                 error(loc, "only supported on image with format r64i", fnCandidate.getName().c_str(), "");
             else if (callNode.getType().getBasicType() == EbtUint64 && imageType.getQualifier().getFormat() != ElfR64ui)
                 error(loc, "only supported on image with format r64ui", fnCandidate.getName().c_str(), "");
-        } else {
-            bool isImageAtomicOnFloatAllowed = ((fnCandidate.getName().compare(0, 14, "imageAtomicAdd") == 0) ||
-                (fnCandidate.getName().compare(0, 15, "imageAtomicLoad") == 0) ||
-                (fnCandidate.getName().compare(0, 16, "imageAtomicStore") == 0) ||
-                (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") == 0));
-            if (imageType.getSampler().type == EbtFloat && isImageAtomicOnFloatAllowed &&
-                (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") != 0)) // imageAtomicExchange doesn't require GL_EXT_shader_atomic_float
+        } else if (imageType.getSampler().type == EbtFloat) {
+            if (fnCandidate.getName().compare(0, 19, "imageAtomicExchange") == 0) {
+                // imageAtomicExchange doesn't require an extension
+            } else if ((fnCandidate.getName().compare(0, 14, "imageAtomicAdd") == 0) ||
+                       (fnCandidate.getName().compare(0, 15, "imageAtomicLoad") == 0) ||
+                       (fnCandidate.getName().compare(0, 16, "imageAtomicStore") == 0)) {
                 requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str());
-            if (!isImageAtomicOnFloatAllowed)
+            } else if ((fnCandidate.getName().compare(0, 14, "imageAtomicMin") == 0) ||
+                       (fnCandidate.getName().compare(0, 14, "imageAtomicMax") == 0)) {
+                requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str());
+            } else {
                 error(loc, "only supported on integer images", fnCandidate.getName().c_str(), "");
-            else if (imageType.getQualifier().getFormat() != ElfR32f && isEsProfile())
+            }
+            if (imageType.getQualifier().getFormat() != ElfR32f && isEsProfile())
                 error(loc, "only supported on image with format r32f", fnCandidate.getName().c_str(), "");
+        } else {
+            error(loc, "not supported on this image type", fnCandidate.getName().c_str(), "");
         }
 
         const size_t maxArgs = imageType.getSampler().isMultiSample() ? 5 : 4;
@@ -2303,17 +2425,37 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
             memorySemanticsCheck(loc, fnCandidate, callNode);
             if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange ||
                 callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore) &&
-                (arg0->getType().isFloatingDomain())) {
+                (arg0->getType().getBasicType() == EbtFloat ||
+                 arg0->getType().getBasicType() == EbtDouble)) {
                 requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str());
+            } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange ||
+                        callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore ||
+                        callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) &&
+                       arg0->getType().isFloatingDomain()) {
+                requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str());
             }
         } else if (arg0->getType().getBasicType() == EbtInt64 || arg0->getType().getBasicType() == EbtUint64) {
             const char* const extensions[2] = { E_GL_NV_shader_atomic_int64,
                                                 E_GL_EXT_shader_atomic_int64 };
             requireExtensions(loc, 2, extensions, fnCandidate.getName().c_str());
         } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange) &&
-                   (arg0->getType().isFloatingDomain())) {
+                   (arg0->getType().getBasicType() == EbtFloat ||
+                    arg0->getType().getBasicType() == EbtDouble)) {
             requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float, fnCandidate.getName().c_str());
+        } else if ((callNode.getOp() == EOpAtomicAdd || callNode.getOp() == EOpAtomicExchange ||
+                    callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpAtomicStore ||
+                    callNode.getOp() == EOpAtomicMin || callNode.getOp() == EOpAtomicMax) &&
+                   arg0->getType().isFloatingDomain()) {
+            requireExtensions(loc, 1, &E_GL_EXT_shader_atomic_float2, fnCandidate.getName().c_str());
         }
+
+        const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true , true);
+        const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr;
+        const TQualifier& qualifier = (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier();
+        if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer)
+            error(loc,"Atomic memory function can only be used for shader storage block member or shared variable.",
+            fnCandidate.getName().c_str(), "");
+
         break;
     }
 
@@ -2887,11 +3029,14 @@ void TParseContext::constantValueCheck(TIntermTyped* node, const char* token)
 
 //
 // Both test, and if necessary spit out an error, to see if the node is really
-// an integer.
+// a 32-bit integer or can implicitly convert to one.
 //
 void TParseContext::integerCheck(const TIntermTyped* node, const char* token)
 {
-    if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar())
+    auto from_type = node->getBasicType();
+    if ((from_type == EbtInt || from_type == EbtUint ||
+         intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) ||
+         intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar())
         return;
 
     error(node->getLoc(), "scalar integer expression required", token, "");
@@ -2915,7 +3060,8 @@ void TParseContext::reservedErrorCheck(const TSourceLoc& loc, const TString& ide
     // "Identifiers starting with "gl_" are reserved for use by OpenGL, and may not be
     // declared in a shader; this results in a compile-time error."
     if (! symbolTable.atBuiltInLevel()) {
-        if (builtInName(identifier))
+        if (builtInName(identifier) && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
+            // The extension GL_EXT_spirv_intrinsics allows us to declare identifiers starting with "gl_".
             error(loc, "identifiers starting with \"gl_\" are reserved", identifier.c_str(), "");
 
         // "__" are not supposed to be an error.  ES 300 (and desktop) added the clarification:
@@ -2923,7 +3069,8 @@ void TParseContext::reservedErrorCheck(const TSourceLoc& loc, const TString& ide
         // reserved; using such a name does not itself result in an error, but may result
         // in undefined behavior."
         // however, before that, ES tests required an error.
-        if (identifier.find("__") != TString::npos) {
+        if (identifier.find("__") != TString::npos && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
+            // The extension GL_EXT_spirv_intrinsics allows us to declare identifiers starting with "__".
             if (isEsProfile() && version < 300)
                 error(loc, "identifiers containing consecutive underscores (\"__\") are reserved, and an error if version < 300", identifier.c_str(), "");
             else
@@ -2944,14 +3091,16 @@ void TParseContext::reservedPpErrorCheck(const TSourceLoc& loc, const char* iden
     // single underscore) are also reserved, and defining such a name results in a
     // compile-time error."
     // however, before that, ES tests required an error.
-    if (strncmp(identifier, "GL_", 3) == 0)
+    if (strncmp(identifier, "GL_", 3) == 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
+        // The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "GL_".
         ppError(loc, "names beginning with \"GL_\" can't be (un)defined:", op,  identifier);
     else if (strncmp(identifier, "defined", 8) == 0)
         if (relaxedErrors())
             ppWarn(loc, "\"defined\" is (un)defined:", op,  identifier);
         else
             ppError(loc, "\"defined\" can't be (un)defined:", op,  identifier);
-    else if (strstr(identifier, "__") != 0) {
+    else if (strstr(identifier, "__") != 0 && !extensionTurnedOn(E_GL_EXT_spirv_intrinsics)) {
+        // The extension GL_EXT_spirv_intrinsics allows us to declare macros prefixed with "__".
         if (isEsProfile() && version >= 300 &&
             (strcmp(identifier, "__LINE__") == 0 ||
              strcmp(identifier, "__FILE__") == 0 ||
@@ -3099,6 +3248,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
     bool matrixInMatrix = false;
     bool arrayArg = false;
     bool floatArgument = false;
+    bool intArgument = false;
     for (int arg = 0; arg < function.getParamCount(); ++arg) {
         if (function[arg].type->isArray()) {
             if (function[arg].type->isUnsizedArray()) {
@@ -3129,6 +3279,8 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
             specConstType = true;
         if (function[arg].type->isFloatingDomain())
             floatArgument = true;
+        if (function[arg].type->isIntegerDomain())
+            intArgument = true;
         if (type.isStruct()) {
             if (function[arg].type->contains16BitFloat()) {
                 requireFloat16Arithmetic(loc, "constructor", "can't construct structure containing 16-bit type");
@@ -3234,6 +3386,15 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
                 // and aren't making an array.
                 makeSpecConst = ! floatArgument && ! type.isArray();
                 break;
+
+            case EOpConstructVec2:
+            case EOpConstructVec3:
+            case EOpConstructVec4:
+                // This was the list of valid ones, if they aren't converting from int
+                // and aren't making an array.
+                makeSpecConst = ! intArgument && !type.isArray();
+                break;
+
             default:
                 // anything else wasn't white-listed in the spec as a conversion
                 makeSpecConst = false;
@@ -3540,6 +3701,8 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q
         profileRequires(loc, ENoProfile, 130, nullptr, "out for stage outputs");
         profileRequires(loc, EEsProfile, 300, nullptr, "out for stage outputs");
         qualifier.storage = EvqVaryingOut;
+        if (intermediate.isInvariantAll())
+            qualifier.invariant = true;
         break;
     case EvqInOut:
         qualifier.storage = EvqVaryingIn;
@@ -3556,7 +3719,7 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q
         if (blockName == nullptr &&
             qualifier.layoutPacking == ElpStd430)
         {
-            error(loc, "it is invalid to declare std430 qualifier on uniform", "", "");
+            requireExtensions(loc, 1, &E_GL_EXT_scalar_block_layout, "default std430 layout for uniform");
         }
         break;
     default:
@@ -3566,6 +3729,14 @@ void TParseContext::globalQualifierFixCheck(const TSourceLoc& loc, TQualifier& q
     if (!nonuniformOkay && qualifier.isNonUniform())
         error(loc, "for non-parameter, can only apply to 'in' or no storage qualifier", "nonuniformEXT", "");
 
+#ifndef GLSLANG_WEB
+    if (qualifier.isSpirvByReference())
+        error(loc, "can only apply to parameter", "spirv_by_reference", "");
+
+    if (qualifier.isSpirvLiteral())
+        error(loc, "can only apply to parameter", "spirv_literal", "");
+#endif
+
     // Storage qualifier isn't ready for memberQualifierCheck, we should skip invariantCheck for it.
     if (!isMemberCheck || structNestingLevel > 0)
         invariantCheck(loc, qualifier);
@@ -3827,6 +3998,41 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
     MERGE_SINGLETON(nonUniform);
 #endif
 
+#ifndef GLSLANG_WEB
+    // SPIR-V storage class qualifier (GL_EXT_spirv_intrinsics)
+    dst.spirvStorageClass = src.spirvStorageClass;
+
+    // SPIR-V decorate qualifiers (GL_EXT_spirv_intrinsics)
+    if (src.hasSprivDecorate()) {
+        if (dst.hasSprivDecorate()) {
+            const TSpirvDecorate& srcSpirvDecorate = src.getSpirvDecorate();
+            TSpirvDecorate& dstSpirvDecorate = dst.getSpirvDecorate();
+            for (auto& decorate : srcSpirvDecorate.decorates) {
+                if (dstSpirvDecorate.decorates.find(decorate.first) != dstSpirvDecorate.decorates.end())
+                    error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate", "(decoration=%u)", decorate.first);
+                else
+                    dstSpirvDecorate.decorates.insert(decorate);
+            }
+
+            for (auto& decorateId : srcSpirvDecorate.decorateIds) {
+                if (dstSpirvDecorate.decorateIds.find(decorateId.first) != dstSpirvDecorate.decorateIds.end())
+                    error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_id", "(decoration=%u)", decorateId.first);
+                else
+                    dstSpirvDecorate.decorateIds.insert(decorateId);
+            }
+
+            for (auto& decorateString : srcSpirvDecorate.decorateStrings) {
+                if (dstSpirvDecorate.decorates.find(decorateString.first) != dstSpirvDecorate.decorates.end())
+                    error(loc, "too many SPIR-V decorate qualifiers", "spirv_decorate_string", "(decoration=%u)", decorateString.first);
+                else
+                    dstSpirvDecorate.decorates.insert(decorateString);
+            }
+        } else {
+            dst.spirvDecorate = src.spirvDecorate;
+        }
+    }
+#endif
+
     if (repeated)
         error(loc, "replicated qualifiers", "", "");
 }
@@ -4790,6 +4996,17 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali
     }
     if (qualifier.isNonUniform())
         type.getQualifier().nonUniform = qualifier.nonUniform;
+#ifndef GLSLANG_WEB
+    if (qualifier.isSpirvByReference())
+        type.getQualifier().setSpirvByReference();
+    if (qualifier.isSpirvLiteral()) {
+        if (type.getBasicType() == EbtFloat || type.getBasicType() == EbtInt || type.getBasicType() == EbtUint ||
+            type.getBasicType() == EbtBool)
+            type.getQualifier().setSpirvLiteral();
+        else
+            error(loc, "cannot use spirv_literal qualifier", type.getBasicTypeString().c_str(), "");
+#endif
+    }
 
     paramCheckFixStorage(loc, qualifier.storage, type);
 }
@@ -5596,14 +5813,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
         if (! IsPow2(value))
             error(loc, "must be a power of 2", "buffer_reference_align", "");
         else
-#ifdef __ANDROID__
-            // Android NDK r15c tageting ABI 15 doesn't have full support for C++11
-            // (no std::exp2/log2). ::exp2 is available from C99 but ::log2 isn't
-            // available up until ABI 18 so we use the mathematical equivalent form
-            publicType.qualifier.layoutBufferReferenceAlign = (unsigned int)(std::log(value) / std::log(2.0));
-#else
-            publicType.qualifier.layoutBufferReferenceAlign = (unsigned int)std::log2(value);
-#endif
+            publicType.qualifier.layoutBufferReferenceAlign = IntLog2(value);
         if (nonLiteral)
             error(loc, "needs a literal integer", "buffer_reference_align", "");
         return;
@@ -5864,6 +6074,9 @@ void TParseContext::layoutObjectCheck(const TSourceLoc& loc, const TSymbol& symb
         case EvqVaryingIn:
         case EvqVaryingOut:
             if (!type.getQualifier().isTaskMemory() &&
+#ifndef GLSLANG_WEB
+                !type.getQualifier().hasSprivDecorate() &&
+#endif
                 (type.getBasicType() != EbtBlock ||
                  (!(*type.getStruct())[0].type->getQualifier().hasLocation() &&
                    (*type.getStruct())[0].type->getQualifier().builtIn == EbvNone)))
@@ -5925,6 +6138,11 @@ void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool m
 // Do layout error checking with respect to a type.
 void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
 {
+#ifndef GLSLANG_WEB
+    if (extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
+        return; // Skip any check if GL_EXT_spirv_intrinsics is turned on
+#endif
+
     const TQualifier& qualifier = type.getQualifier();
 
     // first, intra-layout qualifier-only error checking
@@ -6278,6 +6496,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
             error(loc, "can only be used with a uniform", "push_constant", "");
         if (qualifier.hasSet())
             error(loc, "cannot be used with push_constant", "set", "");
+        if (qualifier.hasBinding())
+            error(loc, "cannot be used with push_constant", "binding", "");
     }
     if (qualifier.hasBufferReference()) {
         if (qualifier.storage != EvqBuffer)
@@ -6425,12 +6645,17 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
                                 extensionTurnedOn(E_GL_EXT_shader_explicit_arithmetic_types_float64);
 
     if (isEsProfile())
-        function = (extensionTurnedOn(E_GL_EXT_shader_implicit_conversions) && version >= 310) ?
-                    findFunction120(loc, call, builtIn) : findFunctionExact(loc, call, builtIn);
+        function = (explicitTypesEnabled && version >= 310)
+                   ? findFunctionExplicitTypes(loc, call, builtIn)
+                   : ((extensionTurnedOn(E_GL_EXT_shader_implicit_conversions) && version >= 310)
+                      ? findFunction120(loc, call, builtIn)
+                      : findFunctionExact(loc, call, builtIn));
     else if (version < 120)
         function = findFunctionExact(loc, call, builtIn);
-    else if (version < 400)
-        function = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn);
+    else if (version < 400) {
+        bool needfindFunction400 = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) || extensionTurnedOn(E_GL_ARB_gpu_shader5);
+        function = needfindFunction400 ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn);
+    }
     else if (explicitTypesEnabled)
         function = findFunctionExplicitTypes(loc, call, builtIn);
     else
@@ -7473,7 +7698,13 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode*
             return nullptr;
     }
 
-    return intermediate.setAggregateOperator(aggrNode, op, type, loc);
+    TIntermTyped *ret_node = intermediate.setAggregateOperator(aggrNode, op, type, loc);
+
+    TIntermAggregate *agg_node = ret_node->getAsAggregate();
+    if (agg_node && (agg_node->isVector() || agg_node->isArray() || agg_node->isMatrix()))
+        agg_node->updatePrecision();
+
+    return ret_node;
 }
 
 // Function for constructor implementation. Calls addUnaryMath with appropriate EOp value
@@ -7928,6 +8159,10 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
             memberQualifier.perViewNV = currentBlockQualifier.perViewNV;
         if (currentBlockQualifier.perTaskNV)
             memberQualifier.perTaskNV = currentBlockQualifier.perTaskNV;
+        if (memberQualifier.storage == EvqSpirvStorageClass)
+            error(memberLoc, "member cannot have a spirv_storage_class qualifier", memberType.getFieldName().c_str(), "");
+        if (memberQualifier.hasSprivDecorate() && !memberQualifier.getSpirvDecorate().decorateIds.empty())
+            error(memberLoc, "member cannot have a spirv_decorate_id qualifier", memberType.getFieldName().c_str(), "");
 #endif
         if ((currentBlockQualifier.storage == EvqUniform || currentBlockQualifier.storage == EvqBuffer) && (memberQualifier.isInterpolation() || memberQualifier.isAuxiliary()))
             error(memberLoc, "member of uniform or buffer block cannot have an auxiliary or interpolation qualifier", memberType.getFieldName().c_str(), "");
@@ -8518,8 +8753,8 @@ void TParseContext::fixBlockUniformLayoutMatrix(TQualifier& qualifier, TTypeList
 }
 
 //
-// Spread LayoutPacking to block member, if a  block member is a struct, we need spread LayoutPacking to
-// this struct member too. and keep this rule for recursive.
+// Spread LayoutPacking to matrix or aggregate block members. If a block member is a struct or
+// array of struct, spread LayoutPacking recursively to its matrix or aggregate members.
 //
 void TParseContext::fixBlockUniformLayoutPacking(TQualifier& qualifier, TTypeList* originTypeList,
                                                  TTypeList* tmpTypeList)
@@ -8528,11 +8763,13 @@ void TParseContext::fixBlockUniformLayoutPacking(TQualifier& qualifier, TTypeLis
     for (unsigned int member = 0; member < originTypeList->size(); ++member) {
         if (qualifier.layoutPacking != ElpNone) {
             if (tmpTypeList == nullptr) {
-                if ((*originTypeList)[member].type->getQualifier().layoutPacking == ElpNone) {
+                if ((*originTypeList)[member].type->getQualifier().layoutPacking == ElpNone &&
+                    !(*originTypeList)[member].type->isScalarOrVector()) {
                     (*originTypeList)[member].type->getQualifier().layoutPacking = qualifier.layoutPacking;
                 }
             } else {
-                if ((*tmpTypeList)[member].type->getQualifier().layoutPacking == ElpNone) {
+                if ((*tmpTypeList)[member].type->getQualifier().layoutPacking == ElpNone &&
+                    !(*tmpTypeList)[member].type->isScalarOrVector()) {
                     (*tmpTypeList)[member].type->getQualifier().layoutPacking = qualifier.layoutPacking;
                 }
             }
@@ -9013,11 +9250,14 @@ TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expre
         // "it is an error to have no statement between a label and the end of the switch statement."
         // The specifications were updated to remove this (being ill-defined what a "statement" was),
         // so, this became a warning.  However, 3.0 tests still check for the error.
-        if (isEsProfile() && version <= 300 && ! relaxedErrors())
+        if (isEsProfile() && (version <= 300 || version >= 320) && ! relaxedErrors())
+            error(loc, "last case/default label not followed by statements", "switch", "");
+        else if (!isEsProfile() && (version <= 430 || version >= 460))
             error(loc, "last case/default label not followed by statements", "switch", "");
         else
             warn(loc, "last case/default label not followed by statements", "switch", "");
 
+
         // emulate a break for error recovery
         lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc));
         lastStatements->setOperator(EOpSequence);

+ 17 - 0
src/libraries/glslang/glslang/MachineIndependent/ParseHelper.h

@@ -241,6 +241,7 @@ protected:
     // override this to set the language-specific name
     virtual const char* getAtomicCounterBlockName() const { return ""; }
     virtual void setAtomicCounterBlockDefaults(TType&) const {}
+    virtual void setInvariant(const TSourceLoc&, const char*) {}
     virtual void finalizeAtomicCounterBlockLayout(TVariable&) {}
     bool isAtomicCounterBlock(const TSymbol& symbol) {
         const TVariable* var = symbol.getAsVariable();
@@ -470,6 +471,21 @@ public:
     void handleSwitchAttributes(const TAttributes& attributes, TIntermNode*);
     // Determine loop control from attributes
     void handleLoopAttributes(const TAttributes& attributes, TIntermNode*);
+    // Function attributes
+    void handleFunctionAttributes(const TSourceLoc&, const TAttributes&);
+
+    // GL_EXT_spirv_intrinsics
+    TSpirvRequirement* makeSpirvRequirement(const TSourceLoc& loc, const TString& name,
+                                            const TIntermAggregate* extensions, const TIntermAggregate* capabilities);
+    TSpirvRequirement* mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1,
+                                                TSpirvRequirement* spirvReq2);
+    TSpirvTypeParameters* makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant);
+    TSpirvTypeParameters* mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1,
+                                                   TSpirvTypeParameters* spirvTypeParams2);
+    TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value);
+    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);
@@ -495,6 +511,7 @@ protected:
     virtual const char* getAtomicCounterBlockName() const override;
     virtual void finalizeAtomicCounterBlockLayout(TVariable&) override;
     virtual void setAtomicCounterBlockDefaults(TType& block) const override;
+    virtual void setInvariant(const TSourceLoc& loc, const char* builtin) override;
 
 public:
     //

+ 27 - 0
src/libraries/glslang/glslang/MachineIndependent/Scan.cpp

@@ -586,6 +586,18 @@ void TScanContext::fillInKeywordMap()
     (*KeywordMap)["f64mat4x2"] =               F64MAT4X2;
     (*KeywordMap)["f64mat4x3"] =               F64MAT4X3;
     (*KeywordMap)["f64mat4x4"] =               F64MAT4X4;
+
+    // GL_EXT_spirv_intrinsics
+    (*KeywordMap)["spirv_instruction"] =       SPIRV_INSTRUCTION;
+    (*KeywordMap)["spirv_execution_mode"] =    SPIRV_EXECUTION_MODE;
+    (*KeywordMap)["spirv_execution_mode_id"] = SPIRV_EXECUTION_MODE_ID;
+    (*KeywordMap)["spirv_decorate"] =          SPIRV_DECORATE;
+    (*KeywordMap)["spirv_decorate_id"] =       SPIRV_DECORATE_ID;
+    (*KeywordMap)["spirv_decorate_string"] =   SPIRV_DECORATE_STRING;
+    (*KeywordMap)["spirv_type"] =              SPIRV_TYPE;
+    (*KeywordMap)["spirv_storage_class"] =     SPIRV_STORAGE_CLASS;
+    (*KeywordMap)["spirv_by_reference"] =      SPIRV_BY_REFERENCE;
+    (*KeywordMap)["spirv_literal"] =           SPIRV_LITERAL;
 #endif
 
     (*KeywordMap)["sampler2D"] =               SAMPLER2D;
@@ -1765,6 +1777,21 @@ int TScanContext::tokenizeIdentifier()
             return keyword;
         else
             return identifierOrType();
+
+    case SPIRV_INSTRUCTION:
+    case SPIRV_EXECUTION_MODE:
+    case SPIRV_EXECUTION_MODE_ID:
+    case SPIRV_DECORATE:
+    case SPIRV_DECORATE_ID:
+    case SPIRV_DECORATE_STRING:
+    case SPIRV_TYPE:
+    case SPIRV_STORAGE_CLASS:
+    case SPIRV_BY_REFERENCE:
+    case SPIRV_LITERAL:
+        if (parseContext.symbolTable.atBuiltInLevel() ||
+            parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
+            return keyword;
+        return identifierOrType();
 #endif
 
     default:

+ 6 - 3
src/libraries/glslang/glslang/MachineIndependent/ShaderLang.cpp

@@ -1343,7 +1343,6 @@ int ShInitialize()
 
     glslang::GetGlobalLock();
     ++NumberOfClients;
-    glslang::ReleaseGlobalLock();
 
     if (PerProcessGPA == nullptr)
         PerProcessGPA = new TPoolAllocator();
@@ -1353,6 +1352,7 @@ int ShInitialize()
     glslang::HlslScanContext::fillInKeywordMap();
 #endif
 
+    glslang::ReleaseGlobalLock();
     return 1;
 }
 
@@ -1415,9 +1415,10 @@ int ShFinalize()
     --NumberOfClients;
     assert(NumberOfClients >= 0);
     bool finalize = NumberOfClients == 0;
-    glslang::ReleaseGlobalLock();
-    if (! finalize)
+    if (! finalize) {
+        glslang::ReleaseGlobalLock();
         return 1;
+    }
 
     for (int version = 0; version < VersionCount; ++version) {
         for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) {
@@ -1455,6 +1456,7 @@ int ShFinalize()
     glslang::HlslScanContext::deleteKeywordMap();
 #endif
 
+    glslang::ReleaseGlobalLock();
     return 1;
 }
 
@@ -1827,6 +1829,7 @@ void  TShader::setUniqueId(unsigned long long id)
 }
 
 void TShader::setInvertY(bool invert)                   { intermediate->setInvertY(invert); }
+void TShader::setDxPositionW(bool invert)               { intermediate->setDxPositionW(invert); }
 void TShader::setNanMinMaxClamp(bool useNonNan)         { intermediate->setNanMinMaxClamp(useNonNan); }
 
 #ifndef GLSLANG_WEB

+ 350 - 0
src/libraries/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp

@@ -0,0 +1,350 @@
+//
+// Copyright(C) 2021 Advanced Micro Devices, Inc.
+//
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+//
+//    Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+//
+//    Redistributions in binary form must reproduce the above
+//    copyright notice, this list of conditions and the following
+//    disclaimer in the documentation and/or other materials provided
+//    with the distribution.
+//
+//    Neither the name of 3Dlabs Inc. Ltd. nor the names of its
+//    contributors may be used to endorse or promote products derived
+//    from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+
+#ifndef GLSLANG_WEB
+
+//
+// GL_EXT_spirv_intrinsics
+//
+#include "../Include/intermediate.h"
+#include "../Include/SpirvIntrinsics.h"
+#include "../Include/Types.h"
+#include "ParseHelper.h"
+
+namespace glslang {
+
+//
+// Handle SPIR-V requirements
+//
+TSpirvRequirement* TParseContext::makeSpirvRequirement(const TSourceLoc& loc, const TString& name,
+                                                       const TIntermAggregate* extensions,
+                                                       const TIntermAggregate* capabilities)
+{
+    TSpirvRequirement* spirvReq = new TSpirvRequirement;
+
+    if (name == "extensions") {
+        assert(extensions);
+        for (auto extension : extensions->getSequence()) {
+            assert(extension->getAsConstantUnion());
+            spirvReq->extensions.insert(*extension->getAsConstantUnion()->getConstArray()[0].getSConst());
+        }
+    } else if (name == "capabilities") {
+        assert(capabilities);
+        for (auto capability : capabilities->getSequence()) {
+            assert(capability->getAsConstantUnion());
+            spirvReq->capabilities.insert(capability->getAsConstantUnion()->getConstArray()[0].getIConst());
+        }
+    } else
+        error(loc, "unknow SPIR-V requirement", name.c_str(), "");
+
+    return spirvReq;
+}
+
+TSpirvRequirement* TParseContext::mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1,
+                                                         TSpirvRequirement* spirvReq2)
+{
+    // Merge the second SPIR-V requirement to the first one
+    if (!spirvReq2->extensions.empty()) {
+        if (spirvReq1->extensions.empty())
+            spirvReq1->extensions = spirvReq2->extensions;
+        else
+            error(loc, "too many SPIR-V requirements", "extensions", "");
+    }
+
+    if (!spirvReq2->capabilities.empty()) {
+        if (spirvReq1->capabilities.empty())
+            spirvReq1->capabilities = spirvReq2->capabilities;
+        else
+            error(loc, "too many SPIR-V requirements", "capabilities", "");
+    }
+
+    return spirvReq1;
+}
+
+void TIntermediate::insertSpirvRequirement(const TSpirvRequirement* spirvReq)
+{
+    if (!spirvRequirement)
+        spirvRequirement = new TSpirvRequirement;
+
+    for (auto extension : spirvReq->extensions)
+        spirvRequirement->extensions.insert(extension);
+
+    for (auto capability : spirvReq->capabilities)
+        spirvRequirement->capabilities.insert(capability);
+}
+
+//
+// Handle SPIR-V execution modes
+//
+void TIntermediate::insertSpirvExecutionMode(int executionMode, const TIntermAggregate* args)
+{
+    if (!spirvExecutionMode)
+        spirvExecutionMode = new TSpirvExecutionMode;
+
+    TVector<const TIntermConstantUnion*> extraOperands;
+    if (args) {
+        for (auto arg : args->getSequence()) {
+            auto extraOperand = arg->getAsConstantUnion();
+            assert(extraOperand != nullptr);
+            extraOperands.push_back(extraOperand);
+        }
+    }
+    spirvExecutionMode->modes[executionMode] = extraOperands;
+}
+
+void TIntermediate::insertSpirvExecutionModeId(int executionMode, const TIntermAggregate* args)
+{
+    if (!spirvExecutionMode)
+        spirvExecutionMode = new TSpirvExecutionMode;
+
+    assert(args);
+    TVector<const TIntermTyped*> extraOperands;
+
+    for (auto arg : args->getSequence()) {
+        auto extraOperand = arg->getAsTyped();
+        assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant());
+        extraOperands.push_back(extraOperand);
+    }
+    spirvExecutionMode->modeIds[executionMode] = extraOperands;
+}
+
+//
+// Handle SPIR-V decorate qualifiers
+//
+void TQualifier::setSpirvDecorate(int decoration, const TIntermAggregate* args)
+{
+    if (!spirvDecorate)
+        spirvDecorate = new TSpirvDecorate;
+
+    TVector<const TIntermConstantUnion*> extraOperands;
+    if (args) {
+        for (auto arg : args->getSequence()) {
+            auto extraOperand = arg->getAsConstantUnion();
+            assert(extraOperand != nullptr);
+            extraOperands.push_back(extraOperand);
+        }
+    }
+    spirvDecorate->decorates[decoration] = extraOperands;
+}
+
+void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args)
+{
+    if (!spirvDecorate)
+        spirvDecorate = new TSpirvDecorate;
+
+    assert(args);
+    TVector<const TIntermTyped*> extraOperands;
+    for (auto arg : args->getSequence()) {
+        auto extraOperand = arg->getAsTyped();
+        assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant());
+        extraOperands.push_back(extraOperand);
+    }
+    spirvDecorate->decorateIds[decoration] = extraOperands;
+}
+
+void TQualifier::setSpirvDecorateString(int decoration, const TIntermAggregate* args)
+{
+    if (!spirvDecorate)
+        spirvDecorate = new TSpirvDecorate;
+
+    assert(args);
+    TVector<const TIntermConstantUnion*> extraOperands;
+    for (auto arg : args->getSequence()) {
+        auto extraOperand = arg->getAsConstantUnion();
+        assert(extraOperand != nullptr);
+        extraOperands.push_back(extraOperand);
+    }
+    spirvDecorate->decorateStrings[decoration] = extraOperands;
+}
+
+TString TQualifier::getSpirvDecorateQualifierString() const
+{
+    assert(spirvDecorate);
+
+    TString qualifierString;
+
+    const auto appendFloat = [&](float f) { qualifierString.append(std::to_string(f).c_str()); };
+    const auto appendInt = [&](int i) { qualifierString.append(std::to_string(i).c_str()); };
+    const auto appendUint = [&](unsigned int u) { qualifierString.append(std::to_string(u).c_str()); };
+    const auto appendBool = [&](bool b) { qualifierString.append(std::to_string(b).c_str()); };
+    const auto appendStr = [&](const char* s) { qualifierString.append(s); };
+
+    const auto appendDecorate = [&](const TIntermTyped* constant) {
+        auto& constArray = constant->getAsConstantUnion() != nullptr ? constant->getAsConstantUnion()->getConstArray()
+                                                                     : constant->getAsSymbolNode()->getConstArray();
+        if (constant->getBasicType() == EbtFloat) {
+            float value = static_cast<float>(constArray[0].getDConst());
+            appendFloat(value);
+        }
+        else if (constant->getBasicType() == EbtInt) {
+            int value = constArray[0].getIConst();
+            appendInt(value);
+        }
+        else if (constant->getBasicType() == EbtUint) {
+            unsigned value = constArray[0].getUConst();
+            appendUint(value);
+        }
+        else if (constant->getBasicType() == EbtBool) {
+            bool value = constArray[0].getBConst();
+            appendBool(value);
+        }
+        else if (constant->getBasicType() == EbtString) {
+            const TString* value = constArray[0].getSConst();
+            appendStr(value->c_str());
+        }
+        else
+            assert(0);
+    };
+
+    for (auto& decorate : spirvDecorate->decorates) {
+        appendStr("spirv_decorate(");
+        appendInt(decorate.first);
+        for (auto extraOperand : decorate.second) {
+            appendStr(", ");
+            appendDecorate(extraOperand);
+        }
+        appendStr(") ");
+    }
+
+    for (auto& decorateId : spirvDecorate->decorateIds) {
+        appendStr("spirv_decorate_id(");
+        appendInt(decorateId.first);
+        for (auto extraOperand : decorateId.second) {
+            appendStr(", ");
+            appendDecorate(extraOperand);
+        }
+        appendStr(") ");
+    }
+
+    for (auto& decorateString : spirvDecorate->decorateStrings) {
+        appendStr("spirv_decorate_string(");
+        appendInt(decorateString.first);
+        for (auto extraOperand : decorateString.second) {
+            appendStr(", ");
+            appendDecorate(extraOperand);
+        }
+        appendStr(") ");
+    }
+
+    return qualifierString;
+}
+
+//
+// Handle SPIR-V type specifiers
+//
+void TPublicType::setSpirvType(const TSpirvInstruction& spirvInst, const TSpirvTypeParameters* typeParams)
+{
+    if (!spirvType)
+        spirvType = new TSpirvType;
+
+    basicType = EbtSpirvType;
+    spirvType->spirvInst = spirvInst;
+    if (typeParams)
+        spirvType->typeParams = *typeParams;
+}
+
+TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant)
+{
+    TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters;
+    if (constant->getBasicType() != EbtFloat &&
+        constant->getBasicType() != EbtInt &&
+        constant->getBasicType() != EbtUint &&
+        constant->getBasicType() != EbtBool &&
+        constant->getBasicType() != EbtString)
+        error(loc, "this type not allowed", constant->getType().getBasicString(), "");
+    else {
+        assert(constant);
+        spirvTypeParams->push_back(TSpirvTypeParameter(constant));
+    }
+
+    return spirvTypeParams;
+}
+
+TSpirvTypeParameters* TParseContext::mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, TSpirvTypeParameters* spirvTypeParams2)
+{
+    // Merge SPIR-V type parameters of the second one to the first one
+    for (const auto& spirvTypeParam : *spirvTypeParams2)
+        spirvTypeParams1->push_back(spirvTypeParam);
+    return spirvTypeParams1;
+}
+
+//
+// Handle SPIR-V instruction qualifiers
+//
+TSpirvInstruction* TParseContext::makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value)
+{
+    TSpirvInstruction* spirvInst = new TSpirvInstruction;
+    if (name == "set")
+        spirvInst->set = value;
+    else
+        error(loc, "unknown SPIR-V instruction qualifier", name.c_str(), "");
+
+    return spirvInst;
+}
+
+TSpirvInstruction* TParseContext::makeSpirvInstruction(const TSourceLoc& loc, const TString& name, int value)
+{
+    TSpirvInstruction* spirvInstuction = new TSpirvInstruction;
+    if (name == "id")
+        spirvInstuction->id = value;
+    else
+        error(loc, "unknown SPIR-V instruction qualifier", name.c_str(), "");
+
+    return spirvInstuction;
+}
+
+TSpirvInstruction* TParseContext::mergeSpirvInstruction(const TSourceLoc& loc, TSpirvInstruction* spirvInst1, TSpirvInstruction* spirvInst2)
+{
+    // Merge qualifiers of the second SPIR-V instruction to those of the first one
+    if (!spirvInst2->set.empty()) {
+        if (spirvInst1->set.empty())
+            spirvInst1->set = spirvInst2->set;
+        else
+            error(loc, "too many SPIR-V instruction qualifiers", "spirv_instruction", "(set)");
+    }
+
+    if (spirvInst2->id != -1) {
+        if (spirvInst1->id == -1)
+            spirvInst1->id = spirvInst2->id;
+        else
+            error(loc, "too many SPIR-V instruction qualifiers", "spirv_instruction", "(id)");
+    }
+
+    return spirvInst1;
+}
+
+} // end namespace glslang
+
+#endif // GLSLANG_WEB

+ 30 - 3
src/libraries/glslang/glslang/MachineIndependent/SymbolTable.cpp

@@ -77,6 +77,7 @@ void TType::buildMangledName(TString& mangledName) const
     case EbtAtomicUint:         mangledName += "au";     break;
     case EbtAccStruct:          mangledName += "as";     break;
     case EbtRayQuery:           mangledName += "rq";     break;
+    case EbtSpirvType:          mangledName += "spv-t";  break;
 #endif
     case EbtSampler:
         switch (sampler.type) {
@@ -278,8 +279,14 @@ TFunction::~TFunction()
 //
 TSymbolTableLevel::~TSymbolTableLevel()
 {
-    for (tLevel::iterator it = level.begin(); it != level.end(); ++it)
-        delete (*it).second;
+    for (tLevel::iterator it = level.begin(); it != level.end(); ++it) {
+        const TString& name = it->first;
+        auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(),
+                                      [&name](const std::pair<TString, TString>& i) { return i.first == name; });
+        if (retargetIter == retargetedSymbols.end())
+            delete (*it).second;
+    }
+
 
     delete [] defaultPrecision;
 }
@@ -390,6 +397,9 @@ 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
@@ -414,6 +424,10 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const
     TSymbolTableLevel *symTableLevel = new TSymbolTableLevel();
     symTableLevel->anonId = anonId;
     symTableLevel->thisLevel = thisLevel;
+    symTableLevel->retargetedSymbols.clear();
+    for (auto &s : retargetedSymbols) {
+        symTableLevel->retargetedSymbols.push_back({s.first, s.second});
+    }
     std::vector<bool> containerCopied(anonId, false);
     tLevel::const_iterator iter;
     for (iter = level.begin(); iter != level.end(); ++iter) {
@@ -429,8 +443,21 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const
                 symTableLevel->insert(*container, false);
                 containerCopied[anon->getAnonId()] = true;
             }
-        } else
+        } else {
+            const TString& name = iter->first;
+            auto retargetIter = std::find_if(retargetedSymbols.begin(), retargetedSymbols.end(),
+                                          [&name](const std::pair<TString, TString>& i) { return i.first == name; });
+            if (retargetIter != retargetedSymbols.end())
+                continue;
             symTableLevel->insert(*iter->second->clone(), false);
+        }
+    }
+    // Now point retargeted symbols to the newly created versions of them
+    for (auto &s : retargetedSymbols) {
+        TSymbol* sym = symTableLevel->find(s.second);
+        if (!sym)
+            continue;
+        symTableLevel->insert(s.first, sym);
     }
 
     return symTableLevel;

+ 41 - 3
src/libraries/glslang/glslang/MachineIndependent/SymbolTable.h

@@ -84,7 +84,7 @@ typedef TVector<const char*> TExtensionList;
 class TSymbol {
 public:
     POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
-    explicit TSymbol(const TString *n) :  name(n), extensions(0), writable(true) { }
+    explicit TSymbol(const TString *n) :  name(n), uniqueId(0), extensions(0), writable(true) { }
     virtual TSymbol* clone() const = 0;
     virtual ~TSymbol() { }  // rely on all symbol owned memory coming from the pool
 
@@ -319,6 +319,15 @@ public:
     virtual TParameter& operator[](int i) { assert(writable); return parameters[i]; }
     virtual const TParameter& operator[](int i) const { return parameters[i]; }
 
+#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) && !defined(GLSLANG_ANGLE)
     virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
 #endif
@@ -342,6 +351,10 @@ protected:
                                // This is important for a static member function that has member variables in scope,
                                // but is not allowed to use them, or see hidden symbols instead.
     int  defaultParamCount;
+
+#ifndef GLSLANG_WEB
+    TSpirvInstruction spirvInst; // SPIR-V instruction qualifiers
+#endif
 };
 
 //
@@ -400,13 +413,20 @@ public:
     TSymbolTableLevel() : defaultPrecision(0), anonId(0), thisLevel(false) { }
     ~TSymbolTableLevel();
 
-    bool insert(TSymbol& symbol, bool separateNameSpaces)
+    bool insert(const TString& name, TSymbol* symbol) {
+        return level.insert(tLevelPair(name, symbol)).second;
+    }
+
+    bool insert(TSymbol& symbol, bool separateNameSpaces, const TString& forcedKeyName = TString())
     {
         //
         // returning true means symbol was added to the table with no semantic errors
         //
         const TString& name = symbol.getName();
-        if (name == "") {
+        if (forcedKeyName.length()) {
+            return level.insert(tLevelPair(forcedKeyName, &symbol)).second;
+        }
+        else if (name == "") {
             symbol.getAsVariable()->setAnonId(anonId++);
             // An empty name means an anonymous container, exposing its members to the external scope.
             // Give it a name and insert its members in the symbol table, pointing to the container.
@@ -458,6 +478,16 @@ public:
         return true;
     }
 
+    void retargetSymbol(const TString& from, const TString& to) {
+        tLevel::const_iterator fromIt = level.find(from);
+        tLevel::const_iterator toIt = level.find(to);
+        if (fromIt == level.end() || toIt == level.end())
+            return;
+        delete fromIt->second;
+        level[from] = toIt->second;
+        retargetedSymbols.push_back({from, to});
+    }
+
     TSymbol* find(const TString& name) const
     {
         tLevel::const_iterator it = level.find(name);
@@ -570,6 +600,8 @@ protected:
 
     tLevel level;  // named mappings
     TPrecisionQualifier *defaultPrecision;
+    // pair<FromName, ToName>
+    TVector<std::pair<TString, TString>> retargetedSymbols;
     int anonId;
     bool thisLevel;  // True if this level of the symbol table is a structure scope containing member function
                      // that are supposed to see anonymous access to member variables.
@@ -775,6 +807,12 @@ public:
         return symbol;
     }
 
+    void retargetSymbol(const TString& from, const TString& to) {
+        int level = currentLevel();
+        table[level]->retargetSymbol(from, to);
+    }
+
+
     // Find of a symbol that returns how many layers deep of nested
     // structures-with-member-functions ('this' scopes) deep the symbol was
     // found in.

+ 44 - 3
src/libraries/glslang/glslang/MachineIndependent/Versions.cpp

@@ -165,12 +165,14 @@ void TParseVersions::initializeExtensionBehavior()
         EShTargetLanguageVersion minSpvVersion;
     } extensionData;
 
-    const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4} };
+    const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4},
+                                   {E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4}
+                                 };
 
     for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) {
         // Add only extensions which require > spv1.0 to save space in map
         if (exts[ii].minSpvVersion > EShTargetSpv_1_0) {
-            extensionMinSpv[E_GL_EXT_ray_tracing] = exts[ii].minSpvVersion;
+            extensionMinSpv[exts[ii].extensionName] = exts[ii].minSpvVersion;
         }
     }
 
@@ -199,6 +201,7 @@ void TParseVersions::initializeExtensionBehavior()
     extensionBehavior[E_GL_ARB_explicit_uniform_location]    = EBhDisable;
     extensionBehavior[E_GL_ARB_shader_image_load_store]      = EBhDisable;
     extensionBehavior[E_GL_ARB_shader_atomic_counters]       = EBhDisable;
+    extensionBehavior[E_GL_ARB_shader_atomic_counter_ops]    = EBhDisable;
     extensionBehavior[E_GL_ARB_shader_draw_parameters]       = EBhDisable;
     extensionBehavior[E_GL_ARB_shader_group_vote]            = EBhDisable;
     extensionBehavior[E_GL_ARB_derivative_control]           = EBhDisable;
@@ -223,6 +226,9 @@ void TParseVersions::initializeExtensionBehavior()
     extensionBehavior[E_GL_ARB_shading_language_packing]     = EBhDisable;
     extensionBehavior[E_GL_ARB_texture_query_lod]            = EBhDisable;
     extensionBehavior[E_GL_ARB_vertex_attrib_64bit]          = EBhDisable;
+    extensionBehavior[E_GL_ARB_draw_instanced]               = EBhDisable;
+    extensionBehavior[E_GL_ARB_fragment_coord_conventions]   = EBhDisable;
+
 
     extensionBehavior[E_GL_KHR_shader_subgroup_basic]            = EBhDisable;
     extensionBehavior[E_GL_KHR_shader_subgroup_vote]             = EBhDisable;
@@ -252,6 +258,7 @@ void TParseVersions::initializeExtensionBehavior()
 
     extensionBehavior[E_GL_EXT_shader_16bit_storage]                    = EBhDisable;
     extensionBehavior[E_GL_EXT_shader_8bit_storage]                     = EBhDisable;
+    extensionBehavior[E_GL_EXT_subgroup_uniform_control_flow]           = EBhDisable;
 
     // #line and #include
     extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive]          = EBhDisable;
@@ -281,6 +288,7 @@ void TParseVersions::initializeExtensionBehavior()
     extensionBehavior[E_GL_NV_shader_subgroup_partitioned]           = EBhDisable;
     extensionBehavior[E_GL_NV_shading_rate_image]                    = EBhDisable;
     extensionBehavior[E_GL_NV_ray_tracing]                           = EBhDisable;
+    extensionBehavior[E_GL_NV_ray_tracing_motion_blur]               = EBhDisable;
     extensionBehavior[E_GL_NV_fragment_shader_barycentric]           = EBhDisable;
     extensionBehavior[E_GL_NV_compute_shader_derivatives]            = EBhDisable;
     extensionBehavior[E_GL_NV_shader_texture_footprint]              = EBhDisable;
@@ -333,6 +341,7 @@ void TParseVersions::initializeExtensionBehavior()
     extensionBehavior[E_GL_EXT_shader_image_int64]   = EBhDisable;
     extensionBehavior[E_GL_EXT_terminate_invocation]        = EBhDisable;
     extensionBehavior[E_GL_EXT_shared_memory_block]         = EBhDisable;
+    extensionBehavior[E_GL_EXT_spirv_intrinsics]            = EBhDisable;
 
     // OVR extensions
     extensionBehavior[E_GL_OVR_multiview]                = EBhDisable;
@@ -354,6 +363,7 @@ void TParseVersions::initializeExtensionBehavior()
     extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_int64]   = EBhDisable;
     extensionBehavior[E_GL_EXT_shader_subgroup_extended_types_float16] = EBhDisable;
     extensionBehavior[E_GL_EXT_shader_atomic_float]                    = EBhDisable;
+    extensionBehavior[E_GL_EXT_shader_atomic_float2]                   = EBhDisable;
 }
 
 #endif // GLSLANG_WEB
@@ -417,6 +427,7 @@ void TParseVersions::getPreamble(std::string& preamble)
             }
             if (version >= 310) {
                 preamble += "#define GL_EXT_null_initializer 1\n";
+                preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n";
             }
 
     } else { // !isEsProfile()
@@ -460,6 +471,8 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_ARB_shader_storage_buffer_object 1\n"
             "#define GL_ARB_texture_query_lod 1\n"
             "#define GL_ARB_vertex_attrib_64bit 1\n"
+            "#define GL_ARB_draw_instanced 1\n"
+            "#define GL_ARB_fragment_coord_conventions 1\n"
             "#define GL_EXT_shader_non_constant_global_initializers 1\n"
             "#define GL_EXT_shader_image_load_formatted 1\n"
             "#define GL_EXT_post_depth_coverage 1\n"
@@ -477,6 +490,7 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_EXT_debug_printf 1\n"
             "#define GL_EXT_fragment_shading_rate 1\n"
             "#define GL_EXT_shared_memory_block 1\n"
+            "#define GL_EXT_shader_integer_mix 1\n"
 
             // GL_KHR_shader_subgroup
             "#define GL_KHR_shader_subgroup_basic 1\n"
@@ -494,6 +508,7 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_EXT_ray_tracing 1\n"
             "#define GL_EXT_ray_query 1\n"
             "#define GL_EXT_ray_flags_primitive_culling 1\n"
+            "#define GL_EXT_spirv_intrinsics 1\n"
 
             "#define GL_AMD_shader_ballot 1\n"
             "#define GL_AMD_shader_trinary_minmax 1\n"
@@ -516,6 +531,7 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_NV_shader_subgroup_partitioned 1\n"
             "#define GL_NV_shading_rate_image 1\n"
             "#define GL_NV_ray_tracing 1\n"
+            "#define GL_NV_ray_tracing_motion_blur 1\n"
             "#define GL_NV_fragment_shader_barycentric 1\n"
             "#define GL_NV_compute_shader_derivatives 1\n"
             "#define GL_NV_shader_texture_footprint 1\n"
@@ -538,6 +554,7 @@ void TParseVersions::getPreamble(std::string& preamble)
             "#define GL_EXT_shader_subgroup_extended_types_float16 1\n"
 
             "#define GL_EXT_shader_atomic_float 1\n"
+            "#define GL_EXT_shader_atomic_float2 1\n"
             ;
 
         if (version >= 150) {
@@ -549,6 +566,7 @@ void TParseVersions::getPreamble(std::string& preamble)
         }
         if (version >= 140) {
             preamble += "#define GL_EXT_null_initializer 1\n";
+            preamble += "#define GL_EXT_subgroup_uniform_control_flow 1\n";
         }
 #endif // GLSLANG_WEB
     }
@@ -602,6 +620,29 @@ void TParseVersions::getPreamble(std::string& preamble)
         preamble += "\n";
     }
 #endif
+
+#ifndef GLSLANG_WEB
+    // GL_EXT_spirv_intrinsics
+    if (!isEsProfile()) {
+        switch (language) {
+        case EShLangVertex:         preamble += "#define GL_VERTEX_SHADER 1 \n";                    break;
+        case EShLangTessControl:    preamble += "#define GL_TESSELLATION_CONTROL_SHADER 1 \n";      break;
+        case EShLangTessEvaluation: preamble += "#define GL_TESSELLATION_EVALUATION_SHADER 1 \n";   break;
+        case EShLangGeometry:       preamble += "#define GL_GEOMETRY_SHADER 1 \n";                  break;
+        case EShLangFragment:       preamble += "#define GL_FRAGMENT_SHADER 1 \n";                  break;
+        case EShLangCompute:        preamble += "#define GL_COMPUTE_SHADER 1 \n";                   break;
+        case EShLangRayGen:         preamble += "#define GL_RAY_GENERATION_SHADER_EXT 1 \n";        break;
+        case EShLangIntersect:      preamble += "#define GL_INTERSECTION_SHADER_EXT 1 \n";          break;
+        case EShLangAnyHit:         preamble += "#define GL_ANY_HIT_SHADER_EXT 1 \n";               break;
+        case EShLangClosestHit:     preamble += "#define GL_CLOSEST_HIT_SHADER_EXT 1 \n";           break;
+        case EShLangMiss:           preamble += "#define GL_MISS_SHADER_EXT 1 \n";                  break;
+        case EShLangCallable:       preamble += "#define GL_CALLABLE_SHADER_EXT 1 \n";              break;
+        case EShLangTaskNV:         preamble += "#define GL_TASK_SHADER_NV 1 \n";                   break;
+        case EShLangMeshNV:         preamble += "#define GL_MESH_SHADER_NV 1 \n";                   break;
+        default:                                                                                    break;
+        }
+    }
+#endif
 }
 
 //
@@ -878,7 +919,7 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
     checkExtensionStage(getCurrentLoc(), extension);
 
     // check if extension has additional requirements
-    extensionRequires(getCurrentLoc(), extension ,behaviorString);
+    extensionRequires(getCurrentLoc(), extension, behaviorString);
 
     // update the requested extension
     updateExtensionBehavior(extension, behavior);

+ 7 - 0
src/libraries/glslang/glslang/MachineIndependent/Versions.h

@@ -137,6 +137,7 @@ const char* const E_GL_ARB_explicit_attrib_location     = "GL_ARB_explicit_attri
 const char* const E_GL_ARB_explicit_uniform_location    = "GL_ARB_explicit_uniform_location";
 const char* const E_GL_ARB_shader_image_load_store      = "GL_ARB_shader_image_load_store";
 const char* const E_GL_ARB_shader_atomic_counters       = "GL_ARB_shader_atomic_counters";
+const char* const E_GL_ARB_shader_atomic_counter_ops    = "GL_ARB_shader_atomic_counter_ops";
 const char* const E_GL_ARB_shader_draw_parameters       = "GL_ARB_shader_draw_parameters";
 const char* const E_GL_ARB_shader_group_vote            = "GL_ARB_shader_group_vote";
 const char* const E_GL_ARB_derivative_control           = "GL_ARB_derivative_control";
@@ -161,6 +162,8 @@ const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage
 const char* const E_GL_ARB_shading_language_packing     = "GL_ARB_shading_language_packing";
 const char* const E_GL_ARB_texture_query_lod            = "GL_ARB_texture_query_lod";
 const char* const E_GL_ARB_vertex_attrib_64bit          = "GL_ARB_vertex_attrib_64bit";
+const char* const E_GL_ARB_draw_instanced               = "GL_ARB_draw_instanced";
+const char* const E_GL_ARB_fragment_coord_conventions   = "GL_ARB_fragment_coord_conventions";
 
 const char* const E_GL_KHR_shader_subgroup_basic            = "GL_KHR_shader_subgroup_basic";
 const char* const E_GL_KHR_shader_subgroup_vote             = "GL_KHR_shader_subgroup_vote";
@@ -205,6 +208,8 @@ const char* const E_GL_EXT_fragment_shading_rate            = "GL_EXT_fragment_s
 const char* const E_GL_EXT_shader_image_int64               = "GL_EXT_shader_image_int64";
 const char* const E_GL_EXT_null_initializer                 = "GL_EXT_null_initializer";
 const char* const E_GL_EXT_shared_memory_block              = "GL_EXT_shared_memory_block";
+const char* const E_GL_EXT_subgroup_uniform_control_flow    = "GL_EXT_subgroup_uniform_control_flow";
+const char* const E_GL_EXT_spirv_intrinsics                 = "GL_EXT_spirv_intrinsics";
 
 // Arrays of extensions for the above viewportEXTs duplications
 
@@ -246,6 +251,7 @@ const char* const E_GL_NV_shader_noperspective_interpolation    = "GL_NV_shader_
 const char* const E_GL_NV_shader_subgroup_partitioned           = "GL_NV_shader_subgroup_partitioned";
 const char* const E_GL_NV_shading_rate_image                    = "GL_NV_shading_rate_image";
 const char* const E_GL_NV_ray_tracing                           = "GL_NV_ray_tracing";
+const char* const E_GL_NV_ray_tracing_motion_blur               = "GL_NV_ray_tracing_motion_blur";
 const char* const E_GL_NV_fragment_shader_barycentric           = "GL_NV_fragment_shader_barycentric";
 const char* const E_GL_NV_compute_shader_derivatives            = "GL_NV_compute_shader_derivatives";
 const char* const E_GL_NV_shader_texture_footprint              = "GL_NV_shader_texture_footprint";
@@ -306,6 +312,7 @@ const char* const E_GL_EXT_shader_subgroup_extended_types_float16 = "GL_EXT_shad
 const char* const E_GL_EXT_terminate_invocation = "GL_EXT_terminate_invocation";
 
 const char* const E_GL_EXT_shader_atomic_float = "GL_EXT_shader_atomic_float";
+const char* const E_GL_EXT_shader_atomic_float2 = "GL_EXT_shader_atomic_float2";
 
 // Arrays of extensions for the above AEP duplications
 

+ 25 - 0
src/libraries/glslang/glslang/MachineIndependent/attribute.cpp

@@ -123,6 +123,8 @@ TAttributeType TParseContext::attributeFromName(const TString& name) const
         return EatPeelCount;
     else if (name == "partial_count")
         return EatPartialCount;
+    else if (name == "subgroup_uniform_control_flow")
+        return EatSubgroupUniformControlFlow;
     else
         return EatNone;
 }
@@ -341,6 +343,29 @@ void TParseContext::handleLoopAttributes(const TAttributes& attributes, TIntermN
     }
 }
 
+
+//
+// Function attributes
+//
+void TParseContext::handleFunctionAttributes(const TSourceLoc& loc, const TAttributes& attributes)
+{
+    for (auto it = attributes.begin(); it != attributes.end(); ++it) {
+        if (it->size() > 0) {
+            warn(loc, "attribute with arguments not recognized, skipping", "", "");
+            continue;
+        }
+
+        switch (it->name) {
+        case EatSubgroupUniformControlFlow:
+            intermediate.setSubgroupUniformControlFlow();
+            break;
+        default:
+            warn(loc, "attribute does not apply to a function", "", "");
+            break;
+        }
+    }
+}
+
 } // end namespace glslang
 
 #endif // GLSLANG_WEB

+ 2 - 1
src/libraries/glslang/glslang/MachineIndependent/attribute.h

@@ -118,7 +118,8 @@ namespace glslang {
         EatFormatR8ui,
         EatFormatUnknown,
         EatNonWritable,
-        EatNonReadable
+        EatNonReadable,
+        EatSubgroupUniformControlFlow,
     };
 
     class TIntermAggregate;

File diff suppressed because it is too large
+ 592 - 503
src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp


+ 142 - 129
src/libraries/glslang/glslang/MachineIndependent/glslang_tab.cpp.h

@@ -368,134 +368,144 @@ extern int yydebug;
     USUBPASSINPUTMS = 569,         /* USUBPASSINPUTMS  */
     F16SUBPASSINPUT = 570,         /* F16SUBPASSINPUT  */
     F16SUBPASSINPUTMS = 571,       /* F16SUBPASSINPUTMS  */
-    LEFT_OP = 572,                 /* LEFT_OP  */
-    RIGHT_OP = 573,                /* RIGHT_OP  */
-    INC_OP = 574,                  /* INC_OP  */
-    DEC_OP = 575,                  /* DEC_OP  */
-    LE_OP = 576,                   /* LE_OP  */
-    GE_OP = 577,                   /* GE_OP  */
-    EQ_OP = 578,                   /* EQ_OP  */
-    NE_OP = 579,                   /* NE_OP  */
-    AND_OP = 580,                  /* AND_OP  */
-    OR_OP = 581,                   /* OR_OP  */
-    XOR_OP = 582,                  /* XOR_OP  */
-    MUL_ASSIGN = 583,              /* MUL_ASSIGN  */
-    DIV_ASSIGN = 584,              /* DIV_ASSIGN  */
-    ADD_ASSIGN = 585,              /* ADD_ASSIGN  */
-    MOD_ASSIGN = 586,              /* MOD_ASSIGN  */
-    LEFT_ASSIGN = 587,             /* LEFT_ASSIGN  */
-    RIGHT_ASSIGN = 588,            /* RIGHT_ASSIGN  */
-    AND_ASSIGN = 589,              /* AND_ASSIGN  */
-    XOR_ASSIGN = 590,              /* XOR_ASSIGN  */
-    OR_ASSIGN = 591,               /* OR_ASSIGN  */
-    SUB_ASSIGN = 592,              /* SUB_ASSIGN  */
-    STRING_LITERAL = 593,          /* STRING_LITERAL  */
-    LEFT_PAREN = 594,              /* LEFT_PAREN  */
-    RIGHT_PAREN = 595,             /* RIGHT_PAREN  */
-    LEFT_BRACKET = 596,            /* LEFT_BRACKET  */
-    RIGHT_BRACKET = 597,           /* RIGHT_BRACKET  */
-    LEFT_BRACE = 598,              /* LEFT_BRACE  */
-    RIGHT_BRACE = 599,             /* RIGHT_BRACE  */
-    DOT = 600,                     /* DOT  */
-    COMMA = 601,                   /* COMMA  */
-    COLON = 602,                   /* COLON  */
-    EQUAL = 603,                   /* EQUAL  */
-    SEMICOLON = 604,               /* SEMICOLON  */
-    BANG = 605,                    /* BANG  */
-    DASH = 606,                    /* DASH  */
-    TILDE = 607,                   /* TILDE  */
-    PLUS = 608,                    /* PLUS  */
-    STAR = 609,                    /* STAR  */
-    SLASH = 610,                   /* SLASH  */
-    PERCENT = 611,                 /* PERCENT  */
-    LEFT_ANGLE = 612,              /* LEFT_ANGLE  */
-    RIGHT_ANGLE = 613,             /* RIGHT_ANGLE  */
-    VERTICAL_BAR = 614,            /* VERTICAL_BAR  */
-    CARET = 615,                   /* CARET  */
-    AMPERSAND = 616,               /* AMPERSAND  */
-    QUESTION = 617,                /* QUESTION  */
-    INVARIANT = 618,               /* INVARIANT  */
-    HIGH_PRECISION = 619,          /* HIGH_PRECISION  */
-    MEDIUM_PRECISION = 620,        /* MEDIUM_PRECISION  */
-    LOW_PRECISION = 621,           /* LOW_PRECISION  */
-    PRECISION = 622,               /* PRECISION  */
-    PACKED = 623,                  /* PACKED  */
-    RESOURCE = 624,                /* RESOURCE  */
-    SUPERP = 625,                  /* SUPERP  */
-    FLOATCONSTANT = 626,           /* FLOATCONSTANT  */
-    INTCONSTANT = 627,             /* INTCONSTANT  */
-    UINTCONSTANT = 628,            /* UINTCONSTANT  */
-    BOOLCONSTANT = 629,            /* BOOLCONSTANT  */
-    IDENTIFIER = 630,              /* IDENTIFIER  */
-    TYPE_NAME = 631,               /* TYPE_NAME  */
-    CENTROID = 632,                /* CENTROID  */
-    IN = 633,                      /* IN  */
-    OUT = 634,                     /* OUT  */
-    INOUT = 635,                   /* INOUT  */
-    STRUCT = 636,                  /* STRUCT  */
-    VOID = 637,                    /* VOID  */
-    WHILE = 638,                   /* WHILE  */
-    BREAK = 639,                   /* BREAK  */
-    CONTINUE = 640,                /* CONTINUE  */
-    DO = 641,                      /* DO  */
-    ELSE = 642,                    /* ELSE  */
-    FOR = 643,                     /* FOR  */
-    IF = 644,                      /* IF  */
-    DISCARD = 645,                 /* DISCARD  */
-    RETURN = 646,                  /* RETURN  */
-    SWITCH = 647,                  /* SWITCH  */
-    CASE = 648,                    /* CASE  */
-    DEFAULT = 649,                 /* DEFAULT  */
-    TERMINATE_INVOCATION = 650,    /* TERMINATE_INVOCATION  */
-    TERMINATE_RAY = 651,           /* TERMINATE_RAY  */
-    IGNORE_INTERSECTION = 652,     /* IGNORE_INTERSECTION  */
-    UNIFORM = 653,                 /* UNIFORM  */
-    SHARED = 654,                  /* SHARED  */
-    BUFFER = 655,                  /* BUFFER  */
-    FLAT = 656,                    /* FLAT  */
-    SMOOTH = 657,                  /* SMOOTH  */
-    LAYOUT = 658,                  /* LAYOUT  */
-    DOUBLECONSTANT = 659,          /* DOUBLECONSTANT  */
-    INT16CONSTANT = 660,           /* INT16CONSTANT  */
-    UINT16CONSTANT = 661,          /* UINT16CONSTANT  */
-    FLOAT16CONSTANT = 662,         /* FLOAT16CONSTANT  */
-    INT32CONSTANT = 663,           /* INT32CONSTANT  */
-    UINT32CONSTANT = 664,          /* UINT32CONSTANT  */
-    INT64CONSTANT = 665,           /* INT64CONSTANT  */
-    UINT64CONSTANT = 666,          /* UINT64CONSTANT  */
-    SUBROUTINE = 667,              /* SUBROUTINE  */
-    DEMOTE = 668,                  /* DEMOTE  */
-    PAYLOADNV = 669,               /* PAYLOADNV  */
-    PAYLOADINNV = 670,             /* PAYLOADINNV  */
-    HITATTRNV = 671,               /* HITATTRNV  */
-    CALLDATANV = 672,              /* CALLDATANV  */
-    CALLDATAINNV = 673,            /* CALLDATAINNV  */
-    PAYLOADEXT = 674,              /* PAYLOADEXT  */
-    PAYLOADINEXT = 675,            /* PAYLOADINEXT  */
-    HITATTREXT = 676,              /* HITATTREXT  */
-    CALLDATAEXT = 677,             /* CALLDATAEXT  */
-    CALLDATAINEXT = 678,           /* CALLDATAINEXT  */
-    PATCH = 679,                   /* PATCH  */
-    SAMPLE = 680,                  /* SAMPLE  */
-    NONUNIFORM = 681,              /* NONUNIFORM  */
-    COHERENT = 682,                /* COHERENT  */
-    VOLATILE = 683,                /* VOLATILE  */
-    RESTRICT = 684,                /* RESTRICT  */
-    READONLY = 685,                /* READONLY  */
-    WRITEONLY = 686,               /* WRITEONLY  */
-    DEVICECOHERENT = 687,          /* DEVICECOHERENT  */
-    QUEUEFAMILYCOHERENT = 688,     /* QUEUEFAMILYCOHERENT  */
-    WORKGROUPCOHERENT = 689,       /* WORKGROUPCOHERENT  */
-    SUBGROUPCOHERENT = 690,        /* SUBGROUPCOHERENT  */
-    NONPRIVATE = 691,              /* NONPRIVATE  */
-    SHADERCALLCOHERENT = 692,      /* SHADERCALLCOHERENT  */
-    NOPERSPECTIVE = 693,           /* NOPERSPECTIVE  */
-    EXPLICITINTERPAMD = 694,       /* EXPLICITINTERPAMD  */
-    PERVERTEXNV = 695,             /* PERVERTEXNV  */
-    PERPRIMITIVENV = 696,          /* PERPRIMITIVENV  */
-    PERVIEWNV = 697,               /* PERVIEWNV  */
-    PERTASKNV = 698,               /* PERTASKNV  */
-    PRECISE = 699                  /* PRECISE  */
+    SPIRV_INSTRUCTION = 572,       /* SPIRV_INSTRUCTION  */
+    SPIRV_EXECUTION_MODE = 573,    /* SPIRV_EXECUTION_MODE  */
+    SPIRV_EXECUTION_MODE_ID = 574, /* SPIRV_EXECUTION_MODE_ID  */
+    SPIRV_DECORATE = 575,          /* SPIRV_DECORATE  */
+    SPIRV_DECORATE_ID = 576,       /* SPIRV_DECORATE_ID  */
+    SPIRV_DECORATE_STRING = 577,   /* SPIRV_DECORATE_STRING  */
+    SPIRV_TYPE = 578,              /* SPIRV_TYPE  */
+    SPIRV_STORAGE_CLASS = 579,     /* SPIRV_STORAGE_CLASS  */
+    SPIRV_BY_REFERENCE = 580,      /* SPIRV_BY_REFERENCE  */
+    SPIRV_LITERAL = 581,           /* SPIRV_LITERAL  */
+    LEFT_OP = 582,                 /* LEFT_OP  */
+    RIGHT_OP = 583,                /* RIGHT_OP  */
+    INC_OP = 584,                  /* INC_OP  */
+    DEC_OP = 585,                  /* DEC_OP  */
+    LE_OP = 586,                   /* LE_OP  */
+    GE_OP = 587,                   /* GE_OP  */
+    EQ_OP = 588,                   /* EQ_OP  */
+    NE_OP = 589,                   /* NE_OP  */
+    AND_OP = 590,                  /* AND_OP  */
+    OR_OP = 591,                   /* OR_OP  */
+    XOR_OP = 592,                  /* XOR_OP  */
+    MUL_ASSIGN = 593,              /* MUL_ASSIGN  */
+    DIV_ASSIGN = 594,              /* DIV_ASSIGN  */
+    ADD_ASSIGN = 595,              /* ADD_ASSIGN  */
+    MOD_ASSIGN = 596,              /* MOD_ASSIGN  */
+    LEFT_ASSIGN = 597,             /* LEFT_ASSIGN  */
+    RIGHT_ASSIGN = 598,            /* RIGHT_ASSIGN  */
+    AND_ASSIGN = 599,              /* AND_ASSIGN  */
+    XOR_ASSIGN = 600,              /* XOR_ASSIGN  */
+    OR_ASSIGN = 601,               /* OR_ASSIGN  */
+    SUB_ASSIGN = 602,              /* SUB_ASSIGN  */
+    STRING_LITERAL = 603,          /* STRING_LITERAL  */
+    LEFT_PAREN = 604,              /* LEFT_PAREN  */
+    RIGHT_PAREN = 605,             /* RIGHT_PAREN  */
+    LEFT_BRACKET = 606,            /* LEFT_BRACKET  */
+    RIGHT_BRACKET = 607,           /* RIGHT_BRACKET  */
+    LEFT_BRACE = 608,              /* LEFT_BRACE  */
+    RIGHT_BRACE = 609,             /* RIGHT_BRACE  */
+    DOT = 610,                     /* DOT  */
+    COMMA = 611,                   /* COMMA  */
+    COLON = 612,                   /* COLON  */
+    EQUAL = 613,                   /* EQUAL  */
+    SEMICOLON = 614,               /* SEMICOLON  */
+    BANG = 615,                    /* BANG  */
+    DASH = 616,                    /* DASH  */
+    TILDE = 617,                   /* TILDE  */
+    PLUS = 618,                    /* PLUS  */
+    STAR = 619,                    /* STAR  */
+    SLASH = 620,                   /* SLASH  */
+    PERCENT = 621,                 /* PERCENT  */
+    LEFT_ANGLE = 622,              /* LEFT_ANGLE  */
+    RIGHT_ANGLE = 623,             /* RIGHT_ANGLE  */
+    VERTICAL_BAR = 624,            /* VERTICAL_BAR  */
+    CARET = 625,                   /* CARET  */
+    AMPERSAND = 626,               /* AMPERSAND  */
+    QUESTION = 627,                /* QUESTION  */
+    INVARIANT = 628,               /* INVARIANT  */
+    HIGH_PRECISION = 629,          /* HIGH_PRECISION  */
+    MEDIUM_PRECISION = 630,        /* MEDIUM_PRECISION  */
+    LOW_PRECISION = 631,           /* LOW_PRECISION  */
+    PRECISION = 632,               /* PRECISION  */
+    PACKED = 633,                  /* PACKED  */
+    RESOURCE = 634,                /* RESOURCE  */
+    SUPERP = 635,                  /* SUPERP  */
+    FLOATCONSTANT = 636,           /* FLOATCONSTANT  */
+    INTCONSTANT = 637,             /* INTCONSTANT  */
+    UINTCONSTANT = 638,            /* UINTCONSTANT  */
+    BOOLCONSTANT = 639,            /* BOOLCONSTANT  */
+    IDENTIFIER = 640,              /* IDENTIFIER  */
+    TYPE_NAME = 641,               /* TYPE_NAME  */
+    CENTROID = 642,                /* CENTROID  */
+    IN = 643,                      /* IN  */
+    OUT = 644,                     /* OUT  */
+    INOUT = 645,                   /* INOUT  */
+    STRUCT = 646,                  /* STRUCT  */
+    VOID = 647,                    /* VOID  */
+    WHILE = 648,                   /* WHILE  */
+    BREAK = 649,                   /* BREAK  */
+    CONTINUE = 650,                /* CONTINUE  */
+    DO = 651,                      /* DO  */
+    ELSE = 652,                    /* ELSE  */
+    FOR = 653,                     /* FOR  */
+    IF = 654,                      /* IF  */
+    DISCARD = 655,                 /* DISCARD  */
+    RETURN = 656,                  /* RETURN  */
+    SWITCH = 657,                  /* SWITCH  */
+    CASE = 658,                    /* CASE  */
+    DEFAULT = 659,                 /* DEFAULT  */
+    TERMINATE_INVOCATION = 660,    /* TERMINATE_INVOCATION  */
+    TERMINATE_RAY = 661,           /* TERMINATE_RAY  */
+    IGNORE_INTERSECTION = 662,     /* IGNORE_INTERSECTION  */
+    UNIFORM = 663,                 /* UNIFORM  */
+    SHARED = 664,                  /* SHARED  */
+    BUFFER = 665,                  /* BUFFER  */
+    FLAT = 666,                    /* FLAT  */
+    SMOOTH = 667,                  /* SMOOTH  */
+    LAYOUT = 668,                  /* LAYOUT  */
+    DOUBLECONSTANT = 669,          /* DOUBLECONSTANT  */
+    INT16CONSTANT = 670,           /* INT16CONSTANT  */
+    UINT16CONSTANT = 671,          /* UINT16CONSTANT  */
+    FLOAT16CONSTANT = 672,         /* FLOAT16CONSTANT  */
+    INT32CONSTANT = 673,           /* INT32CONSTANT  */
+    UINT32CONSTANT = 674,          /* UINT32CONSTANT  */
+    INT64CONSTANT = 675,           /* INT64CONSTANT  */
+    UINT64CONSTANT = 676,          /* UINT64CONSTANT  */
+    SUBROUTINE = 677,              /* SUBROUTINE  */
+    DEMOTE = 678,                  /* DEMOTE  */
+    PAYLOADNV = 679,               /* PAYLOADNV  */
+    PAYLOADINNV = 680,             /* PAYLOADINNV  */
+    HITATTRNV = 681,               /* HITATTRNV  */
+    CALLDATANV = 682,              /* CALLDATANV  */
+    CALLDATAINNV = 683,            /* CALLDATAINNV  */
+    PAYLOADEXT = 684,              /* PAYLOADEXT  */
+    PAYLOADINEXT = 685,            /* PAYLOADINEXT  */
+    HITATTREXT = 686,              /* HITATTREXT  */
+    CALLDATAEXT = 687,             /* CALLDATAEXT  */
+    CALLDATAINEXT = 688,           /* CALLDATAINEXT  */
+    PATCH = 689,                   /* PATCH  */
+    SAMPLE = 690,                  /* SAMPLE  */
+    NONUNIFORM = 691,              /* NONUNIFORM  */
+    COHERENT = 692,                /* COHERENT  */
+    VOLATILE = 693,                /* VOLATILE  */
+    RESTRICT = 694,                /* RESTRICT  */
+    READONLY = 695,                /* READONLY  */
+    WRITEONLY = 696,               /* WRITEONLY  */
+    DEVICECOHERENT = 697,          /* DEVICECOHERENT  */
+    QUEUEFAMILYCOHERENT = 698,     /* QUEUEFAMILYCOHERENT  */
+    WORKGROUPCOHERENT = 699,       /* WORKGROUPCOHERENT  */
+    SUBGROUPCOHERENT = 700,        /* SUBGROUPCOHERENT  */
+    NONPRIVATE = 701,              /* NONPRIVATE  */
+    SHADERCALLCOHERENT = 702,      /* SHADERCALLCOHERENT  */
+    NOPERSPECTIVE = 703,           /* NOPERSPECTIVE  */
+    EXPLICITINTERPAMD = 704,       /* EXPLICITINTERPAMD  */
+    PERVERTEXNV = 705,             /* PERVERTEXNV  */
+    PERPRIMITIVENV = 706,          /* PERPRIMITIVENV  */
+    PERVIEWNV = 707,               /* PERVIEWNV  */
+    PERTASKNV = 708,               /* PERTASKNV  */
+    PRECISE = 709                  /* PRECISE  */
   };
   typedef enum yytokentype yytoken_kind_t;
 #endif
@@ -527,6 +537,9 @@ union YYSTYPE
             glslang::TIntermNodePair nodePair;
             glslang::TIntermTyped* intermTypedNode;
             glslang::TAttributes* attributes;
+            glslang::TSpirvRequirement* spirvReq;
+            glslang::TSpirvInstruction* spirvInst;
+            glslang::TSpirvTypeParameters* spirvTypeParams;
         };
         union {
             glslang::TPublicType type;
@@ -540,7 +553,7 @@ union YYSTYPE
         glslang::TArraySizes* typeParameters;
     } interm;
 
-#line 544 "MachineIndependent/glslang_tab.cpp.h"
+#line 557 "MachineIndependent/glslang_tab.cpp.h"
 
 };
 typedef union YYSTYPE YYSTYPE;

+ 12 - 31
src/libraries/glslang/glslang/MachineIndependent/intermOut.cpp

@@ -48,37 +48,6 @@
 #endif
 #include <cstdint>
 
-namespace {
-
-bool IsInfinity(double x) {
-#ifdef _MSC_VER
-    switch (_fpclass(x)) {
-    case _FPCLASS_NINF:
-    case _FPCLASS_PINF:
-        return true;
-    default:
-        return false;
-    }
-#else
-    return std::isinf(x);
-#endif
-}
-
-bool IsNan(double x) {
-#ifdef _MSC_VER
-    switch (_fpclass(x)) {
-    case _FPCLASS_SNAN:
-    case _FPCLASS_QNAN:
-        return true;
-    default:
-        return false;
-    }
-#else
-  return std::isnan(x);
-#endif
-}
-
-}
 
 namespace glslang {
 
@@ -696,6 +665,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
 
     case EOpConstructReference: out.debug << "Construct reference type"; break;
 
+#ifndef GLSLANG_WEB
+    case EOpSpirvInst: out.debug << "spirv_instruction"; break;
+#endif
+
     default: out.debug.message(EPrefixError, "Bad unary op");
     }
 
@@ -1085,6 +1058,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpSubpassLoadMS: out.debug << "subpassLoadMS"; break;
 
     case EOpTraceNV:                          out.debug << "traceNV"; break;
+    case EOpTraceRayMotionNV:                 out.debug << "traceRayMotionNV"; break;
     case EOpTraceKHR:                         out.debug << "traceRayKHR"; break;
     case EOpReportIntersection:               out.debug << "reportIntersectionNV"; break;
     case EOpIgnoreIntersectionNV:             out.debug << "ignoreIntersectionNV"; break;
@@ -1126,6 +1100,10 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
     case EOpIsHelperInvocation: out.debug << "IsHelperInvocation"; break;
     case EOpDebugPrintf:  out.debug << "Debug printf";  break;
 
+#ifndef GLSLANG_WEB
+    case EOpSpirvInst: out.debug << "spirv_instruction"; break;
+#endif
+
     default: out.debug.message(EPrefixError, "Bad aggregation op");
     }
 
@@ -1487,6 +1465,9 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
     if (xfbMode)
         infoSink.debug << "in xfb mode\n";
 
+    if (getSubgroupUniformControlFlow())
+        infoSink.debug << "subgroup_uniform_control_flow\n";
+
     switch (language) {
     case EShLangVertex:
         break;

+ 69 - 19
src/libraries/glslang/glslang/MachineIndependent/iomapper.cpp

@@ -79,7 +79,7 @@ public:
             target = &inputList;
         else if (base->getQualifier().storage == EvqVaryingOut)
             target = &outputList;
-        else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant())
+        else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant() && !base->getQualifier().isShaderRecord())
             target = &uniformList;
         // If a global is being visited, then we should also traverse it incase it's evaluation
         // ends up visiting inputs we want to tag as live
@@ -514,6 +514,24 @@ struct TSymbolValidater
                         return;
                     }
                     else {
+                        // Deal with input/output pairs where one is a block member but the other is loose,
+                        // e.g. with ARB_separate_shader_objects
+                        if (type1.getBasicType() == EbtBlock &&
+                            type1.isStruct() && !type2.isStruct()) {
+                            // Iterate through block members tracking layout
+                            glslang::TString name;
+                            type1.getStruct()->begin()->type->appendMangledName(name);
+                            if (name == mangleName2
+                                && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return;
+                        }
+                        if (type2.getBasicType() == EbtBlock &&
+                            type2.isStruct() && !type1.isStruct()) {
+                            // Iterate through block members tracking layout
+                            glslang::TString name;
+                            type2.getStruct()->begin()->type->appendMangledName(name);
+                            if (name == mangleName1
+                                && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return;
+                        }
                         TString err = "Invalid In/Out variable type : " + entKey.first;
                         infoSink.info.message(EPrefixInternalError, err.c_str());
                         hadError = true;
@@ -748,7 +766,7 @@ private:
 };
 
 TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate)
-    : intermediate(intermediate)
+    : referenceIntermediate(intermediate)
     , nextUniformLocation(intermediate.getUniformLocationBase())
     , nextInputLocation(0)
     , nextOutputLocation(0)
@@ -760,17 +778,17 @@ TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate
 
 int TDefaultIoResolverBase::getBaseBinding(EShLanguage stage, TResourceType res, unsigned int set) const {
     return stageIntermediates[stage] ? selectBaseBinding(stageIntermediates[stage]->getShiftBinding(res), stageIntermediates[stage]->getShiftBindingForSet(res, set))
-                                     : selectBaseBinding(intermediate.getShiftBinding(res), intermediate.getShiftBindingForSet(res, set));
+                                     : selectBaseBinding(referenceIntermediate.getShiftBinding(res), referenceIntermediate.getShiftBindingForSet(res, set));
 }
 
 const std::vector<std::string>& TDefaultIoResolverBase::getResourceSetBinding(EShLanguage stage) const {
     return stageIntermediates[stage] ? stageIntermediates[stage]->getResourceSetBinding()
-                                     : intermediate.getResourceSetBinding();
+                                     : referenceIntermediate.getResourceSetBinding();
 }
 
-bool TDefaultIoResolverBase::doAutoBindingMapping() const { return intermediate.getAutoMapBindings(); }
+bool TDefaultIoResolverBase::doAutoBindingMapping() const { return referenceIntermediate.getAutoMapBindings(); }
 
-bool TDefaultIoResolverBase::doAutoLocationMapping() const { return intermediate.getAutoMapLocations(); }
+bool TDefaultIoResolverBase::doAutoLocationMapping() const { return referenceIntermediate.getAutoMapLocations(); }
 
 TDefaultIoResolverBase::TSlotSet::iterator TDefaultIoResolverBase::findSlot(int set, int slot) {
     return std::lower_bound(slots[set].begin(), slots[set].end(), slot);
@@ -827,7 +845,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
     }
     // no locations added if already present, a built-in variable, a block, or an opaque
     if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock ||
-        type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) {
+        type.isAtomic() || type.isSpirvType() || (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) {
         return ent.newLocation = -1;
     }
     // no locations on blocks of built-in variables
@@ -839,7 +857,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
             return ent.newLocation = -1;
         }
     }
-    int location = intermediate.getUniformLocationOverride(name);
+    int location = referenceIntermediate.getUniformLocationOverride(name);
     if (location != -1) {
         return ent.newLocation = location;
     }
@@ -855,8 +873,8 @@ int TDefaultIoResolverBase::resolveInOutLocation(EShLanguage stage, TVarEntryInf
         return ent.newLocation = -1;
     }
 
-    // no locations added if already present, or a built-in variable
-    if (type.getQualifier().hasLocation() || type.isBuiltIn()) {
+    // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate
+    if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) {
         return ent.newLocation = -1;
     }
 
@@ -942,8 +960,8 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf
     if (type.getQualifier().hasLocation()) {
         return ent.newLocation = type.getQualifier().layoutLocation;
     }
-    // no locations added if already present, or a built-in variable
-    if (type.isBuiltIn()) {
+    // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate
+    if (type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) {
         return ent.newLocation = -1;
     }
     // no locations on blocks of built-in variables
@@ -1024,7 +1042,8 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
     } else {
         // no locations added if already present, a built-in variable, a block, or an opaque
         if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock ||
-            type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) {
+            type.isAtomic() || type.isSpirvType() ||
+            (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) {
             return ent.newLocation = -1;
         }
         // no locations on blocks of built-in variables
@@ -1037,7 +1056,7 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
             }
         }
     }
-    int location = intermediate.getUniformLocationOverride(name.c_str());
+    int location = referenceIntermediate.getUniformLocationOverride(name.c_str());
     if (location != -1) {
         return ent.newLocation = location;
     }
@@ -1086,7 +1105,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent
     const TType& type = ent.symbol->getType();
     const TString& name = ent.symbol->getAccessName();
     // On OpenGL arrays of opaque types take a separate binding for each element
-    int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+    int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
     TResourceType resource = getResourceType(type);
     // don't need to handle uniform symbol, it will be handled in resolveUniformLocation
     if (resource == EResUbo && type.getBasicType() != EbtBlock) {
@@ -1095,7 +1114,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent
     // There is no 'set' qualifier in OpenGL shading language, each resource has its own
     // binding name space, so remap the 'set' to resource type which make each resource
     // binding is valid from 0 to MAX_XXRESOURCE_BINDINGS
-    int set = intermediate.getSpv().openGl != 0 ? resource : ent.newSet;
+    int set = referenceIntermediate.getSpv().openGl != 0 ? resource : ent.newSet;
     int resourceKey = set;
     if (resource < EResCount) {
         if (type.getQualifier().hasBinding()) {
@@ -1223,7 +1242,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
     const TType& type = ent.symbol->getType();
     const TString& name = ent.symbol->getAccessName();
     TResourceType resource = getResourceType(type);
-    int set = intermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent);
+    int set = referenceIntermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent);
     int resourceKey = set;
 
     if (type.getQualifier().hasBinding()) {
@@ -1233,7 +1252,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
 
         if (iter == varSlotMap.end()) {
             // Reserve the slots for the ubo, ssbo and opaques who has explicit binding
-            int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+            int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
             varSlotMap[name] = binding;
             reserveSlot(resourceKey, binding, numBindings);
         } else {
@@ -1288,7 +1307,7 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase {
         const TType& type = ent.symbol->getType();
         const int set = getLayoutSet(type);
         // On OpenGL arrays of opaque types take a seperate binding for each element
-        int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+        int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
         TResourceType resource = getResourceType(type);
         if (resource < EResCount) {
             if (type.getQualifier().hasBinding()) {
@@ -1633,6 +1652,37 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
             return TVarEntryInfo::TOrderByPriority()(p1.second, p2.second);
         });
         resolver->endResolve(EShLangCount);
+        if (autoPushConstantBlockName.length()) {
+            bool upgraded = false;
+            for (size_t stage = 0; stage < EShLangCount; stage++) {
+                if (intermediates[stage] != nullptr) {
+                    TVarLiveMap** pUniformVarMap = uniformResolve.uniformVarMap;
+                    auto at = pUniformVarMap[stage]->find(autoPushConstantBlockName);
+                    if (at == pUniformVarMap[stage]->end())
+                        continue;
+                    TQualifier& qualifier = at->second.symbol->getQualifier();
+                    if (!qualifier.isUniform())
+                        continue;
+                    TType& t = at->second.symbol->getWritableType();
+                    int size, stride;
+                    TIntermediate::getBaseAlignment(t, size, stride, autoPushConstantBlockPacking,
+                                                    qualifier.layoutMatrix == ElmRowMajor);
+                    if (size <= int(autoPushConstantMaxSize)) {
+                        qualifier.setBlockStorage(EbsPushConstant);
+                        qualifier.layoutPacking = autoPushConstantBlockPacking;
+                        upgraded = true;
+                    }
+                }
+            }
+            // If it's been upgraded to push_constant, then remove it from the uniformVector
+            // so it doesn't get a set/binding assigned to it.
+            if (upgraded) {
+                auto at = std::find_if(uniformVector.begin(), uniformVector.end(),
+                                       [this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; });
+                if (at != uniformVector.end())
+                    uniformVector.erase(at);
+            }
+        }
         for (size_t stage = 0; stage < EShLangCount; stage++) {
             if (intermediates[stage] != nullptr) {
                 // traverse each stage, set new location to each input/output and unifom symbol, set new binding to

+ 16 - 2
src/libraries/glslang/glslang/MachineIndependent/iomapper.h

@@ -165,7 +165,7 @@ public:
 protected:
     TDefaultIoResolverBase(TDefaultIoResolverBase&);
     TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&);
-    const TIntermediate& intermediate;
+    const TIntermediate& referenceIntermediate;
     int nextUniformLocation;
     int nextInputLocation;
     int nextOutputLocation;
@@ -291,7 +291,7 @@ public:
     bool virtual doMap(TIoMapResolver*, TInfoSink&) { return true; }
 };
 
-// I/O mapper for OpenGL
+// I/O mapper for GLSL
 class TGlslIoMapper : public TIoMapper {
 public:
     TGlslIoMapper() {
@@ -301,6 +301,8 @@ public:
         memset(intermediates, 0, sizeof(TIntermediate*) * (EShLangCount + 1));
         profile = ENoProfile;
         version = 0;
+        autoPushConstantMaxSize = 128;
+        autoPushConstantBlockPacking = ElpStd430;
     }
     virtual ~TGlslIoMapper() {
         for (size_t stage = 0; stage < EShLangCount; stage++) {
@@ -320,6 +322,13 @@ public:
                 intermediates[stage] = nullptr;
         }
     }
+    // If set, the uniform block with the given name will be changed to be backed by
+    // push_constant if it's size is <= maxSize
+    void setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) {
+        autoPushConstantBlockName = name;
+        autoPushConstantMaxSize = maxSize;
+        autoPushConstantBlockPacking = packing;
+    }
     // grow the reflection stage by stage
     bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*) override;
     bool doMap(TIoMapResolver*, TInfoSink&) override;
@@ -329,6 +338,11 @@ public:
     bool hadError = false;
     EProfile profile;
     int version;
+
+private:
+    TString autoPushConstantBlockName;
+    unsigned int autoPushConstantMaxSize;
+    TLayoutPacking autoPushConstantBlockPacking;
 };
 
 } // end namespace glslang

+ 26 - 8
src/libraries/glslang/glslang/MachineIndependent/linkValidate.cpp

@@ -312,10 +312,12 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
     MERGE_TRUE(autoMapBindings);
     MERGE_TRUE(autoMapLocations);
     MERGE_TRUE(invertY);
+    MERGE_TRUE(dxPositionW);
     MERGE_TRUE(flattenUniformArrays);
     MERGE_TRUE(useUnknownFormat);
     MERGE_TRUE(hlslOffsets);
     MERGE_TRUE(useStorageBuffer);
+    MERGE_TRUE(invariantAll);
     MERGE_TRUE(hlslIoMapping);
 
     // TODO: sourceFile
@@ -758,7 +760,10 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin
 
                     auto checkName = [this, unitSymbol, &infoSink](const TString& name) {
                         for (unsigned int i = 0; i < unitSymbol->getType().getStruct()->size(); ++i) {
-                            if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName()) {
+                            if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName()
+                                && !((*unitSymbol->getType().getStruct())[i].type->getQualifier().hasLocation()
+                                    || unitSymbol->getType().getQualifier().hasLocation())
+                                ) {
                                 error(infoSink, "Anonymous member name used for global variable or other anonymous member: ");
                                 infoSink.info << (*unitSymbol->getType().getStruct())[i].type->getCompleteString() << "\n";
                             }
@@ -857,9 +862,19 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
     if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock &&
         symbol.getType().getStruct() && unitSymbol.getType().getStruct() &&
         symbol.getType().sameStructType(unitSymbol.getType())) {
-        for (unsigned int i = 0; i < symbol.getType().getStruct()->size(); ++i) {
-            const TQualifier& qualifier = (*symbol.getType().getStruct())[i].type->getQualifier();
-            const TQualifier& unitQualifier = (*unitSymbol.getType().getStruct())[i].type->getQualifier();
+        unsigned int li = 0;
+        unsigned int ri = 0;
+        while (li < symbol.getType().getStruct()->size() && ri < unitSymbol.getType().getStruct()->size()) {
+            if ((*symbol.getType().getStruct())[li].type->hiddenMember()) {
+                ++li;
+                continue;
+            }
+            if ((*unitSymbol.getType().getStruct())[ri].type->hiddenMember()) {
+                ++ri;
+                continue;
+            }
+            const TQualifier& qualifier = (*symbol.getType().getStruct())[li].type->getQualifier();
+            const TQualifier & unitQualifier = (*unitSymbol.getType().getStruct())[ri].type->getQualifier();
             if (qualifier.layoutMatrix     != unitQualifier.layoutMatrix ||
                 qualifier.layoutOffset     != unitQualifier.layoutOffset ||
                 qualifier.layoutAlign      != unitQualifier.layoutAlign ||
@@ -868,6 +883,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
                 error(infoSink, "Interface block member layout qualifiers must match:");
                 writeTypeComparison = true;
             }
+            ++li;
+            ++ri;
         }
     }
 
@@ -953,10 +970,10 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
     //       current implementation only has one offset.
     if (symbol.getQualifier().layoutMatrix    != unitSymbol.getQualifier().layoutMatrix ||
         symbol.getQualifier().layoutPacking   != unitSymbol.getQualifier().layoutPacking ||
-        symbol.getQualifier().layoutLocation  != unitSymbol.getQualifier().layoutLocation ||
+        (symbol.getQualifier().hasLocation() && unitSymbol.getQualifier().hasLocation() && symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation) ||
         symbol.getQualifier().layoutComponent != unitSymbol.getQualifier().layoutComponent ||
         symbol.getQualifier().layoutIndex     != unitSymbol.getQualifier().layoutIndex ||
-        symbol.getQualifier().layoutBinding   != unitSymbol.getQualifier().layoutBinding ||
+        (symbol.getQualifier().hasBinding() && unitSymbol.getQualifier().hasBinding() && symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) ||
         (symbol.getQualifier().hasBinding() && (symbol.getQualifier().layoutOffset != unitSymbol.getQualifier().layoutOffset))) {
         error(infoSink, "Layout qualification must match:");
         writeTypeComparison = true;
@@ -1933,7 +1950,7 @@ int TIntermediate::getBaseAlignment(const TType& type, int& size, int& stride, T
     }
 
     // rule 9
-    if (type.getBasicType() == EbtStruct) {
+    if (type.getBasicType() == EbtStruct || type.getBasicType() == EbtBlock) {
         const TTypeList& memberList = *type.getStruct();
 
         size = 0;
@@ -2158,8 +2175,9 @@ int TIntermediate::computeBufferReferenceTypeSize(const TType& type)
 bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
     return type.isArray() &&
             ((language == EShLangGeometry    && type.getQualifier().storage == EvqVaryingIn) ||
-            (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut &&
+            (language == EShLangTessControl && (type.getQualifier().storage == EvqVaryingIn || type.getQualifier().storage == EvqVaryingOut) &&
                 ! type.getQualifier().patch) ||
+            (language == EShLangTessEvaluation && type.getQualifier().storage == EvqVaryingIn) ||
             (language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn &&
                 type.getQualifier().pervertexNV) ||
             (language == EShLangMeshNV && type.getQualifier().storage == EvqVaryingOut &&

+ 42 - 1
src/libraries/glslang/glslang/MachineIndependent/localintermediate.h

@@ -290,7 +290,9 @@ public:
         resources(TBuiltInResource{}),
         numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
         invertY(false),
+        dxPositionW(false),
         useStorageBuffer(false),
+        invariantAll(false),
         nanMinMaxClamp(false),
         depthReplacing(false),
         uniqueId(0),
@@ -328,7 +330,10 @@ public:
         textureSamplerTransformMode(EShTexSampTransKeep),
         needToLegalize(false),
         binaryDoubleOutput(false),
+        subgroupUniformControlFlow(false),
         usePhysicalStorageBuffer(false),
+        spirvRequirement(nullptr),
+        spirvExecutionMode(nullptr),
         uniformLocationBase(0)
 #endif
     {
@@ -393,6 +398,9 @@ public:
         case EShTargetSpv_1_5:
             processes.addProcess("target-env spirv1.5");
             break;
+        case EShTargetSpv_1_6:
+            processes.addProcess("target-env spirv1.6");
+            break;
         default:
             processes.addProcess("target-env spirvUnknown");
             break;
@@ -456,6 +464,14 @@ public:
     }
     bool getInvertY() const { return invertY; }
 
+    void setDxPositionW(bool dxPosW)
+    {
+      dxPositionW = dxPosW;
+      if (dxPositionW)
+        processes.addProcess("dx-position-w");
+    }
+    bool getDxPositionW() const { return dxPositionW; }
+
 #ifdef ENABLE_HLSL
     void setSource(EShSource s) { source = s; }
     EShSource getSource() const { return source; }
@@ -535,7 +551,7 @@ public:
     TIntermTyped* foldSwizzle(TIntermTyped* node, TSwizzleSelectors<TVectorSelector>& fields, const TSourceLoc&);
 
     // Tree ops
-    static const TIntermTyped* findLValueBase(const TIntermTyped*, bool swizzleOkay);
+    static const TIntermTyped* findLValueBase(const TIntermTyped*, bool swizzleOkay , bool BufferReferenceOk = false);
 
     // Linkage related
     void addSymbolLinkageNodes(TIntermAggregate*& linkage, EShLanguage, TSymbolTable&);
@@ -557,6 +573,8 @@ public:
 
     void setUseStorageBuffer() { useStorageBuffer = true; }
     bool usingStorageBuffer() const { return useStorageBuffer; }
+    void setInvariantAll() { invariantAll = true; }
+    bool isInvariantAll() const { return invariantAll; }
     void setDepthReplacing() { depthReplacing = true; }
     bool isDepthReplacing() const { return depthReplacing; }
     bool setLocalSize(int dim, int size)
@@ -864,6 +882,18 @@ public:
 
     void setBinaryDoubleOutput() { binaryDoubleOutput = true; }
     bool getBinaryDoubleOutput() { return binaryDoubleOutput; }
+
+    void setSubgroupUniformControlFlow() { subgroupUniformControlFlow = true; }
+    bool getSubgroupUniformControlFlow() const { return subgroupUniformControlFlow; }
+
+    // GL_EXT_spirv_intrinsics
+    void insertSpirvRequirement(const TSpirvRequirement* spirvReq);
+    bool hasSpirvRequirement() const { return spirvRequirement != nullptr; }
+    const TSpirvRequirement& getSpirvRequirement() const { return *spirvRequirement; }
+    void insertSpirvExecutionMode(int executionMode, const TIntermAggregate* args = nullptr);
+    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)
@@ -911,6 +941,11 @@ public:
         return false;
     }
 
+    bool IsRequestedExtension(const char* extension) const
+    {
+        return (requestedExtensions.find(extension) != requestedExtensions.end());
+    }
+
     void addToCallGraph(TInfoSink&, const TString& caller, const TString& callee);
     void merge(TInfoSink&, TIntermediate&);
     void finalCheck(TInfoSink&, bool keepUncalled);
@@ -1047,7 +1082,9 @@ protected:
     int numPushConstants;
     bool recursive;
     bool invertY;
+    bool dxPositionW;
     bool useStorageBuffer;
+    bool invariantAll;
     bool nanMinMaxClamp;            // true if desiring min/max/clamp to favor non-NaN over NaN
     bool depthReplacing;
     int localSize[3];
@@ -1115,8 +1152,12 @@ protected:
 
     bool needToLegalize;
     bool binaryDoubleOutput;
+    bool subgroupUniformControlFlow;
     bool usePhysicalStorageBuffer;
 
+    TSpirvRequirement* spirvRequirement;
+    TSpirvExecutionMode* spirvExecutionMode;
+
     std::unordered_map<std::string, int> uniformLocationOverrides;
     int uniformLocationBase;
     TNumericFeatures numericFeatures;

+ 18 - 19
src/libraries/glslang/glslang/MachineIndependent/parseConst.cpp

@@ -166,31 +166,30 @@ void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
                 }
             } else {
                 // matrix from vector or scalar
-                int count = 0;
-                const int startIndex = index;
                 int nodeComps = node->getType().computeNumComponents();
-                for (int i = startIndex; i < endIndex; i++) {
-                    if (i >= instanceSize)
-                        return;
-                    if (nodeComps == 1) {
-                        // If there is a single scalar parameter to a matrix
-                        // constructor, it is used to initialize all the
-                        // components on the matrix's diagonal, with the
-                        // remaining components initialized to 0.0.
-                        if (i == startIndex || (i - startIndex) % (matrixRows + 1) == 0 )
-                            leftUnionArray[i] = rightUnionArray[count];
-                        else
-                            leftUnionArray[i].setDConst(0.0);
-                    } else {
+                if (nodeComps == 1) {
+                    for (int c = 0; c < matrixCols; ++c) {
+                        for (int r = 0; r < matrixRows; ++r) {
+                            if (r == c)
+                                leftUnionArray[index] = rightUnionArray[0];
+                            else
+                                leftUnionArray[index].setDConst(0.0);
+                            index++;
+                        }
+                    }
+                } else {
+                    int count = 0;
+                    for (int i = index; i < endIndex; i++) {
+                        if (i >= instanceSize)
+                            return;
+
                         // construct the matrix in column-major order, from
                         // the components provided, in order
                         leftUnionArray[i] = rightUnionArray[count];
-                    }
-
-                    index++;
 
-                    if (nodeComps > 1)
+                        index++;
                         count++;
+                    }
                 }
             }
         }

+ 5 - 3
src/libraries/glslang/glslang/MachineIndependent/preprocessor/PpScanner.cpp

@@ -1191,9 +1191,11 @@ int TPpContext::tokenize(TPpToken& ppToken)
             // HLSL allows string literals.
             // GLSL allows string literals with GL_EXT_debug_printf.
             if (ifdepth == 0 && parseContext.intermediate.getSource() != EShSourceHlsl) {
-                parseContext.requireExtensions(ppToken.loc, 1, &E_GL_EXT_debug_printf, "string literal");
-                if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf))
-                    continue;
+              const char* const string_literal_EXTs[] = { E_GL_EXT_debug_printf, E_GL_EXT_spirv_intrinsics };
+              parseContext.requireExtensions(ppToken.loc, 2, string_literal_EXTs, "string literal");
+              if (!parseContext.extensionTurnedOn(E_GL_EXT_debug_printf) &&
+                  !parseContext.extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
+                  continue;
             }
             break;
         case '\'':

+ 7 - 1
src/libraries/glslang/glslang/OSDependent/Unix/ossource.cpp

@@ -172,7 +172,7 @@ namespace {
     pthread_mutex_t gMutex;
 }
 
-void InitGlobalLock()
+static void InitMutex(void)
 {
   pthread_mutexattr_t mutexattr;
   pthread_mutexattr_init(&mutexattr);
@@ -180,6 +180,12 @@ void InitGlobalLock()
   pthread_mutex_init(&gMutex, &mutexattr);
 }
 
+void InitGlobalLock()
+{
+  static pthread_once_t once = PTHREAD_ONCE_INIT;
+  pthread_once(&once, InitMutex);
+}
+
 void GetGlobalLock()
 {
   pthread_mutex_lock(&gMutex);

+ 6 - 3
src/libraries/glslang/glslang/Public/ShaderLang.h

@@ -163,6 +163,7 @@ typedef enum {
 } EShTargetLanguage;
 
 typedef enum {
+    EShTargetUniversal = 0,                           // Universal
     EShTargetVulkan_1_0 = (1 << 22),                  // Vulkan 1.0
     EShTargetVulkan_1_1 = (1 << 22) | (1 << 12),      // Vulkan 1.1
     EShTargetVulkan_1_2 = (1 << 22) | (2 << 12),      // Vulkan 1.2
@@ -179,7 +180,8 @@ typedef enum {
     EShTargetSpv_1_3 = (1 << 16) | (3 << 8),          // SPIR-V 1.3
     EShTargetSpv_1_4 = (1 << 16) | (4 << 8),          // SPIR-V 1.4
     EShTargetSpv_1_5 = (1 << 16) | (5 << 8),          // SPIR-V 1.5
-    LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 6),
+    EShTargetSpv_1_6 = (1 << 16) | (6 << 8),          // SPIR-V 1.6
+    LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 7),
 } EShTargetLanguageVersion;
 
 struct TInputLanguage {
@@ -485,6 +487,7 @@ public:
     GLSLANG_EXPORT void addUniformLocationOverride(const char* name, int loc);
     GLSLANG_EXPORT void setUniformLocationBase(int base);
     GLSLANG_EXPORT void setInvertY(bool invert);
+    GLSLANG_EXPORT void setDxPositionW(bool dxPosW);
 #ifdef ENABLE_HLSL
     GLSLANG_EXPORT void setHlslIoMapping(bool hlslIoMap);
     GLSLANG_EXPORT void setFlattenUniformArrays(bool flatten);
@@ -508,7 +511,7 @@ public:
     //
     // setEnvInput:    The input source language and stage. If generating code for a
     //                 specific client, the input client semantics to use and the
-    //                 version of the that client's input semantics to use, otherwise
+    //                 version of that client's input semantics to use, otherwise
     //                 use EShClientNone and version of 0, e.g. for validation mode.
     //                 Note 'version' does not describe the target environment,
     //                 just the version of the source dialect to compile under.
@@ -722,7 +725,7 @@ class TObjectReflection {
 public:
     GLSLANG_EXPORT TObjectReflection(const std::string& pName, const TType& pType, int pOffset, int pGLDefineType, int pSize, int pIndex);
 
-    GLSLANG_EXPORT const TType* getType() const { return type; }
+    const TType* getType() const { return type; }
     GLSLANG_EXPORT int getBinding() const;
     GLSLANG_EXPORT void dump() const;
     static TObjectReflection badReflection() { return TObjectReflection(); }

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