Browse Source

Fix the build

Panagiotis Christopoulos Charitos 3 years ago
parent
commit
df473b9ba4
97 changed files with 9243 additions and 2859 deletions
  1. 3 1
      ThirdParty/Glslang/External/spirv-tools/Android.mk
  2. 2 2
      ThirdParty/Glslang/External/spirv-tools/BUILD.bazel
  3. 14 5
      ThirdParty/Glslang/External/spirv-tools/BUILD.gn
  4. 54 2
      ThirdParty/Glslang/External/spirv-tools/CHANGES
  5. 3 3
      ThirdParty/Glslang/External/spirv-tools/DEPS
  6. 5 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt
  7. 2 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml
  8. 1878 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.bf
  9. 48 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
  10. 9 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs
  11. 10 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h
  12. 10 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp
  13. 10 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11
  14. 12 4
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json
  15. 9 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua
  16. 9 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py
  17. 9 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d
  18. 42 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp
  19. 1 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h
  20. 3 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp
  21. 10 0
      ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp
  22. 1 1
      ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/windows/build.bat
  23. 2 2
      ThirdParty/Glslang/External/spirv-tools/source/CMakeLists.txt
  24. 8 2
      ThirdParty/Glslang/External/spirv-tools/source/link/linker.cpp
  25. 1 0
      ThirdParty/Glslang/External/spirv-tools/source/opcode.cpp
  26. 4 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/CMakeLists.txt
  27. 2 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp
  28. 90 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/fix_func_call_arguments.cpp
  29. 47 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/fix_func_call_arguments.h
  30. 343 6
      ThirdParty/Glslang/External/spirv-tools/source/opt/folding_rules.cpp
  31. 2 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/if_conversion.cpp
  32. 964 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/interface_var_sroa.cpp
  33. 401 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/interface_var_sroa.h
  34. 9 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/ir_builder.h
  35. 13 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/ir_context.cpp
  36. 7 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/ir_context.h
  37. 20 11
      ThirdParty/Glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp
  38. 2 1
      ThirdParty/Glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h
  39. 2 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp
  40. 2 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp
  41. 4 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/loop_descriptor.cpp
  42. 2 1
      ThirdParty/Glslang/External/spirv-tools/source/opt/loop_descriptor.h
  43. 12 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/optimizer.cpp
  44. 2 0
      ThirdParty/Glslang/External/spirv-tools/source/opt/passes.h
  45. 11 9
      ThirdParty/Glslang/External/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp
  46. 6 5
      ThirdParty/Glslang/External/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h
  47. 27 43
      ThirdParty/Glslang/External/spirv-tools/source/opt/spread_volatile_semantics.cpp
  48. 13 7
      ThirdParty/Glslang/External/spirv-tools/source/opt/spread_volatile_semantics.h
  49. 5 3
      ThirdParty/Glslang/External/spirv-tools/source/text.cpp
  50. 1 0
      ThirdParty/Glslang/External/spirv-tools/source/util/ilist.h
  51. 9 4
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_annotation.cpp
  52. 96 5
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_builtins.cpp
  53. 3 8
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_cfg.cpp
  54. 22 22
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_decorations.cpp
  55. 5 6
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_function.cpp
  56. 3 2
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_image.cpp
  57. 16 4
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_interfaces.cpp
  58. 1 2
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_logicals.cpp
  59. 12 21
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_memory.cpp
  60. 55 0
      ThirdParty/Glslang/External/spirv-tools/source/val/validate_non_uniform.cpp
  61. 38 5
      ThirdParty/Glslang/External/spirv-tools/source/val/validation_state.cpp
  62. 2 4
      ThirdParty/Glslang/External/spirv-tools/source/val/validation_state.h
  63. 8 2
      ThirdParty/Glslang/External/spirv-tools/test/c_interface_test.cpp
  64. 43 0
      ThirdParty/Glslang/External/spirv-tools/test/link/entry_points_test.cpp
  65. 4 0
      ThirdParty/Glslang/External/spirv-tools/test/link/linker_fixture.h
  66. 4 2
      ThirdParty/Glslang/External/spirv-tools/test/opt/CMakeLists.txt
  67. 152 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/fix_func_call_arguments_test.cpp
  68. 407 2
      ThirdParty/Glslang/External/spirv-tools/test/opt/fold_test.cpp
  69. 34 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/if_conversion_test.cpp
  70. 410 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/interface_var_sroa_test.cpp
  71. 95 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp
  72. 34 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp
  73. 77 0
      ThirdParty/Glslang/External/spirv-tools/test/opt/replace_desc_array_access_using_var_index_test.cpp
  74. 155 6
      ThirdParty/Glslang/External/spirv-tools/test/opt/spread_volatile_semantics_test.cpp
  75. 6 3
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp
  76. 14 7
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp
  77. 6 3
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp
  78. 2 1
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp
  79. 63 0
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp
  80. 6 3
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.image_test.cpp
  81. 4 2
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp
  82. 2 1
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp
  83. 8 4
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp
  84. 8 4
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp
  85. 6 3
      ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp
  86. 1 0
      ThirdParty/Glslang/External/spirv-tools/test/val/CMakeLists.txt
  87. 2 0
      ThirdParty/Glslang/External/spirv-tools/test/val/val_annotation_test.cpp
  88. 126 0
      ThirdParty/Glslang/External/spirv-tools/test/val/val_builtins_test.cpp
  89. 199 25
      ThirdParty/Glslang/External/spirv-tools/test/val/val_decoration_test.cpp
  90. 352 0
      ThirdParty/Glslang/External/spirv-tools/test/val/val_extension_spv_khr_subgroup_rotate.cpp
  91. 20 0
      ThirdParty/Glslang/External/spirv-tools/test/val/val_image_test.cpp
  92. 2 2
      ThirdParty/Glslang/External/spirv-tools/test/val/val_memory_test.cpp
  93. 4 9
      ThirdParty/Glslang/External/spirv-tools/tools/opt/opt.cpp
  94. 2 0
      ThirdParty/Glslang/External/spirv-tools/utils/roll_deps.sh
  95. 11 12
      ThirdParty/Glslang/External/spirv-tools/utils/update_build_version.py
  96. 2511 2511
      ThirdParty/Glslang/SPIRV/spirv.hpp
  97. 57 57
      ThirdParty/Glslang/gen_extension_headers.py

+ 3 - 1
ThirdParty/Glslang/External/spirv-tools/Android.mk

@@ -109,6 +109,7 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/eliminate_dead_input_components_pass.cpp \
 		source/opt/eliminate_dead_members_pass.cpp \
 		source/opt/feature_manager.cpp \
+		source/opt/fix_func_call_arguments.cpp \
 		source/opt/fix_storage_class.cpp \
 		source/opt/flatten_decoration_pass.cpp \
 		source/opt/fold.cpp \
@@ -127,6 +128,7 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/instruction.cpp \
 		source/opt/instruction_list.cpp \
 		source/opt/instrument_pass.cpp \
+		source/opt/interface_var_sroa.cpp \
 		source/opt/interp_fixup_pass.cpp \
 		source/opt/ir_context.cpp \
 		source/opt/ir_loader.cpp \
@@ -302,7 +304,7 @@ $(1)/build-version.inc: \
         $(LOCAL_PATH)/utils/update_build_version.py \
         $(LOCAL_PATH)/CHANGES
 		@$(HOST_PYTHON) $(LOCAL_PATH)/utils/update_build_version.py \
-		                $(LOCAL_PATH) $(1)/build-version.inc
+		                $(LOCAL_PATH)/CHANGES $(1)/build-version.inc
 		@echo "[$(TARGET_ARCH_ABI)] Generate       : build-version.inc <= CHANGES"
 $(LOCAL_PATH)/source/software_version.cpp: $(1)/build-version.inc
 endef

+ 2 - 2
ThirdParty/Glslang/External/spirv-tools/BUILD.bazel

@@ -94,8 +94,8 @@ genrule(
     name = "gen_build_version",
     srcs = ["CHANGES"],
     outs = ["build-version.inc"],
-    cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $$(dirname $(location CHANGES)) $(location build-version.inc)",
-    cmd_bat = "set SOURCE_DATE_EPOCH=0  && $(location //:update_build_version) \"$(location CHANGES)\\..\" $(location build-version.inc)",
+    cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $(location CHANGES) $(location build-version.inc)",
+    cmd_bat = "set SOURCE_DATE_EPOCH=0  && $(location //:update_build_version) $(location CHANGES) $(location build-version.inc)",
     tools = [":update_build_version"],
 )
 

+ 14 - 5
ThirdParty/Glslang/External/spirv-tools/BUILD.gn

@@ -20,10 +20,15 @@ if (build_with_chromium) {
 }
 
 # SPIRV-Tools may be part of multiple projects in the Chromium tree.
-# Only enable building executables if this is the main copy, or standalone.
+# Only enable building executables if this is the main copy.
 abspath = get_path_info(".", "abspath")
-spvtools_chromium_third_party = (abspath == "//third_party/SPIRV-Tools/")
-spvtools_build_executables = !build_with_chromium || spvtools_chromium_third_party
+spvtools_chromium_third_party = (abspath == "//third_party/vulkan-deps/spirv-tools/src/")
+spvtools_build_executables = build_with_chromium && spvtools_chromium_third_party
+# Fuchsia also requires building the executables.
+# TODO(b/158002593): Avoid the use of dependent-specific variables.
+if (defined(is_fuchsia_tree) && is_fuchsia_tree) {
+  spvtools_build_executables = true
+}
 
 spirv_headers = spirv_tools_spirv_headers_dir
 spirv_is_winuwp = is_win && target_os == "winuwp"
@@ -251,12 +256,12 @@ action("spvtools_generators_inc") {
 action("spvtools_build_version") {
   script = "utils/update_build_version.py"
 
-  src_dir = "."
+  changes_file = "CHANGES"
   inc_file = "${target_gen_dir}/build-version.inc"
 
   outputs = [ inc_file ]
   args = [
-    rebase_path(src_dir, root_build_dir),
+    rebase_path(changes_file, root_build_dir),
     rebase_path(inc_file, root_build_dir),
   ]
 }
@@ -624,6 +629,8 @@ static_library("spvtools_opt") {
     "source/opt/empty_pass.h",
     "source/opt/feature_manager.cpp",
     "source/opt/feature_manager.h",
+    "source/opt/fix_func_call_arguments.cpp",
+    "source/opt/fix_func_call_arguments.h",
     "source/opt/fix_storage_class.cpp",
     "source/opt/fix_storage_class.h",
     "source/opt/flatten_decoration_pass.cpp",
@@ -660,6 +667,8 @@ static_library("spvtools_opt") {
     "source/opt/instruction_list.h",
     "source/opt/instrument_pass.cpp",
     "source/opt/instrument_pass.h",
+    "source/opt/interface_var_sroa.cpp",
+    "source/opt/interface_var_sroa.h",
     "source/opt/interp_fixup_pass.cpp",
     "source/opt/interp_fixup_pass.h",
     "source/opt/ir_builder.h",

+ 54 - 2
ThirdParty/Glslang/External/spirv-tools/CHANGES

@@ -1,7 +1,59 @@
 Revision history for SPIRV-Tools
 
-v2022.2-dev 2022-01-26
-  - Start v2022.2-dev
+v2022.3-dev 2022-05-31
+  - General
+    - Add SPV_KHR_fragment_shader_barycentric support (#4805)
+    - Add support for SPV_KHR_subgroup_rotate (#4786)
+  - Optimizer
+    - Fold multiply and subtraction into FMA with negation (#4808)
+    - Add more folding for composite instructions (#4802)
+    - spirv-opt: add pass for interface variable scalar replacement (#4779)
+    - Don't try to unroll loop with step count 0. (#4769)
+  - Validator
+    - spirv-val: Add PerVertexKHR (#4807)
+    - spirv-opt : Add FixFuncCallArgumentsPass (#4775)
+    - spirv-val: Add CullMaskKHR support (#4792)
+  - Linker
+    - linker: Recalculate interface variables (#4784)
+
+v2022.2 2022-04-07
+  - General
+    - Add OpModuleProcessed to debug opcode (#4694)
+  - Optimizer
+    - Complete handling of RayQueryKHR type (#4690)
+    - Have scalar replacement use undef instead of null (#4691)
+    - Optimize Instruction::Instruction (#4705)
+    - Handle propagation of arrays with decorations (#4717)
+    - spirv-opt: Add OpExecutionModeId support (#4719)
+    - Optimize Type::HashValue (#4707)
+    - Optimize DefUseManager allocations (#4709)
+    - Add pass to remove DontInline function control (#4747)
+    - Better handling of 0xFFFFFFFF when folding vector shuffle (#4743)
+    - Reset the id bound on the module in compact ids (#4744)
+    - spirv-opt: (WIP) Eliminate Dead Input Component Pass (#4720)
+    - Support SPV_KHR_uniform_group_instructions (#4734)
+    - Handle shaders without execution model in spread-volatile-semantics (#4766)
+  - Validator
+    - Fix handling of Nontemporal image operand (#4692)
+    - [spirv-val] Allow 0 Component Count for DebugTypeArray for Shader (#4706)
+    - spirv-val: Validate DebugTypeMatrix (#4732)
+    - spirv-val: Label Vulkan VUID 04734 (#4739)
+    - spirv-val: Label VUID 06491 (#4745)
+    - spirv-val: Disallow array of push constants (#4742)
+    - spirv-val: Label Vulkan RuntimeArray VUID (#4749)
+    - spirv-val: Add Vulkan Image VUID 06214 (#4750)
+    - spirv-val: Add Vulkan Dref not allowed 3D dim VUID (#4751)
+    - spirv-val: Label and add test for PSB Aligned (#4756)
+    - spirv-val: Add Vulkan 32-bit bit op Base (#4758)
+    - spirv-val: Add more Vulkan VUID labels (#4764)
+  - Diff
+    - Introduce spirv-diff (#4611)
+    - Stabilize the output of spirv-diff (#4698)
+    - spirv-diff: Handle OpSpecConstant array sizes (#4700)
+    - spirv-diff: Match OpSpecConstantComposite correctly (#4704)
+    - spirv-diff: Use GetSingleWord*Operand (#4768)
+    - spirv-diff: Basic support for OpTypeForwardPointer (#4761)
+    - spirv-diff: Fix OpTypeFunction matching w.r.t operand count (#4771)
 
 v2022.1 2022-01-26
   - General

+ 3 - 3
ThirdParty/Glslang/External/spirv-tools/DEPS

@@ -4,9 +4,9 @@ vars = {
   'github': 'https://github.com',
 
   'effcee_revision': 'ddf5e2bb92957dc8a12c5392f8495333d6844133',
-  'googletest_revision': 'f45d5865ed0b2b8912244627cdf508a24cc6ccb4',
-  're2_revision': '611baecbcedc9cec1f46e38616b6d8880b676c03',
-  'spirv_headers_revision': '6a55fade62dec6a406a5a721148f88a2211cbefa',
+  'googletest_revision': '548b13dc3c02b93f60eeff9a0cc6e11c1ea722ca',
+  're2_revision': '5723bb8950318135ed9cf4fc76bed988a087f536',
+  'spirv_headers_revision': '5a121866927a16ab9d49bed4788b532c7fcea766',
 }
 
 deps = {

+ 5 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt

@@ -89,9 +89,14 @@ if (SPIRV_HEADERS_ENABLE_INSTALL)
     set(namespace "${PROJECT_NAME}::")
 
     include(CMakePackageConfigHelpers)
+
+    if (NOT CMAKE_VERSION VERSION_LESS 3.14)
+        set(arch_independent_str ARCH_INDEPENDENT)
+    endif()
     write_basic_package_version_file(
         "${version_config}"
         COMPATIBILITY SameMajorVersion
+        ${arch_independent_str}
     )
 
     configure_package_config_file(

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml

@@ -84,7 +84,8 @@
         <id value="31"  vendor="Google" tool="Skia SkSL" comment="Contact Ethan Nicholas, [email protected]"/>
         <id value="32"  vendor="TornadoVM" tool="SPIRV Beehive Toolkit" comment="https://github.com/beehive-lab/spirv-beehive-toolkit"/>
         <id value="33"  vendor="DragonJoker" tool="ShaderWriter" comment="Contact Sylvain Doremus, https://github.com/DragonJoker/ShaderWriter"/>
-        <unused start="34" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
+        <id value="34"  vendor="Rayan Hatout" tool="SPIRVSmith" comment="Contact Rayan Hatout [email protected], Repo https://github.com/rayanht/SPIRVSmith"/>
+        <unused start="35" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
     </ids>
 
     <!-- SECTION: SPIR-V Opcodes and Enumerants -->

+ 1878 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.bf

@@ -0,0 +1,1878 @@
+// 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, Beef
+// 
+// - 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
+// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+//     e.g.: Spv.Specification.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.
+
+namespace Spv
+{
+    using System;
+
+    public static class Specification
+    {
+        public const uint32 MagicNumber = 0x07230203;
+        public const uint32 Version = 0x00010600;
+        public const uint32 Revision = 1;
+        public const uint32 OpCodeMask = 0xffff;
+        public const uint32 WordCountShift = 16;
+
+        [AllowDuplicates, CRepr] public enum SourceLanguage
+        {
+            Unknown = 0,
+            ESSL = 1,
+            GLSL = 2,
+            OpenCL_C = 3,
+            OpenCL_CPP = 4,
+            HLSL = 5,
+            CPP_for_OpenCL = 6,
+            SYCL = 7,
+        }
+
+        [AllowDuplicates, CRepr] public enum ExecutionModel
+        {
+            Vertex = 0,
+            TessellationControl = 1,
+            TessellationEvaluation = 2,
+            Geometry = 3,
+            Fragment = 4,
+            GLCompute = 5,
+            Kernel = 6,
+            TaskNV = 5267,
+            MeshNV = 5268,
+            RayGenerationKHR = 5313,
+            RayGenerationNV = 5313,
+            IntersectionKHR = 5314,
+            IntersectionNV = 5314,
+            AnyHitKHR = 5315,
+            AnyHitNV = 5315,
+            ClosestHitKHR = 5316,
+            ClosestHitNV = 5316,
+            MissKHR = 5317,
+            MissNV = 5317,
+            CallableKHR = 5318,
+            CallableNV = 5318,
+        }
+
+        [AllowDuplicates, CRepr] public enum AddressingModel
+        {
+            Logical = 0,
+            Physical32 = 1,
+            Physical64 = 2,
+            PhysicalStorageBuffer64 = 5348,
+            PhysicalStorageBuffer64EXT = 5348,
+        }
+
+        [AllowDuplicates, CRepr] public enum MemoryModel
+        {
+            Simple = 0,
+            GLSL450 = 1,
+            OpenCL = 2,
+            Vulkan = 3,
+            VulkanKHR = 3,
+        }
+
+        [AllowDuplicates, CRepr] public enum ExecutionMode
+        {
+            Invocations = 0,
+            SpacingEqual = 1,
+            SpacingFractionalEven = 2,
+            SpacingFractionalOdd = 3,
+            VertexOrderCw = 4,
+            VertexOrderCcw = 5,
+            PixelCenterInteger = 6,
+            OriginUpperLeft = 7,
+            OriginLowerLeft = 8,
+            EarlyFragmentTests = 9,
+            PointMode = 10,
+            Xfb = 11,
+            DepthReplacing = 12,
+            DepthGreater = 14,
+            DepthLess = 15,
+            DepthUnchanged = 16,
+            LocalSize = 17,
+            LocalSizeHint = 18,
+            InputPoints = 19,
+            InputLines = 20,
+            InputLinesAdjacency = 21,
+            Triangles = 22,
+            InputTrianglesAdjacency = 23,
+            Quads = 24,
+            Isolines = 25,
+            OutputVertices = 26,
+            OutputPoints = 27,
+            OutputLineStrip = 28,
+            OutputTriangleStrip = 29,
+            VecTypeHint = 30,
+            ContractionOff = 31,
+            Initializer = 33,
+            Finalizer = 34,
+            SubgroupSize = 35,
+            SubgroupsPerWorkgroup = 36,
+            SubgroupsPerWorkgroupId = 37,
+            LocalSizeId = 38,
+            LocalSizeHintId = 39,
+            SubgroupUniformControlFlowKHR = 4421,
+            PostDepthCoverage = 4446,
+            DenormPreserve = 4459,
+            DenormFlushToZero = 4460,
+            SignedZeroInfNanPreserve = 4461,
+            RoundingModeRTE = 4462,
+            RoundingModeRTZ = 4463,
+            StencilRefReplacingEXT = 5027,
+            OutputLinesNV = 5269,
+            OutputPrimitivesNV = 5270,
+            DerivativeGroupQuadsNV = 5289,
+            DerivativeGroupLinearNV = 5290,
+            OutputTrianglesNV = 5298,
+            PixelInterlockOrderedEXT = 5366,
+            PixelInterlockUnorderedEXT = 5367,
+            SampleInterlockOrderedEXT = 5368,
+            SampleInterlockUnorderedEXT = 5369,
+            ShadingRateInterlockOrderedEXT = 5370,
+            ShadingRateInterlockUnorderedEXT = 5371,
+            SharedLocalMemorySizeINTEL = 5618,
+            RoundingModeRTPINTEL = 5620,
+            RoundingModeRTNINTEL = 5621,
+            FloatingPointModeALTINTEL = 5622,
+            FloatingPointModeIEEEINTEL = 5623,
+            MaxWorkgroupSizeINTEL = 5893,
+            MaxWorkDimINTEL = 5894,
+            NoGlobalOffsetINTEL = 5895,
+            NumSIMDWorkitemsINTEL = 5896,
+            SchedulerTargetFmaxMhzINTEL = 5903,
+            NamedBarrierCountINTEL = 6417,
+        }
+
+        [AllowDuplicates, CRepr] public enum StorageClass
+        {
+            UniformConstant = 0,
+            Input = 1,
+            Uniform = 2,
+            Output = 3,
+            Workgroup = 4,
+            CrossWorkgroup = 5,
+            Private = 6,
+            Function = 7,
+            Generic = 8,
+            PushConstant = 9,
+            AtomicCounter = 10,
+            Image = 11,
+            StorageBuffer = 12,
+            CallableDataKHR = 5328,
+            CallableDataNV = 5328,
+            IncomingCallableDataKHR = 5329,
+            IncomingCallableDataNV = 5329,
+            RayPayloadKHR = 5338,
+            RayPayloadNV = 5338,
+            HitAttributeKHR = 5339,
+            HitAttributeNV = 5339,
+            IncomingRayPayloadKHR = 5342,
+            IncomingRayPayloadNV = 5342,
+            ShaderRecordBufferKHR = 5343,
+            ShaderRecordBufferNV = 5343,
+            PhysicalStorageBuffer = 5349,
+            PhysicalStorageBufferEXT = 5349,
+            CodeSectionINTEL = 5605,
+            DeviceOnlyINTEL = 5936,
+            HostOnlyINTEL = 5937,
+        }
+
+        [AllowDuplicates, CRepr] public enum Dim
+        {
+            Dim1D = 0,
+            Dim2D = 1,
+            Dim3D = 2,
+            Cube = 3,
+            Rect = 4,
+            Buffer = 5,
+            SubpassData = 6,
+        }
+
+        [AllowDuplicates, CRepr] public enum SamplerAddressingMode
+        {
+            None = 0,
+            ClampToEdge = 1,
+            Clamp = 2,
+            Repeat = 3,
+            RepeatMirrored = 4,
+        }
+
+        [AllowDuplicates, CRepr] public enum SamplerFilterMode
+        {
+            Nearest = 0,
+            Linear = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum ImageFormat
+        {
+            Unknown = 0,
+            Rgba32f = 1,
+            Rgba16f = 2,
+            R32f = 3,
+            Rgba8 = 4,
+            Rgba8Snorm = 5,
+            Rg32f = 6,
+            Rg16f = 7,
+            R11fG11fB10f = 8,
+            R16f = 9,
+            Rgba16 = 10,
+            Rgb10A2 = 11,
+            Rg16 = 12,
+            Rg8 = 13,
+            R16 = 14,
+            R8 = 15,
+            Rgba16Snorm = 16,
+            Rg16Snorm = 17,
+            Rg8Snorm = 18,
+            R16Snorm = 19,
+            R8Snorm = 20,
+            Rgba32i = 21,
+            Rgba16i = 22,
+            Rgba8i = 23,
+            R32i = 24,
+            Rg32i = 25,
+            Rg16i = 26,
+            Rg8i = 27,
+            R16i = 28,
+            R8i = 29,
+            Rgba32ui = 30,
+            Rgba16ui = 31,
+            Rgba8ui = 32,
+            R32ui = 33,
+            Rgb10a2ui = 34,
+            Rg32ui = 35,
+            Rg16ui = 36,
+            Rg8ui = 37,
+            R16ui = 38,
+            R8ui = 39,
+            R64ui = 40,
+            R64i = 41,
+        }
+
+        [AllowDuplicates, CRepr] public enum ImageChannelOrder
+        {
+            R = 0,
+            A = 1,
+            RG = 2,
+            RA = 3,
+            RGB = 4,
+            RGBA = 5,
+            BGRA = 6,
+            ARGB = 7,
+            Intensity = 8,
+            Luminance = 9,
+            Rx = 10,
+            RGx = 11,
+            RGBx = 12,
+            Depth = 13,
+            DepthStencil = 14,
+            sRGB = 15,
+            sRGBx = 16,
+            sRGBA = 17,
+            sBGRA = 18,
+            ABGR = 19,
+        }
+
+        [AllowDuplicates, CRepr] public enum ImageChannelDataType
+        {
+            SnormInt8 = 0,
+            SnormInt16 = 1,
+            UnormInt8 = 2,
+            UnormInt16 = 3,
+            UnormShort565 = 4,
+            UnormShort555 = 5,
+            UnormInt101010 = 6,
+            SignedInt8 = 7,
+            SignedInt16 = 8,
+            SignedInt32 = 9,
+            UnsignedInt8 = 10,
+            UnsignedInt16 = 11,
+            UnsignedInt32 = 12,
+            HalfFloat = 13,
+            Float = 14,
+            UnormInt24 = 15,
+            UnormInt101010_2 = 16,
+        }
+
+        [AllowDuplicates, CRepr] public enum ImageOperandsShift
+        {
+            Bias = 0,
+            Lod = 1,
+            Grad = 2,
+            ConstOffset = 3,
+            Offset = 4,
+            ConstOffsets = 5,
+            Sample = 6,
+            MinLod = 7,
+            MakeTexelAvailable = 8,
+            MakeTexelAvailableKHR = 8,
+            MakeTexelVisible = 9,
+            MakeTexelVisibleKHR = 9,
+            NonPrivateTexel = 10,
+            NonPrivateTexelKHR = 10,
+            VolatileTexel = 11,
+            VolatileTexelKHR = 11,
+            SignExtend = 12,
+            ZeroExtend = 13,
+            Nontemporal = 14,
+            Offsets = 16,
+        }
+
+        [AllowDuplicates, CRepr] public enum ImageOperandsMask
+        {
+            MaskNone = 0,
+            Bias = 0x00000001,
+            Lod = 0x00000002,
+            Grad = 0x00000004,
+            ConstOffset = 0x00000008,
+            Offset = 0x00000010,
+            ConstOffsets = 0x00000020,
+            Sample = 0x00000040,
+            MinLod = 0x00000080,
+            MakeTexelAvailable = 0x00000100,
+            MakeTexelAvailableKHR = 0x00000100,
+            MakeTexelVisible = 0x00000200,
+            MakeTexelVisibleKHR = 0x00000200,
+            NonPrivateTexel = 0x00000400,
+            NonPrivateTexelKHR = 0x00000400,
+            VolatileTexel = 0x00000800,
+            VolatileTexelKHR = 0x00000800,
+            SignExtend = 0x00001000,
+            ZeroExtend = 0x00002000,
+            Nontemporal = 0x00004000,
+            Offsets = 0x00010000,
+        }
+
+        [AllowDuplicates, CRepr] public enum FPFastMathModeShift
+        {
+            NotNaN = 0,
+            NotInf = 1,
+            NSZ = 2,
+            AllowRecip = 3,
+            Fast = 4,
+            AllowContractFastINTEL = 16,
+            AllowReassocINTEL = 17,
+        }
+
+        [AllowDuplicates, CRepr] public enum FPFastMathModeMask
+        {
+            MaskNone = 0,
+            NotNaN = 0x00000001,
+            NotInf = 0x00000002,
+            NSZ = 0x00000004,
+            AllowRecip = 0x00000008,
+            Fast = 0x00000010,
+            AllowContractFastINTEL = 0x00010000,
+            AllowReassocINTEL = 0x00020000,
+        }
+
+        [AllowDuplicates, CRepr] public enum FPRoundingMode
+        {
+            RTE = 0,
+            RTZ = 1,
+            RTP = 2,
+            RTN = 3,
+        }
+
+        [AllowDuplicates, CRepr] public enum LinkageType
+        {
+            Export = 0,
+            Import = 1,
+            LinkOnceODR = 2,
+        }
+
+        [AllowDuplicates, CRepr] public enum AccessQualifier
+        {
+            ReadOnly = 0,
+            WriteOnly = 1,
+            ReadWrite = 2,
+        }
+
+        [AllowDuplicates, CRepr] public enum FunctionParameterAttribute
+        {
+            Zext = 0,
+            Sext = 1,
+            ByVal = 2,
+            Sret = 3,
+            NoAlias = 4,
+            NoCapture = 5,
+            NoWrite = 6,
+            NoReadWrite = 7,
+        }
+
+        [AllowDuplicates, CRepr] public enum Decoration
+        {
+            RelaxedPrecision = 0,
+            SpecId = 1,
+            Block = 2,
+            BufferBlock = 3,
+            RowMajor = 4,
+            ColMajor = 5,
+            ArrayStride = 6,
+            MatrixStride = 7,
+            GLSLShared = 8,
+            GLSLPacked = 9,
+            CPacked = 10,
+            BuiltIn = 11,
+            NoPerspective = 13,
+            Flat = 14,
+            Patch = 15,
+            Centroid = 16,
+            Sample = 17,
+            Invariant = 18,
+            Restrict = 19,
+            Aliased = 20,
+            Volatile = 21,
+            Constant = 22,
+            Coherent = 23,
+            NonWritable = 24,
+            NonReadable = 25,
+            Uniform = 26,
+            UniformId = 27,
+            SaturatedConversion = 28,
+            Stream = 29,
+            Location = 30,
+            Component = 31,
+            Index = 32,
+            Binding = 33,
+            DescriptorSet = 34,
+            Offset = 35,
+            XfbBuffer = 36,
+            XfbStride = 37,
+            FuncParamAttr = 38,
+            FPRoundingMode = 39,
+            FPFastMathMode = 40,
+            LinkageAttributes = 41,
+            NoContraction = 42,
+            InputAttachmentIndex = 43,
+            Alignment = 44,
+            MaxByteOffset = 45,
+            AlignmentId = 46,
+            MaxByteOffsetId = 47,
+            NoSignedWrap = 4469,
+            NoUnsignedWrap = 4470,
+            ExplicitInterpAMD = 4999,
+            OverrideCoverageNV = 5248,
+            PassthroughNV = 5250,
+            ViewportRelativeNV = 5252,
+            SecondaryViewportRelativeNV = 5256,
+            PerPrimitiveNV = 5271,
+            PerViewNV = 5272,
+            PerTaskNV = 5273,
+            PerVertexKHR = 5285,
+            PerVertexNV = 5285,
+            NonUniform = 5300,
+            NonUniformEXT = 5300,
+            RestrictPointer = 5355,
+            RestrictPointerEXT = 5355,
+            AliasedPointer = 5356,
+            AliasedPointerEXT = 5356,
+            BindlessSamplerNV = 5398,
+            BindlessImageNV = 5399,
+            BoundSamplerNV = 5400,
+            BoundImageNV = 5401,
+            SIMTCallINTEL = 5599,
+            ReferencedIndirectlyINTEL = 5602,
+            ClobberINTEL = 5607,
+            SideEffectsINTEL = 5608,
+            VectorComputeVariableINTEL = 5624,
+            FuncParamIOKindINTEL = 5625,
+            VectorComputeFunctionINTEL = 5626,
+            StackCallINTEL = 5627,
+            GlobalVariableOffsetINTEL = 5628,
+            CounterBuffer = 5634,
+            HlslCounterBufferGOOGLE = 5634,
+            HlslSemanticGOOGLE = 5635,
+            UserSemantic = 5635,
+            UserTypeGOOGLE = 5636,
+            FunctionRoundingModeINTEL = 5822,
+            FunctionDenormModeINTEL = 5823,
+            RegisterINTEL = 5825,
+            MemoryINTEL = 5826,
+            NumbanksINTEL = 5827,
+            BankwidthINTEL = 5828,
+            MaxPrivateCopiesINTEL = 5829,
+            SinglepumpINTEL = 5830,
+            DoublepumpINTEL = 5831,
+            MaxReplicatesINTEL = 5832,
+            SimpleDualPortINTEL = 5833,
+            MergeINTEL = 5834,
+            BankBitsINTEL = 5835,
+            ForcePow2DepthINTEL = 5836,
+            BurstCoalesceINTEL = 5899,
+            CacheSizeINTEL = 5900,
+            DontStaticallyCoalesceINTEL = 5901,
+            PrefetchINTEL = 5902,
+            StallEnableINTEL = 5905,
+            FuseLoopsInFunctionINTEL = 5907,
+            AliasScopeINTEL = 5914,
+            NoAliasINTEL = 5915,
+            BufferLocationINTEL = 5921,
+            IOPipeStorageINTEL = 5944,
+            FunctionFloatingPointModeINTEL = 6080,
+            SingleElementVectorINTEL = 6085,
+            VectorComputeCallableFunctionINTEL = 6087,
+            MediaBlockIOINTEL = 6140,
+        }
+
+        [AllowDuplicates, CRepr] public enum BuiltIn
+        {
+            Position = 0,
+            PointSize = 1,
+            ClipDistance = 3,
+            CullDistance = 4,
+            VertexId = 5,
+            InstanceId = 6,
+            PrimitiveId = 7,
+            InvocationId = 8,
+            Layer = 9,
+            ViewportIndex = 10,
+            TessLevelOuter = 11,
+            TessLevelInner = 12,
+            TessCoord = 13,
+            PatchVertices = 14,
+            FragCoord = 15,
+            PointCoord = 16,
+            FrontFacing = 17,
+            SampleId = 18,
+            SamplePosition = 19,
+            SampleMask = 20,
+            FragDepth = 22,
+            HelperInvocation = 23,
+            NumWorkgroups = 24,
+            WorkgroupSize = 25,
+            WorkgroupId = 26,
+            LocalInvocationId = 27,
+            GlobalInvocationId = 28,
+            LocalInvocationIndex = 29,
+            WorkDim = 30,
+            GlobalSize = 31,
+            EnqueuedWorkgroupSize = 32,
+            GlobalOffset = 33,
+            GlobalLinearId = 34,
+            SubgroupSize = 36,
+            SubgroupMaxSize = 37,
+            NumSubgroups = 38,
+            NumEnqueuedSubgroups = 39,
+            SubgroupId = 40,
+            SubgroupLocalInvocationId = 41,
+            VertexIndex = 42,
+            InstanceIndex = 43,
+            SubgroupEqMask = 4416,
+            SubgroupEqMaskKHR = 4416,
+            SubgroupGeMask = 4417,
+            SubgroupGeMaskKHR = 4417,
+            SubgroupGtMask = 4418,
+            SubgroupGtMaskKHR = 4418,
+            SubgroupLeMask = 4419,
+            SubgroupLeMaskKHR = 4419,
+            SubgroupLtMask = 4420,
+            SubgroupLtMaskKHR = 4420,
+            BaseVertex = 4424,
+            BaseInstance = 4425,
+            DrawIndex = 4426,
+            PrimitiveShadingRateKHR = 4432,
+            DeviceIndex = 4438,
+            ViewIndex = 4440,
+            ShadingRateKHR = 4444,
+            BaryCoordNoPerspAMD = 4992,
+            BaryCoordNoPerspCentroidAMD = 4993,
+            BaryCoordNoPerspSampleAMD = 4994,
+            BaryCoordSmoothAMD = 4995,
+            BaryCoordSmoothCentroidAMD = 4996,
+            BaryCoordSmoothSampleAMD = 4997,
+            BaryCoordPullModelAMD = 4998,
+            FragStencilRefEXT = 5014,
+            ViewportMaskNV = 5253,
+            SecondaryPositionNV = 5257,
+            SecondaryViewportMaskNV = 5258,
+            PositionPerViewNV = 5261,
+            ViewportMaskPerViewNV = 5262,
+            FullyCoveredEXT = 5264,
+            TaskCountNV = 5274,
+            PrimitiveCountNV = 5275,
+            PrimitiveIndicesNV = 5276,
+            ClipDistancePerViewNV = 5277,
+            CullDistancePerViewNV = 5278,
+            LayerPerViewNV = 5279,
+            MeshViewCountNV = 5280,
+            MeshViewIndicesNV = 5281,
+            BaryCoordKHR = 5286,
+            BaryCoordNV = 5286,
+            BaryCoordNoPerspKHR = 5287,
+            BaryCoordNoPerspNV = 5287,
+            FragSizeEXT = 5292,
+            FragmentSizeNV = 5292,
+            FragInvocationCountEXT = 5293,
+            InvocationsPerPixelNV = 5293,
+            LaunchIdKHR = 5319,
+            LaunchIdNV = 5319,
+            LaunchSizeKHR = 5320,
+            LaunchSizeNV = 5320,
+            WorldRayOriginKHR = 5321,
+            WorldRayOriginNV = 5321,
+            WorldRayDirectionKHR = 5322,
+            WorldRayDirectionNV = 5322,
+            ObjectRayOriginKHR = 5323,
+            ObjectRayOriginNV = 5323,
+            ObjectRayDirectionKHR = 5324,
+            ObjectRayDirectionNV = 5324,
+            RayTminKHR = 5325,
+            RayTminNV = 5325,
+            RayTmaxKHR = 5326,
+            RayTmaxNV = 5326,
+            InstanceCustomIndexKHR = 5327,
+            InstanceCustomIndexNV = 5327,
+            ObjectToWorldKHR = 5330,
+            ObjectToWorldNV = 5330,
+            WorldToObjectKHR = 5331,
+            WorldToObjectNV = 5331,
+            HitTNV = 5332,
+            HitKindKHR = 5333,
+            HitKindNV = 5333,
+            CurrentRayTimeNV = 5334,
+            IncomingRayFlagsKHR = 5351,
+            IncomingRayFlagsNV = 5351,
+            RayGeometryIndexKHR = 5352,
+            WarpsPerSMNV = 5374,
+            SMCountNV = 5375,
+            WarpIDNV = 5376,
+            SMIDNV = 5377,
+            CullMaskKHR = 6021,
+        }
+
+        [AllowDuplicates, CRepr] public enum SelectionControlShift
+        {
+            Flatten = 0,
+            DontFlatten = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum SelectionControlMask
+        {
+            MaskNone = 0,
+            Flatten = 0x00000001,
+            DontFlatten = 0x00000002,
+        }
+
+        [AllowDuplicates, CRepr] public enum LoopControlShift
+        {
+            Unroll = 0,
+            DontUnroll = 1,
+            DependencyInfinite = 2,
+            DependencyLength = 3,
+            MinIterations = 4,
+            MaxIterations = 5,
+            IterationMultiple = 6,
+            PeelCount = 7,
+            PartialCount = 8,
+            InitiationIntervalINTEL = 16,
+            MaxConcurrencyINTEL = 17,
+            DependencyArrayINTEL = 18,
+            PipelineEnableINTEL = 19,
+            LoopCoalesceINTEL = 20,
+            MaxInterleavingINTEL = 21,
+            SpeculatedIterationsINTEL = 22,
+            NoFusionINTEL = 23,
+        }
+
+        [AllowDuplicates, CRepr] public enum LoopControlMask
+        {
+            MaskNone = 0,
+            Unroll = 0x00000001,
+            DontUnroll = 0x00000002,
+            DependencyInfinite = 0x00000004,
+            DependencyLength = 0x00000008,
+            MinIterations = 0x00000010,
+            MaxIterations = 0x00000020,
+            IterationMultiple = 0x00000040,
+            PeelCount = 0x00000080,
+            PartialCount = 0x00000100,
+            InitiationIntervalINTEL = 0x00010000,
+            MaxConcurrencyINTEL = 0x00020000,
+            DependencyArrayINTEL = 0x00040000,
+            PipelineEnableINTEL = 0x00080000,
+            LoopCoalesceINTEL = 0x00100000,
+            MaxInterleavingINTEL = 0x00200000,
+            SpeculatedIterationsINTEL = 0x00400000,
+            NoFusionINTEL = 0x00800000,
+        }
+
+        [AllowDuplicates, CRepr] public enum FunctionControlShift
+        {
+            Inline = 0,
+            DontInline = 1,
+            Pure = 2,
+            Const = 3,
+            OptNoneINTEL = 16,
+        }
+
+        [AllowDuplicates, CRepr] public enum FunctionControlMask
+        {
+            MaskNone = 0,
+            Inline = 0x00000001,
+            DontInline = 0x00000002,
+            Pure = 0x00000004,
+            Const = 0x00000008,
+            OptNoneINTEL = 0x00010000,
+        }
+
+        [AllowDuplicates, CRepr] public enum MemorySemanticsShift
+        {
+            Acquire = 1,
+            Release = 2,
+            AcquireRelease = 3,
+            SequentiallyConsistent = 4,
+            UniformMemory = 6,
+            SubgroupMemory = 7,
+            WorkgroupMemory = 8,
+            CrossWorkgroupMemory = 9,
+            AtomicCounterMemory = 10,
+            ImageMemory = 11,
+            OutputMemory = 12,
+            OutputMemoryKHR = 12,
+            MakeAvailable = 13,
+            MakeAvailableKHR = 13,
+            MakeVisible = 14,
+            MakeVisibleKHR = 14,
+            Volatile = 15,
+        }
+
+        [AllowDuplicates, CRepr] public enum MemorySemanticsMask
+        {
+            MaskNone = 0,
+            Acquire = 0x00000002,
+            Release = 0x00000004,
+            AcquireRelease = 0x00000008,
+            SequentiallyConsistent = 0x00000010,
+            UniformMemory = 0x00000040,
+            SubgroupMemory = 0x00000080,
+            WorkgroupMemory = 0x00000100,
+            CrossWorkgroupMemory = 0x00000200,
+            AtomicCounterMemory = 0x00000400,
+            ImageMemory = 0x00000800,
+            OutputMemory = 0x00001000,
+            OutputMemoryKHR = 0x00001000,
+            MakeAvailable = 0x00002000,
+            MakeAvailableKHR = 0x00002000,
+            MakeVisible = 0x00004000,
+            MakeVisibleKHR = 0x00004000,
+            Volatile = 0x00008000,
+        }
+
+        [AllowDuplicates, CRepr] public enum MemoryAccessShift
+        {
+            Volatile = 0,
+            Aligned = 1,
+            Nontemporal = 2,
+            MakePointerAvailable = 3,
+            MakePointerAvailableKHR = 3,
+            MakePointerVisible = 4,
+            MakePointerVisibleKHR = 4,
+            NonPrivatePointer = 5,
+            NonPrivatePointerKHR = 5,
+            AliasScopeINTELMask = 16,
+            NoAliasINTELMask = 17,
+        }
+
+        [AllowDuplicates, CRepr] public enum MemoryAccessMask
+        {
+            MaskNone = 0,
+            Volatile = 0x00000001,
+            Aligned = 0x00000002,
+            Nontemporal = 0x00000004,
+            MakePointerAvailable = 0x00000008,
+            MakePointerAvailableKHR = 0x00000008,
+            MakePointerVisible = 0x00000010,
+            MakePointerVisibleKHR = 0x00000010,
+            NonPrivatePointer = 0x00000020,
+            NonPrivatePointerKHR = 0x00000020,
+            AliasScopeINTELMask = 0x00010000,
+            NoAliasINTELMask = 0x00020000,
+        }
+
+        [AllowDuplicates, CRepr] public enum Scope
+        {
+            CrossDevice = 0,
+            Device = 1,
+            Workgroup = 2,
+            Subgroup = 3,
+            Invocation = 4,
+            QueueFamily = 5,
+            QueueFamilyKHR = 5,
+            ShaderCallKHR = 6,
+        }
+
+        [AllowDuplicates, CRepr] public enum GroupOperation
+        {
+            Reduce = 0,
+            InclusiveScan = 1,
+            ExclusiveScan = 2,
+            ClusteredReduce = 3,
+            PartitionedReduceNV = 6,
+            PartitionedInclusiveScanNV = 7,
+            PartitionedExclusiveScanNV = 8,
+        }
+
+        [AllowDuplicates, CRepr] public enum KernelEnqueueFlags
+        {
+            NoWait = 0,
+            WaitKernel = 1,
+            WaitWorkGroup = 2,
+        }
+
+        [AllowDuplicates, CRepr] public enum KernelProfilingInfoShift
+        {
+            CmdExecTime = 0,
+        }
+
+        [AllowDuplicates, CRepr] public enum KernelProfilingInfoMask
+        {
+            MaskNone = 0,
+            CmdExecTime = 0x00000001,
+        }
+
+        [AllowDuplicates, CRepr] public enum Capability
+        {
+            Matrix = 0,
+            Shader = 1,
+            Geometry = 2,
+            Tessellation = 3,
+            Addresses = 4,
+            Linkage = 5,
+            Kernel = 6,
+            Vector16 = 7,
+            Float16Buffer = 8,
+            Float16 = 9,
+            Float64 = 10,
+            Int64 = 11,
+            Int64Atomics = 12,
+            ImageBasic = 13,
+            ImageReadWrite = 14,
+            ImageMipmap = 15,
+            Pipes = 17,
+            Groups = 18,
+            DeviceEnqueue = 19,
+            LiteralSampler = 20,
+            AtomicStorage = 21,
+            Int16 = 22,
+            TessellationPointSize = 23,
+            GeometryPointSize = 24,
+            ImageGatherExtended = 25,
+            StorageImageMultisample = 27,
+            UniformBufferArrayDynamicIndexing = 28,
+            SampledImageArrayDynamicIndexing = 29,
+            StorageBufferArrayDynamicIndexing = 30,
+            StorageImageArrayDynamicIndexing = 31,
+            ClipDistance = 32,
+            CullDistance = 33,
+            ImageCubeArray = 34,
+            SampleRateShading = 35,
+            ImageRect = 36,
+            SampledRect = 37,
+            GenericPointer = 38,
+            Int8 = 39,
+            InputAttachment = 40,
+            SparseResidency = 41,
+            MinLod = 42,
+            Sampled1D = 43,
+            Image1D = 44,
+            SampledCubeArray = 45,
+            SampledBuffer = 46,
+            ImageBuffer = 47,
+            ImageMSArray = 48,
+            StorageImageExtendedFormats = 49,
+            ImageQuery = 50,
+            DerivativeControl = 51,
+            InterpolationFunction = 52,
+            TransformFeedback = 53,
+            GeometryStreams = 54,
+            StorageImageReadWithoutFormat = 55,
+            StorageImageWriteWithoutFormat = 56,
+            MultiViewport = 57,
+            SubgroupDispatch = 58,
+            NamedBarrier = 59,
+            PipeStorage = 60,
+            GroupNonUniform = 61,
+            GroupNonUniformVote = 62,
+            GroupNonUniformArithmetic = 63,
+            GroupNonUniformBallot = 64,
+            GroupNonUniformShuffle = 65,
+            GroupNonUniformShuffleRelative = 66,
+            GroupNonUniformClustered = 67,
+            GroupNonUniformQuad = 68,
+            ShaderLayer = 69,
+            ShaderViewportIndex = 70,
+            UniformDecoration = 71,
+            FragmentShadingRateKHR = 4422,
+            SubgroupBallotKHR = 4423,
+            DrawParameters = 4427,
+            WorkgroupMemoryExplicitLayoutKHR = 4428,
+            WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
+            WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
+            SubgroupVoteKHR = 4431,
+            StorageBuffer16BitAccess = 4433,
+            StorageUniformBufferBlock16 = 4433,
+            StorageUniform16 = 4434,
+            UniformAndStorageBuffer16BitAccess = 4434,
+            StoragePushConstant16 = 4435,
+            StorageInputOutput16 = 4436,
+            DeviceGroup = 4437,
+            MultiView = 4439,
+            VariablePointersStorageBuffer = 4441,
+            VariablePointers = 4442,
+            AtomicStorageOps = 4445,
+            SampleMaskPostDepthCoverage = 4447,
+            StorageBuffer8BitAccess = 4448,
+            UniformAndStorageBuffer8BitAccess = 4449,
+            StoragePushConstant8 = 4450,
+            DenormPreserve = 4464,
+            DenormFlushToZero = 4465,
+            SignedZeroInfNanPreserve = 4466,
+            RoundingModeRTE = 4467,
+            RoundingModeRTZ = 4468,
+            RayQueryProvisionalKHR = 4471,
+            RayQueryKHR = 4472,
+            RayTraversalPrimitiveCullingKHR = 4478,
+            RayTracingKHR = 4479,
+            Float16ImageAMD = 5008,
+            ImageGatherBiasLodAMD = 5009,
+            FragmentMaskAMD = 5010,
+            StencilExportEXT = 5013,
+            ImageReadWriteLodAMD = 5015,
+            Int64ImageEXT = 5016,
+            ShaderClockKHR = 5055,
+            SampleMaskOverrideCoverageNV = 5249,
+            GeometryShaderPassthroughNV = 5251,
+            ShaderViewportIndexLayerEXT = 5254,
+            ShaderViewportIndexLayerNV = 5254,
+            ShaderViewportMaskNV = 5255,
+            ShaderStereoViewNV = 5259,
+            PerViewAttributesNV = 5260,
+            FragmentFullyCoveredEXT = 5265,
+            MeshShadingNV = 5266,
+            ImageFootprintNV = 5282,
+            FragmentBarycentricKHR = 5284,
+            FragmentBarycentricNV = 5284,
+            ComputeDerivativeGroupQuadsNV = 5288,
+            FragmentDensityEXT = 5291,
+            ShadingRateNV = 5291,
+            GroupNonUniformPartitionedNV = 5297,
+            ShaderNonUniform = 5301,
+            ShaderNonUniformEXT = 5301,
+            RuntimeDescriptorArray = 5302,
+            RuntimeDescriptorArrayEXT = 5302,
+            InputAttachmentArrayDynamicIndexing = 5303,
+            InputAttachmentArrayDynamicIndexingEXT = 5303,
+            UniformTexelBufferArrayDynamicIndexing = 5304,
+            UniformTexelBufferArrayDynamicIndexingEXT = 5304,
+            StorageTexelBufferArrayDynamicIndexing = 5305,
+            StorageTexelBufferArrayDynamicIndexingEXT = 5305,
+            UniformBufferArrayNonUniformIndexing = 5306,
+            UniformBufferArrayNonUniformIndexingEXT = 5306,
+            SampledImageArrayNonUniformIndexing = 5307,
+            SampledImageArrayNonUniformIndexingEXT = 5307,
+            StorageBufferArrayNonUniformIndexing = 5308,
+            StorageBufferArrayNonUniformIndexingEXT = 5308,
+            StorageImageArrayNonUniformIndexing = 5309,
+            StorageImageArrayNonUniformIndexingEXT = 5309,
+            InputAttachmentArrayNonUniformIndexing = 5310,
+            InputAttachmentArrayNonUniformIndexingEXT = 5310,
+            UniformTexelBufferArrayNonUniformIndexing = 5311,
+            UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
+            StorageTexelBufferArrayNonUniformIndexing = 5312,
+            StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
+            RayTracingNV = 5340,
+            RayTracingMotionBlurNV = 5341,
+            VulkanMemoryModel = 5345,
+            VulkanMemoryModelKHR = 5345,
+            VulkanMemoryModelDeviceScope = 5346,
+            VulkanMemoryModelDeviceScopeKHR = 5346,
+            PhysicalStorageBufferAddresses = 5347,
+            PhysicalStorageBufferAddressesEXT = 5347,
+            ComputeDerivativeGroupLinearNV = 5350,
+            RayTracingProvisionalKHR = 5353,
+            CooperativeMatrixNV = 5357,
+            FragmentShaderSampleInterlockEXT = 5363,
+            FragmentShaderShadingRateInterlockEXT = 5372,
+            ShaderSMBuiltinsNV = 5373,
+            FragmentShaderPixelInterlockEXT = 5378,
+            DemoteToHelperInvocation = 5379,
+            DemoteToHelperInvocationEXT = 5379,
+            BindlessTextureNV = 5390,
+            SubgroupShuffleINTEL = 5568,
+            SubgroupBufferBlockIOINTEL = 5569,
+            SubgroupImageBlockIOINTEL = 5570,
+            SubgroupImageMediaBlockIOINTEL = 5579,
+            RoundToInfinityINTEL = 5582,
+            FloatingPointModeINTEL = 5583,
+            IntegerFunctions2INTEL = 5584,
+            FunctionPointersINTEL = 5603,
+            IndirectReferencesINTEL = 5604,
+            AsmINTEL = 5606,
+            AtomicFloat32MinMaxEXT = 5612,
+            AtomicFloat64MinMaxEXT = 5613,
+            AtomicFloat16MinMaxEXT = 5616,
+            VectorComputeINTEL = 5617,
+            VectorAnyINTEL = 5619,
+            ExpectAssumeKHR = 5629,
+            SubgroupAvcMotionEstimationINTEL = 5696,
+            SubgroupAvcMotionEstimationIntraINTEL = 5697,
+            SubgroupAvcMotionEstimationChromaINTEL = 5698,
+            VariableLengthArrayINTEL = 5817,
+            FunctionFloatControlINTEL = 5821,
+            FPGAMemoryAttributesINTEL = 5824,
+            FPFastMathModeINTEL = 5837,
+            ArbitraryPrecisionIntegersINTEL = 5844,
+            ArbitraryPrecisionFloatingPointINTEL = 5845,
+            UnstructuredLoopControlsINTEL = 5886,
+            FPGALoopControlsINTEL = 5888,
+            KernelAttributesINTEL = 5892,
+            FPGAKernelAttributesINTEL = 5897,
+            FPGAMemoryAccessesINTEL = 5898,
+            FPGAClusterAttributesINTEL = 5904,
+            LoopFuseINTEL = 5906,
+            MemoryAccessAliasingINTEL = 5910,
+            FPGABufferLocationINTEL = 5920,
+            ArbitraryPrecisionFixedPointINTEL = 5922,
+            USMStorageClassesINTEL = 5935,
+            IOPipesINTEL = 5943,
+            BlockingPipesINTEL = 5945,
+            FPGARegINTEL = 5948,
+            DotProductInputAll = 6016,
+            DotProductInputAllKHR = 6016,
+            DotProductInput4x8Bit = 6017,
+            DotProductInput4x8BitKHR = 6017,
+            DotProductInput4x8BitPacked = 6018,
+            DotProductInput4x8BitPackedKHR = 6018,
+            DotProduct = 6019,
+            DotProductKHR = 6019,
+            RayCullMaskKHR = 6020,
+            BitInstructions = 6025,
+            GroupNonUniformRotateKHR = 6026,
+            AtomicFloat32AddEXT = 6033,
+            AtomicFloat64AddEXT = 6034,
+            LongConstantCompositeINTEL = 6089,
+            OptNoneINTEL = 6094,
+            AtomicFloat16AddEXT = 6095,
+            DebugInfoModuleINTEL = 6114,
+            SplitBarrierINTEL = 6141,
+            GroupUniformArithmeticKHR = 6400,
+        }
+
+        [AllowDuplicates, CRepr] public enum RayFlagsShift
+        {
+            OpaqueKHR = 0,
+            NoOpaqueKHR = 1,
+            TerminateOnFirstHitKHR = 2,
+            SkipClosestHitShaderKHR = 3,
+            CullBackFacingTrianglesKHR = 4,
+            CullFrontFacingTrianglesKHR = 5,
+            CullOpaqueKHR = 6,
+            CullNoOpaqueKHR = 7,
+            SkipTrianglesKHR = 8,
+            SkipAABBsKHR = 9,
+        }
+
+        [AllowDuplicates, CRepr] public enum RayFlagsMask
+        {
+            MaskNone = 0,
+            OpaqueKHR = 0x00000001,
+            NoOpaqueKHR = 0x00000002,
+            TerminateOnFirstHitKHR = 0x00000004,
+            SkipClosestHitShaderKHR = 0x00000008,
+            CullBackFacingTrianglesKHR = 0x00000010,
+            CullFrontFacingTrianglesKHR = 0x00000020,
+            CullOpaqueKHR = 0x00000040,
+            CullNoOpaqueKHR = 0x00000080,
+            SkipTrianglesKHR = 0x00000100,
+            SkipAABBsKHR = 0x00000200,
+        }
+
+        [AllowDuplicates, CRepr] public enum RayQueryIntersection
+        {
+            RayQueryCandidateIntersectionKHR = 0,
+            RayQueryCommittedIntersectionKHR = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum RayQueryCommittedIntersectionType
+        {
+            RayQueryCommittedIntersectionNoneKHR = 0,
+            RayQueryCommittedIntersectionTriangleKHR = 1,
+            RayQueryCommittedIntersectionGeneratedKHR = 2,
+        }
+
+        [AllowDuplicates, CRepr] public enum RayQueryCandidateIntersectionType
+        {
+            RayQueryCandidateIntersectionTriangleKHR = 0,
+            RayQueryCandidateIntersectionAABBKHR = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum FragmentShadingRateShift
+        {
+            Vertical2Pixels = 0,
+            Vertical4Pixels = 1,
+            Horizontal2Pixels = 2,
+            Horizontal4Pixels = 3,
+        }
+
+        [AllowDuplicates, CRepr] public enum FragmentShadingRateMask
+        {
+            MaskNone = 0,
+            Vertical2Pixels = 0x00000001,
+            Vertical4Pixels = 0x00000002,
+            Horizontal2Pixels = 0x00000004,
+            Horizontal4Pixels = 0x00000008,
+        }
+
+        [AllowDuplicates, CRepr] public enum FPDenormMode
+        {
+            Preserve = 0,
+            FlushToZero = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum FPOperationMode
+        {
+            IEEE = 0,
+            ALT = 1,
+        }
+
+        [AllowDuplicates, CRepr] public enum QuantizationModes
+        {
+            TRN = 0,
+            TRN_ZERO = 1,
+            RND = 2,
+            RND_ZERO = 3,
+            RND_INF = 4,
+            RND_MIN_INF = 5,
+            RND_CONV = 6,
+            RND_CONV_ODD = 7,
+        }
+
+        [AllowDuplicates, CRepr] public enum OverflowModes
+        {
+            WRAP = 0,
+            SAT = 1,
+            SAT_ZERO = 2,
+            SAT_SYM = 3,
+        }
+
+        [AllowDuplicates, CRepr] public enum PackedVectorFormat
+        {
+            PackedVectorFormat4x8Bit = 0,
+            PackedVectorFormat4x8BitKHR = 0,
+        }
+
+        [AllowDuplicates, CRepr] public 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,
+            OpGroupNonUniformRotateKHR = 4431,
+            OpSubgroupReadInvocationKHR = 4432,
+            OpTraceRayKHR = 4445,
+            OpExecuteCallableKHR = 4446,
+            OpConvertUToAccelerationStructureKHR = 4447,
+            OpIgnoreIntersectionKHR = 4448,
+            OpTerminateRayKHR = 4449,
+            OpSDot = 4450,
+            OpSDotKHR = 4450,
+            OpUDot = 4451,
+            OpUDotKHR = 4451,
+            OpSUDot = 4452,
+            OpSUDotKHR = 4452,
+            OpSDotAccSat = 4453,
+            OpSDotAccSatKHR = 4453,
+            OpUDotAccSat = 4454,
+            OpUDotAccSatKHR = 4454,
+            OpSUDotAccSat = 4455,
+            OpSUDotAccSatKHR = 4455,
+            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,
+            OpDemoteToHelperInvocation = 5380,
+            OpDemoteToHelperInvocationEXT = 5380,
+            OpIsHelperInvocationEXT = 5381,
+            OpConvertUToImageNV = 5391,
+            OpConvertUToSamplerNV = 5392,
+            OpConvertImageToUNV = 5393,
+            OpConvertSamplerToUNV = 5394,
+            OpConvertUToSampledImageNV = 5395,
+            OpConvertSampledImageToUNV = 5396,
+            OpSamplerImageAddressingModeNV = 5397,
+            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,
+            OpConstantFunctionPointerINTEL = 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,
+            OpArbitraryFloatSinCosPiINTEL = 5840,
+            OpArbitraryFloatCastINTEL = 5841,
+            OpArbitraryFloatCastFromIntINTEL = 5842,
+            OpArbitraryFloatCastToIntINTEL = 5843,
+            OpArbitraryFloatAddINTEL = 5846,
+            OpArbitraryFloatSubINTEL = 5847,
+            OpArbitraryFloatMulINTEL = 5848,
+            OpArbitraryFloatDivINTEL = 5849,
+            OpArbitraryFloatGTINTEL = 5850,
+            OpArbitraryFloatGEINTEL = 5851,
+            OpArbitraryFloatLTINTEL = 5852,
+            OpArbitraryFloatLEINTEL = 5853,
+            OpArbitraryFloatEQINTEL = 5854,
+            OpArbitraryFloatRecipINTEL = 5855,
+            OpArbitraryFloatRSqrtINTEL = 5856,
+            OpArbitraryFloatCbrtINTEL = 5857,
+            OpArbitraryFloatHypotINTEL = 5858,
+            OpArbitraryFloatSqrtINTEL = 5859,
+            OpArbitraryFloatLogINTEL = 5860,
+            OpArbitraryFloatLog2INTEL = 5861,
+            OpArbitraryFloatLog10INTEL = 5862,
+            OpArbitraryFloatLog1pINTEL = 5863,
+            OpArbitraryFloatExpINTEL = 5864,
+            OpArbitraryFloatExp2INTEL = 5865,
+            OpArbitraryFloatExp10INTEL = 5866,
+            OpArbitraryFloatExpm1INTEL = 5867,
+            OpArbitraryFloatSinINTEL = 5868,
+            OpArbitraryFloatCosINTEL = 5869,
+            OpArbitraryFloatSinCosINTEL = 5870,
+            OpArbitraryFloatSinPiINTEL = 5871,
+            OpArbitraryFloatCosPiINTEL = 5872,
+            OpArbitraryFloatASinINTEL = 5873,
+            OpArbitraryFloatASinPiINTEL = 5874,
+            OpArbitraryFloatACosINTEL = 5875,
+            OpArbitraryFloatACosPiINTEL = 5876,
+            OpArbitraryFloatATanINTEL = 5877,
+            OpArbitraryFloatATanPiINTEL = 5878,
+            OpArbitraryFloatATan2INTEL = 5879,
+            OpArbitraryFloatPowINTEL = 5880,
+            OpArbitraryFloatPowRINTEL = 5881,
+            OpArbitraryFloatPowNINTEL = 5882,
+            OpLoopControlINTEL = 5887,
+            OpAliasDomainDeclINTEL = 5911,
+            OpAliasScopeDeclINTEL = 5912,
+            OpAliasScopeListDeclINTEL = 5913,
+            OpFixedSqrtINTEL = 5923,
+            OpFixedRecipINTEL = 5924,
+            OpFixedRsqrtINTEL = 5925,
+            OpFixedSinINTEL = 5926,
+            OpFixedCosINTEL = 5927,
+            OpFixedSinCosINTEL = 5928,
+            OpFixedSinPiINTEL = 5929,
+            OpFixedCosPiINTEL = 5930,
+            OpFixedSinCosPiINTEL = 5931,
+            OpFixedLogINTEL = 5932,
+            OpFixedExpINTEL = 5933,
+            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,
+            OpControlBarrierArriveINTEL = 6142,
+            OpControlBarrierWaitINTEL = 6143,
+            OpGroupIMulKHR = 6401,
+            OpGroupFMulKHR = 6402,
+            OpGroupBitwiseAndKHR = 6403,
+            OpGroupBitwiseOrKHR = 6404,
+            OpGroupBitwiseXorKHR = 6405,
+            OpGroupLogicalAndKHR = 6406,
+            OpGroupLogicalOrKHR = 6407,
+            OpGroupLogicalXorKHR = 6408,
+        }
+    }
+}
+

+ 48 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json

@@ -4183,6 +4183,21 @@
       "capabilities" : [ "SubgroupVoteKHR" ],
       "version" : "None"
     },
+    {
+      "opname" : "OpGroupNonUniformRotateKHR",
+      "class"  : "Group",
+      "opcode" : 4431,
+      "operands" : [
+        { "kind" : "IdResultType" },
+        { "kind" : "IdResult" },
+        { "kind" : "IdScope", "name" : "'Execution'" },
+        { "kind" : "IdRef", "name" : "'Value'" },
+        { "kind" : "IdRef", "name" : "'Delta'" },
+        { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+      ],
+      "capabilities" : [ "GroupNonUniformRotateKHR" ],
+      "version" : "None"
+    },
     {
       "opname" : "OpSubgroupReadInvocationKHR",
       "class"  : "Group",
@@ -9434,6 +9449,10 @@
         {
           "enumerant" : "CPP_for_OpenCL",
           "value" : 6
+        },
+        {
+          "enumerant" : "SYCL",
+          "value" : 7
         }
       ]
     },
@@ -10110,6 +10129,15 @@
           ],
           "capabilities" : [ "FPGAKernelAttributesINTEL" ],
           "version" : "None"
+        },
+        {
+          "enumerant" : "NamedBarrierCountINTEL",
+          "value" : 6417,
+          "parameters" : [
+            { "kind" : "LiteralInteger", "name" : "'Barrier Count'" }
+          ],
+          "capabilities" : [ "VectorComputeINTEL" ],
+          "version" : "None"
         }
       ]
     },
@@ -12588,6 +12616,13 @@
           "capabilities" : [ "ShaderSMBuiltinsNV" ],
           "extensions" : [ "SPV_NV_shader_sm_builtins" ],
           "version" : "None"
+        },
+        {
+          "enumerant" : "CullMaskKHR",
+          "value"  : 6021,
+          "capabilities" : [ "RayCullMaskKHR" ],
+          "extensions" : [ "SPV_KHR_ray_cull_mask" ],
+          "version" : "None"
         }
       ]
     },
@@ -13976,12 +14011,25 @@
           "extensions" : [ "SPV_KHR_integer_dot_product" ],
           "version" : "1.6"
         },
+        {
+          "enumerant" : "RayCullMaskKHR",
+          "value" : 6020,
+          "extensions" : [ "SPV_KHR_ray_cull_mask" ],
+          "version" : "None"
+        },
         {
           "enumerant" : "BitInstructions",
           "value" : 6025,
           "extensions" : [ "SPV_KHR_bit_instructions" ],
           "version" : "None"
         },
+        {
+          "enumerant" : "GroupNonUniformRotateKHR",
+          "value" : 6026,
+          "capabilities" : [ "GroupNonUniform" ],
+          "extensions" : [ "SPV_KHR_subgroup_rotate" ],
+          "version" : "None"
+        },
         {
           "enumerant" : "AtomicFloat32AddEXT",
           "value" : 6033,

+ 9 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs

@@ -26,7 +26,7 @@
 // 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, C++, C++11, JSON, Lua, Python, C#, D, Beef
 // 
 // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
 // - 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
+// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+//     e.g.: Spv.Specification.SourceLanguage.GLSL
 // 
 // Some tokens act like mask values, which can be OR'd together,
 // while others are mutually exclusive.  The mask-like ones have
@@ -62,6 +64,7 @@ namespace Spv
             OpenCL_CPP = 4,
             HLSL = 5,
             CPP_for_OpenCL = 6,
+            SYCL = 7,
         }
 
         public enum ExecutionModel
@@ -176,6 +179,7 @@ namespace Spv
             NoGlobalOffsetINTEL = 5895,
             NumSIMDWorkitemsINTEL = 5896,
             SchedulerTargetFmaxMhzINTEL = 5903,
+            NamedBarrierCountINTEL = 6417,
         }
 
         public enum StorageClass
@@ -673,6 +677,7 @@ namespace Spv
             SMCountNV = 5375,
             WarpIDNV = 5376,
             SMIDNV = 5377,
+            CullMaskKHR = 6021,
         }
 
         public enum SelectionControlShift
@@ -1080,7 +1085,9 @@ namespace Spv
             DotProductInput4x8BitPackedKHR = 6018,
             DotProduct = 6019,
             DotProductKHR = 6019,
+            RayCullMaskKHR = 6020,
             BitInstructions = 6025,
+            GroupNonUniformRotateKHR = 6026,
             AtomicFloat32AddEXT = 6033,
             AtomicFloat64AddEXT = 6034,
             LongConstantCompositeINTEL = 6089,
@@ -1546,6 +1553,7 @@ namespace Spv
             OpSubgroupAllKHR = 4428,
             OpSubgroupAnyKHR = 4429,
             OpSubgroupAllEqualKHR = 4430,
+            OpGroupNonUniformRotateKHR = 4431,
             OpSubgroupReadInvocationKHR = 4432,
             OpTraceRayKHR = 4445,
             OpExecuteCallableKHR = 4446,

+ 10 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h

@@ -31,7 +31,7 @@
 
 /*
 ** Enumeration tokens for SPIR-V, in various styles:
-**   C, C++, C++11, JSON, Lua, Python, C#, D
+**   C, C++, C++11, JSON, Lua, Python, C#, D, Beef
 ** 
 ** - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 ** - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -41,6 +41,8 @@
 ** - 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
+** - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+**     e.g.: Spv.Specification.SourceLanguage.GLSL
 ** 
 ** Some tokens act like mask values, which can be OR'd together,
 ** while others are mutually exclusive.  The mask-like ones have
@@ -70,6 +72,7 @@ typedef enum SpvSourceLanguage_ {
     SpvSourceLanguageOpenCL_CPP = 4,
     SpvSourceLanguageHLSL = 5,
     SpvSourceLanguageCPP_for_OpenCL = 6,
+    SpvSourceLanguageSYCL = 7,
     SpvSourceLanguageMax = 0x7fffffff,
 } SpvSourceLanguage;
 
@@ -184,6 +187,7 @@ typedef enum SpvExecutionMode_ {
     SpvExecutionModeNoGlobalOffsetINTEL = 5895,
     SpvExecutionModeNumSIMDWorkitemsINTEL = 5896,
     SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+    SpvExecutionModeNamedBarrierCountINTEL = 6417,
     SpvExecutionModeMax = 0x7fffffff,
 } SpvExecutionMode;
 
@@ -679,6 +683,7 @@ typedef enum SpvBuiltIn_ {
     SpvBuiltInSMCountNV = 5375,
     SpvBuiltInWarpIDNV = 5376,
     SpvBuiltInSMIDNV = 5377,
+    SpvBuiltInCullMaskKHR = 6021,
     SpvBuiltInMax = 0x7fffffff,
 } SpvBuiltIn;
 
@@ -1080,7 +1085,9 @@ typedef enum SpvCapability_ {
     SpvCapabilityDotProductInput4x8BitPackedKHR = 6018,
     SpvCapabilityDotProduct = 6019,
     SpvCapabilityDotProductKHR = 6019,
+    SpvCapabilityRayCullMaskKHR = 6020,
     SpvCapabilityBitInstructions = 6025,
+    SpvCapabilityGroupNonUniformRotateKHR = 6026,
     SpvCapabilityAtomicFloat32AddEXT = 6033,
     SpvCapabilityAtomicFloat64AddEXT = 6034,
     SpvCapabilityLongConstantCompositeINTEL = 6089,
@@ -1544,6 +1551,7 @@ typedef enum SpvOp_ {
     SpvOpSubgroupAllKHR = 4428,
     SpvOpSubgroupAnyKHR = 4429,
     SpvOpSubgroupAllEqualKHR = 4430,
+    SpvOpGroupNonUniformRotateKHR = 4431,
     SpvOpSubgroupReadInvocationKHR = 4432,
     SpvOpTraceRayKHR = 4445,
     SpvOpExecuteCallableKHR = 4446,
@@ -2222,6 +2230,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
     case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;

+ 10 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp

@@ -26,7 +26,7 @@
 // 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, C++, C++11, JSON, Lua, Python, C#, D, Beef
 // 
 // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
 // - 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
+// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+//     e.g.: Spv.Specification.SourceLanguage.GLSL
 // 
 // Some tokens act like mask values, which can be OR'd together,
 // while others are mutually exclusive.  The mask-like ones have
@@ -66,6 +68,7 @@ enum SourceLanguage {
     SourceLanguageOpenCL_CPP = 4,
     SourceLanguageHLSL = 5,
     SourceLanguageCPP_for_OpenCL = 6,
+    SourceLanguageSYCL = 7,
     SourceLanguageMax = 0x7fffffff,
 };
 
@@ -180,6 +183,7 @@ enum ExecutionMode {
     ExecutionModeNoGlobalOffsetINTEL = 5895,
     ExecutionModeNumSIMDWorkitemsINTEL = 5896,
     ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+    ExecutionModeNamedBarrierCountINTEL = 6417,
     ExecutionModeMax = 0x7fffffff,
 };
 
@@ -675,6 +679,7 @@ enum BuiltIn {
     BuiltInSMCountNV = 5375,
     BuiltInWarpIDNV = 5376,
     BuiltInSMIDNV = 5377,
+    BuiltInCullMaskKHR = 6021,
     BuiltInMax = 0x7fffffff,
 };
 
@@ -1076,7 +1081,9 @@ enum Capability {
     CapabilityDotProductInput4x8BitPackedKHR = 6018,
     CapabilityDotProduct = 6019,
     CapabilityDotProductKHR = 6019,
+    CapabilityRayCullMaskKHR = 6020,
     CapabilityBitInstructions = 6025,
+    CapabilityGroupNonUniformRotateKHR = 6026,
     CapabilityAtomicFloat32AddEXT = 6033,
     CapabilityAtomicFloat64AddEXT = 6034,
     CapabilityLongConstantCompositeINTEL = 6089,
@@ -1540,6 +1547,7 @@ enum Op {
     OpSubgroupAllKHR = 4428,
     OpSubgroupAnyKHR = 4429,
     OpSubgroupAllEqualKHR = 4430,
+    OpGroupNonUniformRotateKHR = 4431,
     OpSubgroupReadInvocationKHR = 4432,
     OpTraceRayKHR = 4445,
     OpExecuteCallableKHR = 4446,
@@ -2218,6 +2226,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
     case OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
     case OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupNonUniformRotateKHR: *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;

+ 10 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11

@@ -26,7 +26,7 @@
 // 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, C++, C++11, JSON, Lua, Python, C#, D, Beef
 // 
 // - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 // - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
 // - 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
+// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+//     e.g.: Spv.Specification.SourceLanguage.GLSL
 // 
 // Some tokens act like mask values, which can be OR'd together,
 // while others are mutually exclusive.  The mask-like ones have
@@ -66,6 +68,7 @@ enum class SourceLanguage : unsigned {
     OpenCL_CPP = 4,
     HLSL = 5,
     CPP_for_OpenCL = 6,
+    SYCL = 7,
     Max = 0x7fffffff,
 };
 
@@ -180,6 +183,7 @@ enum class ExecutionMode : unsigned {
     NoGlobalOffsetINTEL = 5895,
     NumSIMDWorkitemsINTEL = 5896,
     SchedulerTargetFmaxMhzINTEL = 5903,
+    NamedBarrierCountINTEL = 6417,
     Max = 0x7fffffff,
 };
 
@@ -675,6 +679,7 @@ enum class BuiltIn : unsigned {
     SMCountNV = 5375,
     WarpIDNV = 5376,
     SMIDNV = 5377,
+    CullMaskKHR = 6021,
     Max = 0x7fffffff,
 };
 
@@ -1076,7 +1081,9 @@ enum class Capability : unsigned {
     DotProductInput4x8BitPackedKHR = 6018,
     DotProduct = 6019,
     DotProductKHR = 6019,
+    RayCullMaskKHR = 6020,
     BitInstructions = 6025,
+    GroupNonUniformRotateKHR = 6026,
     AtomicFloat32AddEXT = 6033,
     AtomicFloat64AddEXT = 6034,
     LongConstantCompositeINTEL = 6089,
@@ -1540,6 +1547,7 @@ enum class Op : unsigned {
     OpSubgroupAllKHR = 4428,
     OpSubgroupAnyKHR = 4429,
     OpSubgroupAllEqualKHR = 4430,
+    OpGroupNonUniformRotateKHR = 4431,
     OpSubgroupReadInvocationKHR = 4432,
     OpTraceRayKHR = 4445,
     OpExecuteCallableKHR = 4446,
@@ -2218,6 +2226,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
     case Op::OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;

+ 12 - 4
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json

@@ -36,7 +36,7 @@
                 ],
                 [
                     "Enumeration tokens for SPIR-V, in various styles:",
-                    "  C, C++, C++11, JSON, Lua, Python, C#, D",
+                    "  C, C++, C++11, JSON, Lua, Python, C#, D, Beef",
                     "",
                     "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL",
                     "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL",
@@ -46,6 +46,8 @@
                     "- 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",
+                    "- Beef will use enum classes in the Specification class located in the \"Spv\" namespace,",
+                    "    e.g.: Spv.Specification.SourceLanguage.GLSL",
                     "",
                     "Some tokens act like mask values, which can be OR'd together,",
                     "while others are mutually exclusive.  The mask-like ones have",
@@ -72,7 +74,8 @@
                     "OpenCL_C": 3,
                     "OpenCL_CPP": 4,
                     "HLSL": 5,
-                    "CPP_for_OpenCL": 6
+                    "CPP_for_OpenCL": 6,
+                    "SYCL": 7
                 }
             },
             {
@@ -198,7 +201,8 @@
                     "MaxWorkDimINTEL": 5894,
                     "NoGlobalOffsetINTEL": 5895,
                     "NumSIMDWorkitemsINTEL": 5896,
-                    "SchedulerTargetFmaxMhzINTEL": 5903
+                    "SchedulerTargetFmaxMhzINTEL": 5903,
+                    "NamedBarrierCountINTEL": 6417
                 }
             },
             {
@@ -703,7 +707,8 @@
                     "WarpsPerSMNV": 5374,
                     "SMCountNV": 5375,
                     "WarpIDNV": 5376,
-                    "SMIDNV": 5377
+                    "SMIDNV": 5377,
+                    "CullMaskKHR": 6021
                 }
             },
             {
@@ -1058,7 +1063,9 @@
                     "DotProductInput4x8BitPackedKHR": 6018,
                     "DotProduct": 6019,
                     "DotProductKHR": 6019,
+                    "RayCullMaskKHR": 6020,
                     "BitInstructions": 6025,
+                    "GroupNonUniformRotateKHR": 6026,
                     "AtomicFloat32AddEXT": 6033,
                     "AtomicFloat64AddEXT": 6034,
                     "LongConstantCompositeINTEL": 6089,
@@ -1533,6 +1540,7 @@
                     "OpSubgroupAllKHR": 4428,
                     "OpSubgroupAnyKHR": 4429,
                     "OpSubgroupAllEqualKHR": 4430,
+                    "OpGroupNonUniformRotateKHR": 4431,
                     "OpSubgroupReadInvocationKHR": 4432,
                     "OpTraceRayKHR": 4445,
                     "OpExecuteCallableKHR": 4446,

+ 9 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua

@@ -26,7 +26,7 @@
 -- 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, C++, C++11, JSON, Lua, Python, C#, D, Beef
 -- 
 -- - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 -- - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
 -- - 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
+-- - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+--     e.g.: Spv.Specification.SourceLanguage.GLSL
 -- 
 -- Some tokens act like mask values, which can be OR'd together,
 -- while others are mutually exclusive.  The mask-like ones have
@@ -57,6 +59,7 @@ spv = {
         OpenCL_CPP = 4,
         HLSL = 5,
         CPP_for_OpenCL = 6,
+        SYCL = 7,
     },
 
     ExecutionModel = {
@@ -167,6 +170,7 @@ spv = {
         NoGlobalOffsetINTEL = 5895,
         NumSIMDWorkitemsINTEL = 5896,
         SchedulerTargetFmaxMhzINTEL = 5903,
+        NamedBarrierCountINTEL = 6417,
     },
 
     StorageClass = {
@@ -647,6 +651,7 @@ spv = {
         SMCountNV = 5375,
         WarpIDNV = 5376,
         SMIDNV = 5377,
+        CullMaskKHR = 6021,
     },
 
     SelectionControlShift = {
@@ -1038,7 +1043,9 @@ spv = {
         DotProductInput4x8BitPackedKHR = 6018,
         DotProduct = 6019,
         DotProductKHR = 6019,
+        RayCullMaskKHR = 6020,
         BitInstructions = 6025,
+        GroupNonUniformRotateKHR = 6026,
         AtomicFloat32AddEXT = 6033,
         AtomicFloat64AddEXT = 6034,
         LongConstantCompositeINTEL = 6089,
@@ -1491,6 +1498,7 @@ spv = {
         OpSubgroupAllKHR = 4428,
         OpSubgroupAnyKHR = 4429,
         OpSubgroupAllEqualKHR = 4430,
+        OpGroupNonUniformRotateKHR = 4431,
         OpSubgroupReadInvocationKHR = 4432,
         OpTraceRayKHR = 4445,
         OpExecuteCallableKHR = 4446,

+ 9 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py

@@ -26,7 +26,7 @@
 # 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, C++, C++11, JSON, Lua, Python, C#, D, Beef
 # 
 # - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
 # - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -36,6 +36,8 @@
 # - 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
+# - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+#     e.g.: Spv.Specification.SourceLanguage.GLSL
 # 
 # Some tokens act like mask values, which can be OR'd together,
 # while others are mutually exclusive.  The mask-like ones have
@@ -57,6 +59,7 @@ spv = {
         'OpenCL_CPP' : 4,
         'HLSL' : 5,
         'CPP_for_OpenCL' : 6,
+        'SYCL' : 7,
     },
 
     'ExecutionModel' : {
@@ -167,6 +170,7 @@ spv = {
         'NoGlobalOffsetINTEL' : 5895,
         'NumSIMDWorkitemsINTEL' : 5896,
         'SchedulerTargetFmaxMhzINTEL' : 5903,
+        'NamedBarrierCountINTEL' : 6417,
     },
 
     'StorageClass' : {
@@ -647,6 +651,7 @@ spv = {
         'SMCountNV' : 5375,
         'WarpIDNV' : 5376,
         'SMIDNV' : 5377,
+        'CullMaskKHR' : 6021,
     },
 
     'SelectionControlShift' : {
@@ -1038,7 +1043,9 @@ spv = {
         'DotProductInput4x8BitPackedKHR' : 6018,
         'DotProduct' : 6019,
         'DotProductKHR' : 6019,
+        'RayCullMaskKHR' : 6020,
         'BitInstructions' : 6025,
+        'GroupNonUniformRotateKHR' : 6026,
         'AtomicFloat32AddEXT' : 6033,
         'AtomicFloat64AddEXT' : 6034,
         'LongConstantCompositeINTEL' : 6089,
@@ -1491,6 +1498,7 @@ spv = {
         'OpSubgroupAllKHR' : 4428,
         'OpSubgroupAnyKHR' : 4429,
         'OpSubgroupAllEqualKHR' : 4430,
+        'OpGroupNonUniformRotateKHR' : 4431,
         'OpSubgroupReadInvocationKHR' : 4432,
         'OpTraceRayKHR' : 4445,
         'OpExecuteCallableKHR' : 4446,

+ 9 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d

@@ -31,7 +31,7 @@
 
 /+
  + Enumeration tokens for SPIR-V, in various styles:
- +   C, C++, C++11, JSON, Lua, Python, C#, D
+ +   C, C++, C++11, JSON, Lua, Python, C#, D, Beef
  + 
  + - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
  + - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
@@ -41,6 +41,8 @@
  + - 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
+ + - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+ +     e.g.: Spv.Specification.SourceLanguage.GLSL
  + 
  + Some tokens act like mask values, which can be OR'd together,
  + while others are mutually exclusive.  The mask-like ones have
@@ -65,6 +67,7 @@ enum SourceLanguage : uint
     OpenCL_CPP = 4,
     HLSL = 5,
     CPP_for_OpenCL = 6,
+    SYCL = 7,
 }
 
 enum ExecutionModel : uint
@@ -179,6 +182,7 @@ enum ExecutionMode : uint
     NoGlobalOffsetINTEL = 5895,
     NumSIMDWorkitemsINTEL = 5896,
     SchedulerTargetFmaxMhzINTEL = 5903,
+    NamedBarrierCountINTEL = 6417,
 }
 
 enum StorageClass : uint
@@ -676,6 +680,7 @@ enum BuiltIn : uint
     SMCountNV = 5375,
     WarpIDNV = 5376,
     SMIDNV = 5377,
+    CullMaskKHR = 6021,
 }
 
 enum SelectionControlShift : uint
@@ -1083,7 +1088,9 @@ enum Capability : uint
     DotProductInput4x8BitPackedKHR = 6018,
     DotProduct = 6019,
     DotProductKHR = 6019,
+    RayCullMaskKHR = 6020,
     BitInstructions = 6025,
+    GroupNonUniformRotateKHR = 6026,
     AtomicFloat32AddEXT = 6033,
     AtomicFloat64AddEXT = 6034,
     LongConstantCompositeINTEL = 6089,
@@ -1549,6 +1556,7 @@ enum Op : uint
     OpSubgroupAllKHR = 4428,
     OpSubgroupAnyKHR = 4429,
     OpSubgroupAllEqualKHR = 4430,
+    OpGroupNonUniformRotateKHR = 4431,
     OpSubgroupReadInvocationKHR = 4432,
     OpTraceRayKHR = 4445,
     OpExecuteCallableKHR = 4446,

+ 42 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp

@@ -199,7 +199,7 @@ namespace {
 
     const std::string TPrinter::DocComment2 =
         "Enumeration tokens for SPIR-V, in various styles:\n"
-        "  C, C++, C++11, JSON, Lua, Python, C#, D\n"
+        "  C, C++, C++11, JSON, Lua, Python, C#, D, Beef\n"
         "\n"
         "- C will have tokens with a \"Spv\" prefix, e.g.: SpvSourceLanguageGLSL\n"
         "- C++ will have tokens in the \"spv\" name space, e.g.: spv::SourceLanguageGLSL\n"
@@ -209,6 +209,8 @@ namespace {
         "- C# will use enum classes in the Specification class located in the \"Spv\" namespace,\n"
         "    e.g.: Spv.Specification.SourceLanguage.GLSL\n"
         "- D will have tokens under the \"spv\" module, e.g: spv.SourceLanguage.GLSL\n"
+        "- Beef will use enum classes in the Specification class located in the \"Spv\" namespace,\n"
+        "    e.g.: Spv.Specification.SourceLanguage.GLSL\n"
         "\n"
         "Some tokens act like mask values, which can be OR'd together,\n"
         "while others are mutually exclusive.  The mask-like ones have\n"
@@ -779,6 +781,43 @@ namespace {
         }
     };
 
+    // Beef printer
+    class TPrinterBeef final : public TPrinter {
+    private:
+        std::string commentBOL() const override { return "// "; }
+
+        void printPrologue(std::ostream& out) const override {
+            out << "namespace Spv\n{\n";
+            out << indent() << "using System;\n\n";
+            out << indent() << "public static class Specification\n";
+            out << indent() << "{\n";
+        }
+
+        void printEpilogue(std::ostream& out) const override {
+            out << indent() << "}\n";
+            out << "}\n";
+        }
+
+        std::string enumBeg(const std::string& s, enumStyle_t style) const override {
+            return indent(2) + "[AllowDuplicates, CRepr] public enum " + s + styleStr(style) + "\n" + indent(2) + "{\n";
+        }
+
+        std::string enumEnd(const std::string& s, enumStyle_t style, bool isLast) const override {
+            return indent(2) + "}" + +(isLast ? "\n" : "\n\n");
+        }
+
+        std::string enumFmt(const std::string& s, const valpair_t& v,
+            enumStyle_t style, bool isLast) const override {
+            return indent(3) + prependIfDigit(s, v.second) + " = " + fmtStyleVal(v.first, style) + ",\n";
+        }
+
+        std::string fmtConstInt(unsigned val, const std::string& name,
+            const char* fmt, bool isLast) const override {
+            return indent(2) + std::string("public const uint32 ") + name +
+                " = " + fmtNum(fmt, val) + (isLast ? ";\n\n" : ";\n");
+        }
+    };
+
 } // namespace
 
 namespace spv {
@@ -795,6 +834,7 @@ namespace spv {
         langInfo.push_back(std::make_pair(ELangPython,  "spirv.py"));
         langInfo.push_back(std::make_pair(ELangCSharp,  "spirv.cs"));
         langInfo.push_back(std::make_pair(ELangD,       "spv.d"));
+        langInfo.push_back(std::make_pair(ELangBeef,    "spirv.bf"));
 
         for (const auto& lang : langInfo) {
             std::ofstream out(lang.second, std::ios::out);
@@ -822,6 +862,7 @@ namespace spv {
             case ELangPython:  p = TPrinterPtr(new TPrinterPython);  break;
             case ELangCSharp:  p = TPrinterPtr(new TPrinterCSharp);  break;
             case ELangD:       p = TPrinterPtr(new TPrinterD);       break;
+            case ELangBeef:    p = TPrinterPtr(new TPrinterBeef);    break;
             case ELangAll:     PrintAllHeaders();                    break;
             default:
                 std::cerr << "Unknown language." << std::endl;

+ 1 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.h

@@ -43,6 +43,7 @@ namespace spv {
         ELangPython,   // Python
         ELangCSharp,   // CSharp
         ELangD,        // D
+        ELangBeef,     // Beef
 
         ELangAll,      // print headers in all languages to files
     };

+ 3 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/main.cpp

@@ -52,6 +52,7 @@ void Usage()
            "     Python - Python module (also accepts Py)\n"
            "     C#     - C# module (also accepts CSharp)\n"
            "     D      - D module\n"
+           "     Beef   - Beef module\n"
            "  -H print header in all supported languages to files in current directory\n"
            );
 }
@@ -96,6 +97,8 @@ bool ProcessArguments(int argc, char* argv[])
                     Language = spv::ELangCSharp;
                 } else if (language == "d") {
                     Language = spv::ELangD;
+                } else if (language == "beef") {
+                    Language = spv::ELangBeef;
                 } else
                     return false;
 

+ 10 - 0
ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp

@@ -903,10 +903,20 @@ Optimizer::PassToken CreateConvertToSampledImagePass(
     const std::vector<opt::DescriptorSetAndBinding>&
         descriptor_set_binding_pairs);
 
+// Create an interface-variable-scalar-replacement pass that replaces array or
+// matrix interface variables with a series of scalar or vector interface
+// variables. For example, it replaces `float3 foo[2]` with `float3 foo0, foo1`.
+Optimizer::PassToken CreateInterfaceVariableScalarReplacementPass();
+
 // Creates a remove-dont-inline pass to remove the |DontInline| function control
 // from every function in the module.  This is useful if you want the inliner to
 // inline these functions some reason.
 Optimizer::PassToken CreateRemoveDontInlinePass();
+// Create a fix-func-call-param pass to fix non memory argument for the function
+// call, as spirv-validation requires function parameters to be an memory
+// object, currently the pass would remove accesschain pointer argument passed
+// to the function
+Optimizer::PassToken CreateFixFuncCallArgumentsPass();
 }  // namespace spvtools
 
 #endif  // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/windows/build.bat

@@ -22,7 +22,7 @@ set BUILD_TYPE=%1
 set VS_VERSION=%2
 
 :: Force usage of python 3.6
-set PATH=C:\python36;"C:\Program Files\CMake\bin";%PATH%
+set PATH=C:\python36;"C:\Program Files\cmake-3.23.1-windows-x86_64\bin";%PATH%
 
 cd %SRC%
 git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers

+ 2 - 2
ThirdParty/Glslang/External/spirv-tools/source/CMakeLists.txt

@@ -197,7 +197,7 @@ set(SPIRV_TOOLS_CHANGES_FILE
 add_custom_command(OUTPUT ${SPIRV_TOOLS_BUILD_VERSION_INC}
    COMMAND ${PYTHON_EXECUTABLE}
            ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR}
-           ${spirv-tools_SOURCE_DIR} ${SPIRV_TOOLS_BUILD_VERSION_INC}
+           ${SPIRV_TOOLS_CHANGES_FILE} ${SPIRV_TOOLS_BUILD_VERSION_INC}
    DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC_GENERATOR}
            ${SPIRV_TOOLS_CHANGES_FILE}
    COMMENT "Update build-version.inc in the SPIRV-Tools build directory (if necessary).")
@@ -407,7 +407,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   find_library(LIBRT rt)
   if(LIBRT)
     foreach(target ${SPIRV_TOOLS_TARGETS})
-      target_link_libraries(${target} ${LIBRT})
+      target_link_libraries(${target} rt)
     endforeach()
   endif()
 endif()

+ 8 - 2
ThirdParty/Glslang/External/spirv-tools/source/link/linker.cpp

@@ -34,6 +34,7 @@
 #include "source/opt/ir_loader.h"
 #include "source/opt/pass_manager.h"
 #include "source/opt/remove_duplicates_pass.h"
+#include "source/opt/remove_unused_interface_variables_pass.h"
 #include "source/opt/type_manager.h"
 #include "source/spirv_constant.h"
 #include "source/spirv_target_env.h"
@@ -807,11 +808,16 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries,
   pass_res = manager.Run(&linked_context);
   if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
 
-  // Phase 11: Warn if SPIR-V limits were exceeded
+  // Phase 11: Recompute EntryPoint variables
+  manager.AddPass<opt::RemoveUnusedInterfaceVariablesPass>();
+  pass_res = manager.Run(&linked_context);
+  if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
+
+  // Phase 12: Warn if SPIR-V limits were exceeded
   res = VerifyLimits(consumer, linked_context);
   if (res != SPV_SUCCESS) return res;
 
-  // Phase 12: Output the module
+  // Phase 13: Output the module
   linked_context.module()->ToBinary(linked_binary, true);
 
   return SPV_SUCCESS;

+ 1 - 0
ThirdParty/Glslang/External/spirv-tools/source/opcode.cpp

@@ -528,6 +528,7 @@ bool spvOpcodeIsNonUniformGroupOperation(SpvOp opcode) {
     case SpvOpGroupNonUniformLogicalXor:
     case SpvOpGroupNonUniformQuadBroadcast:
     case SpvOpGroupNonUniformQuadSwap:
+    case SpvOpGroupNonUniformRotateKHR:
       return true;
     default:
       return false;

+ 4 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/CMakeLists.txt

@@ -12,6 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 set(SPIRV_TOOLS_OPT_SOURCES
+  fix_func_call_arguments.h
   aggressive_dead_code_elim_pass.h
   amd_ext_to_khr.h
   basic_block.h
@@ -67,6 +68,7 @@ set(SPIRV_TOOLS_OPT_SOURCES
   instruction.h
   instruction_list.h
   instrument_pass.h
+  interface_var_sroa.h
   interp_fixup_pass.h
   ir_builder.h
   ir_context.h
@@ -126,6 +128,7 @@ set(SPIRV_TOOLS_OPT_SOURCES
   workaround1209.h
   wrap_opkill.h
 
+  fix_func_call_arguments.cpp
   aggressive_dead_code_elim_pass.cpp
   amd_ext_to_khr.cpp
   basic_block.cpp
@@ -180,6 +183,7 @@ set(SPIRV_TOOLS_OPT_SOURCES
   instruction.cpp
   instruction_list.cpp
   instrument_pass.cpp
+  interface_var_sroa.cpp
   interp_fixup_pass.cpp
   ir_context.cpp
   ir_loader.cpp

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp

@@ -967,6 +967,8 @@ void AggressiveDCEPass::InitExtensions() {
       "SPV_KHR_integer_dot_product",
       "SPV_EXT_shader_image_int64",
       "SPV_KHR_non_semantic_info",
+      "SPV_KHR_uniform_group_instructions",
+      "SPV_KHR_fragment_shader_barycentric",
   });
 }
 

+ 90 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/fix_func_call_arguments.cpp

@@ -0,0 +1,90 @@
+// Copyright (c) 2022 Advanced Micro Devices, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "fix_func_call_arguments.h"
+
+#include "ir_builder.h"
+
+using namespace spvtools;
+using namespace opt;
+
+bool FixFuncCallArgumentsPass::ModuleHasASingleFunction() {
+  auto funcsNum = get_module()->end() - get_module()->begin();
+  return funcsNum == 1;
+}
+
+Pass::Status FixFuncCallArgumentsPass::Process() {
+  bool modified = false;
+  if (ModuleHasASingleFunction()) return Status::SuccessWithoutChange;
+  for (auto& func : *get_module()) {
+    func.ForEachInst([this, &modified](Instruction* inst) {
+      if (inst->opcode() == SpvOpFunctionCall) {
+        modified |= FixFuncCallArguments(inst);
+      }
+    });
+  }
+  return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
+}
+
+bool FixFuncCallArgumentsPass::FixFuncCallArguments(
+    Instruction* func_call_inst) {
+  bool modified = false;
+  for (uint32_t i = 0; i < func_call_inst->NumInOperands(); ++i) {
+    Operand& op = func_call_inst->GetInOperand(i);
+    if (op.type != SPV_OPERAND_TYPE_ID) continue;
+    Instruction* operand_inst = get_def_use_mgr()->GetDef(op.AsId());
+    if (operand_inst->opcode() == SpvOpAccessChain) {
+      uint32_t var_id =
+          ReplaceAccessChainFuncCallArguments(func_call_inst, operand_inst);
+      func_call_inst->SetInOperand(i, {var_id});
+      modified = true;
+    }
+  }
+  if (modified) {
+    context()->UpdateDefUse(func_call_inst);
+  }
+  return modified;
+}
+
+uint32_t FixFuncCallArgumentsPass::ReplaceAccessChainFuncCallArguments(
+    Instruction* func_call_inst, Instruction* operand_inst) {
+  InstructionBuilder builder(
+      context(), func_call_inst,
+      IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+  Instruction* next_insert_point = func_call_inst->NextNode();
+  // Get Variable insertion point
+  Function* func = context()->get_instr_block(func_call_inst)->GetParent();
+  Instruction* variable_insertion_point = &*(func->begin()->begin());
+  Instruction* op_ptr_type = get_def_use_mgr()->GetDef(operand_inst->type_id());
+  Instruction* op_type =
+      get_def_use_mgr()->GetDef(op_ptr_type->GetSingleWordInOperand(1));
+  uint32_t varType = context()->get_type_mgr()->FindPointerToType(
+      op_type->result_id(), SpvStorageClassFunction);
+  // Create new variable
+  builder.SetInsertPoint(variable_insertion_point);
+  Instruction* var = builder.AddVariable(varType, SpvStorageClassFunction);
+  // Load access chain to the new variable before function call
+  builder.SetInsertPoint(func_call_inst);
+
+  uint32_t operand_id = operand_inst->result_id();
+  Instruction* load = builder.AddLoad(op_type->result_id(), operand_id);
+  builder.AddStore(var->result_id(), load->result_id());
+  // Load return value to the acesschain after function call
+  builder.SetInsertPoint(next_insert_point);
+  load = builder.AddLoad(op_type->result_id(), var->result_id());
+  builder.AddStore(operand_id, load->result_id());
+
+  return var->result_id();
+}

+ 47 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/fix_func_call_arguments.h

@@ -0,0 +1,47 @@
+// Copyright (c) 2022 Advanced Micro Devices, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef _VAR_FUNC_CALL_PASS_H
+#define _VAR_FUNC_CALL_PASS_H
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+class FixFuncCallArgumentsPass : public Pass {
+ public:
+  FixFuncCallArgumentsPass() {}
+  const char* name() const override { return "fix-for-funcall-param"; }
+  Status Process() override;
+  // Returns true if the module has one one function.
+  bool ModuleHasASingleFunction();
+  // Copies from the memory pointed to by |operand_inst| to a new function scope
+  // variable created before |func_call_inst|, and
+  // copies the value of the new variable back to the memory pointed to by
+  // |operand_inst| after |funct_call_inst|  Returns the id of
+  // the new variable.
+  uint32_t ReplaceAccessChainFuncCallArguments(Instruction* func_call_inst,
+                                               Instruction* operand_inst);
+
+  // Fix function call |func_call_inst| non memory object arguments
+  bool FixFuncCallArguments(Instruction* func_call_inst);
+
+  IRContext::Analysis GetPreservedAnalyses() override {
+    return IRContext::kAnalysisTypes;
+  }
+};
+}  // namespace opt
+}  // namespace spvtools
+
+#endif  // _VAR_FUNC_CALL_PASS_H

+ 343 - 6
ThirdParty/Glslang/External/spirv-tools/source/opt/folding_rules.cpp

@@ -1430,6 +1430,132 @@ FoldingRule FactorAddMuls() {
   };
 }
 
+// Replaces |inst| inplace with an FMA instruction |(x*y)+a|.
+void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) {
+  uint32_t ext =
+      inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+
+  if (ext == 0) {
+    inst->context()->AddExtInstImport("GLSL.std.450");
+    ext = inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+    assert(ext != 0 &&
+           "Could not add the GLSL.std.450 extended instruction set");
+  }
+
+  std::vector<Operand> operands;
+  operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
+  operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {x}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {a}});
+
+  inst->SetOpcode(SpvOpExtInst);
+  inst->SetInOperands(std::move(operands));
+}
+
+// Folds a multiple and add into an Fma.
+//
+// Cases:
+// (x * y) + a = Fma x y a
+// a + (x * y) = Fma x y a
+bool MergeMulAddArithmetic(IRContext* context, Instruction* inst,
+                           const std::vector<const analysis::Constant*>&) {
+  assert(inst->opcode() == SpvOpFAdd);
+
+  if (!inst->IsFloatingPointFoldingAllowed()) {
+    return false;
+  }
+
+  analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+  for (int i = 0; i < 2; i++) {
+    uint32_t op_id = inst->GetSingleWordInOperand(i);
+    Instruction* op_inst = def_use_mgr->GetDef(op_id);
+
+    if (op_inst->opcode() != SpvOpFMul) {
+      continue;
+    }
+
+    if (!op_inst->IsFloatingPointFoldingAllowed()) {
+      continue;
+    }
+
+    uint32_t x = op_inst->GetSingleWordInOperand(0);
+    uint32_t y = op_inst->GetSingleWordInOperand(1);
+    uint32_t a = inst->GetSingleWordInOperand((i + 1) % 2);
+    ReplaceWithFma(inst, x, y, a);
+    return true;
+  }
+  return false;
+}
+
+// Replaces |sub| inplace with an FMA instruction |(x*y)+a| where |a| first gets
+// negated if |negate_addition| is true, otherwise |x| gets negated.
+void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y,
+                             uint32_t a, bool negate_addition) {
+  uint32_t ext =
+      sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+
+  if (ext == 0) {
+    sub->context()->AddExtInstImport("GLSL.std.450");
+    ext = sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+    assert(ext != 0 &&
+           "Could not add the GLSL.std.450 extended instruction set");
+  }
+
+  InstructionBuilder ir_builder(
+      sub->context(), sub,
+      IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+  Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), SpvOpFNegate,
+                                           negate_addition ? a : x);
+  uint32_t neg_op = neg->result_id();  // -a : -x
+
+  std::vector<Operand> operands;
+  operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
+  operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? x : neg_op}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
+  operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? neg_op : a}});
+
+  sub->SetOpcode(SpvOpExtInst);
+  sub->SetInOperands(std::move(operands));
+}
+
+// Folds a multiply and subtract into an Fma and negation.
+//
+// Cases:
+// (x * y) - a = Fma x y -a
+// a - (x * y) = Fma -x y a
+bool MergeMulSubArithmetic(IRContext* context, Instruction* sub,
+                           const std::vector<const analysis::Constant*>&) {
+  assert(sub->opcode() == SpvOpFSub);
+
+  if (!sub->IsFloatingPointFoldingAllowed()) {
+    return false;
+  }
+
+  analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+  for (int i = 0; i < 2; i++) {
+    uint32_t op_id = sub->GetSingleWordInOperand(i);
+    Instruction* mul = def_use_mgr->GetDef(op_id);
+
+    if (mul->opcode() != SpvOpFMul) {
+      continue;
+    }
+
+    if (!mul->IsFloatingPointFoldingAllowed()) {
+      continue;
+    }
+
+    uint32_t x = mul->GetSingleWordInOperand(0);
+    uint32_t y = mul->GetSingleWordInOperand(1);
+    uint32_t a = sub->GetSingleWordInOperand((i + 1) % 2);
+    ReplaceWithFmaAndNegate(sub, x, y, a, i == 0);
+    return true;
+  }
+  return false;
+}
+
 FoldingRule IntMultipleBy1() {
   return [](IRContext*, Instruction* inst,
             const std::vector<const analysis::Constant*>& constants) {
@@ -1573,6 +1699,57 @@ bool CompositeConstructFeedingExtract(
   return true;
 }
 
+// Walks the indexes chain from |start| to |end| of an OpCompositeInsert or
+// OpCompositeExtract instruction, and returns the type of the final element
+// being accessed.
+const analysis::Type* GetElementType(uint32_t type_id,
+                                     Instruction::iterator start,
+                                     Instruction::iterator end,
+                                     const analysis::TypeManager* type_mgr) {
+  const analysis::Type* type = type_mgr->GetType(type_id);
+  for (auto index : make_range(std::move(start), std::move(end))) {
+    assert(index.type == SPV_OPERAND_TYPE_LITERAL_INTEGER &&
+           index.words.size() == 1);
+    if (auto* array_type = type->AsArray()) {
+      type = array_type->element_type();
+    } else if (auto* matrix_type = type->AsMatrix()) {
+      type = matrix_type->element_type();
+    } else if (auto* struct_type = type->AsStruct()) {
+      type = struct_type->element_types()[index.words[0]];
+    } else {
+      type = nullptr;
+    }
+  }
+  return type;
+}
+
+// Returns true of |inst_1| and |inst_2| have the same indexes that will be used
+// to index into a composite object, excluding the last index.  The two
+// instructions must have the same opcode, and be either OpCompositeExtract or
+// OpCompositeInsert instructions.
+bool HaveSameIndexesExceptForLast(Instruction* inst_1, Instruction* inst_2) {
+  assert(inst_1->opcode() == inst_2->opcode() &&
+         "Expecting the opcodes to be the same.");
+  assert((inst_1->opcode() == SpvOpCompositeInsert ||
+          inst_1->opcode() == SpvOpCompositeExtract) &&
+         "Instructions must be OpCompositeInsert or OpCompositeExtract.");
+
+  if (inst_1->NumInOperands() != inst_2->NumInOperands()) {
+    return false;
+  }
+
+  uint32_t first_index_position =
+      (inst_1->opcode() == SpvOpCompositeInsert ? 2 : 1);
+  for (uint32_t i = first_index_position; i < inst_1->NumInOperands() - 1;
+       i++) {
+    if (inst_1->GetSingleWordInOperand(i) !=
+        inst_2->GetSingleWordInOperand(i)) {
+      return false;
+    }
+  }
+  return true;
+}
+
 // If the OpCompositeConstruct is simply putting back together elements that
 // where extracted from the same source, we can simply reuse the source.
 //
@@ -1595,19 +1772,24 @@ bool CompositeExtractFeedingConstruct(
   // - extractions
   // - extracting the same position they are inserting
   // - all extract from the same id.
+  Instruction* first_element_inst = nullptr;
   for (uint32_t i = 0; i < inst->NumInOperands(); ++i) {
     const uint32_t element_id = inst->GetSingleWordInOperand(i);
     Instruction* element_inst = def_use_mgr->GetDef(element_id);
+    if (first_element_inst == nullptr) {
+      first_element_inst = element_inst;
+    }
 
     if (element_inst->opcode() != SpvOpCompositeExtract) {
       return false;
     }
 
-    if (element_inst->NumInOperands() != 2) {
+    if (!HaveSameIndexesExceptForLast(element_inst, first_element_inst)) {
       return false;
     }
 
-    if (element_inst->GetSingleWordInOperand(1) != i) {
+    if (element_inst->GetSingleWordInOperand(element_inst->NumInOperands() -
+                                             1) != i) {
       return false;
     }
 
@@ -1623,13 +1805,31 @@ bool CompositeExtractFeedingConstruct(
   // The last check it to see that the object being extracted from is the
   // correct type.
   Instruction* original_inst = def_use_mgr->GetDef(original_id);
-  if (original_inst->type_id() != inst->type_id()) {
+  analysis::TypeManager* type_mgr = context->get_type_mgr();
+  const analysis::Type* original_type =
+      GetElementType(original_inst->type_id(), first_element_inst->begin() + 3,
+                     first_element_inst->end() - 1, type_mgr);
+
+  if (original_type == nullptr) {
     return false;
   }
 
-  // Simplify by using the original object.
-  inst->SetOpcode(SpvOpCopyObject);
-  inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {original_id}}});
+  if (inst->type_id() != type_mgr->GetId(original_type)) {
+    return false;
+  }
+
+  if (first_element_inst->NumInOperands() == 2) {
+    // Simplify by using the original object.
+    inst->SetOpcode(SpvOpCopyObject);
+    inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {original_id}}});
+    return true;
+  }
+
+  // Copies the original id and all indexes except for the last to the new
+  // extract instruction.
+  inst->SetOpcode(SpvOpCompositeExtract);
+  inst->SetInOperands(std::vector<Operand>(first_element_inst->begin() + 2,
+                                           first_element_inst->end() - 1));
   return true;
 }
 
@@ -1833,6 +2033,139 @@ FoldingRule FMixFeedingExtract() {
   };
 }
 
+// Returns the number of elements in the composite type |type|.  Returns 0 if
+// |type| is a scalar value.
+uint32_t GetNumberOfElements(const analysis::Type* type) {
+  if (auto* vector_type = type->AsVector()) {
+    return vector_type->element_count();
+  }
+  if (auto* matrix_type = type->AsMatrix()) {
+    return matrix_type->element_count();
+  }
+  if (auto* struct_type = type->AsStruct()) {
+    return static_cast<uint32_t>(struct_type->element_types().size());
+  }
+  if (auto* array_type = type->AsArray()) {
+    return array_type->length_info().words[0];
+  }
+  return 0;
+}
+
+// Returns a map with the set of values that were inserted into an object by
+// the chain of OpCompositeInsertInstruction starting with |inst|.
+// The map will map the index to the value inserted at that index.
+std::map<uint32_t, uint32_t> GetInsertedValues(Instruction* inst) {
+  analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr();
+  std::map<uint32_t, uint32_t> values_inserted;
+  Instruction* current_inst = inst;
+  while (current_inst->opcode() == SpvOpCompositeInsert) {
+    if (current_inst->NumInOperands() > inst->NumInOperands()) {
+      // This is the catch the case
+      //   %2 = OpCompositeInsert %m2x2int %v2int_1_0 %m2x2int_undef 0
+      //   %3 = OpCompositeInsert %m2x2int %int_4 %2 0 0
+      //   %4 = OpCompositeInsert %m2x2int %v2int_2_3 %3 1
+      // In this case we cannot do a single construct to get the matrix.
+      uint32_t partially_inserted_element_index =
+          current_inst->GetSingleWordInOperand(inst->NumInOperands() - 1);
+      if (values_inserted.count(partially_inserted_element_index) == 0)
+        return {};
+    }
+    if (HaveSameIndexesExceptForLast(inst, current_inst)) {
+      values_inserted.insert(
+          {current_inst->GetSingleWordInOperand(current_inst->NumInOperands() -
+                                                1),
+           current_inst->GetSingleWordInOperand(kInsertObjectIdInIdx)});
+    }
+    current_inst = def_use_mgr->GetDef(
+        current_inst->GetSingleWordInOperand(kInsertCompositeIdInIdx));
+  }
+  return values_inserted;
+}
+
+// Returns true of there is an entry in |values_inserted| for every element of
+// |Type|.
+bool DoInsertedValuesCoverEntireObject(
+    const analysis::Type* type, std::map<uint32_t, uint32_t>& values_inserted) {
+  uint32_t container_size = GetNumberOfElements(type);
+  if (container_size != values_inserted.size()) {
+    return false;
+  }
+
+  if (values_inserted.rbegin()->first >= container_size) {
+    return false;
+  }
+  return true;
+}
+
+// Returns the type of the element that immediately contains the element being
+// inserted by the OpCompositeInsert instruction |inst|.
+const analysis::Type* GetContainerType(Instruction* inst) {
+  assert(inst->opcode() == SpvOpCompositeInsert);
+  analysis::TypeManager* type_mgr = inst->context()->get_type_mgr();
+  return GetElementType(inst->type_id(), inst->begin() + 4, inst->end() - 1,
+                        type_mgr);
+}
+
+// Returns an OpCompositeConstruct instruction that build an object with
+// |type_id| out of the values in |values_inserted|.  Each value will be
+// placed at the index corresponding to the value.  The new instruction will
+// be placed before |insert_before|.
+Instruction* BuildCompositeConstruct(
+    uint32_t type_id, const std::map<uint32_t, uint32_t>& values_inserted,
+    Instruction* insert_before) {
+  InstructionBuilder ir_builder(
+      insert_before->context(), insert_before,
+      IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+  std::vector<uint32_t> ids_in_order;
+  for (auto it : values_inserted) {
+    ids_in_order.push_back(it.second);
+  }
+  Instruction* construct =
+      ir_builder.AddCompositeConstruct(type_id, ids_in_order);
+  return construct;
+}
+
+// Replaces the OpCompositeInsert |inst| that inserts |construct| into the same
+// object as |inst| with final index removed.  If the resulting
+// OpCompositeInsert instruction would have no remaining indexes, the
+// instruction is replaced with an OpCopyObject instead.
+void InsertConstructedObject(Instruction* inst, const Instruction* construct) {
+  if (inst->NumInOperands() == 3) {
+    inst->SetOpcode(SpvOpCopyObject);
+    inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {construct->result_id()}}});
+  } else {
+    inst->SetInOperand(kInsertObjectIdInIdx, {construct->result_id()});
+    inst->RemoveOperand(inst->NumOperands() - 1);
+  }
+}
+
+// Replaces a series of |OpCompositeInsert| instruction that cover the entire
+// object with an |OpCompositeConstruct|.
+bool CompositeInsertToCompositeConstruct(
+    IRContext* context, Instruction* inst,
+    const std::vector<const analysis::Constant*>&) {
+  assert(inst->opcode() == SpvOpCompositeInsert &&
+         "Wrong opcode.  Should be OpCompositeInsert.");
+  if (inst->NumInOperands() < 3) return false;
+
+  std::map<uint32_t, uint32_t> values_inserted = GetInsertedValues(inst);
+  const analysis::Type* container_type = GetContainerType(inst);
+  if (container_type == nullptr) {
+    return false;
+  }
+
+  if (!DoInsertedValuesCoverEntireObject(container_type, values_inserted)) {
+    return false;
+  }
+
+  analysis::TypeManager* type_mgr = context->get_type_mgr();
+  Instruction* construct = BuildCompositeConstruct(
+      type_mgr->GetId(container_type), values_inserted, inst);
+  InsertConstructedObject(inst, construct);
+  return true;
+}
+
 FoldingRule RedundantPhi() {
   // An OpPhi instruction where all values are the same or the result of the phi
   // itself, can be replaced by the value itself.
@@ -2533,6 +2866,8 @@ void FoldingRules::AddFoldingRules() {
   rules_[SpvOpCompositeExtract].push_back(VectorShuffleFeedingExtract());
   rules_[SpvOpCompositeExtract].push_back(FMixFeedingExtract());
 
+  rules_[SpvOpCompositeInsert].push_back(CompositeInsertToCompositeConstruct);
+
   rules_[SpvOpDot].push_back(DotProductDoingExtract());
 
   rules_[SpvOpEntryPoint].push_back(RemoveRedundantOperands());
@@ -2543,6 +2878,7 @@ void FoldingRules::AddFoldingRules() {
   rules_[SpvOpFAdd].push_back(MergeAddSubArithmetic());
   rules_[SpvOpFAdd].push_back(MergeGenericAddSubArithmetic());
   rules_[SpvOpFAdd].push_back(FactorAddMuls());
+  rules_[SpvOpFAdd].push_back(MergeMulAddArithmetic);
 
   rules_[SpvOpFDiv].push_back(RedundantFDiv());
   rules_[SpvOpFDiv].push_back(ReciprocalFDiv());
@@ -2563,6 +2899,7 @@ void FoldingRules::AddFoldingRules() {
   rules_[SpvOpFSub].push_back(MergeSubNegateArithmetic());
   rules_[SpvOpFSub].push_back(MergeSubAddArithmetic());
   rules_[SpvOpFSub].push_back(MergeSubSubArithmetic());
+  rules_[SpvOpFSub].push_back(MergeMulSubArithmetic);
 
   rules_[SpvOpIAdd].push_back(RedundantIAdd());
   rules_[SpvOpIAdd].push_back(MergeAddNegateArithmetic());

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/if_conversion.cpp

@@ -169,6 +169,8 @@ bool IfConversion::CheckBlock(BasicBlock* block, DominatorAnalysis* dominators,
   if (branch->opcode() != SpvOpBranchConditional) return false;
   auto merge = (*common)->GetMergeInst();
   if (!merge || merge->opcode() != SpvOpSelectionMerge) return false;
+  if (merge->GetSingleWordInOperand(1) == SpvSelectionControlDontFlattenMask)
+    return false;
   if ((*common)->MergeBlockIdIfAny() != block->id()) return false;
 
   return true;

+ 964 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/interface_var_sroa.cpp

@@ -0,0 +1,964 @@
+// Copyright (c) 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "source/opt/interface_var_sroa.h"
+
+#include <iostream>
+
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/function.h"
+#include "source/opt/log.h"
+#include "source/opt/type_manager.h"
+#include "source/util/make_unique.h"
+
+const static uint32_t kOpDecorateDecorationInOperandIndex = 1;
+const static uint32_t kOpDecorateLiteralInOperandIndex = 2;
+const static uint32_t kOpEntryPointInOperandInterface = 3;
+const static uint32_t kOpVariableStorageClassInOperandIndex = 0;
+const static uint32_t kOpTypeArrayElemTypeInOperandIndex = 0;
+const static uint32_t kOpTypeArrayLengthInOperandIndex = 1;
+const static uint32_t kOpTypeMatrixColCountInOperandIndex = 1;
+const static uint32_t kOpTypeMatrixColTypeInOperandIndex = 0;
+const static uint32_t kOpTypePtrTypeInOperandIndex = 1;
+const static uint32_t kOpConstantValueInOperandIndex = 0;
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+// Get the length of the OpTypeArray |array_type|.
+uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr,
+                        Instruction* array_type) {
+  assert(array_type->opcode() == SpvOpTypeArray);
+  uint32_t const_int_id =
+      array_type->GetSingleWordInOperand(kOpTypeArrayLengthInOperandIndex);
+  Instruction* array_length_inst = def_use_mgr->GetDef(const_int_id);
+  assert(array_length_inst->opcode() == SpvOpConstant);
+  return array_length_inst->GetSingleWordInOperand(
+      kOpConstantValueInOperandIndex);
+}
+
+// Get the element type instruction of the OpTypeArray |array_type|.
+Instruction* GetArrayElementType(analysis::DefUseManager* def_use_mgr,
+                                 Instruction* array_type) {
+  assert(array_type->opcode() == SpvOpTypeArray);
+  uint32_t elem_type_id =
+      array_type->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex);
+  return def_use_mgr->GetDef(elem_type_id);
+}
+
+// Get the column type instruction of the OpTypeMatrix |matrix_type|.
+Instruction* GetMatrixColumnType(analysis::DefUseManager* def_use_mgr,
+                                 Instruction* matrix_type) {
+  assert(matrix_type->opcode() == SpvOpTypeMatrix);
+  uint32_t column_type_id =
+      matrix_type->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex);
+  return def_use_mgr->GetDef(column_type_id);
+}
+
+// Traverses the component type of OpTypeArray or OpTypeMatrix. Repeats it
+// |depth_to_component| times recursively and returns the component type.
+// |type_id| is the result id of the OpTypeArray or OpTypeMatrix instruction.
+uint32_t GetComponentTypeOfArrayMatrix(analysis::DefUseManager* def_use_mgr,
+                                       uint32_t type_id,
+                                       uint32_t depth_to_component) {
+  if (depth_to_component == 0) return type_id;
+
+  Instruction* type_inst = def_use_mgr->GetDef(type_id);
+  if (type_inst->opcode() == SpvOpTypeArray) {
+    uint32_t elem_type_id =
+        type_inst->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex);
+    return GetComponentTypeOfArrayMatrix(def_use_mgr, elem_type_id,
+                                         depth_to_component - 1);
+  }
+
+  assert(type_inst->opcode() == SpvOpTypeMatrix);
+  uint32_t column_type_id =
+      type_inst->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex);
+  return GetComponentTypeOfArrayMatrix(def_use_mgr, column_type_id,
+                                       depth_to_component - 1);
+}
+
+// Creates an OpDecorate instruction whose Target is |var_id| and Decoration is
+// |decoration|. Adds |literal| as an extra operand of the instruction.
+void CreateDecoration(analysis::DecorationManager* decoration_mgr,
+                      uint32_t var_id, SpvDecoration decoration,
+                      uint32_t literal) {
+  std::vector<Operand> operands({
+      {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}},
+      {spv_operand_type_t::SPV_OPERAND_TYPE_DECORATION,
+       {static_cast<uint32_t>(decoration)}},
+      {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {literal}},
+  });
+  decoration_mgr->AddDecoration(SpvOpDecorate, std::move(operands));
+}
+
+// Replaces load instructions with composite construct instructions in all the
+// users of the loads. |loads_to_composites| is the mapping from each load to
+// its corresponding OpCompositeConstruct.
+void ReplaceLoadWithCompositeConstruct(
+    IRContext* context,
+    const std::unordered_map<Instruction*, Instruction*>& loads_to_composites) {
+  for (const auto& load_and_composite : loads_to_composites) {
+    Instruction* load = load_and_composite.first;
+    Instruction* composite_construct = load_and_composite.second;
+
+    std::vector<Instruction*> users;
+    context->get_def_use_mgr()->ForEachUse(
+        load, [&users, composite_construct](Instruction* user, uint32_t index) {
+          user->GetOperand(index).words[0] = composite_construct->result_id();
+          users.push_back(user);
+        });
+
+    for (Instruction* user : users)
+      context->get_def_use_mgr()->AnalyzeInstUse(user);
+  }
+}
+
+// Returns the storage class of the instruction |var|.
+SpvStorageClass GetStorageClass(Instruction* var) {
+  return static_cast<SpvStorageClass>(
+      var->GetSingleWordInOperand(kOpVariableStorageClassInOperandIndex));
+}
+
+}  // namespace
+
+bool InterfaceVariableScalarReplacement::HasExtraArrayness(
+    Instruction& entry_point, Instruction* var) {
+  SpvExecutionModel execution_model =
+      static_cast<SpvExecutionModel>(entry_point.GetSingleWordInOperand(0));
+  if (execution_model != SpvExecutionModelTessellationEvaluation &&
+      execution_model != SpvExecutionModelTessellationControl) {
+    return false;
+  }
+  if (!context()->get_decoration_mgr()->HasDecoration(var->result_id(),
+                                                      SpvDecorationPatch)) {
+    if (execution_model == SpvExecutionModelTessellationControl) return true;
+    return GetStorageClass(var) != SpvStorageClassOutput;
+  }
+  return false;
+}
+
+bool InterfaceVariableScalarReplacement::
+    CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var,
+                                              bool has_extra_arrayness) {
+  if (has_extra_arrayness) {
+    return !ReportErrorIfHasNoExtraArraynessForOtherEntry(interface_var);
+  }
+  return !ReportErrorIfHasExtraArraynessForOtherEntry(interface_var);
+}
+
+bool InterfaceVariableScalarReplacement::GetVariableLocation(
+    Instruction* var, uint32_t* location) {
+  return !context()->get_decoration_mgr()->WhileEachDecoration(
+      var->result_id(), SpvDecorationLocation,
+      [location](const Instruction& inst) {
+        *location =
+            inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex);
+        return false;
+      });
+}
+
+bool InterfaceVariableScalarReplacement::GetVariableComponent(
+    Instruction* var, uint32_t* component) {
+  return !context()->get_decoration_mgr()->WhileEachDecoration(
+      var->result_id(), SpvDecorationComponent,
+      [component](const Instruction& inst) {
+        *component =
+            inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex);
+        return false;
+      });
+}
+
+std::vector<Instruction*>
+InterfaceVariableScalarReplacement::CollectInterfaceVariables(
+    Instruction& entry_point) {
+  std::vector<Instruction*> interface_vars;
+  for (uint32_t i = kOpEntryPointInOperandInterface;
+       i < entry_point.NumInOperands(); ++i) {
+    Instruction* interface_var = context()->get_def_use_mgr()->GetDef(
+        entry_point.GetSingleWordInOperand(i));
+    assert(interface_var->opcode() == SpvOpVariable);
+
+    SpvStorageClass storage_class = GetStorageClass(interface_var);
+    if (storage_class != SpvStorageClassInput &&
+        storage_class != SpvStorageClassOutput) {
+      continue;
+    }
+
+    interface_vars.push_back(interface_var);
+  }
+  return interface_vars;
+}
+
+void InterfaceVariableScalarReplacement::KillInstructionAndUsers(
+    Instruction* inst) {
+  if (inst->opcode() == SpvOpEntryPoint) {
+    return;
+  }
+  if (inst->opcode() != SpvOpAccessChain) {
+    context()->KillInst(inst);
+    return;
+  }
+  context()->get_def_use_mgr()->ForEachUser(
+      inst, [this](Instruction* user) { KillInstructionAndUsers(user); });
+  context()->KillInst(inst);
+}
+
+void InterfaceVariableScalarReplacement::KillInstructionsAndUsers(
+    const std::vector<Instruction*>& insts) {
+  for (Instruction* inst : insts) {
+    KillInstructionAndUsers(inst);
+  }
+}
+
+void InterfaceVariableScalarReplacement::KillLocationAndComponentDecorations(
+    uint32_t var_id) {
+  context()->get_decoration_mgr()->RemoveDecorationsFrom(
+      var_id, [](const Instruction& inst) {
+        uint32_t decoration =
+            inst.GetSingleWordInOperand(kOpDecorateDecorationInOperandIndex);
+        return decoration == SpvDecorationLocation ||
+               decoration == SpvDecorationComponent;
+      });
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVariableWithScalars(
+    Instruction* interface_var, Instruction* interface_var_type,
+    uint32_t location, uint32_t component, uint32_t extra_array_length) {
+  NestedCompositeComponents scalar_interface_vars =
+      CreateScalarInterfaceVarsForReplacement(interface_var_type,
+                                              GetStorageClass(interface_var),
+                                              extra_array_length);
+
+  AddLocationAndComponentDecorations(scalar_interface_vars, &location,
+                                     component);
+  KillLocationAndComponentDecorations(interface_var->result_id());
+
+  if (!ReplaceInterfaceVarWith(interface_var, extra_array_length,
+                               scalar_interface_vars)) {
+    return false;
+  }
+
+  context()->KillInst(interface_var);
+  return true;
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarWith(
+    Instruction* interface_var, uint32_t extra_array_length,
+    const NestedCompositeComponents& scalar_interface_vars) {
+  std::vector<Instruction*> users;
+  context()->get_def_use_mgr()->ForEachUser(
+      interface_var, [&users](Instruction* user) { users.push_back(user); });
+
+  std::vector<uint32_t> interface_var_component_indices;
+  std::unordered_map<Instruction*, Instruction*> loads_to_composites;
+  std::unordered_map<Instruction*, Instruction*>
+      loads_for_access_chain_to_composites;
+  if (extra_array_length != 0) {
+    // Note that the extra arrayness is the first dimension of the array
+    // interface variable.
+    for (uint32_t index = 0; index < extra_array_length; ++index) {
+      std::unordered_map<Instruction*, Instruction*> loads_to_component_values;
+      if (!ReplaceComponentsOfInterfaceVarWith(
+              interface_var, users, scalar_interface_vars,
+              interface_var_component_indices, &index,
+              &loads_to_component_values,
+              &loads_for_access_chain_to_composites)) {
+        return false;
+      }
+      AddComponentsToCompositesForLoads(loads_to_component_values,
+                                        &loads_to_composites, 0);
+    }
+  } else if (!ReplaceComponentsOfInterfaceVarWith(
+                 interface_var, users, scalar_interface_vars,
+                 interface_var_component_indices, nullptr, &loads_to_composites,
+                 &loads_for_access_chain_to_composites)) {
+    return false;
+  }
+
+  ReplaceLoadWithCompositeConstruct(context(), loads_to_composites);
+  ReplaceLoadWithCompositeConstruct(context(),
+                                    loads_for_access_chain_to_composites);
+
+  KillInstructionsAndUsers(users);
+  return true;
+}
+
+void InterfaceVariableScalarReplacement::AddLocationAndComponentDecorations(
+    const NestedCompositeComponents& vars, uint32_t* location,
+    uint32_t component) {
+  if (!vars.HasMultipleComponents()) {
+    uint32_t var_id = vars.GetComponentVariable()->result_id();
+    CreateDecoration(context()->get_decoration_mgr(), var_id,
+                     SpvDecorationLocation, *location);
+    CreateDecoration(context()->get_decoration_mgr(), var_id,
+                     SpvDecorationComponent, component);
+    ++(*location);
+    return;
+  }
+  for (const auto& var : vars.GetComponents()) {
+    AddLocationAndComponentDecorations(var, location, component);
+  }
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceComponentsOfInterfaceVarWith(
+    Instruction* interface_var,
+    const std::vector<Instruction*>& interface_var_users,
+    const NestedCompositeComponents& scalar_interface_vars,
+    std::vector<uint32_t>& interface_var_component_indices,
+    const uint32_t* extra_array_index,
+    std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+    std::unordered_map<Instruction*, Instruction*>*
+        loads_for_access_chain_to_composites) {
+  if (!scalar_interface_vars.HasMultipleComponents()) {
+    for (Instruction* interface_var_user : interface_var_users) {
+      if (!ReplaceComponentOfInterfaceVarWith(
+              interface_var, interface_var_user,
+              scalar_interface_vars.GetComponentVariable(),
+              interface_var_component_indices, extra_array_index,
+              loads_to_composites, loads_for_access_chain_to_composites)) {
+        return false;
+      }
+    }
+    return true;
+  }
+  return ReplaceMultipleComponentsOfInterfaceVarWith(
+      interface_var, interface_var_users, scalar_interface_vars.GetComponents(),
+      interface_var_component_indices, extra_array_index, loads_to_composites,
+      loads_for_access_chain_to_composites);
+}
+
+bool InterfaceVariableScalarReplacement::
+    ReplaceMultipleComponentsOfInterfaceVarWith(
+        Instruction* interface_var,
+        const std::vector<Instruction*>& interface_var_users,
+        const std::vector<NestedCompositeComponents>& components,
+        std::vector<uint32_t>& interface_var_component_indices,
+        const uint32_t* extra_array_index,
+        std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+        std::unordered_map<Instruction*, Instruction*>*
+            loads_for_access_chain_to_composites) {
+  for (uint32_t i = 0; i < components.size(); ++i) {
+    interface_var_component_indices.push_back(i);
+    std::unordered_map<Instruction*, Instruction*> loads_to_component_values;
+    std::unordered_map<Instruction*, Instruction*>
+        loads_for_access_chain_to_component_values;
+    if (!ReplaceComponentsOfInterfaceVarWith(
+            interface_var, interface_var_users, components[i],
+            interface_var_component_indices, extra_array_index,
+            &loads_to_component_values,
+            &loads_for_access_chain_to_component_values)) {
+      return false;
+    }
+    interface_var_component_indices.pop_back();
+
+    uint32_t depth_to_component =
+        static_cast<uint32_t>(interface_var_component_indices.size());
+    AddComponentsToCompositesForLoads(
+        loads_for_access_chain_to_component_values,
+        loads_for_access_chain_to_composites, depth_to_component);
+    if (extra_array_index) ++depth_to_component;
+    AddComponentsToCompositesForLoads(loads_to_component_values,
+                                      loads_to_composites, depth_to_component);
+  }
+  return true;
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith(
+    Instruction* interface_var, Instruction* interface_var_user,
+    Instruction* scalar_var,
+    const std::vector<uint32_t>& interface_var_component_indices,
+    const uint32_t* extra_array_index,
+    std::unordered_map<Instruction*, Instruction*>* loads_to_component_values,
+    std::unordered_map<Instruction*, Instruction*>*
+        loads_for_access_chain_to_component_values) {
+  SpvOp opcode = interface_var_user->opcode();
+  if (opcode == SpvOpStore) {
+    uint32_t value_id = interface_var_user->GetSingleWordInOperand(1);
+    StoreComponentOfValueToScalarVar(value_id, interface_var_component_indices,
+                                     scalar_var, extra_array_index,
+                                     interface_var_user);
+    return true;
+  }
+  if (opcode == SpvOpLoad) {
+    Instruction* scalar_load =
+        LoadScalarVar(scalar_var, extra_array_index, interface_var_user);
+    loads_to_component_values->insert({interface_var_user, scalar_load});
+    return true;
+  }
+
+  // Copy OpName and annotation instructions only once. Therefore, we create
+  // them only for the first element of the extra array.
+  if (extra_array_index && *extra_array_index != 0) return true;
+
+  if (opcode == SpvOpDecorateId || opcode == SpvOpDecorateString ||
+      opcode == SpvOpDecorate) {
+    CloneAnnotationForVariable(interface_var_user, scalar_var->result_id());
+    return true;
+  }
+
+  if (opcode == SpvOpName) {
+    std::unique_ptr<Instruction> new_inst(interface_var_user->Clone(context()));
+    new_inst->SetInOperand(0, {scalar_var->result_id()});
+    context()->AddDebug2Inst(std::move(new_inst));
+    return true;
+  }
+
+  if (opcode == SpvOpEntryPoint) {
+    return ReplaceInterfaceVarInEntryPoint(interface_var, interface_var_user,
+                                           scalar_var->result_id());
+  }
+
+  if (opcode == SpvOpAccessChain) {
+    ReplaceAccessChainWith(interface_var_user, interface_var_component_indices,
+                           scalar_var,
+                           loads_for_access_chain_to_component_values);
+    return true;
+  }
+
+  std::string message("Unhandled instruction");
+  message += "\n  " + interface_var_user->PrettyPrint(
+                          SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+  message +=
+      "\nfor interface variable scalar replacement\n  " +
+      interface_var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+  context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+  return false;
+}
+
+void InterfaceVariableScalarReplacement::UseBaseAccessChainForAccessChain(
+    Instruction* access_chain, Instruction* base_access_chain) {
+  assert(base_access_chain->opcode() == SpvOpAccessChain &&
+         access_chain->opcode() == SpvOpAccessChain &&
+         access_chain->GetSingleWordInOperand(0) ==
+             base_access_chain->result_id());
+  Instruction::OperandList new_operands;
+  for (uint32_t i = 0; i < base_access_chain->NumInOperands(); ++i) {
+    new_operands.emplace_back(base_access_chain->GetInOperand(i));
+  }
+  for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) {
+    new_operands.emplace_back(access_chain->GetInOperand(i));
+  }
+  access_chain->SetInOperands(std::move(new_operands));
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateAccessChainToVar(
+    uint32_t var_type_id, Instruction* var,
+    const std::vector<uint32_t>& index_ids, Instruction* insert_before,
+    uint32_t* component_type_id) {
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  *component_type_id = GetComponentTypeOfArrayMatrix(
+      def_use_mgr, var_type_id, static_cast<uint32_t>(index_ids.size()));
+
+  uint32_t ptr_type_id =
+      GetPointerType(*component_type_id, GetStorageClass(var));
+
+  std::unique_ptr<Instruction> new_access_chain(
+      new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(),
+                      std::initializer_list<Operand>{
+                          {SPV_OPERAND_TYPE_ID, {var->result_id()}}}));
+  for (uint32_t index_id : index_ids) {
+    new_access_chain->AddOperand({SPV_OPERAND_TYPE_ID, {index_id}});
+  }
+
+  Instruction* inst = new_access_chain.get();
+  def_use_mgr->AnalyzeInstDefUse(inst);
+  insert_before->InsertBefore(std::move(new_access_chain));
+  return inst;
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateAccessChainWithIndex(
+    uint32_t component_type_id, Instruction* var, uint32_t index,
+    Instruction* insert_before) {
+  uint32_t ptr_type_id =
+      GetPointerType(component_type_id, GetStorageClass(var));
+  uint32_t index_id = context()->get_constant_mgr()->GetUIntConst(index);
+  std::unique_ptr<Instruction> new_access_chain(
+      new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(),
+                      std::initializer_list<Operand>{
+                          {SPV_OPERAND_TYPE_ID, {var->result_id()}},
+                          {SPV_OPERAND_TYPE_ID, {index_id}},
+                      }));
+  Instruction* inst = new_access_chain.get();
+  context()->get_def_use_mgr()->AnalyzeInstDefUse(inst);
+  insert_before->InsertBefore(std::move(new_access_chain));
+  return inst;
+}
+
+void InterfaceVariableScalarReplacement::ReplaceAccessChainWith(
+    Instruction* access_chain,
+    const std::vector<uint32_t>& interface_var_component_indices,
+    Instruction* scalar_var,
+    std::unordered_map<Instruction*, Instruction*>* loads_to_component_values) {
+  std::vector<uint32_t> indexes;
+  for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) {
+    indexes.push_back(access_chain->GetSingleWordInOperand(i));
+  }
+
+  // Note that we have a strong assumption that |access_chain| has only a single
+  // index that is for the extra arrayness.
+  context()->get_def_use_mgr()->ForEachUser(
+      access_chain,
+      [this, access_chain, &indexes, &interface_var_component_indices,
+       scalar_var, loads_to_component_values](Instruction* user) {
+        switch (user->opcode()) {
+          case SpvOpAccessChain: {
+            UseBaseAccessChainForAccessChain(user, access_chain);
+            ReplaceAccessChainWith(user, interface_var_component_indices,
+                                   scalar_var, loads_to_component_values);
+            return;
+          }
+          case SpvOpStore: {
+            uint32_t value_id = user->GetSingleWordInOperand(1);
+            StoreComponentOfValueToAccessChainToScalarVar(
+                value_id, interface_var_component_indices, scalar_var, indexes,
+                user);
+            return;
+          }
+          case SpvOpLoad: {
+            Instruction* value =
+                LoadAccessChainToVar(scalar_var, indexes, user);
+            loads_to_component_values->insert({user, value});
+            return;
+          }
+          default:
+            break;
+        }
+      });
+}
+
+void InterfaceVariableScalarReplacement::CloneAnnotationForVariable(
+    Instruction* annotation_inst, uint32_t var_id) {
+  assert(annotation_inst->opcode() == SpvOpDecorate ||
+         annotation_inst->opcode() == SpvOpDecorateId ||
+         annotation_inst->opcode() == SpvOpDecorateString);
+  std::unique_ptr<Instruction> new_inst(annotation_inst->Clone(context()));
+  new_inst->SetInOperand(0, {var_id});
+  context()->AddAnnotationInst(std::move(new_inst));
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarInEntryPoint(
+    Instruction* interface_var, Instruction* entry_point,
+    uint32_t scalar_var_id) {
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  uint32_t interface_var_id = interface_var->result_id();
+  if (interface_vars_removed_from_entry_point_operands_.find(
+          interface_var_id) !=
+      interface_vars_removed_from_entry_point_operands_.end()) {
+    entry_point->AddOperand({SPV_OPERAND_TYPE_ID, {scalar_var_id}});
+    def_use_mgr->AnalyzeInstUse(entry_point);
+    return true;
+  }
+
+  bool success = !entry_point->WhileEachInId(
+      [&interface_var_id, &scalar_var_id](uint32_t* id) {
+        if (*id == interface_var_id) {
+          *id = scalar_var_id;
+          return false;
+        }
+        return true;
+      });
+  if (!success) {
+    std::string message(
+        "interface variable is not an operand of the entry point");
+    message += "\n  " + interface_var->PrettyPrint(
+                            SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+    message += "\n  " + entry_point->PrettyPrint(
+                            SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+    context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+    return false;
+  }
+
+  def_use_mgr->AnalyzeInstUse(entry_point);
+  interface_vars_removed_from_entry_point_operands_.insert(interface_var_id);
+  return true;
+}
+
+uint32_t InterfaceVariableScalarReplacement::GetPointeeTypeIdOfVar(
+    Instruction* var) {
+  assert(var->opcode() == SpvOpVariable);
+
+  uint32_t ptr_type_id = var->type_id();
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  Instruction* ptr_type_inst = def_use_mgr->GetDef(ptr_type_id);
+
+  assert(ptr_type_inst->opcode() == SpvOpTypePointer &&
+         "Variable must have a pointer type.");
+  return ptr_type_inst->GetSingleWordInOperand(kOpTypePtrTypeInOperandIndex);
+}
+
+void InterfaceVariableScalarReplacement::StoreComponentOfValueToScalarVar(
+    uint32_t value_id, const std::vector<uint32_t>& component_indices,
+    Instruction* scalar_var, const uint32_t* extra_array_index,
+    Instruction* insert_before) {
+  uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+  Instruction* ptr = scalar_var;
+  if (extra_array_index) {
+    auto* ty_mgr = context()->get_type_mgr();
+    analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray();
+    assert(array_type != nullptr);
+    component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type());
+    ptr = CreateAccessChainWithIndex(component_type_id, scalar_var,
+                                     *extra_array_index, insert_before);
+  }
+
+  StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr,
+                          extra_array_index, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::LoadScalarVar(
+    Instruction* scalar_var, const uint32_t* extra_array_index,
+    Instruction* insert_before) {
+  uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+  Instruction* ptr = scalar_var;
+  if (extra_array_index) {
+    auto* ty_mgr = context()->get_type_mgr();
+    analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray();
+    assert(array_type != nullptr);
+    component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type());
+    ptr = CreateAccessChainWithIndex(component_type_id, scalar_var,
+                                     *extra_array_index, insert_before);
+  }
+
+  return CreateLoad(component_type_id, ptr, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateLoad(
+    uint32_t type_id, Instruction* ptr, Instruction* insert_before) {
+  std::unique_ptr<Instruction> load(
+      new Instruction(context(), SpvOpLoad, type_id, TakeNextId(),
+                      std::initializer_list<Operand>{
+                          {SPV_OPERAND_TYPE_ID, {ptr->result_id()}}}));
+  Instruction* load_inst = load.get();
+  context()->get_def_use_mgr()->AnalyzeInstDefUse(load_inst);
+  insert_before->InsertBefore(std::move(load));
+  return load_inst;
+}
+
+void InterfaceVariableScalarReplacement::StoreComponentOfValueTo(
+    uint32_t component_type_id, uint32_t value_id,
+    const std::vector<uint32_t>& component_indices, Instruction* ptr,
+    const uint32_t* extra_array_index, Instruction* insert_before) {
+  std::unique_ptr<Instruction> composite_extract(CreateCompositeExtract(
+      component_type_id, value_id, component_indices, extra_array_index));
+
+  std::unique_ptr<Instruction> new_store(
+      new Instruction(context(), SpvOpStore));
+  new_store->AddOperand({SPV_OPERAND_TYPE_ID, {ptr->result_id()}});
+  new_store->AddOperand(
+      {SPV_OPERAND_TYPE_ID, {composite_extract->result_id()}});
+
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  def_use_mgr->AnalyzeInstDefUse(composite_extract.get());
+  def_use_mgr->AnalyzeInstDefUse(new_store.get());
+
+  insert_before->InsertBefore(std::move(composite_extract));
+  insert_before->InsertBefore(std::move(new_store));
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateCompositeExtract(
+    uint32_t type_id, uint32_t composite_id,
+    const std::vector<uint32_t>& indexes, const uint32_t* extra_first_index) {
+  uint32_t component_id = TakeNextId();
+  Instruction* composite_extract = new Instruction(
+      context(), SpvOpCompositeExtract, type_id, component_id,
+      std::initializer_list<Operand>{{SPV_OPERAND_TYPE_ID, {composite_id}}});
+  if (extra_first_index) {
+    composite_extract->AddOperand(
+        {SPV_OPERAND_TYPE_LITERAL_INTEGER, {*extra_first_index}});
+  }
+  for (uint32_t index : indexes) {
+    composite_extract->AddOperand({SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}});
+  }
+  return composite_extract;
+}
+
+void InterfaceVariableScalarReplacement::
+    StoreComponentOfValueToAccessChainToScalarVar(
+        uint32_t value_id, const std::vector<uint32_t>& component_indices,
+        Instruction* scalar_var,
+        const std::vector<uint32_t>& access_chain_indices,
+        Instruction* insert_before) {
+  uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+  Instruction* ptr = scalar_var;
+  if (!access_chain_indices.empty()) {
+    ptr = CreateAccessChainToVar(component_type_id, scalar_var,
+                                 access_chain_indices, insert_before,
+                                 &component_type_id);
+  }
+
+  StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr,
+                          nullptr, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::LoadAccessChainToVar(
+    Instruction* var, const std::vector<uint32_t>& indexes,
+    Instruction* insert_before) {
+  uint32_t component_type_id = GetPointeeTypeIdOfVar(var);
+  Instruction* ptr = var;
+  if (!indexes.empty()) {
+    ptr = CreateAccessChainToVar(component_type_id, var, indexes, insert_before,
+                                 &component_type_id);
+  }
+
+  return CreateLoad(component_type_id, ptr, insert_before);
+}
+
+Instruction*
+InterfaceVariableScalarReplacement::CreateCompositeConstructForComponentOfLoad(
+    Instruction* load, uint32_t depth_to_component) {
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  uint32_t type_id = load->type_id();
+  if (depth_to_component != 0) {
+    type_id = GetComponentTypeOfArrayMatrix(def_use_mgr, load->type_id(),
+                                            depth_to_component);
+  }
+  uint32_t new_id = context()->TakeNextId();
+  std::unique_ptr<Instruction> new_composite_construct(
+      new Instruction(context(), SpvOpCompositeConstruct, type_id, new_id, {}));
+  Instruction* composite_construct = new_composite_construct.get();
+  def_use_mgr->AnalyzeInstDefUse(composite_construct);
+
+  // Insert |new_composite_construct| after |load|. When there are multiple
+  // recursive composite construct instructions for a load, we have to place the
+  // composite construct with a lower depth later because it constructs the
+  // composite that contains other composites with lower depths.
+  auto* insert_before = load->NextNode();
+  while (true) {
+    auto itr =
+        composite_ids_to_component_depths.find(insert_before->result_id());
+    if (itr == composite_ids_to_component_depths.end()) break;
+    if (itr->second <= depth_to_component) break;
+    insert_before = insert_before->NextNode();
+  }
+  insert_before->InsertBefore(std::move(new_composite_construct));
+  composite_ids_to_component_depths.insert({new_id, depth_to_component});
+  return composite_construct;
+}
+
+void InterfaceVariableScalarReplacement::AddComponentsToCompositesForLoads(
+    const std::unordered_map<Instruction*, Instruction*>&
+        loads_to_component_values,
+    std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+    uint32_t depth_to_component) {
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  for (auto& load_and_component_vale : loads_to_component_values) {
+    Instruction* load = load_and_component_vale.first;
+    Instruction* component_value = load_and_component_vale.second;
+    Instruction* composite_construct = nullptr;
+    auto itr = loads_to_composites->find(load);
+    if (itr == loads_to_composites->end()) {
+      composite_construct =
+          CreateCompositeConstructForComponentOfLoad(load, depth_to_component);
+      loads_to_composites->insert({load, composite_construct});
+    } else {
+      composite_construct = itr->second;
+    }
+    composite_construct->AddOperand(
+        {SPV_OPERAND_TYPE_ID, {component_value->result_id()}});
+    def_use_mgr->AnalyzeInstDefUse(composite_construct);
+  }
+}
+
+uint32_t InterfaceVariableScalarReplacement::GetArrayType(
+    uint32_t elem_type_id, uint32_t array_length) {
+  analysis::Type* elem_type = context()->get_type_mgr()->GetType(elem_type_id);
+  uint32_t array_length_id =
+      context()->get_constant_mgr()->GetUIntConst(array_length);
+  analysis::Array array_type(
+      elem_type,
+      analysis::Array::LengthInfo{array_length_id, {0, array_length}});
+  return context()->get_type_mgr()->GetTypeInstruction(&array_type);
+}
+
+uint32_t InterfaceVariableScalarReplacement::GetPointerType(
+    uint32_t type_id, SpvStorageClass storage_class) {
+  analysis::Type* type = context()->get_type_mgr()->GetType(type_id);
+  analysis::Pointer ptr_type(type, storage_class);
+  return context()->get_type_mgr()->GetTypeInstruction(&ptr_type);
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForArray(
+    Instruction* interface_var_type, SpvStorageClass storage_class,
+    uint32_t extra_array_length) {
+  assert(interface_var_type->opcode() == SpvOpTypeArray);
+
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  uint32_t array_length = GetArrayLength(def_use_mgr, interface_var_type);
+  Instruction* elem_type = GetArrayElementType(def_use_mgr, interface_var_type);
+
+  NestedCompositeComponents scalar_vars;
+  while (array_length > 0) {
+    NestedCompositeComponents scalar_vars_for_element =
+        CreateScalarInterfaceVarsForReplacement(elem_type, storage_class,
+                                                extra_array_length);
+    scalar_vars.AddComponent(scalar_vars_for_element);
+    --array_length;
+  }
+  return scalar_vars;
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForMatrix(
+    Instruction* interface_var_type, SpvStorageClass storage_class,
+    uint32_t extra_array_length) {
+  assert(interface_var_type->opcode() == SpvOpTypeMatrix);
+
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  uint32_t column_count = interface_var_type->GetSingleWordInOperand(
+      kOpTypeMatrixColCountInOperandIndex);
+  Instruction* column_type =
+      GetMatrixColumnType(def_use_mgr, interface_var_type);
+
+  NestedCompositeComponents scalar_vars;
+  while (column_count > 0) {
+    NestedCompositeComponents scalar_vars_for_column =
+        CreateScalarInterfaceVarsForReplacement(column_type, storage_class,
+                                                extra_array_length);
+    scalar_vars.AddComponent(scalar_vars_for_column);
+    --column_count;
+  }
+  return scalar_vars;
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForReplacement(
+    Instruction* interface_var_type, SpvStorageClass storage_class,
+    uint32_t extra_array_length) {
+  // Handle array case.
+  if (interface_var_type->opcode() == SpvOpTypeArray) {
+    return CreateScalarInterfaceVarsForArray(interface_var_type, storage_class,
+                                             extra_array_length);
+  }
+
+  // Handle matrix case.
+  if (interface_var_type->opcode() == SpvOpTypeMatrix) {
+    return CreateScalarInterfaceVarsForMatrix(interface_var_type, storage_class,
+                                              extra_array_length);
+  }
+
+  // Handle scalar or vector case.
+  NestedCompositeComponents scalar_var;
+  uint32_t type_id = interface_var_type->result_id();
+  if (extra_array_length != 0) {
+    type_id = GetArrayType(type_id, extra_array_length);
+  }
+  uint32_t ptr_type_id =
+      context()->get_type_mgr()->FindPointerToType(type_id, storage_class);
+  uint32_t id = TakeNextId();
+  std::unique_ptr<Instruction> variable(
+      new Instruction(context(), SpvOpVariable, ptr_type_id, id,
+                      std::initializer_list<Operand>{
+                          {SPV_OPERAND_TYPE_STORAGE_CLASS,
+                           {static_cast<uint32_t>(storage_class)}}}));
+  scalar_var.SetSingleComponentVariable(variable.get());
+  context()->AddGlobalValue(std::move(variable));
+  return scalar_var;
+}
+
+Instruction* InterfaceVariableScalarReplacement::GetTypeOfVariable(
+    Instruction* var) {
+  uint32_t pointee_type_id = GetPointeeTypeIdOfVar(var);
+  analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+  return def_use_mgr->GetDef(pointee_type_id);
+}
+
+Pass::Status InterfaceVariableScalarReplacement::Process() {
+  Pass::Status status = Status::SuccessWithoutChange;
+  for (Instruction& entry_point : get_module()->entry_points()) {
+    status =
+        CombineStatus(status, ReplaceInterfaceVarsWithScalars(entry_point));
+  }
+  return status;
+}
+
+bool InterfaceVariableScalarReplacement::
+    ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var) {
+  if (vars_with_extra_arrayness.find(var) == vars_with_extra_arrayness.end())
+    return false;
+
+  std::string message(
+      "A variable is arrayed for an entry point but it is not "
+      "arrayed for another entry point");
+  message +=
+      "\n  " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+  context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+  return true;
+}
+
+bool InterfaceVariableScalarReplacement::
+    ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var) {
+  if (vars_without_extra_arrayness.find(var) ==
+      vars_without_extra_arrayness.end())
+    return false;
+
+  std::string message(
+      "A variable is not arrayed for an entry point but it is "
+      "arrayed for another entry point");
+  message +=
+      "\n  " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+  context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+  return true;
+}
+
+Pass::Status
+InterfaceVariableScalarReplacement::ReplaceInterfaceVarsWithScalars(
+    Instruction& entry_point) {
+  std::vector<Instruction*> interface_vars =
+      CollectInterfaceVariables(entry_point);
+
+  Pass::Status status = Status::SuccessWithoutChange;
+  for (Instruction* interface_var : interface_vars) {
+    uint32_t location, component;
+    if (!GetVariableLocation(interface_var, &location)) continue;
+    if (!GetVariableComponent(interface_var, &component)) component = 0;
+
+    Instruction* interface_var_type = GetTypeOfVariable(interface_var);
+    uint32_t extra_array_length = 0;
+    if (HasExtraArrayness(entry_point, interface_var)) {
+      extra_array_length =
+          GetArrayLength(context()->get_def_use_mgr(), interface_var_type);
+      interface_var_type =
+          GetArrayElementType(context()->get_def_use_mgr(), interface_var_type);
+      vars_with_extra_arrayness.insert(interface_var);
+    } else {
+      vars_without_extra_arrayness.insert(interface_var);
+    }
+
+    if (!CheckExtraArraynessConflictBetweenEntries(interface_var,
+                                                   extra_array_length != 0)) {
+      return Pass::Status::Failure;
+    }
+
+    if (interface_var_type->opcode() != SpvOpTypeArray &&
+        interface_var_type->opcode() != SpvOpTypeMatrix) {
+      continue;
+    }
+
+    if (!ReplaceInterfaceVariableWithScalars(interface_var, interface_var_type,
+                                             location, component,
+                                             extra_array_length)) {
+      return Pass::Status::Failure;
+    }
+    status = Pass::Status::SuccessWithChange;
+  }
+
+  return status;
+}
+
+}  // namespace opt
+}  // namespace spvtools

+ 401 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/interface_var_sroa.h

@@ -0,0 +1,401 @@
+// Copyright (c) 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef SOURCE_OPT_INTERFACE_VAR_SROA_H_
+#define SOURCE_OPT_INTERFACE_VAR_SROA_H_
+
+#include <unordered_set>
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// See optimizer.hpp for documentation.
+//
+// Note that the current implementation of this pass covers only store, load,
+// access chain instructions for the interface variables. Supporting other types
+// of instructions is a future work.
+class InterfaceVariableScalarReplacement : public Pass {
+ public:
+  InterfaceVariableScalarReplacement() {}
+
+  const char* name() const override {
+    return "interface-variable-scalar-replacement";
+  }
+  Status Process() override;
+
+  IRContext::Analysis GetPreservedAnalyses() override {
+    return IRContext::kAnalysisDecorations | IRContext::kAnalysisDefUse |
+           IRContext::kAnalysisConstants | IRContext::kAnalysisTypes;
+  }
+
+ private:
+  // A struct containing components of a composite variable. If the composite
+  // consists of multiple or recursive components, |component_variable| is
+  // nullptr and |nested_composite_components| keeps the components. If it has a
+  // single component, |nested_composite_components| is empty and
+  // |component_variable| is the component. Note that each element of
+  // |nested_composite_components| has the NestedCompositeComponents struct as
+  // its type that can recursively keep the components.
+  struct NestedCompositeComponents {
+    NestedCompositeComponents() : component_variable(nullptr) {}
+
+    bool HasMultipleComponents() const {
+      return !nested_composite_components.empty();
+    }
+
+    const std::vector<NestedCompositeComponents>& GetComponents() const {
+      return nested_composite_components;
+    }
+
+    void AddComponent(const NestedCompositeComponents& component) {
+      nested_composite_components.push_back(component);
+    }
+
+    Instruction* GetComponentVariable() const { return component_variable; }
+
+    void SetSingleComponentVariable(Instruction* var) {
+      component_variable = var;
+    }
+
+   private:
+    std::vector<NestedCompositeComponents> nested_composite_components;
+    Instruction* component_variable;
+  };
+
+  // Collects all interface variables used by the |entry_point|.
+  std::vector<Instruction*> CollectInterfaceVariables(Instruction& entry_point);
+
+  // Returns whether |var| has the extra arrayness for the entry point
+  // |entry_point| or not.
+  bool HasExtraArrayness(Instruction& entry_point, Instruction* var);
+
+  // Finds a Location BuiltIn decoration of |var| and returns it via
+  // |location|. Returns true whether the location exists or not.
+  bool GetVariableLocation(Instruction* var, uint32_t* location);
+
+  // Finds a Component BuiltIn decoration of |var| and returns it via
+  // |component|. Returns true whether the component exists or not.
+  bool GetVariableComponent(Instruction* var, uint32_t* component);
+
+  // Returns the interface variable instruction whose result id is
+  // |interface_var_id|.
+  Instruction* GetInterfaceVariable(uint32_t interface_var_id);
+
+  // Returns the type of |var| as an instruction.
+  Instruction* GetTypeOfVariable(Instruction* var);
+
+  // Replaces an interface variable |interface_var| whose type is
+  // |interface_var_type| with scalars and returns whether it succeeds or not.
+  // |location| is the value of Location Decoration for |interface_var|.
+  // |component| is the value of Component Decoration for |interface_var|.
+  // If |extra_array_length| is 0, it means |interface_var| has a Patch
+  // decoration. Otherwise, |extra_array_length| denotes the length of the extra
+  // array of |interface_var|.
+  bool ReplaceInterfaceVariableWithScalars(Instruction* interface_var,
+                                           Instruction* interface_var_type,
+                                           uint32_t location,
+                                           uint32_t component,
+                                           uint32_t extra_array_length);
+
+  // Creates scalar variables with the storage classe |storage_class| to replace
+  // an interface variable whose type is |interface_var_type|. If
+  // |extra_array_length| is not zero, adds the extra arrayness to the created
+  // scalar variables.
+  NestedCompositeComponents CreateScalarInterfaceVarsForReplacement(
+      Instruction* interface_var_type, SpvStorageClass storage_class,
+      uint32_t extra_array_length);
+
+  // Creates scalar variables with the storage classe |storage_class| to replace
+  // the interface variable whose type is OpTypeArray |interface_var_type| with.
+  // If |extra_array_length| is not zero, adds the extra arrayness to all the
+  // scalar variables.
+  NestedCompositeComponents CreateScalarInterfaceVarsForArray(
+      Instruction* interface_var_type, SpvStorageClass storage_class,
+      uint32_t extra_array_length);
+
+  // Creates scalar variables with the storage classe |storage_class| to replace
+  // the interface variable whose type is OpTypeMatrix |interface_var_type|
+  // with. If |extra_array_length| is not zero, adds the extra arrayness to all
+  // the scalar variables.
+  NestedCompositeComponents CreateScalarInterfaceVarsForMatrix(
+      Instruction* interface_var_type, SpvStorageClass storage_class,
+      uint32_t extra_array_length);
+
+  // Recursively adds Location and Component decorations to variables in
+  // |vars| with |location| and |component|. Increases |location| by one after
+  // it actually adds Location and Component decorations for a variable.
+  void AddLocationAndComponentDecorations(const NestedCompositeComponents& vars,
+                                          uint32_t* location,
+                                          uint32_t component);
+
+  // Replaces the interface variable |interface_var| with
+  // |scalar_interface_vars| and returns whether it succeeds or not.
+  // |extra_arrayness| is the extra arrayness of the interface variable.
+  // |scalar_interface_vars| contains the nested variables to replace the
+  // interface variable with.
+  bool ReplaceInterfaceVarWith(
+      Instruction* interface_var, uint32_t extra_arrayness,
+      const NestedCompositeComponents& scalar_interface_vars);
+
+  // Replaces |interface_var| in the operands of instructions
+  // |interface_var_users| with |scalar_interface_vars|. This is a recursive
+  // method and |interface_var_component_indices| is used to specify which
+  // recursive component of |interface_var| is replaced. Returns composite
+  // construct instructions to be replaced with load instructions of
+  // |interface_var_users| via |loads_to_composites|. Returns composite
+  // construct instructions to be replaced with load instructions of access
+  // chain instructions in |interface_var_users| via
+  // |loads_for_access_chain_to_composites|.
+  bool ReplaceComponentsOfInterfaceVarWith(
+      Instruction* interface_var,
+      const std::vector<Instruction*>& interface_var_users,
+      const NestedCompositeComponents& scalar_interface_vars,
+      std::vector<uint32_t>& interface_var_component_indices,
+      const uint32_t* extra_array_index,
+      std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+      std::unordered_map<Instruction*, Instruction*>*
+          loads_for_access_chain_to_composites);
+
+  // Replaces |interface_var| in the operands of instructions
+  // |interface_var_users| with |components| that is a vector of components for
+  // the interface variable |interface_var|. This is a recursive method and
+  // |interface_var_component_indices| is used to specify which recursive
+  // component of |interface_var| is replaced. Returns composite construct
+  // instructions to be replaced with load instructions of |interface_var_users|
+  // via |loads_to_composites|. Returns composite construct instructions to be
+  // replaced with load instructions of access chain instructions in
+  // |interface_var_users| via |loads_for_access_chain_to_composites|.
+  bool ReplaceMultipleComponentsOfInterfaceVarWith(
+      Instruction* interface_var,
+      const std::vector<Instruction*>& interface_var_users,
+      const std::vector<NestedCompositeComponents>& components,
+      std::vector<uint32_t>& interface_var_component_indices,
+      const uint32_t* extra_array_index,
+      std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+      std::unordered_map<Instruction*, Instruction*>*
+          loads_for_access_chain_to_composites);
+
+  // Replaces a component of |interface_var| that is used as an operand of
+  // instruction |interface_var_user| with |scalar_var|.
+  // |interface_var_component_indices| is a vector of recursive indices for
+  // which recursive component of |interface_var| is replaced. If
+  // |interface_var_user| is a load, returns the component value via
+  // |loads_to_component_values|. If |interface_var_user| is an access chain,
+  // returns the component value for loads of |interface_var_user| via
+  // |loads_for_access_chain_to_component_values|.
+  bool ReplaceComponentOfInterfaceVarWith(
+      Instruction* interface_var, Instruction* interface_var_user,
+      Instruction* scalar_var,
+      const std::vector<uint32_t>& interface_var_component_indices,
+      const uint32_t* extra_array_index,
+      std::unordered_map<Instruction*, Instruction*>* loads_to_component_values,
+      std::unordered_map<Instruction*, Instruction*>*
+          loads_for_access_chain_to_component_values);
+
+  // Creates instructions to load |scalar_var| and inserts them before
+  // |insert_before|. If |extra_array_index| is not null, they load
+  // |extra_array_index| th component of |scalar_var| instead of |scalar_var|
+  // itself.
+  Instruction* LoadScalarVar(Instruction* scalar_var,
+                             const uint32_t* extra_array_index,
+                             Instruction* insert_before);
+
+  // Creates instructions to load an access chain to |var| and inserts them
+  // before |insert_before|. |Indexes| will be Indexes operand of the access
+  // chain.
+  Instruction* LoadAccessChainToVar(Instruction* var,
+                                    const std::vector<uint32_t>& indexes,
+                                    Instruction* insert_before);
+
+  // Creates instructions to store a component of an aggregate whose id is
+  // |value_id| to an access chain to |scalar_var| and inserts the created
+  // instructions before |insert_before|. To get the component, recursively
+  // traverses the aggregate with |component_indices| as indexes.
+  // Numbers in |access_chain_indices| are the Indexes operand of the access
+  // chain to |scalar_var|
+  void StoreComponentOfValueToAccessChainToScalarVar(
+      uint32_t value_id, const std::vector<uint32_t>& component_indices,
+      Instruction* scalar_var,
+      const std::vector<uint32_t>& access_chain_indices,
+      Instruction* insert_before);
+
+  // Creates instructions to store a component of an aggregate whose id is
+  // |value_id| to |scalar_var| and inserts the created instructions before
+  // |insert_before|. To get the component, recursively traverses the aggregate
+  // using |extra_array_index| and |component_indices| as indexes.
+  void StoreComponentOfValueToScalarVar(
+      uint32_t value_id, const std::vector<uint32_t>& component_indices,
+      Instruction* scalar_var, const uint32_t* extra_array_index,
+      Instruction* insert_before);
+
+  // Creates instructions to store a component of an aggregate whose id is
+  // |value_id| to |ptr| and inserts the created instructions before
+  // |insert_before|. To get the component, recursively traverses the aggregate
+  // using |extra_array_index| and |component_indices| as indexes.
+  // |component_type_id| is the id of the type instruction of the component.
+  void StoreComponentOfValueTo(uint32_t component_type_id, uint32_t value_id,
+                               const std::vector<uint32_t>& component_indices,
+                               Instruction* ptr,
+                               const uint32_t* extra_array_index,
+                               Instruction* insert_before);
+
+  // Creates new OpCompositeExtract with |type_id| for Result Type,
+  // |composite_id| for Composite operand, and |indexes| for Indexes operands.
+  // If |extra_first_index| is not nullptr, uses it as the first Indexes
+  // operand.
+  Instruction* CreateCompositeExtract(uint32_t type_id, uint32_t composite_id,
+                                      const std::vector<uint32_t>& indexes,
+                                      const uint32_t* extra_first_index);
+
+  // Creates a new OpLoad whose Result Type is |type_id| and Pointer operand is
+  // |ptr|. Inserts the new instruction before |insert_before|.
+  Instruction* CreateLoad(uint32_t type_id, Instruction* ptr,
+                          Instruction* insert_before);
+
+  // Clones an annotation instruction |annotation_inst| and sets the target
+  // operand of the new annotation instruction as |var_id|.
+  void CloneAnnotationForVariable(Instruction* annotation_inst,
+                                  uint32_t var_id);
+
+  // Replaces the interface variable |interface_var| in the operands of the
+  // entry point |entry_point| with |scalar_var_id|. If it cannot find
+  // |interface_var| from the operands of the entry point |entry_point|, adds
+  // |scalar_var_id| as an operand of the entry point |entry_point|.
+  bool ReplaceInterfaceVarInEntryPoint(Instruction* interface_var,
+                                       Instruction* entry_point,
+                                       uint32_t scalar_var_id);
+
+  // Creates an access chain instruction whose Base operand is |var| and Indexes
+  // operand is |index|. |component_type_id| is the id of the type instruction
+  // that is the type of component. Inserts the new access chain before
+  // |insert_before|.
+  Instruction* CreateAccessChainWithIndex(uint32_t component_type_id,
+                                          Instruction* var, uint32_t index,
+                                          Instruction* insert_before);
+
+  // Returns the pointee type of the type of variable |var|.
+  uint32_t GetPointeeTypeIdOfVar(Instruction* var);
+
+  // Replaces the access chain |access_chain| and its users with a new access
+  // chain that points |scalar_var| as the Base operand having
+  // |interface_var_component_indices| as Indexes operands and users of the new
+  // access chain. When some of the users are load instructions, returns the
+  // original load instruction to the new instruction that loads a component of
+  // the original load value via |loads_to_component_values|.
+  void ReplaceAccessChainWith(
+      Instruction* access_chain,
+      const std::vector<uint32_t>& interface_var_component_indices,
+      Instruction* scalar_var,
+      std::unordered_map<Instruction*, Instruction*>*
+          loads_to_component_values);
+
+  // Assuming that |access_chain| is an access chain instruction whose Base
+  // operand is |base_access_chain|, replaces the operands of |access_chain|
+  // with operands of |base_access_chain| and Indexes operands of
+  // |access_chain|.
+  void UseBaseAccessChainForAccessChain(Instruction* access_chain,
+                                        Instruction* base_access_chain);
+
+  // Creates composite construct instructions for load instructions that are the
+  // keys of |loads_to_component_values| if no such composite construct
+  // instructions exist. Adds a component of the composite as an operand of the
+  // created composite construct instruction. Each value of
+  // |loads_to_component_values| is the component. Returns the created composite
+  // construct instructions using |loads_to_composites|. |depth_to_component| is
+  // the number of recursive access steps to get the component from the
+  // composite.
+  void AddComponentsToCompositesForLoads(
+      const std::unordered_map<Instruction*, Instruction*>&
+          loads_to_component_values,
+      std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+      uint32_t depth_to_component);
+
+  // Creates a composite construct instruction for a component of the value of
+  // instruction |load| in |depth_to_component| th recursive depth and inserts
+  // it after |load|.
+  Instruction* CreateCompositeConstructForComponentOfLoad(
+      Instruction* load, uint32_t depth_to_component);
+
+  // Creates a new access chain instruction that points to variable |var| whose
+  // type is the instruction with |var_type_id| and inserts it before
+  // |insert_before|. The new access chain will have |index_ids| for Indexes
+  // operands. Returns the type id of the component that is pointed by the new
+  // access chain via |component_type_id|.
+  Instruction* CreateAccessChainToVar(uint32_t var_type_id, Instruction* var,
+                                      const std::vector<uint32_t>& index_ids,
+                                      Instruction* insert_before,
+                                      uint32_t* component_type_id);
+
+  // Returns the result id of OpTypeArray instrunction whose Element Type
+  // operand is |elem_type_id| and Length operand is |array_length|.
+  uint32_t GetArrayType(uint32_t elem_type_id, uint32_t array_length);
+
+  // Returns the result id of OpTypePointer instrunction whose Type
+  // operand is |type_id| and Storage Class operand is |storage_class|.
+  uint32_t GetPointerType(uint32_t type_id, SpvStorageClass storage_class);
+
+  // Kills an instrunction |inst| and its users.
+  void KillInstructionAndUsers(Instruction* inst);
+
+  // Kills a vector of instrunctions |insts| and their users.
+  void KillInstructionsAndUsers(const std::vector<Instruction*>& insts);
+
+  // Kills all OpDecorate instructions for Location and Component of the
+  // variable whose id is |var_id|.
+  void KillLocationAndComponentDecorations(uint32_t var_id);
+
+  // If |var| has the extra arrayness for an entry point, reports an error and
+  // returns true. Otherwise, returns false.
+  bool ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var);
+
+  // If |var| does not have the extra arrayness for an entry point, reports an
+  // error and returns true. Otherwise, returns false.
+  bool ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var);
+
+  // If |interface_var| has the extra arrayness for an entry point but it does
+  // not have one for another entry point, reports an error and returns false.
+  // Otherwise, returns true. |has_extra_arrayness| denotes whether it has an
+  // extra arrayness for an entry point or not.
+  bool CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var,
+                                                 bool has_extra_arrayness);
+
+  // Conducts the scalar replacement for the interface variables used by the
+  // |entry_point|.
+  Pass::Status ReplaceInterfaceVarsWithScalars(Instruction& entry_point);
+
+  // A set of interface variable ids that were already removed from operands of
+  // the entry point.
+  std::unordered_set<uint32_t>
+      interface_vars_removed_from_entry_point_operands_;
+
+  // A mapping from ids of new composite construct instructions that load
+  // instructions are replaced with to the recursive depth of the component of
+  // load that the new component construct instruction is used for.
+  std::unordered_map<uint32_t, uint32_t> composite_ids_to_component_depths;
+
+  // A set of interface variables with the extra arrayness for any of the entry
+  // points.
+  std::unordered_set<Instruction*> vars_with_extra_arrayness;
+
+  // A set of interface variables without the extra arrayness for any of the
+  // entry points.
+  std::unordered_set<Instruction*> vars_without_extra_arrayness;
+};
+
+}  // namespace opt
+}  // namespace spvtools
+
+#endif  // SOURCE_OPT_INTERFACE_VAR_SROA_H_

+ 9 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/ir_builder.h

@@ -487,6 +487,15 @@ class InstructionBuilder {
     return AddInstruction(std::move(new_inst));
   }
 
+  Instruction* AddVariable(uint32_t type_id, uint32_t storage_class) {
+    std::vector<Operand> operands;
+    operands.push_back({SPV_OPERAND_TYPE_ID, {storage_class}});
+    std::unique_ptr<Instruction> new_inst(
+        new Instruction(GetContext(), SpvOpVariable, type_id,
+                        GetContext()->TakeNextId(), operands));
+    return AddInstruction(std::move(new_inst));
+  }
+
   Instruction* AddStore(uint32_t ptr_id, uint32_t obj_id) {
     std::vector<Operand> operands;
     operands.push_back({SPV_OPERAND_TYPE_ID, {ptr_id}});

+ 13 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/ir_context.cpp

@@ -926,6 +926,19 @@ bool IRContext::ProcessCallTreeFromRoots(ProcessFunction& pfn,
   return modified;
 }
 
+void IRContext::CollectCallTreeFromRoots(unsigned entryId,
+                                         std::unordered_set<uint32_t>* funcs) {
+  std::queue<uint32_t> roots;
+  roots.push(entryId);
+  while (!roots.empty()) {
+    const uint32_t fi = roots.front();
+    roots.pop();
+    funcs->insert(fi);
+    Function* fn = GetFunction(fi);
+    AddCalls(fn, &roots);
+  }
+}
+
 void IRContext::EmitErrorMessage(std::string message, Instruction* inst) {
   if (!consumer()) {
     return;

+ 7 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/ir_context.h

@@ -411,6 +411,10 @@ class IRContext {
   void CollectNonSemanticTree(Instruction* inst,
                               std::unordered_set<Instruction*>* to_kill);
 
+  // Collect function reachable from |entryId|, returns |funcs|
+  void CollectCallTreeFromRoots(unsigned entryId,
+                                std::unordered_set<uint32_t>* funcs);
+
   // Returns true if all of the given analyses are valid.
   bool AreAnalysesValid(Analysis set) { return (set & valid_analyses_) == set; }
 
@@ -1090,6 +1094,9 @@ void IRContext::AddDebug2Inst(std::unique_ptr<Instruction>&& d) {
       id_to_name_->insert({d->GetSingleWordInOperand(0), d.get()});
     }
   }
+  if (AreAnalysesValid(kAnalysisDefUse)) {
+    get_def_use_mgr()->AnalyzeInstDefUse(d.get());
+  }
   module()->AddDebug2Inst(std::move(d));
 }
 

+ 20 - 11
ThirdParty/Glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.cpp

@@ -28,8 +28,6 @@ namespace {
 
 const uint32_t kStoreValIdInIdx = 1;
 const uint32_t kAccessChainPtrIdInIdx = 0;
-const uint32_t kConstantValueInIdx = 0;
-const uint32_t kTypeIntWidthInIdx = 0;
 
 }  // anonymous namespace
 
@@ -67,7 +65,19 @@ void LocalAccessChainConvertPass::AppendConstantOperands(
   ptrInst->ForEachInId([&iidIdx, &in_opnds, this](const uint32_t* iid) {
     if (iidIdx > 0) {
       const Instruction* cInst = get_def_use_mgr()->GetDef(*iid);
-      uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx);
+      const auto* constant_value =
+          context()->get_constant_mgr()->GetConstantFromInst(cInst);
+      assert(constant_value != nullptr &&
+             "Expecting the index to be a constant.");
+
+      // We take the sign extended value because OpAccessChain interprets the
+      // index as signed.
+      int64_t long_value = constant_value->GetSignExtendedValue();
+      assert(long_value <= UINT32_MAX && long_value >= 0 &&
+             "The index value is too large for a composite insert or extract "
+             "instruction.");
+
+      uint32_t val = static_cast<uint32_t>(long_value);
       in_opnds->push_back(
           {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {val}});
     }
@@ -169,13 +179,16 @@ bool LocalAccessChainConvertPass::GenAccessChainStoreReplacement(
   return true;
 }
 
-bool LocalAccessChainConvertPass::IsConstantIndexAccessChain(
+bool LocalAccessChainConvertPass::Is32BitConstantIndexAccessChain(
     const Instruction* acp) const {
   uint32_t inIdx = 0;
   return acp->WhileEachInId([&inIdx, this](const uint32_t* tid) {
     if (inIdx > 0) {
       Instruction* opInst = get_def_use_mgr()->GetDef(*tid);
       if (opInst->opcode() != SpvOpConstant) return false;
+      const auto* index =
+          context()->get_constant_mgr()->GetConstantFromInst(opInst);
+      if (index->GetSignExtendedValue() > UINT32_MAX) return false;
     }
     ++inIdx;
     return true;
@@ -231,7 +244,7 @@ void LocalAccessChainConvertPass::FindTargetVars(Function* func) {
             break;
           }
           // Rule out variables accessed with non-constant indices
-          if (!IsConstantIndexAccessChain(ptrInst)) {
+          if (!Is32BitConstantIndexAccessChain(ptrInst)) {
             seen_non_target_vars_.insert(varId);
             seen_target_vars_.erase(varId);
             break;
@@ -349,12 +362,6 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const {
 }
 
 Pass::Status LocalAccessChainConvertPass::ProcessImpl() {
-  // If non-32-bit integer type in module, terminate processing
-  // TODO(): Handle non-32-bit integer constants in access chains
-  for (const Instruction& inst : get_module()->types_values())
-    if (inst.opcode() == SpvOpTypeInt &&
-        inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32)
-      return Status::SuccessWithoutChange;
   // Do not process if module contains OpGroupDecorate. Additional
   // support required in KillNamesAndDecorates().
   // TODO(greg-lunarg): Add support for OpGroupDecorate
@@ -434,6 +441,8 @@ void LocalAccessChainConvertPass::InitExtensions() {
       "SPV_KHR_integer_dot_product",
       "SPV_EXT_shader_image_int64",
       "SPV_KHR_non_semantic_info",
+      "SPV_KHR_uniform_group_instructions",
+      "SPV_KHR_fragment_shader_barycentric",
   });
 }
 

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/source/opt/local_access_chain_convert_pass.h

@@ -95,7 +95,8 @@ class LocalAccessChainConvertPass : public MemPass {
                               Instruction* original_load);
 
   // Return true if all indices of access chain |acp| are OpConstant integers
-  bool IsConstantIndexAccessChain(const Instruction* acp) const;
+  // whose values can fit into an unsigned 32-bit value.
+  bool Is32BitConstantIndexAccessChain(const Instruction* acp) const;
 
   // Identify all function scope variables of target type which are
   // accessed only with loads, stores and access chains with constant

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/local_single_block_elim_pass.cpp

@@ -286,6 +286,8 @@ void LocalSingleBlockLoadStoreElimPass::InitExtensions() {
       "SPV_KHR_integer_dot_product",
       "SPV_EXT_shader_image_int64",
       "SPV_KHR_non_semantic_info",
+      "SPV_KHR_uniform_group_instructions",
+      "SPV_KHR_fragment_shader_barycentric",
   });
 }
 

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/local_single_store_elim_pass.cpp

@@ -139,6 +139,8 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() {
       "SPV_KHR_integer_dot_product",
       "SPV_EXT_shader_image_int64",
       "SPV_KHR_non_semantic_info",
+      "SPV_KHR_uniform_group_instructions",
+      "SPV_KHR_fragment_shader_barycentric",
   });
 }
 bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {

+ 4 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/loop_descriptor.cpp

@@ -754,6 +754,10 @@ bool Loop::FindNumberOfIterations(const Instruction* induction,
 // |step_value| is NOT cleanly divisible then we add one to the sum.
 int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value,
                             int64_t init_value, int64_t step_value) const {
+  if (step_value == 0) {
+    return 0;
+  }
+
   int64_t diff = 0;
 
   switch (condition) {

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/source/opt/loop_descriptor.h

@@ -398,7 +398,8 @@ class Loop {
   // Each different loop |condition| affects how we calculate the number of
   // iterations using the |condition_value|, |init_value|, and |step_values| of
   // the induction variable. This method will return the number of iterations in
-  // a loop with those values for a given |condition|.
+  // a loop with those values for a given |condition|.  Returns 0 if the number
+  // of iterations could not be computed.
   int64_t GetIterations(SpvOp condition, int64_t condition_value,
                         int64_t init_value, int64_t step_value) const;
 

+ 12 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/optimizer.cpp

@@ -525,6 +525,8 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
     RegisterPass(CreateRemoveDontInlinePass());
   } else if (pass_name == "eliminate-dead-input-components") {
     RegisterPass(CreateEliminateDeadInputComponentsPass());
+  } else if (pass_name == "fix-func-call-param") {
+    RegisterPass(CreateFixFuncCallArgumentsPass());
   } else if (pass_name == "convert-to-sampled-image") {
     if (pass_args.size() > 0) {
       auto descriptor_set_binding_pairs =
@@ -1018,8 +1020,18 @@ Optimizer::PassToken CreateConvertToSampledImagePass(
       MakeUnique<opt::ConvertToSampledImagePass>(descriptor_set_binding_pairs));
 }
 
+Optimizer::PassToken CreateInterfaceVariableScalarReplacementPass() {
+  return MakeUnique<Optimizer::PassToken::Impl>(
+      MakeUnique<opt::InterfaceVariableScalarReplacement>());
+}
+
 Optimizer::PassToken CreateRemoveDontInlinePass() {
   return MakeUnique<Optimizer::PassToken::Impl>(
       MakeUnique<opt::RemoveDontInline>());
 }
+
+Optimizer::PassToken CreateFixFuncCallArgumentsPass() {
+  return MakeUnique<Optimizer::PassToken::Impl>(
+      MakeUnique<opt::FixFuncCallArgumentsPass>());
+}
 }  // namespace spvtools

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/source/opt/passes.h

@@ -37,6 +37,7 @@
 #include "source/opt/eliminate_dead_input_components_pass.h"
 #include "source/opt/eliminate_dead_members_pass.h"
 #include "source/opt/empty_pass.h"
+#include "source/opt/fix_func_call_arguments.h"
 #include "source/opt/fix_storage_class.h"
 #include "source/opt/flatten_decoration_pass.h"
 #include "source/opt/fold_spec_constant_op_and_composite_pass.h"
@@ -48,6 +49,7 @@
 #include "source/opt/inst_bindless_check_pass.h"
 #include "source/opt/inst_buff_addr_check_pass.h"
 #include "source/opt/inst_debug_printf_pass.h"
+#include "source/opt/interface_var_sroa.h"
 #include "source/opt/interp_fixup_pass.h"
 #include "source/opt/licm_pass.h"
 #include "source/opt/local_access_chain_convert_pass.h"

+ 11 - 9
ThirdParty/Glslang/External/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp

@@ -95,7 +95,7 @@ void ReplaceDescArrayAccessUsingVarIndex::ReplaceUsersOfAccessChain(
   CollectRecursiveUsersWithConcreteType(access_chain, &final_users);
   for (auto* inst : final_users) {
     std::deque<Instruction*> insts_to_be_cloned =
-        CollectRequiredImageInsts(inst);
+        CollectRequiredImageAndAccessInsts(inst);
     ReplaceNonUniformAccessWithSwitchCase(
         inst, access_chain, number_of_elements, insts_to_be_cloned);
   }
@@ -121,8 +121,8 @@ void ReplaceDescArrayAccessUsingVarIndex::CollectRecursiveUsersWithConcreteType(
 }
 
 std::deque<Instruction*>
-ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageInsts(
-    Instruction* user_of_image_insts) const {
+ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageAndAccessInsts(
+    Instruction* user) const {
   std::unordered_set<uint32_t> seen_inst_ids;
   std::queue<Instruction*> work_list;
 
@@ -131,21 +131,23 @@ ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageInsts(
     if (!seen_inst_ids.insert(*idp).second) return;
     Instruction* operand = get_def_use_mgr()->GetDef(*idp);
     if (context()->get_instr_block(operand) != nullptr &&
-        HasImageOrImagePtrType(operand)) {
+        (HasImageOrImagePtrType(operand) ||
+         operand->opcode() == SpvOpAccessChain ||
+         operand->opcode() == SpvOpInBoundsAccessChain)) {
       work_list.push(operand);
     }
   };
 
-  std::deque<Instruction*> required_image_insts;
-  required_image_insts.push_front(user_of_image_insts);
-  user_of_image_insts->ForEachInId(decision_to_include_operand);
+  std::deque<Instruction*> required_insts;
+  required_insts.push_front(user);
+  user->ForEachInId(decision_to_include_operand);
   while (!work_list.empty()) {
     auto* inst_from_work_list = work_list.front();
     work_list.pop();
-    required_image_insts.push_front(inst_from_work_list);
+    required_insts.push_front(inst_from_work_list);
     inst_from_work_list->ForEachInId(decision_to_include_operand);
   }
-  return required_image_insts;
+  return required_insts;
 }
 
 bool ReplaceDescArrayAccessUsingVarIndex::HasImageOrImagePtrType(

+ 6 - 5
ThirdParty/Glslang/External/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h

@@ -76,11 +76,12 @@ class ReplaceDescArrayAccessUsingVarIndex : public Pass {
   void CollectRecursiveUsersWithConcreteType(
       Instruction* access_chain, std::vector<Instruction*>* final_users) const;
 
-  // Recursively collects the operands of |user_of_image_insts| (and operands
-  // of the operands) whose result types are images/samplers or pointers/array/
-  // struct of them and returns them.
-  std::deque<Instruction*> CollectRequiredImageInsts(
-      Instruction* user_of_image_insts) const;
+  // Recursively collects the operands of |user| (and operands of the operands)
+  // whose result types are images/samplers (or pointers/arrays/ structs of
+  // them) and access chains instructions and returns them. The returned
+  // collection includes |user|.
+  std::deque<Instruction*> CollectRequiredImageAndAccessInsts(
+      Instruction* user) const;
 
   // Returns whether result type of |inst| is an image/sampler/pointer of image
   // or sampler or not.

+ 27 - 43
ThirdParty/Glslang/External/spirv-tools/source/opt/spread_volatile_semantics.cpp

@@ -68,34 +68,12 @@ bool HasVolatileDecoration(analysis::DecorationManager* decoration_manager,
   return decoration_manager->HasDecoration(var_id, SpvDecorationVolatile);
 }
 
-bool HasOnlyEntryPointsAsFunctions(IRContext* context, Module* module) {
-  std::unordered_set<uint32_t> entry_function_ids;
-  for (Instruction& entry_point : module->entry_points()) {
-    entry_function_ids.insert(
-        entry_point.GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint));
-  }
-  for (auto& function : *module) {
-    if (entry_function_ids.find(function.result_id()) ==
-        entry_function_ids.end()) {
-      std::string message(
-          "Functions of SPIR-V for spread-volatile-semantics pass input must "
-          "be inlined except entry points");
-      message += "\n  " + function.DefInst().PrettyPrint(
-                              SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
-      context->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
-      return false;
-    }
-  }
-  return true;
-}
-
 }  // namespace
 
 Pass::Status SpreadVolatileSemantics::Process() {
-  if (!HasOnlyEntryPointsAsFunctions(context(), get_module())) {
-    return Status::Failure;
+  if (HasNoExecutionModel()) {
+    return Status::SuccessWithoutChange;
   }
-
   const bool is_vk_memory_model_enabled =
       context()->get_feature_mgr()->HasCapability(
           SpvCapabilityVulkanMemoryModel);
@@ -138,6 +116,8 @@ bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint(
     uint32_t var_id, Instruction* entry_point) {
   uint32_t entry_function_id =
       entry_point->GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint);
+  std::unordered_set<uint32_t> funcs;
+  context()->CollectCallTreeFromRoots(entry_function_id, &funcs);
   return !VisitLoadsOfPointersToVariableInEntries(
       var_id,
       [](Instruction* load) {
@@ -150,7 +130,7 @@ bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint(
             load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands);
         return (memory_operands & SpvMemoryAccessVolatileMask) != 0;
       },
-      {entry_function_id});
+      funcs);
 }
 
 bool SpreadVolatileSemantics::HasInterfaceInConflictOfVolatileSemantics() {
@@ -221,7 +201,7 @@ void SpreadVolatileSemantics::DecorateVarWithVolatile(Instruction* var) {
 
 bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries(
     uint32_t var_id, const std::function<bool(Instruction*)>& handle_load,
-    const std::unordered_set<uint32_t>& entry_function_ids) {
+    const std::unordered_set<uint32_t>& function_ids) {
   std::vector<uint32_t> worklist({var_id});
   auto* def_use_mgr = context()->get_def_use_mgr();
   while (!worklist.empty()) {
@@ -229,11 +209,11 @@ bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries(
     worklist.pop_back();
     bool finish_traversal = !def_use_mgr->WhileEachUser(
         ptr_id, [this, &worklist, &ptr_id, handle_load,
-                 &entry_function_ids](Instruction* user) {
+                 &function_ids](Instruction* user) {
           BasicBlock* block = context()->get_instr_block(user);
           if (block == nullptr ||
-              entry_function_ids.find(block->GetParent()->result_id()) ==
-                  entry_function_ids.end()) {
+              function_ids.find(block->GetParent()->result_id()) ==
+                  function_ids.end()) {
             return true;
           }
 
@@ -262,21 +242,25 @@ void SpreadVolatileSemantics::SetVolatileForLoadsInEntries(
     Instruction* var, const std::unordered_set<uint32_t>& entry_function_ids) {
   // Set Volatile memory operand for all load instructions if they do not have
   // it.
-  VisitLoadsOfPointersToVariableInEntries(
-      var->result_id(),
-      [](Instruction* load) {
-        if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) {
-          load->AddOperand(
-              {SPV_OPERAND_TYPE_MEMORY_ACCESS, {SpvMemoryAccessVolatileMask}});
+  for (auto entry_id : entry_function_ids) {
+    std::unordered_set<uint32_t> funcs;
+    context()->CollectCallTreeFromRoots(entry_id, &funcs);
+    VisitLoadsOfPointersToVariableInEntries(
+        var->result_id(),
+        [](Instruction* load) {
+          if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) {
+            load->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS,
+                              {SpvMemoryAccessVolatileMask}});
+            return true;
+          }
+          uint32_t memory_operands =
+              load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands);
+          memory_operands |= SpvMemoryAccessVolatileMask;
+          load->SetInOperand(kOpLoadInOperandMemoryOperands, {memory_operands});
           return true;
-        }
-        uint32_t memory_operands =
-            load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands);
-        memory_operands |= SpvMemoryAccessVolatileMask;
-        load->SetInOperand(kOpLoadInOperandMemoryOperands, {memory_operands});
-        return true;
-      },
-      entry_function_ids);
+        },
+        funcs);
+  }
 }
 
 bool SpreadVolatileSemantics::IsTargetForVolatileSemantics(

+ 13 - 7
ThirdParty/Glslang/External/spirv-tools/source/opt/spread_volatile_semantics.h

@@ -35,6 +35,13 @@ class SpreadVolatileSemantics : public Pass {
   }
 
  private:
+  // Returns true if it does not have an execution model. Linkage shaders do not
+  // have an execution model.
+  bool HasNoExecutionModel() {
+    return get_module()->entry_points().empty() &&
+           context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage);
+  }
+
   // Iterates interface variables and spreads the Volatile semantics if it has
   // load instructions for the Volatile semantics.
   Pass::Status SpreadVolatileSemanticsToVariables(
@@ -65,15 +72,14 @@ class SpreadVolatileSemantics : public Pass {
                                                  Instruction* entry_point);
 
   // Visits load instructions of pointers to variable whose result id is
-  // |var_id| if the load instructions are in entry points whose
-  // function id is one of |entry_function_ids|. |handle_load| is a function to
-  // do some actions for the load instructions. Finishes the traversal and
-  // returns false if |handle_load| returns false for a load instruction.
-  // Otherwise, returns true after running |handle_load| for all the load
-  // instructions.
+  // |var_id| if the load instructions are in reachable functions from entry
+  // points. |handle_load| is a function to do some actions for the load
+  // instructions. Finishes the traversal and returns false if |handle_load|
+  // returns false for a load instruction. Otherwise, returns true after running
+  // |handle_load| for all the load instructions.
   bool VisitLoadsOfPointersToVariableInEntries(
       uint32_t var_id, const std::function<bool(Instruction*)>& handle_load,
-      const std::unordered_set<uint32_t>& entry_function_ids);
+      const std::unordered_set<uint32_t>& function_ids);
 
   // Sets Memory Operands of OpLoad instructions that load |var| or pointers
   // of |var| as Volatile if the function id of the OpLoad instruction is

+ 5 - 3
ThirdParty/Glslang/External/spirv-tools/source/text.cpp

@@ -623,7 +623,8 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
           break;
         } else {
           return context->diagnostic()
-                 << "Expected operand, found end of stream.";
+                 << "Expected operand for " << opcodeName
+                 << " instruction, but found the end of the stream.";
         }
       }
       assert(error == SPV_SUCCESS && "Somebody added another way to fail");
@@ -633,7 +634,8 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
           break;
         } else {
           return context->diagnostic()
-                 << "Expected operand, found next instruction instead.";
+                 << "Expected operand for " << opcodeName
+                 << " instruction, but found the next instruction instead.";
         }
       }
 
@@ -667,7 +669,7 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
 
   if (pInst->words.size() > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) {
     return context->diagnostic()
-           << "Instruction too long: " << pInst->words.size()
+           << opcodeName << " Instruction too long: " << pInst->words.size()
            << " words, but the limit is "
            << SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX;
   }

+ 1 - 0
ThirdParty/Glslang/External/spirv-tools/source/util/ilist.h

@@ -348,6 +348,7 @@ void IntrusiveList<NodeType>::Check(NodeType* start) {
     p = p->next_node_;
   } while (p != start);
   assert(sentinel_count == 1 && "List should have exactly 1 sentinel node.");
+  (void)sentinel_count;
 
   p = start;
   do {

+ 9 - 4
ThirdParty/Glslang/External/spirv-tools/source/val/validate_annotation.cpp

@@ -136,8 +136,8 @@ std::string LogStringForDecoration(uint32_t decoration) {
       return "PerViewNV";
     case SpvDecorationPerTaskNV:
       return "PerTaskNV";
-    case SpvDecorationPerVertexNV:
-      return "PerVertexNV";
+    case SpvDecorationPerVertexKHR:
+      return "PerVertexKHR";
     case SpvDecorationNonUniform:
       return "NonUniform";
     case SpvDecorationRestrictPointer:
@@ -334,7 +334,7 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
             sc != SpvStorageClassIncomingCallableDataKHR &&
             sc != SpvStorageClassShaderRecordBufferKHR) {
           return _.diag(SPV_ERROR_INVALID_ID, target)
-                 << LogStringForDecoration(dec)
+                 << _.VkErrorID(6672) << LogStringForDecoration(dec)
                  << " decoration must not be applied to this storage class";
         }
         break;
@@ -355,7 +355,7 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
         break;
       case SpvDecorationInputAttachmentIndex:
         if (sc != SpvStorageClassUniformConstant) {
-          return fail(0) << "must be in the UniformConstant storage class";
+          return fail(6678) << "must be in the UniformConstant storage class";
         }
         break;
       case SpvDecorationFlat:
@@ -366,6 +366,11 @@ spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
           return fail(4670) << "storage class must be Input or Output";
         }
         break;
+      case SpvDecorationPerVertexKHR:
+        if (sc != SpvStorageClassInput) {
+          return fail(6777) << "storage class must be Input";
+        }
+        break;
       default:
         break;
     }

+ 96 - 5
ThirdParty/Glslang/External/spirv-tools/source/val/validate_builtins.cpp

@@ -120,7 +120,7 @@ typedef enum VUIDError_ {
   VUIDErrorMax,
 } VUIDError;
 
-const static uint32_t NumVUIDBuiltins = 33;
+const static uint32_t NumVUIDBuiltins = 36;
 
 typedef struct {
   SpvBuiltIn builtIn;
@@ -162,6 +162,9 @@ std::array<BuiltinVUIDMapping, NumVUIDBuiltins> builtinVUIDInfo = {{
     {SpvBuiltInFragSizeEXT,               {4220, 4221, 4222}},
     {SpvBuiltInFragStencilRefEXT,         {4223, 4224, 4225}},
     {SpvBuiltInFullyCoveredEXT,           {4232, 4233, 4234}},
+    {SpvBuiltInCullMaskKHR,               {6735, 6736, 6737}},
+    {SpvBuiltInBaryCoordKHR,              {4154, 4155, 4156}},
+    {SpvBuiltInBaryCoordNoPerspKHR,       {4160, 4161, 4162}},
     // clang-format off
 } };
 
@@ -208,6 +211,7 @@ bool IsExecutionModelValidForRtBuiltIn(SpvBuiltIn builtin,
     case SpvBuiltInRayTmaxKHR:
     case SpvBuiltInWorldRayDirectionKHR:
     case SpvBuiltInWorldRayOriginKHR:
+    case SpvBuiltInCullMaskKHR:
       switch (stage) {
         case SpvExecutionModelIntersectionKHR:
         case SpvExecutionModelAnyHitKHR:
@@ -331,7 +335,9 @@ class BuiltInsValidator {
       const Decoration& decoration, const Instruction& inst);
   spv_result_t ValidateSMBuiltinsAtDefinition(const Decoration& decoration,
                                               const Instruction& inst);
-
+  // Used for BaryCoord, BaryCoordNoPersp.
+  spv_result_t ValidateFragmentShaderF32Vec3InputAtDefinition(
+      const Decoration& decoration, const Instruction& inst);
   // Used for SubgroupEqMask, SubgroupGeMask, SubgroupGtMask, SubgroupLtMask,
   // SubgroupLeMask.
   spv_result_t ValidateI32Vec4InputAtDefinition(const Decoration& decoration,
@@ -509,6 +515,13 @@ class BuiltInsValidator {
       const Decoration& decoration, const Instruction& built_in_inst,
       const Instruction& referenced_inst,
       const Instruction& referenced_from_inst);
+
+  // Used for BaryCoord, BaryCoordNoPersp.
+  spv_result_t ValidateFragmentShaderF32Vec3InputAtReference(
+      const Decoration& decoration, const Instruction& built_in_inst,
+      const Instruction& referenced_inst,
+      const Instruction& referenced_from_inst);
+
   // Used for SubgroupId and NumSubgroups.
   spv_result_t ValidateComputeI32InputAtReference(
       const Decoration& decoration, const Instruction& built_in_inst,
@@ -2788,6 +2801,80 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
   return SPV_SUCCESS;
 }
 
+spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition(
+    const Decoration& decoration, const Instruction& inst) {
+  if (spvIsVulkanEnv(_.context()->target_env)) {
+    const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]);
+    if (spv_result_t error = ValidateF32Vec(
+            decoration, inst, 3,
+            [this, &inst, builtin](const std::string& message) -> spv_result_t {
+              uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorType);
+              return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+                     << _.VkErrorID(vuid) << "According to the "
+                     << spvLogStringForEnv(_.context()->target_env)
+                     << " spec BuiltIn "
+                     << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
+                                                      builtin)
+                     << " variable needs to be a 3-component 32-bit float "
+                        "vector. "
+                     << message;
+            })) {
+      return error;
+    }
+  }
+
+  // Seed at reference checks with this built-in.
+  return ValidateFragmentShaderF32Vec3InputAtReference(decoration, inst, inst,
+                                                      inst);
+}
+
+spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference(
+    const Decoration& decoration, const Instruction& built_in_inst,
+    const Instruction& referenced_inst,
+    const Instruction& referenced_from_inst) {
+
+  if (spvIsVulkanEnv(_.context()->target_env)) {
+    const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]);
+    const SpvStorageClass storage_class = GetStorageClass(referenced_from_inst);
+    if (storage_class != SpvStorageClassMax &&
+        storage_class != SpvStorageClassInput) {
+      uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorStorageClass);
+      return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
+             << _.VkErrorID(vuid) << spvLogStringForEnv(_.context()->target_env)
+             << " spec allows BuiltIn "
+             << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin)
+             << " to be only used for variables with Input storage class. "
+             << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
+                                 referenced_from_inst)
+             << " " << GetStorageClassDesc(referenced_from_inst);
+    }
+
+    for (const SpvExecutionModel execution_model : execution_models_) {
+      if (execution_model != SpvExecutionModelFragment) {
+        uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel);
+        return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
+               << _.VkErrorID(vuid)
+               << spvLogStringForEnv(_.context()->target_env)
+               << " spec allows BuiltIn "
+               << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin)
+               << " to be used only with Fragment execution model. "
+               << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
+                                   referenced_from_inst, execution_model);
+      }
+    }
+  }
+
+  if (function_id_ == 0) {
+    // Propagate this rule to all dependant ids in the global scope.
+    id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+        &BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference, this,
+        decoration, built_in_inst, referenced_from_inst,
+        std::placeholders::_1));
+  }
+
+  return SPV_SUCCESS;
+}
+
 spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition(
     const Decoration& decoration, const Instruction& inst) {
   if (spvIsVulkanEnv(_.context()->target_env)) {
@@ -3851,6 +3938,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition(
       case SpvBuiltInInstanceId:
       case SpvBuiltInRayGeometryIndexKHR:
       case SpvBuiltInIncomingRayFlagsKHR:
+      case SpvBuiltInCullMaskKHR:
         // i32 scalar
         if (spv_result_t error = ValidateI32(
                 decoration, inst,
@@ -4027,6 +4115,10 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
     case SpvBuiltInWorkgroupId: {
       return ValidateComputeShaderI32Vec3InputAtDefinition(decoration, inst);
     }
+    case SpvBuiltInBaryCoordKHR:
+    case SpvBuiltInBaryCoordNoPerspKHR: {
+      return ValidateFragmentShaderF32Vec3InputAtDefinition(decoration, inst);
+    }
     case SpvBuiltInHelperInvocation: {
       return ValidateHelperInvocationAtDefinition(decoration, inst);
     }
@@ -4151,7 +4243,8 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
     case SpvBuiltInObjectToWorldKHR:        // alias SpvBuiltInObjectToWorldNV
     case SpvBuiltInWorldToObjectKHR:        // alias SpvBuiltInWorldToObjectNV
     case SpvBuiltInIncomingRayFlagsKHR:    // alias SpvBuiltInIncomingRayFlagsNV
-    case SpvBuiltInRayGeometryIndexKHR: {  // NOT present in NV
+    case SpvBuiltInRayGeometryIndexKHR:    // NOT present in NV
+    case SpvBuiltInCullMaskKHR: {
       return ValidateRayTracingBuiltinsAtDefinition(decoration, inst);
     }
     case SpvBuiltInWorkDim:
@@ -4182,8 +4275,6 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
     case SpvBuiltInLayerPerViewNV:
     case SpvBuiltInMeshViewCountNV:
     case SpvBuiltInMeshViewIndicesNV:
-    case SpvBuiltInBaryCoordNV:
-    case SpvBuiltInBaryCoordNoPerspNV:
     case SpvBuiltInCurrentRayTimeNV:
       // No validation rules (for the moment).
       break;

+ 3 - 8
ThirdParty/Glslang/External/spirv-tools/source/val/validate_cfg.cpp

@@ -55,8 +55,7 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) {
   }
   if (_.IsPointerType(inst->type_id()) &&
       _.addressing_model() == SpvAddressingModelLogical) {
-    if (!_.features().variable_pointers &&
-        !_.features().variable_pointers_storage_buffer) {
+    if (!_.features().variable_pointers) {
       return _.diag(SPV_ERROR_INVALID_DATA, inst)
              << "Using pointers with OpPhi requires capability "
              << "VariablePointers or VariablePointersStorageBuffer";
@@ -249,13 +248,9 @@ spv_result_t ValidateReturnValue(ValidationState_t& _,
            << _.getIdName(value->type_id()) << "' is missing or void.";
   }
 
-  const bool uses_variable_pointer =
-      _.features().variable_pointers ||
-      _.features().variable_pointers_storage_buffer;
-
   if (_.addressing_model() == SpvAddressingModelLogical &&
-      SpvOpTypePointer == value_type->opcode() && !uses_variable_pointer &&
-      !_.options()->relax_logical_pointer) {
+      SpvOpTypePointer == value_type->opcode() &&
+      !_.features().variable_pointers && !_.options()->relax_logical_pointer) {
     return _.diag(SPV_ERROR_INVALID_ID, inst)
            << "OpReturnValue value's type <id> '"
            << _.getIdName(value->type_id())

+ 22 - 22
ThirdParty/Glslang/External/spirv-tools/source/val/validate_decorations.cpp

@@ -956,41 +956,41 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
       const bool storage_buffer = storageClass == SpvStorageClassStorageBuffer;
 
       if (spvIsVulkanEnv(vstate.context()->target_env)) {
-        // Vulkan 14.5.1: There must be no more than one PushConstant block
-        // per entry point.
+        // Vulkan: There must be no more than one PushConstant block per entry
+        // point.
         if (push_constant) {
           auto entry_points = vstate.EntryPointReferences(var_id);
           for (auto ep_id : entry_points) {
             const bool already_used = !uses_push_constant.insert(ep_id).second;
             if (already_used) {
               return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                     << "Entry point id '" << ep_id
+                     << vstate.VkErrorID(6674) << "Entry point id '" << ep_id
                      << "' uses more than one PushConstant interface.\n"
-                     << "From Vulkan spec, section 14.5.1:\n"
+                     << "From Vulkan spec:\n"
                      << "There must be no more than one push constant block "
                      << "statically used per shader entry point.";
             }
           }
         }
-        // Vulkan 14.5.2: Check DescriptorSet and Binding decoration for
+        // Vulkan: Check DescriptorSet and Binding decoration for
         // UniformConstant which cannot be a struct.
         if (uniform_constant) {
           auto entry_points = vstate.EntryPointReferences(var_id);
           if (!entry_points.empty() &&
               !hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                   << "UniformConstant id '" << var_id
+                   << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id
                    << "' is missing DescriptorSet decoration.\n"
-                   << "From Vulkan spec, section 14.5.2:\n"
+                   << "From Vulkan spec:\n"
                    << "These variables must have DescriptorSet and Binding "
                       "decorations specified";
           }
           if (!entry_points.empty() &&
               !hasDecoration(var_id, SpvDecorationBinding, vstate)) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                   << "UniformConstant id '" << var_id
+                   << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id
                    << "' is missing Binding decoration.\n"
-                   << "From Vulkan spec, section 14.5.2:\n"
+                   << "From Vulkan spec:\n"
                    << "These variables must have DescriptorSet and Binding "
                       "decorations specified";
           }
@@ -1051,55 +1051,55 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
               hasDecoration(id, SpvDecorationBufferBlock, vstate);
           if (storage_buffer && buffer_block) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                   << "Storage buffer id '" << var_id
+                   << vstate.VkErrorID(6675) << "Storage buffer id '" << var_id
                    << " In Vulkan, BufferBlock is disallowed on variables in "
                       "the StorageBuffer storage class";
           }
-          // Vulkan 14.5.1/2: Check Block decoration for PushConstant, Uniform
+          // Vulkan: Check Block decoration for PushConstant, Uniform
           // and StorageBuffer variables. Uniform can also use BufferBlock.
           if (push_constant && !block) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
-                   << "PushConstant id '" << id
+                   << vstate.VkErrorID(6675) << "PushConstant id '" << id
                    << "' is missing Block decoration.\n"
-                   << "From Vulkan spec, section 14.5.1:\n"
+                   << "From Vulkan spec:\n"
                    << "Such variables must be identified with a Block "
                       "decoration";
           }
           if (storage_buffer && !block) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
-                   << "StorageBuffer id '" << id
+                   << vstate.VkErrorID(6675) << "StorageBuffer id '" << id
                    << "' is missing Block decoration.\n"
-                   << "From Vulkan spec, section 14.5.2:\n"
+                   << "From Vulkan spec:\n"
                    << "Such variables must be identified with a Block "
                       "decoration";
           }
           if (uniform && !block && !buffer_block) {
             return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
-                   << "Uniform id '" << id
+                   << vstate.VkErrorID(6676) << "Uniform id '" << id
                    << "' is missing Block or BufferBlock decoration.\n"
-                   << "From Vulkan spec, section 14.5.2:\n"
+                   << "From Vulkan spec:\n"
                    << "Such variables must be identified with a Block or "
                       "BufferBlock decoration";
           }
-          // Vulkan 14.5.2: Check DescriptorSet and Binding decoration for
+          // Vulkan: Check DescriptorSet and Binding decoration for
           // Uniform and StorageBuffer variables.
           if (uniform || storage_buffer) {
             auto entry_points = vstate.EntryPointReferences(var_id);
             if (!entry_points.empty() &&
                 !hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) {
               return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                     << sc_str << " id '" << var_id
+                     << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
                      << "' is missing DescriptorSet decoration.\n"
-                     << "From Vulkan spec, section 14.5.2:\n"
+                     << "From Vulkan spec:\n"
                      << "These variables must have DescriptorSet and Binding "
                         "decorations specified";
             }
             if (!entry_points.empty() &&
                 !hasDecoration(var_id, SpvDecorationBinding, vstate)) {
               return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
-                     << sc_str << " id '" << var_id
+                     << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
                      << "' is missing Binding decoration.\n"
-                     << "From Vulkan spec, section 14.5.2:\n"
+                     << "From Vulkan spec:\n"
                      << "These variables must have DescriptorSet and Binding "
                         "decorations specified";
             }

+ 5 - 6
ThirdParty/Glslang/External/spirv-tools/source/val/validate_function.cpp

@@ -300,7 +300,7 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
             // These are always allowed.
             break;
           case SpvStorageClassStorageBuffer:
-            if (!_.features().variable_pointers_storage_buffer) {
+            if (!_.features().variable_pointers) {
               return _.diag(SPV_ERROR_INVALID_ID, inst)
                      << "StorageBuffer pointer operand "
                      << _.getIdName(argument_id)
@@ -316,11 +316,10 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
         // Validate memory object declaration requirements.
         if (argument->opcode() != SpvOpVariable &&
             argument->opcode() != SpvOpFunctionParameter) {
-          const bool ssbo_vptr =
-              _.features().variable_pointers_storage_buffer &&
-              sc == SpvStorageClassStorageBuffer;
-          const bool wg_vptr =
-              _.features().variable_pointers && sc == SpvStorageClassWorkgroup;
+          const bool ssbo_vptr = _.features().variable_pointers &&
+                                 sc == SpvStorageClassStorageBuffer;
+          const bool wg_vptr = _.HasCapability(SpvCapabilityVariablePointers) &&
+                               sc == SpvStorageClassWorkgroup;
           const bool uc_ptr = sc == SpvStorageClassUniformConstant;
           if (!ssbo_vptr && !wg_vptr && !uc_ptr) {
             return _.diag(SPV_ERROR_INVALID_ID, inst)

+ 3 - 2
ThirdParty/Glslang/External/spirv-tools/source/val/validate_image.cpp

@@ -980,8 +980,9 @@ spv_result_t ValidateSampledImage(ValidationState_t& _,
   if (spvIsVulkanEnv(_.context()->target_env)) {
     if (info.sampled != 1) {
       return _.diag(SPV_ERROR_INVALID_DATA, inst)
-             << "Expected Image 'Sampled' parameter to be 1 "
-             << "for Vulkan environment.";
+             << _.VkErrorID(6671)
+             << "Expected Image 'Sampled' parameter to be 1 for Vulkan "
+                "environment.";
     }
   } else {
     if (info.sampled != 0 && info.sampled != 1) {

+ 16 - 4
ThirdParty/Glslang/External/spirv-tools/source/val/validate_interfaces.cpp

@@ -238,7 +238,7 @@ spv_result_t GetLocationsForVariable(
   uint32_t index = 0;
   bool has_patch = false;
   bool has_per_task_nv = false;
-  bool has_per_vertex_nv = false;
+  bool has_per_vertex_khr = false;
   for (auto& dec : _.id_decorations(variable->id())) {
     if (dec.dec_type() == SpvDecorationLocation) {
       if (has_location && dec.params()[0] != location) {
@@ -272,8 +272,20 @@ spv_result_t GetLocationsForVariable(
       has_patch = true;
     } else if (dec.dec_type() == SpvDecorationPerTaskNV) {
       has_per_task_nv = true;
-    } else if (dec.dec_type() == SpvDecorationPerVertexNV) {
-      has_per_vertex_nv = true;
+    } else if (dec.dec_type() == SpvDecorationPerVertexKHR) {
+      if (!is_fragment) {
+        return _.diag(SPV_ERROR_INVALID_DATA, variable)
+               << _.VkErrorID(6777)
+               << "PerVertexKHR can only be applied to Fragment Execution "
+                  "Models";
+      }
+      if (type->opcode() != SpvOpTypeArray &&
+          type->opcode() != SpvOpTypeRuntimeArray) {
+        return _.diag(SPV_ERROR_INVALID_DATA, variable)
+               << _.VkErrorID(6778)
+               << "PerVertexKHR must be declared as arrays";
+      }
+      has_per_vertex_khr = true;
     }
   }
 
@@ -298,7 +310,7 @@ spv_result_t GetLocationsForVariable(
       }
       break;
     case SpvExecutionModelFragment:
-      if (!is_output && has_per_vertex_nv) {
+      if (!is_output && has_per_vertex_khr) {
         is_arrayed = true;
       }
       break;

+ 1 - 2
ThirdParty/Glslang/External/spirv-tools/source/val/validate_logicals.cpp

@@ -163,8 +163,7 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) {
         switch (type_opcode) {
           case SpvOpTypePointer: {
             if (_.addressing_model() == SpvAddressingModelLogical &&
-                !_.features().variable_pointers &&
-                !_.features().variable_pointers_storage_buffer)
+                !_.features().variable_pointers)
               return _.diag(SPV_ERROR_INVALID_DATA, inst)
                      << "Using pointers with OpSelect requires capability "
                      << "VariablePointers or VariablePointersStorageBuffer";

+ 12 - 21
ThirdParty/Glslang/External/spirv-tools/source/val/validate_memory.cpp

@@ -870,17 +870,14 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) {
            << "' is not defined.";
   }
 
-  const bool uses_variable_pointers =
-      _.features().variable_pointers ||
-      _.features().variable_pointers_storage_buffer;
   const auto pointer_index = 2;
   const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
   const auto pointer = _.FindDef(pointer_id);
   if (!pointer ||
       ((_.addressing_model() == SpvAddressingModelLogical) &&
-       ((!uses_variable_pointers &&
+       ((!_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
-        (uses_variable_pointers &&
+        (_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
     return _.diag(SPV_ERROR_INVALID_ID, inst)
            << "OpLoad Pointer <id> '" << _.getIdName(pointer_id)
@@ -926,17 +923,14 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) {
 }
 
 spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) {
-  const bool uses_variable_pointer =
-      _.features().variable_pointers ||
-      _.features().variable_pointers_storage_buffer;
   const auto pointer_index = 0;
   const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
   const auto pointer = _.FindDef(pointer_id);
   if (!pointer ||
       (_.addressing_model() == SpvAddressingModelLogical &&
-       ((!uses_variable_pointer &&
+       ((!_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
-        (uses_variable_pointer &&
+        (_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
     return _.diag(SPV_ERROR_INVALID_ID, inst)
            << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
@@ -1362,8 +1356,7 @@ spv_result_t ValidateAccessChain(ValidationState_t& _,
 spv_result_t ValidatePtrAccessChain(ValidationState_t& _,
                                     const Instruction* inst) {
   if (_.addressing_model() == SpvAddressingModelLogical) {
-    if (!_.features().variable_pointers &&
-        !_.features().variable_pointers_storage_buffer) {
+    if (!_.features().variable_pointers) {
       return _.diag(SPV_ERROR_INVALID_DATA, inst)
              << "Generating variable pointers requires capability "
              << "VariablePointers or VariablePointersStorageBuffer";
@@ -1481,18 +1474,15 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
     }
   }
 
-  const bool uses_variable_pointers =
-      _.features().variable_pointers ||
-      _.features().variable_pointers_storage_buffer;
   const auto pointer_index =
       (inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 2u : 0u;
   const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
   const auto pointer = _.FindDef(pointer_id);
   if (!pointer ||
       ((_.addressing_model() == SpvAddressingModelLogical) &&
-       ((!uses_variable_pointers &&
+       ((!_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
-        (uses_variable_pointers &&
+        (_.features().variable_pointers &&
          !spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
     return _.diag(SPV_ERROR_INVALID_ID, inst)
            << opname << " Pointer <id> '" << _.getIdName(pointer_id)
@@ -1564,10 +1554,10 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
 spv_result_t ValidatePtrComparison(ValidationState_t& _,
                                    const Instruction* inst) {
   if (_.addressing_model() == SpvAddressingModelLogical &&
-      !_.features().variable_pointers_storage_buffer) {
+      !_.features().variable_pointers) {
     return _.diag(SPV_ERROR_INVALID_ID, inst)
-           << "Instruction cannot be used without a variable pointers "
-              "capability";
+           << "Instruction cannot for logical addressing model be used without "
+              "a variable pointers capability";
   }
 
   const auto result_type = _.FindDef(inst->type_id());
@@ -1602,7 +1592,8 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _,
              << "Invalid pointer storage class";
     }
 
-    if (sc == SpvStorageClassWorkgroup && !_.features().variable_pointers) {
+    if (sc == SpvStorageClassWorkgroup &&
+        !_.HasCapability(SpvCapabilityVariablePointers)) {
       return _.diag(SPV_ERROR_INVALID_ID, inst)
              << "Workgroup storage class pointer requires VariablePointers "
                 "capability to be specified";

+ 55 - 0
ThirdParty/Glslang/External/spirv-tools/source/val/validate_non_uniform.cpp

@@ -63,6 +63,59 @@ spv_result_t ValidateGroupNonUniformBallotBitCount(ValidationState_t& _,
   return SPV_SUCCESS;
 }
 
+spv_result_t ValidateGroupNonUniformRotateKHR(ValidationState_t& _,
+                                              const Instruction* inst) {
+  // Scope is already checked by ValidateExecutionScope() above.
+  const uint32_t result_type = inst->type_id();
+  if (!_.IsIntScalarOrVectorType(result_type) &&
+      !_.IsFloatScalarOrVectorType(result_type) &&
+      !_.IsBoolScalarOrVectorType(result_type)) {
+    return _.diag(SPV_ERROR_INVALID_DATA, inst)
+           << "Expected Result Type to be a scalar or vector of "
+              "floating-point, integer or boolean type.";
+  }
+
+  const uint32_t value_type = _.GetTypeId(inst->GetOperandAs<uint32_t>(3));
+  if (value_type != result_type) {
+    return _.diag(SPV_ERROR_INVALID_DATA, inst)
+           << "Result Type must be the same as the type of Value.";
+  }
+
+  const uint32_t delta_type = _.GetTypeId(inst->GetOperandAs<uint32_t>(4));
+  if (!_.IsUnsignedIntScalarType(delta_type)) {
+    return _.diag(SPV_ERROR_INVALID_DATA, inst)
+           << "Delta must be a scalar of integer type, whose Signedness "
+              "operand is 0.";
+  }
+
+  if (inst->words().size() > 6) {
+    const uint32_t cluster_size_op_id = inst->GetOperandAs<uint32_t>(5);
+    const uint32_t cluster_size_type = _.GetTypeId(cluster_size_op_id);
+    if (!_.IsUnsignedIntScalarType(cluster_size_type)) {
+      return _.diag(SPV_ERROR_INVALID_DATA, inst)
+             << "ClusterSize must be a scalar of integer type, whose "
+                "Signedness operand is 0.";
+    }
+
+    uint64_t cluster_size;
+    if (!_.GetConstantValUint64(cluster_size_op_id, &cluster_size)) {
+      return _.diag(SPV_ERROR_INVALID_DATA, inst)
+             << "ClusterSize must come from a constant instruction.";
+    }
+
+    if ((cluster_size == 0) || ((cluster_size & (cluster_size - 1)) != 0)) {
+      return _.diag(SPV_WARNING, inst)
+             << "Behavior is undefined unless ClusterSize is at least 1 and a "
+                "power of 2.";
+    }
+
+    // TODO(kpet) Warn about undefined behavior when ClusterSize is greater than
+    // the declared SubGroupSize
+  }
+
+  return SPV_SUCCESS;
+}
+
 }  // namespace
 
 // Validates correctness of non-uniform group instructions.
@@ -79,6 +132,8 @@ spv_result_t NonUniformPass(ValidationState_t& _, const Instruction* inst) {
   switch (opcode) {
     case SpvOpGroupNonUniformBallotBitCount:
       return ValidateGroupNonUniformBallotBitCount(_, inst);
+    case SpvOpGroupNonUniformRotateKHR:
+      return ValidateGroupNonUniformRotateKHR(_, inst);
     default:
       break;
   }

+ 38 - 5
ThirdParty/Glslang/External/spirv-tools/source/val/validation_state.cpp

@@ -392,11 +392,8 @@ void ValidationState_t::RegisterCapability(SpvCapability cap) {
       features_.free_fp_rounding_mode = true;
       break;
     case SpvCapabilityVariablePointers:
-      features_.variable_pointers = true;
-      features_.variable_pointers_storage_buffer = true;
-      break;
     case SpvCapabilityVariablePointersStorageBuffer:
-      features_.variable_pointers_storage_buffer = true;
+      features_.variable_pointers = true;
       break;
     default:
       // TODO(dneto): For now don't validate SPV_NV_ray_tracing, which uses
@@ -541,7 +538,7 @@ void ValidationState_t::RegisterInstruction(Instruction* inst) {
   if (inst->id()) all_definitions_.insert(std::make_pair(inst->id(), inst));
 
   // Some validation checks are easier by getting all the consumers
-  for (uint16_t i = 0; i < inst->operands().size(); ++i) {
+  for (size_t i = 0; i < inst->operands().size(); ++i) {
     const spv_parsed_operand_t& operand = inst->operand(i);
     if ((SPV_OPERAND_TYPE_ID == operand.type) ||
         (SPV_OPERAND_TYPE_TYPE_ID == operand.type)) {
@@ -1414,6 +1411,18 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
   // Clang format adds spaces between hyphens
   // clang-format off
   switch (id) {
+    case 4154:
+      return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04154);
+    case 4155:
+      return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04155);
+    case 4156:
+      return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04156);
+    case 4160:
+      return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04160);
+    case 4161:
+      return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04161);
+    case 4162:
+      return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04162);
     case 4181:
       return VUID_WRAP(VUID-BaseInstance-BaseInstance-04181);
     case 4182:
@@ -1446,6 +1455,12 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
       return VUID_WRAP(VUID-CullDistance-CullDistance-04199);
     case 4200:
       return VUID_WRAP(VUID-CullDistance-CullDistance-04200);
+    case 6735:
+      return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06735); // Execution Model
+    case 6736:
+      return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06736); // input storage
+    case 6737:
+      return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06737); // 32 int scalar
     case 4205:
       return VUID_WRAP(VUID-DeviceIndex-DeviceIndex-04205);
     case 4206:
@@ -1908,6 +1923,24 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
       return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-06214);
     case 6491:
       return VUID_WRAP(VUID-StandaloneSpirv-DescriptorSet-06491);
+    case 6671:
+      return VUID_WRAP(VUID-StandaloneSpirv-OpTypeSampledImage-06671);
+    case 6672:
+      return VUID_WRAP(VUID-StandaloneSpirv-Location-06672);
+    case 6674:
+      return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-06674);
+    case 6675:
+      return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06675);
+    case 6676:
+      return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06676);
+    case 6677:
+      return VUID_WRAP(VUID-StandaloneSpirv-UniformConstant-06677);
+    case 6678:
+      return VUID_WRAP(VUID-StandaloneSpirv-InputAttachmentIndex-06678);
+    case 6777:
+      return VUID_WRAP(VUID-StandaloneSpirv-PerVertexKHR-06777);
+    case 6778:
+      return VUID_WRAP(VUID-StandaloneSpirv-Input-06778);
     default:
       return "";  // unknown id
   }

+ 2 - 4
ThirdParty/Glslang/External/spirv-tools/source/val/validation_state.h

@@ -70,11 +70,9 @@ class ValidationState_t {
                                          // and its values to be used without
                                          // requiring any capability
 
-    // Allow functionalities enabled by VariablePointers capability.
+    // Allow functionalities enabled by VariablePointers or
+    // VariablePointersStorageBuffer capability.
     bool variable_pointers = false;
-    // Allow functionalities enabled by VariablePointersStorageBuffer
-    // capability.
-    bool variable_pointers_storage_buffer = false;
 
     // Permit group oerations Reduce, InclusiveScan, ExclusiveScan
     bool group_ops_reduce_and_scans = false;

+ 8 - 2
ThirdParty/Glslang/External/spirv-tools/test/c_interface_test.cpp

@@ -122,7 +122,10 @@ TEST(CInterface, SpecifyConsumerNullDiagnosticForAssembling) {
         EXPECT_EQ(1u, position.line);
         EXPECT_EQ(0u, position.column);
         EXPECT_EQ(12u, position.index);
-        EXPECT_STREQ("Expected operand, found end of stream.", message);
+        EXPECT_STREQ(
+            "Expected operand for OpName instruction, but found the end of the "
+            "stream.",
+            message);
       });
 
   spv_binary binary = nullptr;
@@ -228,7 +231,10 @@ TEST(CInterface, SpecifyConsumerSpecifyDiagnosticForAssembling) {
             spvTextToBinary(context, input_text, sizeof(input_text), &binary,
                             &diagnostic));
   EXPECT_EQ(0, invocation);  // Consumer should not be invoked at all.
-  EXPECT_STREQ("Expected operand, found end of stream.", diagnostic->error);
+  EXPECT_STREQ(
+      "Expected operand for OpName instruction, but found the end of the "
+      "stream.",
+      diagnostic->error);
 
   spvDiagnosticDestroy(diagnostic);
   spvBinaryDestroy(binary);

+ 43 - 0
ThirdParty/Glslang/External/spirv-tools/test/link/entry_points_test.cpp

@@ -104,5 +104,48 @@ OpFunctionEnd
                         "GLCompute, was already defined."));
 }
 
+TEST_F(EntryPoints, LinkedVariables) {
+  const std::string body1 = R"(
+               OpCapability Addresses
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpDecorate %7 LinkageAttributes "foo" Export
+%1 = OpTypeInt 32 0
+%2 = OpTypeVector %1 3
+%3 = OpTypePointer Input %2
+%4 = OpVariable %3 Input
+%5 = OpTypeVoid
+%6 = OpTypeFunction %5
+%7 = OpFunction %5 None %6
+%8 = OpLabel
+%9 = OpLoad %2 %4 Aligned 32
+OpReturn
+OpFunctionEnd
+)";
+  const std::string body2 = R"(
+OpCapability Linkage
+OpCapability Kernel
+OpMemoryModel Physical64 OpenCL
+OpEntryPoint Kernel %4 "bar"
+OpDecorate %3 LinkageAttributes "foo" Import
+%1 = OpTypeVoid
+%2 = OpTypeFunction %1
+%3 = OpFunction %1 None %2
+OpFunctionEnd
+%4 = OpFunction %1 None %2
+%5 = OpLabel
+%6 = OpFunctionCall %1 %3
+OpReturn
+OpFunctionEnd
+)";
+
+  spvtest::Binary linked_binary;
+  EXPECT_EQ(SPV_SUCCESS, AssembleAndLink({body1, body2}, &linked_binary));
+  EXPECT_THAT(GetErrorMessage(), std::string());
+  EXPECT_TRUE(Validate(linked_binary));
+  EXPECT_THAT(GetErrorMessage(), std::string());
+}
+
 }  // namespace
 }  // namespace spvtools

+ 4 - 0
ThirdParty/Glslang/External/spirv-tools/test/link/linker_fixture.h

@@ -208,6 +208,10 @@ class LinkerTest : public ::testing::Test {
   // Returns the accumulated error messages for the test.
   std::string GetErrorMessage() const { return error_message_; }
 
+  bool Validate(const spvtest::Binary& binary) {
+    return tools_.Validate(binary);
+  }
+
  private:
   spvtools::Context context_;
   spvtools::SpirvTools

+ 4 - 2
ThirdParty/Glslang/External/spirv-tools/test/opt/CMakeLists.txt

@@ -45,6 +45,7 @@ add_spvtools_unittest(TARGET opt
        eliminate_dead_input_components_test.cpp
        eliminate_dead_member_test.cpp
        feature_manager_test.cpp
+       fix_func_call_arguments_test.cpp
        fix_storage_class_test.cpp
        flatten_decoration_test.cpp
        fold_spec_const_op_composite_test.cpp
@@ -61,6 +62,7 @@ add_spvtools_unittest(TARGET opt
        inst_debug_printf_test.cpp
        instruction_list_test.cpp
        instruction_test.cpp
+       interface_var_sroa_test.cpp
        interp_fixup_test.cpp
        ir_builder.cpp
        ir_context_test.cpp
@@ -84,7 +86,7 @@ add_spvtools_unittest(TARGET opt
        reduce_load_size_test.cpp
        redundancy_elimination_test.cpp
        remove_dontinline_test.cpp
-	   remove_unused_interface_variables_test.cpp
+       remove_unused_interface_variables_test.cpp
        register_liveness.cpp
        relax_float_ops_test.cpp
        replace_desc_array_access_using_var_index_test.cpp
@@ -96,7 +98,7 @@ add_spvtools_unittest(TARGET opt
        spread_volatile_semantics_test.cpp
        strength_reduction_test.cpp
        strip_debug_info_test.cpp
-        strip_nonsemantic_info_test.cpp
+       strip_nonsemantic_info_test.cpp
        struct_cfg_analysis_test.cpp
        type_manager_test.cpp
        types_test.cpp

+ 152 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/fix_func_call_arguments_test.cpp

@@ -0,0 +1,152 @@
+// Copyright (c) 2022 Advanced Micro Devices, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gmock/gmock.h"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+using FixFuncCallArgumentsTest = PassTest<::testing::Test>;
+TEST_F(FixFuncCallArgumentsTest, Simple) {
+  const std::string text = R"(
+;
+; CHECK: [[v0:%\w+]] = OpVariable %_ptr_Function_float Function
+; CHECK: [[v1:%\w+]] = OpVariable %_ptr_Function_float Function
+; CHECK: [[v2:%\w+]] = OpVariable %_ptr_Function_T Function
+; CHECK: [[ac0:%\w+]] = OpAccessChain %_ptr_Function_float %t %int_0
+; CHECK: [[ac1:%\w+]] = OpAccessChain %_ptr_Uniform_float %r1 %int_0 %uint_0
+; CHECK: [[ld0:%\w+]] = OpLoad %float [[ac0]]
+; CHECK:                OpStore [[v1]] [[ld0]]
+; CHECK: [[ld1:%\w+]] = OpLoad %float [[ac1]]
+; CHECK:                OpStore [[v0]] [[ld1]]
+; CHECK: [[func:%\w+]] = OpFunctionCall %void %fn [[v1]] [[v0]]
+; CHECK: [[ld2:%\w+]] = OpLoad %float [[v0]]
+; CHECK: OpStore [[ac1]] [[ld2]]
+; CHECK: [[ld3:%\w+]] = OpLoad %float [[v1]]
+; CHECK: OpStore [[ac0]] [[ld3]]
+;
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+OpSource HLSL 630
+OpName %type_RWStructuredBuffer_float "type.RWStructuredBuffer.float"
+OpName %r1 "r1"
+OpName %type_ACSBuffer_counter "type.ACSBuffer.counter"
+OpMemberName %type_ACSBuffer_counter 0 "counter"
+OpName %counter_var_r1 "counter.var.r1"
+OpName %main "main"
+OpName %bb_entry "bb.entry"
+OpName %T "T"
+OpMemberName %T 0 "t0"
+OpName %t "t"
+OpName %fn "fn"
+OpName %p0 "p0"
+OpName %p2 "p2"
+OpName %bb_entry_0 "bb.entry"
+OpDecorate %main LinkageAttributes "main" Export
+OpDecorate %r1 DescriptorSet 0
+OpDecorate %r1 Binding 0
+OpDecorate %counter_var_r1 DescriptorSet 0
+OpDecorate %counter_var_r1 Binding 1
+OpDecorate %_runtimearr_float ArrayStride 4
+OpMemberDecorate %type_RWStructuredBuffer_float 0 Offset 0
+OpDecorate %type_RWStructuredBuffer_float BufferBlock
+OpMemberDecorate %type_ACSBuffer_counter 0 Offset 0
+OpDecorate %type_ACSBuffer_counter BufferBlock
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%int_1 = OpConstant %int 1
+%float = OpTypeFloat 32
+%_runtimearr_float = OpTypeRuntimeArray %float
+%type_RWStructuredBuffer_float = OpTypeStruct %_runtimearr_float
+%_ptr_Uniform_type_RWStructuredBuffer_float = OpTypePointer Uniform %type_RWStructuredBuffer_float
+%type_ACSBuffer_counter = OpTypeStruct %int
+%_ptr_Uniform_type_ACSBuffer_counter = OpTypePointer Uniform %type_ACSBuffer_counter
+%15 = OpTypeFunction %int
+%T = OpTypeStruct %float
+%_ptr_Function_T = OpTypePointer Function %T
+%_ptr_Function_float = OpTypePointer Function %float
+%_ptr_Uniform_float = OpTypePointer Uniform %float
+%void = OpTypeVoid
+%27 = OpTypeFunction %void %_ptr_Function_float %_ptr_Function_float
+%r1 = OpVariable %_ptr_Uniform_type_RWStructuredBuffer_float Uniform
+%counter_var_r1 = OpVariable %_ptr_Uniform_type_ACSBuffer_counter Uniform
+%main = OpFunction %int None %15
+%bb_entry = OpLabel
+%t = OpVariable %_ptr_Function_T Function
+%21 = OpAccessChain %_ptr_Function_float %t %int_0
+%23 = OpAccessChain %_ptr_Uniform_float %r1 %int_0 %uint_0
+%25 = OpFunctionCall %void %fn %21 %23
+OpReturnValue %int_1
+OpFunctionEnd
+%fn = OpFunction %void DontInline %27
+%p0 = OpFunctionParameter %_ptr_Function_float
+%p2 = OpFunctionParameter %_ptr_Function_float
+%bb_entry_0 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndMatch<FixFuncCallArgumentsPass>(text, true);
+}
+
+TEST_F(FixFuncCallArgumentsTest, NotAccessChainInput) {
+  const std::string text = R"(
+;
+; CHECK: [[o:%\w+]] = OpCopyObject %_ptr_Function_float %t
+; CHECK: [[func:%\w+]] = OpFunctionCall %void %fn [[o]]
+;
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+OpSource HLSL 630
+OpName %main "main"
+OpName %bb_entry "bb.entry"
+OpName %t "t"
+OpName %fn "fn"
+OpName %p0 "p0"
+OpName %bb_entry_0 "bb.entry"
+OpDecorate %main LinkageAttributes "main" Export
+%int = OpTypeInt 32 1
+%int_1 = OpConstant %int 1
+%4 = OpTypeFunction %int
+%float = OpTypeFloat 32
+%_ptr_Function_float = OpTypePointer Function %float
+%void = OpTypeVoid
+%12 = OpTypeFunction %void %_ptr_Function_float
+%main = OpFunction %int None %4
+%bb_entry = OpLabel
+%t = OpVariable %_ptr_Function_float Function
+%t1 = OpCopyObject %_ptr_Function_float %t
+%10 = OpFunctionCall %void %fn %t1
+OpReturnValue %int_1
+OpFunctionEnd
+%fn = OpFunction %void DontInline %12
+%p0 = OpFunctionParameter %_ptr_Function_float
+%bb_entry_0 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndMatch<FixFuncCallArgumentsPass>(text, false);
+}
+
+}  // namespace
+}  // namespace opt
+}  // namespace spvtools

+ 407 - 2
ThirdParty/Glslang/External/spirv-tools/test/opt/fold_test.cpp

@@ -147,6 +147,7 @@ OpName %main "main"
 %v2double = OpTypeVector %double 2
 %v2half = OpTypeVector %half 2
 %v2bool = OpTypeVector %bool 2
+%m2x2int = OpTypeMatrix %v2int 2
 %struct_v2int_int_int = OpTypeStruct %v2int %int %int
 %_ptr_int = OpTypePointer Function %int
 %_ptr_uint = OpTypePointer Function %uint
@@ -218,7 +219,9 @@ OpName %main "main"
 %struct_v2int_int_int_null = OpConstantNull %struct_v2int_int_int
 %v2int_null = OpConstantNull %v2int
 %102 = OpConstantComposite %v2int %103 %103
+%v4int_undef = OpUndef %v4int
 %v4int_0_0_0_0 = OpConstantComposite %v4int %int_0 %int_0 %int_0 %int_0
+%m2x2int_undef = OpUndef %m2x2int
 %struct_undef_0_0 = OpConstantComposite %struct_v2int_int_int %v2int_undef %int_0 %int_0
 %float_n1 = OpConstant %float -1
 %104 = OpConstant %float 0 ; Need a def with an numerical id to define id maps.
@@ -6862,7 +6865,7 @@ INSTANTIATE_TEST_SUITE_P(SelectFoldingTest, MatchingInstructionFoldingTest,
       4, true)
 ));
 
-INSTANTIATE_TEST_SUITE_P(CompositeExtractMatchingTest, MatchingInstructionFoldingTest,
+INSTANTIATE_TEST_SUITE_P(CompositeExtractOrInsertMatchingTest, MatchingInstructionFoldingTest,
 ::testing::Values(
     // Test case 0: Extracting from result of consecutive shuffles of differing
     // size.
@@ -7002,7 +7005,145 @@ INSTANTIATE_TEST_SUITE_P(CompositeExtractMatchingTest, MatchingInstructionFoldin
             "%4 = OpCompositeExtract %int %3 1\n" +
             "OpReturn\n" +
             "OpFunctionEnd",
-        4, true)
+        4, true),
+    // Test case 8: Inserting every element of a vector turns into a composite construct.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK-DAG: [[v4:%\\w+]] = OpTypeVector [[int]] 4\n" +
+            "; CHECK-DAG: [[int1:%\\w+]] = OpConstant [[int]] 1\n" +
+            "; CHECK-DAG: [[int2:%\\w+]] = OpConstant [[int]] 2\n" +
+            "; CHECK-DAG: [[int3:%\\w+]] = OpConstant [[int]] 3\n" +
+            "; CHECK: [[construct:%\\w+]] = OpCompositeConstruct [[v4]] %100 [[int1]] [[int2]] [[int3]]\n" +
+            "; CHECK: %5 = OpCopyObject [[v4]] [[construct]]\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %v4int %100 %v4int_undef 0\n" +
+            "%3 = OpCompositeInsert %v4int %int_1 %2 1\n" +
+            "%4 = OpCompositeInsert %v4int %int_2 %3 2\n" +
+            "%5 = OpCompositeInsert %v4int %int_3 %4 3\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        5, true),
+    // Test case 9: Inserting every element of a vector turns into a composite construct in a different order.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK-DAG: [[v4:%\\w+]] = OpTypeVector [[int]] 4\n" +
+            "; CHECK-DAG: [[int1:%\\w+]] = OpConstant [[int]] 1\n" +
+            "; CHECK-DAG: [[int2:%\\w+]] = OpConstant [[int]] 2\n" +
+            "; CHECK-DAG: [[int3:%\\w+]] = OpConstant [[int]] 3\n" +
+            "; CHECK: [[construct:%\\w+]] = OpCompositeConstruct [[v4]] %100 [[int1]] [[int2]] [[int3]]\n" +
+            "; CHECK: %5 = OpCopyObject [[v4]] [[construct]]\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %v4int %100 %v4int_undef 0\n" +
+            "%4 = OpCompositeInsert %v4int %int_2 %2 2\n" +
+            "%3 = OpCompositeInsert %v4int %int_1 %4 1\n" +
+            "%5 = OpCompositeInsert %v4int %int_3 %3 3\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        5, true),
+    // Test case 10: Check multiple inserts to the same position are handled correctly.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK-DAG: [[v4:%\\w+]] = OpTypeVector [[int]] 4\n" +
+            "; CHECK-DAG: [[int1:%\\w+]] = OpConstant [[int]] 1\n" +
+            "; CHECK-DAG: [[int2:%\\w+]] = OpConstant [[int]] 2\n" +
+            "; CHECK-DAG: [[int3:%\\w+]] = OpConstant [[int]] 3\n" +
+            "; CHECK: [[construct:%\\w+]] = OpCompositeConstruct [[v4]] %100 [[int1]] [[int2]] [[int3]]\n" +
+            "; CHECK: %6 = OpCopyObject [[v4]] [[construct]]\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %v4int %100 %v4int_undef 0\n" +
+            "%3 = OpCompositeInsert %v4int %int_2 %2 2\n" +
+            "%4 = OpCompositeInsert %v4int %int_4 %3 1\n" +
+            "%5 = OpCompositeInsert %v4int %int_1 %4 1\n" +
+            "%6 = OpCompositeInsert %v4int %int_3 %5 3\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        6, true),
+    // Test case 11: The last indexes are 0 and 1, but they have different first indexes.  This should not be folded.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %m2x2int %100 %m2x2int_undef 0 0\n" +
+            "%3 = OpCompositeInsert %m2x2int %int_1 %2 1 1\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        3, false),
+    // Test case 12: Don't fold when there is a partial insertion.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %m2x2int %v2int_1_0 %m2x2int_undef 0\n" +
+            "%3 = OpCompositeInsert %m2x2int %int_4 %2 0 0\n" +
+            "%4 = OpCompositeInsert %m2x2int %v2int_2_3 %3 1\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        4, false),
+    // Test case 13: Insert into a column of a matrix
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK-DAG: [[v2:%\\w+]] = OpTypeVector [[int]] 2\n" +
+            "; CHECK: [[m2x2:%\\w+]] = OpTypeMatrix [[v2]] 2\n" +
+            "; CHECK-DAG: [[m2x2_undef:%\\w+]] = OpUndef [[m2x2]]\n" +
+            "; CHECK-DAG: [[int1:%\\w+]] = OpConstant [[int]] 1\n" +
+// We keep this insert in the chain.  DeadInsertElimPass should remove it.
+            "; CHECK: [[insert:%\\w+]] = OpCompositeInsert [[m2x2]] %100 [[m2x2_undef]] 0 0\n" +
+            "; CHECK: [[construct:%\\w+]] = OpCompositeConstruct [[v2]] %100 [[int1]]\n" +
+            "; CHECK: %3 = OpCompositeInsert [[m2x2]] [[construct]] [[insert]] 0\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeInsert %m2x2int %100 %m2x2int_undef 0 0\n" +
+            "%3 = OpCompositeInsert %m2x2int %int_1 %2 0 1\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        3, true),
+    // Test case 14: Insert all elements of the matrix.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK-DAG: [[v2:%\\w+]] = OpTypeVector [[int]] 2\n" +
+            "; CHECK: [[m2x2:%\\w+]] = OpTypeMatrix [[v2]] 2\n" +
+            "; CHECK-DAG: [[m2x2_undef:%\\w+]] = OpUndef [[m2x2]]\n" +
+            "; CHECK-DAG: [[int1:%\\w+]] = OpConstant [[int]] 1\n" +
+            "; CHECK-DAG: [[int2:%\\w+]] = OpConstant [[int]] 2\n" +
+            "; CHECK-DAG: [[int3:%\\w+]] = OpConstant [[int]] 3\n" +
+            "; CHECK: [[c0:%\\w+]] = OpCompositeConstruct [[v2]] %100 [[int1]]\n" +
+            "; CHECK: [[c1:%\\w+]] = OpCompositeConstruct [[v2]] [[int2]] [[int3]]\n" +
+            "; CHECK: [[matrix:%\\w+]] = OpCompositeConstruct [[m2x2]] [[c0]] [[c1]]\n" +
+            "; CHECK: %5 = OpCopyObject [[m2x2]] [[matrix]]\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%2 = OpCompositeConstruct %v2int %100 %int_1\n" +
+            "%3 = OpCompositeInsert %m2x2int %2 %m2x2int_undef 0\n" +
+            "%4 = OpCompositeInsert %m2x2int %int_2 %3 1 0\n" +
+            "%5 = OpCompositeInsert %m2x2int %int_3 %4 1 1\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        5, true),
+    // Test case 15: Replace construct with extract when reconstructing a member
+    // of another object.
+    InstructionFoldingCase<bool>(
+        Header() +
+            "; CHECK: [[int:%\\w+]] = OpTypeInt 32 1\n" +
+            "; CHECK: [[v2:%\\w+]] = OpTypeVector [[int]] 2\n" +
+            "; CHECK: [[m2x2:%\\w+]] = OpTypeMatrix [[v2]] 2\n" +
+            "; CHECK: [[m2x2_undef:%\\w+]] = OpUndef [[m2x2]]\n" +
+            "; CHECK: %5 = OpCompositeExtract [[v2]] [[m2x2_undef]]\n" +
+            "%main = OpFunction %void None %void_func\n" +
+            "%main_lab = OpLabel\n" +
+            "%3 = OpCompositeExtract %int %m2x2int_undef 1 0\n" +
+            "%4 = OpCompositeExtract %int %m2x2int_undef 1 1\n" +
+            "%5 = OpCompositeConstruct %v2int %3 %4\n" +
+            "OpReturn\n" +
+            "OpFunctionEnd",
+        5, true)
 ));
 
 INSTANTIATE_TEST_SUITE_P(DotProductMatchingTest, MatchingInstructionFoldingTest,
@@ -7108,6 +7249,270 @@ INSTANTIATE_TEST_SUITE_P(VectorShuffleMatchingTest, MatchingInstructionFoldingTe
         3, true)
  ));
 
+INSTANTIATE_TEST_SUITE_P(FmaGenerationMatchingTest, MatchingInstructionFoldingTest,
+::testing::Values(
+   // Test case 0: (x * y) + a = Fma(x, y, a)
+   InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFAdd %float %mul %la\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+    // Test case 1:  a + (x * y) = Fma(x, y, a)
+   InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFAdd %float %la %mul\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+   // Test case 2: (x * y) + a = Fma(x, y, a) with vectors
+   InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_v4float Function\n" +
+           "%y = OpVariable %_ptr_v4float Function\n" +
+           "%a = OpVariable %_ptr_v4float Function\n" +
+           "%lx = OpLoad %v4float %x\n" +
+           "%ly = OpLoad %v4float %y\n" +
+           "%mul = OpFMul %v4float %lx %ly\n" +
+           "%la = OpLoad %v4float %a\n" +
+           "%3 = OpFAdd %v4float %mul %la\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+    // Test case 3:  a + (x * y) = Fma(x, y, a) with vectors
+   InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFAdd %float %la %mul\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+    // Test 4: that the OpExtInstImport instruction is generated if it is missing.
+   InstructionFoldingCase<bool>(
+           std::string() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "OpCapability Shader\n" +
+           "OpMemoryModel Logical GLSL450\n" +
+           "OpEntryPoint Fragment %main \"main\"\n" +
+           "OpExecutionMode %main OriginUpperLeft\n" +
+           "OpSource GLSL 140\n" +
+           "OpName %main \"main\"\n" +
+           "%void = OpTypeVoid\n" +
+           "%void_func = OpTypeFunction %void\n" +
+           "%bool = OpTypeBool\n" +
+           "%float = OpTypeFloat 32\n" +
+           "%_ptr_float = OpTypePointer Function %float\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFAdd %float %mul %la\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+   // Test 5: Don't fold if the multiple is marked no contract.
+   InstructionFoldingCase<bool>(
+       std::string() +
+           "OpCapability Shader\n" +
+           "OpMemoryModel Logical GLSL450\n" +
+           "OpEntryPoint Fragment %main \"main\"\n" +
+           "OpExecutionMode %main OriginUpperLeft\n" +
+           "OpSource GLSL 140\n" +
+           "OpName %main \"main\"\n" +
+           "OpDecorate %mul NoContraction\n" +
+           "%void = OpTypeVoid\n" +
+           "%void_func = OpTypeFunction %void\n" +
+           "%bool = OpTypeBool\n" +
+           "%float = OpTypeFloat 32\n" +
+           "%_ptr_float = OpTypePointer Function %float\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFAdd %float %mul %la\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, false),
+       // Test 6: Don't fold if the add is marked no contract.
+       InstructionFoldingCase<bool>(
+           std::string() +
+               "OpCapability Shader\n" +
+               "OpMemoryModel Logical GLSL450\n" +
+               "OpEntryPoint Fragment %main \"main\"\n" +
+               "OpExecutionMode %main OriginUpperLeft\n" +
+               "OpSource GLSL 140\n" +
+               "OpName %main \"main\"\n" +
+               "OpDecorate %3 NoContraction\n" +
+               "%void = OpTypeVoid\n" +
+               "%void_func = OpTypeFunction %void\n" +
+               "%bool = OpTypeBool\n" +
+               "%float = OpTypeFloat 32\n" +
+               "%_ptr_float = OpTypePointer Function %float\n" +
+               "%main = OpFunction %void None %void_func\n" +
+               "%main_lab = OpLabel\n" +
+               "%x = OpVariable %_ptr_float Function\n" +
+               "%y = OpVariable %_ptr_float Function\n" +
+               "%a = OpVariable %_ptr_float Function\n" +
+               "%lx = OpLoad %float %x\n" +
+               "%ly = OpLoad %float %y\n" +
+               "%mul = OpFMul %float %lx %ly\n" +
+               "%la = OpLoad %float %a\n" +
+               "%3 = OpFAdd %float %mul %la\n" +
+               "OpStore %a %3\n" +
+               "OpReturn\n" +
+               "OpFunctionEnd",
+           3, false),
+    // Test case 7: (x * y) - a = Fma(x, y, -a)
+    InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[na:%\\w+]] = OpFNegate {{%\\w+}} [[la]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[lx]] [[ly]] [[na]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFSub %float %mul %la\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true),
+   // Test case 8: a - (x * y) = Fma(-x, y, a)
+   InstructionFoldingCase<bool>(
+       Header() +
+           "; CHECK: [[ext:%\\w+]] = OpExtInstImport \"GLSL.std.450\"\n" +
+           "; CHECK: OpFunction\n" +
+           "; CHECK: [[x:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[y:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[a:%\\w+]] = OpVariable {{%\\w+}} Function\n" +
+           "; CHECK: [[lx:%\\w+]] = OpLoad {{%\\w+}} [[x]]\n" +
+           "; CHECK: [[ly:%\\w+]] = OpLoad {{%\\w+}} [[y]]\n" +
+           "; CHECK: [[la:%\\w+]] = OpLoad {{%\\w+}} [[a]]\n" +
+           "; CHECK: [[nx:%\\w+]] = OpFNegate {{%\\w+}} [[lx]]\n" +
+           "; CHECK: [[fma:%\\w+]] = OpExtInst {{%\\w+}} [[ext]] Fma [[nx]] [[ly]] [[la]]\n" +
+           "; CHECK: OpStore {{%\\w+}} [[fma]]\n" +
+           "%main = OpFunction %void None %void_func\n" +
+           "%main_lab = OpLabel\n" +
+           "%x = OpVariable %_ptr_float Function\n" +
+           "%y = OpVariable %_ptr_float Function\n" +
+           "%a = OpVariable %_ptr_float Function\n" +
+           "%lx = OpLoad %float %x\n" +
+           "%ly = OpLoad %float %y\n" +
+           "%mul = OpFMul %float %lx %ly\n" +
+           "%la = OpLoad %float %a\n" +
+           "%3 = OpFSub %float %la %mul\n" +
+           "OpStore %a %3\n" +
+           "OpReturn\n" +
+           "OpFunctionEnd",
+       3, true)
+));
+
 using MatchingInstructionWithNoResultFoldingTest =
 ::testing::TestWithParam<InstructionFoldingCase<bool>>;
 

+ 34 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/if_conversion_test.cpp

@@ -328,6 +328,40 @@ OpFunctionEnd
   SinglePassRunAndCheck<IfConversion>(text, text, true, true);
 }
 
+TEST_F(IfConversionTest, DontFlatten) {
+  const std::string text = R"(OpCapability Shader
+OpMemoryModel Logical GLSL450
+OpEntryPoint Vertex %1 "func" %2
+%void = OpTypeVoid
+%bool = OpTypeBool
+%true = OpConstantTrue %bool
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%uint_1 = OpConstant %uint 1
+%v2uint = OpTypeVector %uint 2
+%10 = OpConstantComposite %v2uint %uint_0 %uint_1
+%11 = OpConstantComposite %v2uint %uint_1 %uint_0
+%_ptr_Output_v2uint = OpTypePointer Output %v2uint
+%2 = OpVariable %_ptr_Output_v2uint Output
+%13 = OpTypeFunction %void
+%1 = OpFunction %void None %13
+%14 = OpLabel
+OpSelectionMerge %15 DontFlatten
+OpBranchConditional %true %16 %17
+%16 = OpLabel
+OpBranch %15
+%17 = OpLabel
+OpBranch %15
+%15 = OpLabel
+%18 = OpPhi %v2uint %10 %16 %11 %17
+OpStore %2 %18
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndCheck<IfConversion>(text, text, true, true);
+}
+
 TEST_F(IfConversionTest, LoopUntouched) {
   const std::string text = R"(OpCapability Shader
 OpMemoryModel Logical GLSL450

+ 410 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/interface_var_sroa_test.cpp

@@ -0,0 +1,410 @@
+// Copyright (c) 2022 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <iostream>
+
+#include "gmock/gmock.h"
+#include "test/opt/assembly_builder.h"
+#include "test/opt/pass_fixture.h"
+#include "test/opt/pass_utils.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+using InterfaceVariableScalarReplacementTest = PassTest<::testing::Test>;
+
+TEST_F(InterfaceVariableScalarReplacementTest,
+       ReplaceInterfaceVarsWithScalars) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability Tessellation
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint TessellationControl %func "shader" %x %y %z %w %u %v
+
+; CHECK:     OpName [[x:%\w+]] "x"
+; CHECK-NOT: OpName {{%\w+}} "x"
+; CHECK:     OpName [[y:%\w+]] "y"
+; CHECK-NOT: OpName {{%\w+}} "y"
+; CHECK:     OpName [[z0:%\w+]] "z"
+; CHECK:     OpName [[z1:%\w+]] "z"
+; CHECK:     OpName [[w0:%\w+]] "w"
+; CHECK:     OpName [[w1:%\w+]] "w"
+; CHECK:     OpName [[u0:%\w+]] "u"
+; CHECK:     OpName [[u1:%\w+]] "u"
+; CHECK:     OpName [[v0:%\w+]] "v"
+; CHECK:     OpName [[v1:%\w+]] "v"
+; CHECK:     OpName [[v2:%\w+]] "v"
+; CHECK:     OpName [[v3:%\w+]] "v"
+; CHECK:     OpName [[v4:%\w+]] "v"
+; CHECK:     OpName [[v5:%\w+]] "v"
+               OpName %x "x"
+               OpName %y "y"
+               OpName %z "z"
+               OpName %w "w"
+               OpName %u "u"
+               OpName %v "v"
+
+; CHECK-DAG: OpDecorate [[x]] Location 2
+; CHECK-DAG: OpDecorate [[y]] Location 0
+; CHECK-DAG: OpDecorate [[z0]] Location 0
+; CHECK-DAG: OpDecorate [[z0]] Component 0
+; CHECK-DAG: OpDecorate [[z1]] Location 1
+; CHECK-DAG: OpDecorate [[z1]] Component 0
+; CHECK-DAG: OpDecorate [[z0]] Patch
+; CHECK-DAG: OpDecorate [[z1]] Patch
+; CHECK-DAG: OpDecorate [[w0]] Location 2
+; CHECK-DAG: OpDecorate [[w0]] Component 0
+; CHECK-DAG: OpDecorate [[w1]] Location 3
+; CHECK-DAG: OpDecorate [[w1]] Component 0
+; CHECK-DAG: OpDecorate [[w0]] Patch
+; CHECK-DAG: OpDecorate [[w1]] Patch
+; CHECK-DAG: OpDecorate [[u0]] Location 3
+; CHECK-DAG: OpDecorate [[u0]] Component 2
+; CHECK-DAG: OpDecorate [[u1]] Location 4
+; CHECK-DAG: OpDecorate [[u1]] Component 2
+; CHECK-DAG: OpDecorate [[v0]] Location 3
+; CHECK-DAG: OpDecorate [[v0]] Component 3
+; CHECK-DAG: OpDecorate [[v1]] Location 4
+; CHECK-DAG: OpDecorate [[v1]] Component 3
+; CHECK-DAG: OpDecorate [[v2]] Location 5
+; CHECK-DAG: OpDecorate [[v2]] Component 3
+; CHECK-DAG: OpDecorate [[v3]] Location 6
+; CHECK-DAG: OpDecorate [[v3]] Component 3
+; CHECK-DAG: OpDecorate [[v4]] Location 7
+; CHECK-DAG: OpDecorate [[v4]] Component 3
+; CHECK-DAG: OpDecorate [[v5]] Location 8
+; CHECK-DAG: OpDecorate [[v5]] Component 3
+               OpDecorate %z Patch
+               OpDecorate %w Patch
+               OpDecorate %z Location 0
+               OpDecorate %x Location 2
+               OpDecorate %v Location 3
+               OpDecorate %v Component 3
+               OpDecorate %y Location 0
+               OpDecorate %w Location 2
+               OpDecorate %u Location 3
+               OpDecorate %u Component 2
+
+       %uint = OpTypeInt 32 0
+     %uint_1 = OpConstant %uint 1
+     %uint_2 = OpConstant %uint 2
+     %uint_3 = OpConstant %uint 3
+     %uint_4 = OpConstant %uint 4
+%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
+%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2
+%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2
+%_ptr_Input_uint = OpTypePointer Input %uint
+%_ptr_Output_uint = OpTypePointer Output %uint
+%_arr_arr_uint_uint_2_3 = OpTypeArray %_arr_uint_uint_2 %uint_3
+%_ptr_Input__arr_arr_uint_uint_2_3 = OpTypePointer Input %_arr_arr_uint_uint_2_3
+%_arr_arr_arr_uint_uint_2_3_4 = OpTypeArray %_arr_arr_uint_uint_2_3 %uint_4
+%_ptr_Output__arr_arr_arr_uint_uint_2_3_4 = OpTypePointer Output %_arr_arr_arr_uint_uint_2_3_4
+%_ptr_Output__arr_arr_uint_uint_2_3 = OpTypePointer Output %_arr_arr_uint_uint_2_3
+          %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+          %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+          %u = OpVariable %_ptr_Input__arr_arr_uint_uint_2_3 Input
+          %v = OpVariable %_ptr_Output__arr_arr_arr_uint_uint_2_3_4 Output
+
+; CHECK-DAG:  [[x]] = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+; CHECK-DAG:  [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+; CHECK-DAG: [[z0]] = OpVariable %_ptr_Output_uint Output
+; CHECK-DAG: [[z1]] = OpVariable %_ptr_Output_uint Output
+; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input
+; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input
+; CHECK-DAG: [[u0]] = OpVariable %_ptr_Input__arr_uint_uint_3 Input
+; CHECK-DAG: [[u1]] = OpVariable %_ptr_Input__arr_uint_uint_3 Input
+; CHECK-DAG: [[v0]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+; CHECK-DAG: [[v1]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+; CHECK-DAG: [[v2]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+; CHECK-DAG: [[v3]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+; CHECK-DAG: [[v4]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+; CHECK-DAG: [[v5]] = OpVariable %_ptr_Output__arr_uint_uint_4 Output
+
+     %void   = OpTypeVoid
+     %void_f = OpTypeFunction %void
+     %func   = OpFunction %void None %void_f
+     %label  = OpLabel
+
+; CHECK: [[w0_value:%\w+]] = OpLoad %uint [[w0]]
+; CHECK: [[w1_value:%\w+]] = OpLoad %uint [[w1]]
+; CHECK:  [[w_value:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[w0_value]] [[w1_value]]
+; CHECK:       [[w0:%\w+]] = OpCompositeExtract %uint [[w_value]] 0
+; CHECK:                     OpStore [[z0]] [[w0]]
+; CHECK:       [[w1:%\w+]] = OpCompositeExtract %uint [[w_value]] 1
+; CHECK:                     OpStore [[z1]] [[w1]]
+    %w_value = OpLoad %_arr_uint_uint_2 %w
+               OpStore %z %w_value
+
+; CHECK: [[u00_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_0
+; CHECK:     [[u00:%\w+]] = OpLoad %uint [[u00_ptr]]
+; CHECK: [[u10_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_0
+; CHECK:     [[u10:%\w+]] = OpLoad %uint [[u10_ptr]]
+; CHECK: [[u01_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_1
+; CHECK:     [[u01:%\w+]] = OpLoad %uint [[u01_ptr]]
+; CHECK: [[u11_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_1
+; CHECK:     [[u11:%\w+]] = OpLoad %uint [[u11_ptr]]
+; CHECK: [[u02_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u0]] %uint_2
+; CHECK:     [[u02:%\w+]] = OpLoad %uint [[u02_ptr]]
+; CHECK: [[u12_ptr:%\w+]] = OpAccessChain %_ptr_Input_uint [[u1]] %uint_2
+; CHECK:     [[u12:%\w+]] = OpLoad %uint [[u12_ptr]]
+
+; CHECK-DAG: [[u0_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u00]] [[u10]]
+; CHECK-DAG: [[u1_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u01]] [[u11]]
+; CHECK-DAG: [[u2_val:%\w+]] = OpCompositeConstruct %_arr_uint_uint_2 [[u02]] [[u12]]
+
+; CHECK: [[u_val:%\w+]] = OpCompositeConstruct %_arr__arr_uint_uint_2_uint_3 [[u0_val]] [[u1_val]] [[u2_val]]
+
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v0]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 0 0
+; CHECK:                OpStore [[ptr]] [[val]]
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v1]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 0 1
+; CHECK:                OpStore [[ptr]] [[val]]
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v2]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 1 0
+; CHECK:                OpStore [[ptr]] [[val]]
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v3]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 1 1
+; CHECK:                OpStore [[ptr]] [[val]]
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v4]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 2 0
+; CHECK:                OpStore [[ptr]] [[val]]
+; CHECK: [[ptr:%\w+]] = OpAccessChain %_ptr_Output_uint [[v5]] %uint_1
+; CHECK: [[val:%\w+]] = OpCompositeExtract %uint [[u_val]] 2 1
+; CHECK:                OpStore [[ptr]] [[val]]
+     %v_ptr  = OpAccessChain %_ptr_Output__arr_arr_uint_uint_2_3 %v %uint_1
+     %u_val  = OpLoad %_arr_arr_uint_uint_2_3 %u
+               OpStore %v_ptr %u_val
+
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  SinglePassRunAndMatch<InterfaceVariableScalarReplacement>(spirv, true);
+}
+
+TEST_F(InterfaceVariableScalarReplacementTest,
+       CheckPatchDecorationPreservation) {
+  // Make sure scalars for the variables with the extra arrayness have the extra
+  // arrayness after running the pass while others do not have it.
+  // Only "y" does not have the extra arrayness in the following SPIR-V.
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability Tessellation
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint TessellationEvaluation %func "shader" %x %y %z %w
+               OpDecorate %z Patch
+               OpDecorate %w Patch
+               OpDecorate %z Location 0
+               OpDecorate %x Location 2
+               OpDecorate %y Location 0
+               OpDecorate %w Location 1
+               OpName %x "x"
+               OpName %y "y"
+               OpName %z "z"
+               OpName %w "w"
+
+  ; CHECK:     OpName [[y:%\w+]] "y"
+  ; CHECK-NOT: OpName {{%\w+}} "y"
+  ; CHECK-DAG: OpName [[z0:%\w+]] "z"
+  ; CHECK-DAG: OpName [[z1:%\w+]] "z"
+  ; CHECK-DAG: OpName [[w0:%\w+]] "w"
+  ; CHECK-DAG: OpName [[w1:%\w+]] "w"
+  ; CHECK-DAG: OpName [[x0:%\w+]] "x"
+  ; CHECK-DAG: OpName [[x1:%\w+]] "x"
+
+       %uint = OpTypeInt 32 0
+     %uint_2 = OpConstant %uint 2
+%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
+%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2
+%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2
+          %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+          %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+
+  ; CHECK-DAG: [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+  ; CHECK-DAG: [[z0]] = OpVariable %_ptr_Output_uint Output
+  ; CHECK-DAG: [[z1]] = OpVariable %_ptr_Output_uint Output
+  ; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input
+  ; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input
+  ; CHECK-DAG: [[x0]] = OpVariable %_ptr_Output_uint Output
+  ; CHECK-DAG: [[x1]] = OpVariable %_ptr_Output_uint Output
+
+     %void   = OpTypeVoid
+     %void_f = OpTypeFunction %void
+     %func   = OpFunction %void None %void_f
+     %label  = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  SinglePassRunAndMatch<InterfaceVariableScalarReplacement>(spirv, true);
+}
+
+TEST_F(InterfaceVariableScalarReplacementTest,
+       CheckEntryPointInterfaceOperands) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability Tessellation
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint TessellationEvaluation %tess "tess" %x %y
+               OpEntryPoint Vertex %vert "vert" %w
+               OpDecorate %z Location 0
+               OpDecorate %x Location 2
+               OpDecorate %y Location 0
+               OpDecorate %w Location 1
+               OpName %x "x"
+               OpName %y "y"
+               OpName %z "z"
+               OpName %w "w"
+
+  ; CHECK:     OpName [[y:%\w+]] "y"
+  ; CHECK-NOT: OpName {{%\w+}} "y"
+  ; CHECK-DAG: OpName [[x0:%\w+]] "x"
+  ; CHECK-DAG: OpName [[x1:%\w+]] "x"
+  ; CHECK-DAG: OpName [[w0:%\w+]] "w"
+  ; CHECK-DAG: OpName [[w1:%\w+]] "w"
+  ; CHECK-DAG: OpName [[z:%\w+]] "z"
+  ; CHECK-NOT: OpName {{%\w+}} "z"
+
+       %uint = OpTypeInt 32 0
+     %uint_2 = OpConstant %uint 2
+%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
+%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2
+%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2
+          %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+          %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+
+  ; CHECK-DAG: [[y]] = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+  ; CHECK-DAG: [[z]] = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+  ; CHECK-DAG: [[w0]] = OpVariable %_ptr_Input_uint Input
+  ; CHECK-DAG: [[w1]] = OpVariable %_ptr_Input_uint Input
+  ; CHECK-DAG: [[x0]] = OpVariable %_ptr_Output_uint Output
+  ; CHECK-DAG: [[x1]] = OpVariable %_ptr_Output_uint Output
+
+     %void   = OpTypeVoid
+     %void_f = OpTypeFunction %void
+     %tess   = OpFunction %void None %void_f
+     %bb0    = OpLabel
+               OpReturn
+               OpFunctionEnd
+     %vert   = OpFunction %void None %void_f
+     %bb1    = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  SinglePassRunAndMatch<InterfaceVariableScalarReplacement>(spirv, true);
+}
+
+class InterfaceVarSROAErrorTest : public PassTest<::testing::Test> {
+ public:
+  InterfaceVarSROAErrorTest()
+      : consumer_([this](spv_message_level_t level, const char*,
+                         const spv_position_t& position, const char* message) {
+          if (!error_message_.empty()) error_message_ += "\n";
+          switch (level) {
+            case SPV_MSG_FATAL:
+            case SPV_MSG_INTERNAL_ERROR:
+            case SPV_MSG_ERROR:
+              error_message_ += "ERROR";
+              break;
+            case SPV_MSG_WARNING:
+              error_message_ += "WARNING";
+              break;
+            case SPV_MSG_INFO:
+              error_message_ += "INFO";
+              break;
+            case SPV_MSG_DEBUG:
+              error_message_ += "DEBUG";
+              break;
+          }
+          error_message_ +=
+              ": " + std::to_string(position.index) + ": " + message;
+        }) {}
+
+  Pass::Status RunPass(const std::string& text) {
+    std::unique_ptr<IRContext> context_ =
+        spvtools::BuildModule(SPV_ENV_UNIVERSAL_1_2, consumer_, text);
+    if (!context_.get()) return Pass::Status::Failure;
+
+    PassManager manager;
+    manager.SetMessageConsumer(consumer_);
+    manager.AddPass<InterfaceVariableScalarReplacement>();
+
+    return manager.Run(context_.get());
+  }
+
+  std::string GetErrorMessage() const { return error_message_; }
+
+  void TearDown() override { error_message_.clear(); }
+
+ private:
+  spvtools::MessageConsumer consumer_;
+  std::string error_message_;
+};
+
+TEST_F(InterfaceVarSROAErrorTest, CheckConflictOfExtraArraynessBetweenEntries) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability Tessellation
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint TessellationControl %tess "tess" %x %y %z
+               OpEntryPoint Vertex %vert "vert" %z %w
+               OpDecorate %z Location 0
+               OpDecorate %x Location 2
+               OpDecorate %y Location 0
+               OpDecorate %w Location 1
+               OpName %x "x"
+               OpName %y "y"
+               OpName %z "z"
+               OpName %w "w"
+       %uint = OpTypeInt 32 0
+     %uint_2 = OpConstant %uint 2
+%_arr_uint_uint_2 = OpTypeArray %uint %uint_2
+%_ptr_Output__arr_uint_uint_2 = OpTypePointer Output %_arr_uint_uint_2
+%_ptr_Input__arr_uint_uint_2 = OpTypePointer Input %_arr_uint_uint_2
+          %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %x = OpVariable %_ptr_Output__arr_uint_uint_2 Output
+          %y = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+          %w = OpVariable %_ptr_Input__arr_uint_uint_2 Input
+     %void   = OpTypeVoid
+     %void_f = OpTypeFunction %void
+     %tess   = OpFunction %void None %void_f
+     %bb0    = OpLabel
+               OpReturn
+               OpFunctionEnd
+     %vert   = OpFunction %void None %void_f
+     %bb1    = OpLabel
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  EXPECT_EQ(RunPass(spirv), Pass::Status::Failure);
+  const char expected_error[] =
+      "ERROR: 0: A variable is arrayed for an entry point but it is not "
+      "arrayed for another entry point\n"
+      "  %z = OpVariable %_ptr_Output__arr_uint_uint_2 Output";
+  EXPECT_STREQ(GetErrorMessage().c_str(), expected_error);
+}
+
+}  // namespace
+}  // namespace opt
+}  // namespace spvtools

+ 95 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/local_access_chain_convert_test.cpp

@@ -1156,6 +1156,101 @@ TEST_F(LocalAccessChainConvertTest, AccessChainWithNoIndex) {
 
   SinglePassRunAndMatch<LocalAccessChainConvertPass>(before, true);
 }
+TEST_F(LocalAccessChainConvertTest, AccessChainWithLongIndex) {
+  // The access chain take a value that is larger than 32-bit.  The index cannot
+  // be encoded in an OpCompositeExtract, so nothing should be done.
+  const std::string before =
+      R"(OpCapability Shader
+OpCapability Int64
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %2 "main_0004f4d4_85b2f584"
+OpExecutionMode %2 OriginUpperLeft
+%ulong = OpTypeInt 64 0
+%ulong_8589934592 = OpConstant %ulong 8589934592
+%ulong_8589934591 = OpConstant %ulong 8589934591
+%_arr_ulong_ulong_8589934592 = OpTypeArray %ulong %ulong_8589934592
+%_ptr_Function__arr_ulong_ulong_8589934592 = OpTypePointer Function %_arr_ulong_ulong_8589934592
+%_ptr_Function_ulong = OpTypePointer Function %ulong
+%void = OpTypeVoid
+%10 = OpTypeFunction %void
+%2 = OpFunction %void None %10
+%11 = OpLabel
+%12 = OpVariable %_ptr_Function__arr_ulong_ulong_8589934592 Function
+%13 = OpAccessChain %_ptr_Function_ulong %12 %ulong_8589934591
+%14 = OpLoad %ulong %13
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndCheck<LocalAccessChainConvertPass>(before, before, false,
+                                                     true);
+}
+
+TEST_F(LocalAccessChainConvertTest, AccessChainWith32BitIndexInLong) {
+  // The access chain has a value that is 32-bits, but it is stored in a 64-bit
+  // variable.  This access change can be converted to an extract.
+  const std::string before =
+      R"(
+; CHECK: OpFunction
+; CHECK: [[var:%\w+]] = OpVariable
+; CHECK: [[ld:%\w+]] = OpLoad {{%\w+}} [[var]]
+; CHECK: OpCompositeExtract %ulong [[ld]] 3
+               OpCapability Shader
+               OpCapability Int64
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %2 "main_0004f4d4_85b2f584"
+               OpExecutionMode %2 OriginUpperLeft
+      %ulong = OpTypeInt 64 0
+%ulong_8589934592 = OpConstant %ulong 8589934592
+%ulong_3 = OpConstant %ulong 3
+%_arr_ulong_ulong_8589934592 = OpTypeArray %ulong %ulong_8589934592
+%_ptr_Function__arr_ulong_ulong_8589934592 = OpTypePointer Function %_arr_ulong_ulong_8589934592
+%_ptr_Function_ulong = OpTypePointer Function %ulong
+       %void = OpTypeVoid
+         %10 = OpTypeFunction %void
+          %2 = OpFunction %void None %10
+         %11 = OpLabel
+         %12 = OpVariable %_ptr_Function__arr_ulong_ulong_8589934592 Function
+         %13 = OpAccessChain %_ptr_Function_ulong %12 %ulong_3
+         %14 = OpLoad %ulong %13
+               OpReturn
+               OpFunctionEnd
+)";
+
+  SinglePassRunAndMatch<LocalAccessChainConvertPass>(before, true);
+}
+
+TEST_F(LocalAccessChainConvertTest, AccessChainWithVarIndex) {
+  // The access chain has a value that is not constant, so there should not be
+  // any changes.
+  const std::string before =
+      R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %2 "main_0004f4d4_85b2f584"
+OpExecutionMode %2 OriginUpperLeft
+%uint = OpTypeInt 32 0
+%uint_5 = OpConstant %uint 5
+%_arr_uint_uint_5 = OpTypeArray %uint %uint_5
+%_ptr_Function__arr_uint_uint_5 = OpTypePointer Function %_arr_uint_uint_5
+%_ptr_Function_uint = OpTypePointer Function %uint
+%8 = OpUndef %uint
+%void = OpTypeVoid
+%10 = OpTypeFunction %void
+%2 = OpFunction %void None %10
+%11 = OpLabel
+%12 = OpVariable %_ptr_Function__arr_uint_uint_5 Function
+%13 = OpAccessChain %_ptr_Function_uint %12 %8
+%14 = OpLoad %uint %13
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndCheck<LocalAccessChainConvertPass>(before, before, false,
+                                                     true);
+}
 
 // TODO(greg-lunarg): Add tests to verify handling of these cases:
 //

+ 34 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/loop_optimizations/unroll_simple.cpp

@@ -3789,6 +3789,40 @@ TEST_F(PassClassTest, PartialUnrollWithPhiReferencesPhi) {
   SinglePassRunAndMatch<PartialUnrollerTestPass<2>>(text, true);
 }
 
+TEST_F(PassClassTest, DontUnrollInfiteLoop) {
+  // This is an infinite loop that because the step is 0.  We want to make sure
+  // the unroller does not try to unroll it.
+  const std::string text = R"(OpCapability Shader
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint Fragment %2 "main"
+OpExecutionMode %2 OriginUpperLeft
+%void = OpTypeVoid
+%4 = OpTypeFunction %void
+%int = OpTypeInt 32 1
+%int_0 = OpConstant %int 0
+%int_50 = OpConstant %int 50
+%bool = OpTypeBool
+%int_0_0 = OpConstant %int 0
+%2 = OpFunction %void None %4
+%10 = OpLabel
+OpBranch %11
+%11 = OpLabel
+%12 = OpPhi %int %int_0 %10 %13 %14
+%15 = OpSLessThan %bool %12 %int_50
+OpLoopMerge %16 %14 Unroll
+OpBranchConditional %15 %14 %16
+%14 = OpLabel
+%13 = OpIAdd %int %12 %int_0_0
+OpBranch %11
+%16 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+  SinglePassRunAndCheck<LoopUnroller>(text, text, false);
+}
+
 }  // namespace
 }  // namespace opt
 }  // namespace spvtools

+ 77 - 0
ThirdParty/Glslang/External/spirv-tools/test/opt/replace_desc_array_access_using_var_index_test.cpp

@@ -406,6 +406,83 @@ TEST_F(ReplaceDescArrayAccessUsingVarIndexTest,
   SinglePassRunAndMatch<ReplaceDescArrayAccessUsingVarIndex>(text, true);
 }
 
+TEST_F(ReplaceDescArrayAccessUsingVarIndexTest, ReplaceMultipleAccessChains) {
+  const std::string text = R"(
+               OpCapability Shader
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %1 "TestFragment" %2
+               OpExecutionMode %1 OriginUpperLeft
+               OpName %11 "type.ConstantBuffer.TestStruct"
+               OpMemberName %11 0 "val1"
+               OpMemberName %11 1 "val2"
+               OpName %3 "TestResources"
+               OpName %13 "type.2d.image"
+               OpName %4 "OutBuffer"
+               OpName %2 "in.var.SV_INSTANCEID"
+               OpName %1 "TestFragment"
+               OpDecorate %2 Flat
+               OpDecorate %2 Location 0
+               OpDecorate %3 DescriptorSet 0
+               OpDecorate %3 Binding 0
+               OpDecorate %4 DescriptorSet 0
+               OpDecorate %4 Binding 1
+               OpMemberDecorate %11 0 Offset 0
+               OpMemberDecorate %11 1 Offset 4
+               OpDecorate %11 Block
+         %9  = OpTypeInt 32 0
+         %10 = OpConstant %9 2
+         %11 = OpTypeStruct %9 %9
+         %8  = OpTypeArray %11 %10
+         %7  = OpTypePointer Uniform %8
+         %13 = OpTypeImage %9 2D 2 0 0 2 R32ui
+         %12 = OpTypePointer UniformConstant %13
+         %14 = OpTypePointer Input %9
+         %15 = OpTypeVoid
+         %16 = OpTypeFunction %15
+         %40 = OpTypeVector %9 2
+         %3  = OpVariable %7 Uniform
+         %4  = OpVariable %12 UniformConstant
+         %2  = OpVariable %14 Input
+         %57 = OpTypePointer Uniform %11
+         %61 = OpTypePointer Uniform %9
+         %62 = OpConstant %9 0
+         %1  = OpFunction %15 None %16
+         %17 = OpLabel
+         %20 = OpLoad %9 %2
+         %47 = OpAccessChain %57 %3 %20
+         %63 = OpAccessChain %61 %47 %62
+         %64 = OpLoad %9 %63
+
+; CHECK: [[null_value:%\w+]] = OpConstantNull %uint
+
+; CHECK: [[var_index:%\w+]] = OpLoad %uint %in_var_SV_INSTANCEID
+; CHECK: OpSelectionMerge [[merge:%\w+]] None
+; CHECK: OpSwitch [[var_index]] [[default:%\w+]] 0 [[case0:%\w+]] 1 [[case1:%\w+]]
+; CHECK: [[case0]] = OpLabel
+; CHECK: OpAccessChain
+; CHECK: OpAccessChain
+; CHECK: [[result0:%\w+]] = OpLoad
+; CHECK: OpBranch [[merge]]
+; CHECK: [[case1]] = OpLabel
+; CHECK: OpAccessChain
+; CHECK: OpAccessChain
+; CHECK: [[result1:%\w+]] = OpLoad
+; CHECK: OpBranch [[merge]]
+; CHECK: [[default]] = OpLabel
+; CHECK: OpBranch [[merge]]
+; CHECK: [[merge]] = OpLabel
+; CHECK: OpPhi %uint [[result0]] [[case0]] [[result1]] [[case1]] [[null_value]] [[default]]
+
+         %55 = OpCompositeConstruct %40 %20 %20
+         %56 = OpLoad %13 %4
+               OpImageWrite %56 %55 %64 None
+               OpReturn
+               OpFunctionEnd
+  )";
+
+  SinglePassRunAndMatch<ReplaceDescArrayAccessUsingVarIndex>(text, true);
+}
+
 TEST_F(ReplaceDescArrayAccessUsingVarIndexTest,
        ReplaceAccessChainToTextureArrayWithNonUniformIndex) {
   const std::string text = R"(

+ 155 - 6
ThirdParty/Glslang/External/spirv-tools/test/opt/spread_volatile_semantics_test.cpp

@@ -54,6 +54,7 @@ OpSource GLSL 460
 OpSourceExtension "GL_EXT_nonuniform_qualifier"
 OpSourceExtension "GL_KHR_ray_tracing"
 OpName %main "main"
+OpName %fn "fn"
 OpName %StorageBuffer "StorageBuffer"
 OpMemberName %StorageBuffer 0 "index"
 OpMemberName %StorageBuffer 1 "red"
@@ -109,6 +110,11 @@ OpDecorate %var BuiltIn )") + built_in + std::string(R"(
 %29 = OpCompositeExtract %float %27 0
 %31 = OpAccessChain %_ptr_Uniform_float %sbo %int_1
 OpStore %31 %29
+%32 = OpFunctionCall %void %fn
+OpReturn
+OpFunctionEnd
+%fn = OpFunction %void None %3
+%33 = OpLabel
 OpReturn
 OpFunctionEnd
 )");
@@ -782,12 +788,7 @@ OpReturn
 OpFunctionEnd
 )";
 
-  EXPECT_EQ(RunPass(text), Pass::Status::Failure);
-  const char expected_error[] =
-      "ERROR: 0: Functions of SPIR-V for spread-volatile-semantics pass "
-      "input must be inlined except entry points";
-  EXPECT_STREQ(GetErrorMessage().substr(0, sizeof(expected_error) - 1).c_str(),
-               expected_error);
+  EXPECT_EQ(RunPass(text), Pass::Status::SuccessWithoutChange);
 }
 
 TEST_F(VolatileSpreadErrorTest, VarNotUsedInEntryPointForVolatile) {
@@ -1113,6 +1114,154 @@ OpFunctionEnd
   SinglePassRunAndMatch<SpreadVolatileSemantics>(text, true);
 }
 
+TEST_F(VolatileSpreadTest, SkipIfItHasNoExecutionModel) {
+  const std::string text = R"(
+OpCapability Shader
+OpCapability Linkage
+OpMemoryModel Logical GLSL450
+%2 = OpTypeVoid
+%3 = OpTypeFunction %2
+%4 = OpFunction %2 None %3
+%5 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+
+  Pass::Status status;
+  std::tie(std::ignore, status) =
+      SinglePassRunToBinary<SpreadVolatileSemantics>(text,
+                                                     /* skip_nop = */ false);
+  EXPECT_EQ(status, Pass::Status::SuccessWithoutChange);
+}
+
+TEST_F(VolatileSpreadTest, NoInlinedfuncCalls) {
+  const std::string text = R"(
+OpCapability RayTracingNV
+OpCapability VulkanMemoryModel
+OpCapability GroupNonUniform
+OpExtension "SPV_NV_ray_tracing"
+OpExtension "SPV_KHR_vulkan_memory_model"
+OpMemoryModel Logical Vulkan
+OpEntryPoint RayGenerationNV %main "main" %SubgroupSize
+OpSource HLSL 630
+OpName %main "main"
+OpName %src_main "src.main"
+OpName %bb_entry "bb.entry"
+OpName %func0 "func0"
+OpName %bb_entry_0 "bb.entry"
+OpName %func2 "func2"
+OpName %bb_entry_1 "bb.entry"
+OpName %param_var_count "param.var.count"
+OpName %func1 "func1"
+OpName %bb_entry_2 "bb.entry"
+OpName %func3 "func3"
+OpName %count "count"
+OpName %bb_entry_3 "bb.entry"
+OpDecorate %SubgroupSize BuiltIn SubgroupSize
+%uint = OpTypeInt 32 0
+%_ptr_Input_uint = OpTypePointer Input %uint
+%void = OpTypeVoid
+%6 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+%25 = OpTypeFunction %void %_ptr_Function_uint
+%SubgroupSize = OpVariable %_ptr_Input_uint Input
+%main = OpFunction %void None %6
+%7 = OpLabel
+%8 = OpFunctionCall %void %src_main
+OpReturn
+OpFunctionEnd
+%src_main = OpFunction %void None %6
+%bb_entry = OpLabel
+%11 = OpFunctionCall %void %func0
+OpReturn
+OpFunctionEnd
+%func0 = OpFunction %void DontInline %6
+%bb_entry_0 = OpLabel
+%14 = OpFunctionCall %void %func2
+%16 = OpFunctionCall %void %func1
+OpReturn
+OpFunctionEnd
+%func2 = OpFunction %void DontInline %6
+%bb_entry_1 = OpLabel
+%param_var_count = OpVariable %_ptr_Function_uint Function
+; CHECK: {{%\w+}} = OpLoad %uint %SubgroupSize Volatile
+%21 = OpLoad %uint %SubgroupSize
+OpStore %param_var_count %21
+%22 = OpFunctionCall %void %func3 %param_var_count
+OpReturn
+OpFunctionEnd
+%func1 = OpFunction %void DontInline %6
+%bb_entry_2 = OpLabel
+OpReturn
+OpFunctionEnd
+%func3 = OpFunction %void DontInline %25
+%count = OpFunctionParameter %_ptr_Function_uint
+%bb_entry_3 = OpLabel
+OpReturn
+OpFunctionEnd
+)";
+  SinglePassRunAndMatch<SpreadVolatileSemantics>(text, true);
+}
+
+TEST_F(VolatileSpreadErrorTest, NoInlinedMultiEntryfuncCalls) {
+  const std::string text = R"(
+OpCapability RayTracingNV
+OpCapability SubgroupBallotKHR
+OpExtension "SPV_NV_ray_tracing"
+OpExtension "SPV_KHR_shader_ballot"
+%1 = OpExtInstImport "GLSL.std.450"
+OpMemoryModel Logical GLSL450
+OpEntryPoint RayGenerationNV %main "main" %SubgroupSize
+OpEntryPoint GLCompute %main2 "main2" %gl_LocalInvocationIndex %SubgroupSize
+OpSource HLSL 630
+OpName %main "main"
+OpName %bb_entry "bb.entry"
+OpName %main2 "main2"
+OpName %bb_entry_0 "bb.entry"
+OpName %func "func"
+OpName %count "count"
+OpName %bb_entry_1 "bb.entry"
+OpDecorate %gl_LocalInvocationIndex BuiltIn LocalInvocationIndex
+OpDecorate %SubgroupSize BuiltIn SubgroupSize
+%uint = OpTypeInt 32 0
+%uint_0 = OpConstant %uint 0
+%_ptr_Input_uint = OpTypePointer Input %uint
+%float = OpTypeFloat 32
+%v4float = OpTypeVector %float 4
+%void = OpTypeVoid
+%12 = OpTypeFunction %void
+%_ptr_Function_uint = OpTypePointer Function %uint
+%_ptr_Function_v4float = OpTypePointer Function %v4float
+%29 = OpTypeFunction %void %_ptr_Function_v4float
+%34 = OpTypeFunction %void %_ptr_Function_uint
+%SubgroupSize = OpVariable %_ptr_Input_uint Input
+%gl_LocalInvocationIndex = OpVariable %_ptr_Input_uint Input
+%main = OpFunction %void None %12
+%bb_entry = OpLabel
+%20 = OpFunctionCall %void %func
+OpReturn
+OpFunctionEnd
+%main2 = OpFunction %void None %12
+%bb_entry_0 = OpLabel
+%33 = OpFunctionCall %void %func
+OpReturn
+OpFunctionEnd
+%func = OpFunction %void DontInline %12
+%bb_entry_1 = OpLabel
+%count = OpVariable %_ptr_Function_uint Function
+%35 = OpLoad %uint %SubgroupSize
+OpStore %count %35
+OpReturn
+OpFunctionEnd
+)";
+  EXPECT_EQ(RunPass(text), Pass::Status::Failure);
+  const char expected_error[] =
+      "ERROR: 0: Variable is a target for Volatile semantics for an entry "
+      "point, but it is not for another entry point";
+  EXPECT_STREQ(GetErrorMessage().substr(0, sizeof(expected_error) - 1).c_str(),
+               expected_error);
+}
+
 }  // namespace
 }  // namespace opt
 }  // namespace spvtools

+ 6 - 3
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.annotation_test.cpp

@@ -398,7 +398,8 @@ TEST_F(TextToBinaryTest, GroupMemberDecorateGoodTwoTargets) {
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateMissingGroupId) {
   EXPECT_THAT(CompileFailure("OpGroupMemberDecorate"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGroupMemberDecorate instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidGroupId) {
@@ -413,7 +414,8 @@ TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetId) {
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateMissingTargetMemberNumber) {
   EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGroupMemberDecorate instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidTargetMemberNumber) {
@@ -428,7 +430,8 @@ TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetId) {
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateMissingSecondTargetMemberNumber) {
   EXPECT_THAT(CompileFailure("OpGroupMemberDecorate %group %id0 42 %id1"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGroupMemberDecorate instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(TextToBinaryTest, GroupMemberDecorateInvalidSecondTargetMemberNumber) {

+ 14 - 7
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.barrier_test.cpp

@@ -44,7 +44,8 @@ TEST_F(OpMemoryBarrier, Good) {
 TEST_F(OpMemoryBarrier, BadMissingScopeId) {
   const std::string input = "OpMemoryBarrier\n";
   EXPECT_THAT(CompileFailure(input),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpMemoryBarrier instruction, but found "
+                 "the end of the stream."));
 }
 
 TEST_F(OpMemoryBarrier, BadInvalidScopeId) {
@@ -55,7 +56,8 @@ TEST_F(OpMemoryBarrier, BadInvalidScopeId) {
 TEST_F(OpMemoryBarrier, BadMissingMemorySemanticsId) {
   const std::string input = "OpMemoryBarrier %scope\n";
   EXPECT_THAT(CompileFailure(input),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpMemoryBarrier instruction, but found "
+                 "the end of the stream."));
 }
 
 TEST_F(OpMemoryBarrier, BadInvalidMemorySemanticsId) {
@@ -92,13 +94,16 @@ TEST_F(NamedMemoryBarrierTest, OpcodeAssemblesInV10) {
 
 TEST_F(NamedMemoryBarrierTest, ArgumentCount) {
   EXPECT_THAT(CompileFailure("OpMemoryNamedBarrier", SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpMemoryNamedBarrier instruction, but "
+                 "found the end of the stream."));
   EXPECT_THAT(
       CompileFailure("OpMemoryNamedBarrier %bar", SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpMemoryNamedBarrier instruction, but found the "
+         "end of the stream."));
   EXPECT_THAT(
       CompileFailure("OpMemoryNamedBarrier %bar %scope", SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpMemoryNamedBarrier instruction, but found the "
+         "end of the stream."));
   EXPECT_THAT(
       CompiledInstructions("OpMemoryNamedBarrier %bar %scope %semantics",
                            SPV_ENV_UNIVERSAL_1_1),
@@ -151,10 +156,12 @@ TEST_F(NamedBarrierInitializeTest, OpcodeAssemblesInV10) {
 TEST_F(NamedBarrierInitializeTest, ArgumentCount) {
   EXPECT_THAT(
       CompileFailure("%bar = OpNamedBarrierInitialize", SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpNamedBarrierInitialize instruction, but found "
+         "the end of the stream."));
   EXPECT_THAT(CompileFailure("%bar = OpNamedBarrierInitialize %ype",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpNamedBarrierInitialize instruction, "
+                 "but found the end of the stream."));
   EXPECT_THAT(
       CompiledInstructions("%bar = OpNamedBarrierInitialize %type %count",
                            SPV_ENV_UNIVERSAL_1_1),

+ 6 - 3
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.control_flow_test.cpp

@@ -163,7 +163,8 @@ TEST_F(TextToBinaryTest, SwitchGoodTwoTargets) {
 
 TEST_F(TextToBinaryTest, SwitchBadMissingSelector) {
   EXPECT_THAT(CompileFailure("OpSwitch"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpSwitch instruction, but found the end "
+                 "of the stream."));
 }
 
 TEST_F(TextToBinaryTest, SwitchBadInvalidSelector) {
@@ -173,7 +174,8 @@ TEST_F(TextToBinaryTest, SwitchBadInvalidSelector) {
 
 TEST_F(TextToBinaryTest, SwitchBadMissingDefault) {
   EXPECT_THAT(CompileFailure("OpSwitch %selector"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpSwitch instruction, but found the end "
+                 "of the stream."));
 }
 
 TEST_F(TextToBinaryTest, SwitchBadInvalidDefault) {
@@ -195,7 +197,8 @@ TEST_F(TextToBinaryTest, SwitchBadMissingTarget) {
   EXPECT_THAT(CompileFailure("%1 = OpTypeInt 32 0\n"
                              "%2 = OpConstant %1 52\n"
                              "OpSwitch %2 %default 12"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpSwitch instruction, but found the end "
+                 "of the stream."));
 }
 
 // A test case for an OpSwitch.

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.device_side_enqueue_test.cpp

@@ -83,7 +83,8 @@ TEST_F(OpKernelEnqueueBad, MissingLastOperand) {
       CompileFailure(
           "%result = OpEnqueueKernel %type %queue %flags %NDRange %num_events"
           " %wait_events %ret_event %invoke %param %param_size"),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpEnqueueKernel instruction, but found the end "
+         "of the stream."));
 }
 
 TEST_F(OpKernelEnqueueBad, InvalidLastOperand) {

+ 63 - 0
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.extension_test.cpp

@@ -1034,5 +1034,68 @@ INSTANTIATE_TEST_SUITE_P(
                                  {SpvCapabilityBitInstructions})},
             })));
 
+// SPV_KHR_uniform_group_instructions
+
+INSTANTIATE_TEST_SUITE_P(
+    SPV_KHR_uniform_group_instructions, ExtensionRoundTripTest,
+    Combine(
+        Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_5,
+               SPV_ENV_UNIVERSAL_1_6, SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1,
+               SPV_ENV_VULKAN_1_2, SPV_ENV_VULKAN_1_3),
+        ValuesIn(std::vector<AssemblyCase>{
+            {"OpExtension \"SPV_KHR_uniform_group_instructions\"\n",
+             MakeInstruction(SpvOpExtension,
+                             MakeVector("SPV_KHR_uniform_group_instructions"))},
+            {"OpCapability GroupUniformArithmeticKHR\n",
+             MakeInstruction(SpvOpCapability,
+                             {SpvCapabilityGroupUniformArithmeticKHR})},
+            {"%2 = OpGroupIMulKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupIMulKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupFMulKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupFMulKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupBitwiseAndKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupBitwiseAndKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupBitwiseOrKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupBitwiseOrKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupBitwiseXorKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupBitwiseXorKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupLogicalAndKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupLogicalAndKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupLogicalOrKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupLogicalOrKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+            {"%2 = OpGroupLogicalXorKHR %1 %3 Reduce %4\n",
+             MakeInstruction(SpvOpGroupLogicalXorKHR,
+                             {1, 2, 3, SpvGroupOperationReduce, 4})},
+        })));
+
+// SPV_KHR_subgroup_rotate
+
+INSTANTIATE_TEST_SUITE_P(
+    SPV_KHR_subgroup_rotate, ExtensionRoundTripTest,
+    Combine(Values(SPV_ENV_UNIVERSAL_1_0, SPV_ENV_UNIVERSAL_1_6,
+                   SPV_ENV_VULKAN_1_0, SPV_ENV_VULKAN_1_1, SPV_ENV_VULKAN_1_2,
+                   SPV_ENV_VULKAN_1_3, SPV_ENV_OPENCL_2_1),
+            ValuesIn(std::vector<AssemblyCase>{
+                {"OpExtension \"SPV_KHR_subgroup_rotate\"\n",
+                 MakeInstruction(SpvOpExtension,
+                                 MakeVector("SPV_KHR_subgroup_rotate"))},
+                {"OpCapability GroupNonUniformRotateKHR\n",
+                 MakeInstruction(SpvOpCapability,
+                                 {SpvCapabilityGroupNonUniformRotateKHR})},
+                {"%2 = OpGroupNonUniformRotateKHR %1 %3 %4 %5\n",
+                 MakeInstruction(SpvOpGroupNonUniformRotateKHR,
+                                 {1, 2, 3, 4, 5})},
+                {"%2 = OpGroupNonUniformRotateKHR %1 %3 %4 %5 %6\n",
+                 MakeInstruction(SpvOpGroupNonUniformRotateKHR,
+                                 {1, 2, 3, 4, 5, 6})},
+            })));
+
 }  // namespace
 }  // namespace spvtools

+ 6 - 3
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.image_test.cpp

@@ -123,7 +123,8 @@ TEST_F(OpImageTest, InvalidTypeOperand) {
 
 TEST_F(OpImageTest, MissingSampledImageOperand) {
   EXPECT_THAT(CompileFailure("%2 = OpImage %1"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpImage instruction, but found the end "
+                 "of the stream."));
 }
 
 TEST_F(OpImageTest, InvalidSampledImageOperand) {
@@ -222,7 +223,8 @@ TEST_F(OpImageSparseReadTest, InvalidTypeOperand) {
 
 TEST_F(OpImageSparseReadTest, MissingImageOperand) {
   EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpImageSparseRead instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(OpImageSparseReadTest, InvalidImageOperand) {
@@ -232,7 +234,8 @@ TEST_F(OpImageSparseReadTest, InvalidImageOperand) {
 
 TEST_F(OpImageSparseReadTest, MissingCoordinateOperand) {
   EXPECT_THAT(CompileFailure("%2 = OpImageSparseRead %1 %2"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpImageSparseRead instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(OpImageSparseReadTest, InvalidCoordinateOperand) {

+ 4 - 2
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.memory_test.cpp

@@ -166,7 +166,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemoryNoMemAccessGood) {
 TEST_F(MemoryRoundTripTest, OpCopyMemoryTooFewArgsBad) {
   std::string spirv = "OpCopyMemory %1\n";
   std::string err = CompileFailure(spirv);
-  EXPECT_THAT(err, HasSubstr("Expected operand, found end of stream"));
+  EXPECT_THAT(err, HasSubstr("Expected operand for OpCopyMemory instruction, "
+                             "but found the end of the stream."));
 }
 
 TEST_F(MemoryRoundTripTest, OpCopyMemoryTooManyArgsBad) {
@@ -295,7 +296,8 @@ TEST_F(MemoryRoundTripTest, OpCopyMemorySizedNoMemAccessGood) {
 TEST_F(MemoryRoundTripTest, OpCopyMemorySizedTooFewArgsBad) {
   std::string spirv = "OpCopyMemorySized %1 %2\n";
   std::string err = CompileFailure(spirv);
-  EXPECT_THAT(err, HasSubstr("Expected operand, found end of stream"));
+  EXPECT_THAT(err, HasSubstr("Expected operand for OpCopyMemorySized "
+                             "instruction, but found the end of the stream."));
 }
 
 TEST_F(MemoryRoundTripTest, OpCopyMemorySizedTooManyArgsBad) {

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.mode_setting_test.cpp

@@ -290,7 +290,8 @@ using TextToBinaryCapability = spvtest::TextToBinaryTest;
 
 TEST_F(TextToBinaryCapability, BadMissingCapability) {
   EXPECT_THAT(CompileFailure("OpCapability"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpCapability instruction, but found the "
+                 "end of the stream."));
 }
 
 TEST_F(TextToBinaryCapability, BadInvalidCapability) {

+ 8 - 4
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.pipe_storage_test.cpp

@@ -59,10 +59,12 @@ TEST_F(OpConstantPipeStorageTest, ArgumentCount) {
          "'OpConstantPipeStorage'."));
   EXPECT_THAT(
       CompileFailure("%1 = OpConstantPipeStorage", SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpConstantPipeStorage instruction, but found "
+         "the end of the stream."));
   EXPECT_THAT(CompileFailure("%1 = OpConstantPipeStorage %2 3 4",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpConstantPipeStorage instruction, but "
+                 "found the end of the stream."));
   EXPECT_THAT(CompiledInstructions("%1 = OpConstantPipeStorage %2 3 4 5",
                                    SPV_ENV_UNIVERSAL_1_1),
               Eq(MakeInstruction(SpvOpConstantPipeStorage, {1, 2, 3, 4, 5})));
@@ -101,10 +103,12 @@ TEST_F(OpCreatePipeFromPipeStorageTest, ArgumentCount) {
          "'OpCreatePipeFromPipeStorage'."));
   EXPECT_THAT(
       CompileFailure("%1 = OpCreatePipeFromPipeStorage", SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpCreatePipeFromPipeStorage instruction, but "
+         "found the end of the stream."));
   EXPECT_THAT(CompileFailure("%1 = OpCreatePipeFromPipeStorage %2 OpNop",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found next instruction instead."));
+              Eq("Expected operand for OpCreatePipeFromPipeStorage "
+                 "instruction, but found the next instruction instead."));
   EXPECT_THAT(CompiledInstructions("%1 = OpCreatePipeFromPipeStorage %2 %3",
                                    SPV_ENV_UNIVERSAL_1_1),
               Eq(MakeInstruction(SpvOpCreatePipeFromPipeStorage, {1, 2, 3})));

+ 8 - 4
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.subgroup_dispatch_test.cpp

@@ -46,11 +46,13 @@ TEST_F(OpGetKernelLocalSizeForSubgroupCountTest, ArgumentCount) {
                  "found 'OpGetKernelLocalSizeForSubgroupCount'."));
   EXPECT_THAT(CompileFailure("%res = OpGetKernelLocalSizeForSubgroupCount",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGetKernelLocalSizeForSubgroupCount "
+                 "instruction, but found the end of the stream."));
   EXPECT_THAT(
       CompileFailure("%1 = OpGetKernelLocalSizeForSubgroupCount %2 %3 %4 %5 %6",
                      SPV_ENV_UNIVERSAL_1_1),
-      Eq("Expected operand, found end of stream."));
+      Eq("Expected operand for OpGetKernelLocalSizeForSubgroupCount "
+         "instruction, but found the end of the stream."));
   EXPECT_THAT(
       CompiledInstructions("%res = OpGetKernelLocalSizeForSubgroupCount %type "
                            "%sgcount %invoke %param %param_size %param_align",
@@ -93,10 +95,12 @@ TEST_F(OpGetKernelMaxNumSubgroupsTest, ArgumentCount) {
          "'OpGetKernelMaxNumSubgroups'."));
   EXPECT_THAT(CompileFailure("%res = OpGetKernelMaxNumSubgroups",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGetKernelMaxNumSubgroups instruction, "
+                 "but found the end of the stream."));
   EXPECT_THAT(CompileFailure("%1 = OpGetKernelMaxNumSubgroups %2 %3 %4 %5",
                              SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpGetKernelMaxNumSubgroups instruction, "
+                 "but found the end of the stream."));
   EXPECT_THAT(
       CompiledInstructions("%res = OpGetKernelMaxNumSubgroups %type "
                            "%invoke %param %param_size %param_align",

+ 6 - 3
ThirdParty/Glslang/External/spirv-tools/test/text_to_binary.type_declaration_test.cpp

@@ -223,12 +223,14 @@ TEST_F(OpTypeForwardPointerTest, ValidStorageClass) {
 
 TEST_F(OpTypeForwardPointerTest, MissingType) {
   EXPECT_THAT(CompileFailure("OpTypeForwardPointer"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpTypeForwardPointer instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(OpTypeForwardPointerTest, MissingClass) {
   EXPECT_THAT(CompileFailure("OpTypeForwardPointer %pt"),
-              Eq("Expected operand, found end of stream."));
+              Eq("Expected operand for OpTypeForwardPointer instruction, but "
+                 "found the end of the stream."));
 }
 
 TEST_F(OpTypeForwardPointerTest, WrongClass) {
@@ -252,7 +254,8 @@ TEST_F(OpSizeOfTest, ArgumentCount) {
       Eq("Expected <result-id> at the beginning of an instruction, found "
          "'OpSizeOf'."));
   EXPECT_THAT(CompileFailure("%res = OpSizeOf OpNop", SPV_ENV_UNIVERSAL_1_1),
-              Eq("Expected operand, found next instruction instead."));
+              Eq("Expected operand for OpSizeOf instruction, but found the "
+                 "next instruction instead."));
   EXPECT_THAT(
       CompiledInstructions("%1 = OpSizeOf %2 %3", SPV_ENV_UNIVERSAL_1_1),
       Eq(MakeInstruction(SpvOpSizeOf, {1, 2, 3})));

+ 1 - 0
ThirdParty/Glslang/External/spirv-tools/test/val/CMakeLists.txt

@@ -45,6 +45,7 @@ add_spvtools_unittest(TARGET val_abcde
        val_extension_spv_khr_integer_dot_product.cpp
        val_extension_spv_khr_bit_instructions.cpp
        val_extension_spv_khr_terminate_invocation.cpp
+       val_extension_spv_khr_subgroup_rotate.cpp
        val_ext_inst_test.cpp
        val_ext_inst_debug_test.cpp
        ${VAL_TEST_COMMON_SRCS}

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/test/val/val_annotation_test.cpp

@@ -754,6 +754,8 @@ OpFunctionEnd
 
   CompileSuccessfully(text, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-Location-06672"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr("decoration must not be applied to this storage class"));

+ 126 - 0
ThirdParty/Glslang/External/spirv-tools/test/val/val_builtins_test.cpp

@@ -2372,6 +2372,67 @@ INSTANTIATE_TEST_SUITE_P(
                               "needs to be a 32-bit int scalar",
                               "is not an int scalar"))));
 
+// CullMaskKHR is valid
+// in IS, AH, CH, MS shaders as an input i32 scalar
+INSTANTIATE_TEST_SUITE_P(
+    CullMaskSuccess,
+    ValidateGenericCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(Values(SPV_ENV_VULKAN_1_2), Values("CullMaskKHR"),
+            Values("AnyHitKHR", "ClosestHitKHR", "IntersectionKHR", "MissKHR"),
+            Values("Input"), Values("%u32"),
+            Values("OpCapability RayTracingKHR\nOpCapability RayCullMaskKHR\n"),
+            Values("OpExtension \"SPV_KHR_ray_tracing\"\nOpExtension "
+                   "\"SPV_KHR_ray_cull_mask\"\n"),
+            Values(nullptr), Values(TestResult())));
+
+INSTANTIATE_TEST_SUITE_P(
+    CullMaskNotExecutionMode,
+    ValidateGenericCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(Values(SPV_ENV_VULKAN_1_2), Values("CullMaskKHR"),
+            Values("Vertex", "Fragment", "TessellationControl",
+                   "TessellationEvaluation", "Geometry", "Fragment",
+                   "GLCompute", "RayGenerationKHR", "CallableKHR"),
+            Values("Input"), Values("%u32"),
+            Values("OpCapability RayTracingKHR\nOpCapability RayCullMaskKHR\n"),
+            Values("OpExtension \"SPV_KHR_ray_tracing\"\nOpExtension "
+                   "\"SPV_KHR_ray_cull_mask\"\n"),
+            Values("VUID-CullMaskKHR-CullMaskKHR-06735 "
+                   "VUID-RayTmaxKHR-RayTmaxKHR-04348 "
+                   "VUID-RayTminKHR-RayTminKHR-04351 "),
+            Values(TestResult(SPV_ERROR_INVALID_DATA,
+                              "Vulkan spec does not allow BuiltIn",
+                              "to be used with the execution model"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    ICullMaskNotInput,
+    ValidateGenericCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(Values(SPV_ENV_VULKAN_1_2), Values("CullMaskKHR"),
+            Values("AnyHitKHR", "ClosestHitKHR", "IntersectionKHR", "MissKHR"),
+            Values("Output"), Values("%u32"),
+            Values("OpCapability RayTracingKHR\nOpCapability RayCullMaskKHR\n"),
+            Values("OpExtension \"SPV_KHR_ray_tracing\"\nOpExtension "
+                   "\"SPV_KHR_ray_cull_mask\"\n"),
+            Values("VUID-CullMaskKHR-CullMaskKHR-06736 "
+                   "VUID-RayTmaxKHR-RayTmaxKHR-04349 "
+                   "VUID-RayTminKHR-RayTminKHR-04352 "),
+            Values(TestResult(SPV_ERROR_INVALID_DATA, "Vulkan spec allows",
+                              "used for variables with Input storage class"))));
+INSTANTIATE_TEST_SUITE_P(
+    CullMaskNotIntScalar,
+    ValidateGenericCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(Values(SPV_ENV_VULKAN_1_2), Values("CullMaskKHR"),
+            Values("AnyHitKHR", "ClosestHitKHR", "IntersectionKHR", "MissKHR"),
+            Values("Input"), Values("%f32", "%u32vec3"),
+            Values("OpCapability RayTracingKHR\nOpCapability RayCullMaskKHR\n"),
+            Values("OpExtension \"SPV_KHR_ray_tracing\"\nOpExtension "
+                   "\"SPV_KHR_ray_cull_mask\"\n"),
+            Values("VUID-CullMaskKHR-CullMaskKHR-06737 "
+                   "VUID-RayTmaxKHR-RayTmaxKHR-04350 "
+                   "VUID-RayTminKHR-RayTminKHR-04353 "),
+            Values(TestResult(SPV_ERROR_INVALID_DATA,
+                              "needs to be a 32-bit int scalar",
+                              "is not an int scalar"))));
+
 // RayTmaxKHR, RayTminKHR are all valid
 // in IS, AH, CH, MS shaders as input f32 scalars
 INSTANTIATE_TEST_SUITE_P(
@@ -4065,6 +4126,71 @@ INSTANTIATE_TEST_SUITE_P(
                 "According to the Vulkan spec BuiltIn FullyCoveredEXT variable "
                 "needs to be a bool scalar."))));
 
+INSTANTIATE_TEST_SUITE_P(
+    BaryCoordNotFragment,
+    ValidateVulkanCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(
+        Values("BaryCoordKHR", "BaryCoordNoPerspKHR"), Values("Vertex"),
+        Values("Input"), Values("%f32vec3"),
+        Values("OpCapability FragmentBarycentricKHR\n"),
+        Values("OpExtension \"SPV_KHR_fragment_shader_barycentric\"\n"),
+        Values("VUID-BaryCoordKHR-BaryCoordKHR-04154 "
+               "VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04160 "),
+        Values(TestResult(SPV_ERROR_INVALID_DATA, "Vulkan spec allows BuiltIn",
+                          "to be used only with Fragment execution model"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    BaryCoordNotInput,
+    ValidateVulkanCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(Values("BaryCoordKHR", "BaryCoordNoPerspKHR"), Values("Fragment"),
+            Values("Output"), Values("%f32vec3"),
+            Values("OpCapability FragmentBarycentricKHR\n"),
+            Values("OpExtension \"SPV_KHR_fragment_shader_barycentric\"\n"),
+            Values("VUID-BaryCoordKHR-BaryCoordKHR-04155 "
+                   "VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04161 "),
+            Values(TestResult(
+                SPV_ERROR_INVALID_DATA, "Vulkan spec allows BuiltIn",
+                "to be only used for variables with Input storage class"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    BaryCoordNotFloatVector,
+    ValidateVulkanCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(
+        Values("BaryCoordKHR", "BaryCoordNoPerspKHR"), Values("Fragment"),
+        Values("Output"), Values("%f32arr3", "%u32vec4"),
+        Values("OpCapability FragmentBarycentricKHR\n"),
+        Values("OpExtension \"SPV_KHR_fragment_shader_barycentric\"\n"),
+        Values("VUID-BaryCoordKHR-BaryCoordKHR-04156 "
+               "VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04162 "),
+        Values(TestResult(SPV_ERROR_INVALID_DATA,
+                          "needs to be a 3-component 32-bit float vector"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    BaryCoordNotFloatVec3,
+    ValidateVulkanCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(
+        Values("BaryCoordKHR", "BaryCoordNoPerspKHR"), Values("Fragment"),
+        Values("Output"), Values("%f32vec2"),
+        Values("OpCapability FragmentBarycentricKHR\n"),
+        Values("OpExtension \"SPV_KHR_fragment_shader_barycentric\"\n"),
+        Values("VUID-BaryCoordKHR-BaryCoordKHR-04156 "
+               "VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04162 "),
+        Values(TestResult(SPV_ERROR_INVALID_DATA,
+                          "needs to be a 3-component 32-bit float vector"))));
+
+INSTANTIATE_TEST_SUITE_P(
+    BaryCoordNotF32Vec3,
+    ValidateVulkanCombineBuiltInExecutionModelDataTypeCapabilityExtensionResult,
+    Combine(
+        Values("BaryCoordKHR", "BaryCoordNoPerspKHR"), Values("Fragment"),
+        Values("Output"), Values("%f64vec3"),
+        Values("OpCapability FragmentBarycentricKHR\n"),
+        Values("OpExtension \"SPV_KHR_fragment_shader_barycentric\"\n"),
+        Values("VUID-BaryCoordKHR-BaryCoordKHR-04156 "
+               "VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04162 "),
+        Values(TestResult(SPV_ERROR_INVALID_DATA,
+                          "needs to be a 3-component 32-bit float vector"))));
+
 }  // namespace
 }  // namespace val
 }  // namespace spvtools

+ 199 - 25
ThirdParty/Glslang/External/spirv-tools/test/val/val_decoration_test.cpp

@@ -2686,6 +2686,8 @@ TEST_F(ValidateDecorations, VulkanBufferBlockOnStorageBufferBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-PushConstant-06675"));
   EXPECT_THAT(getDiagnosticString(),
               HasSubstr("In Vulkan, BufferBlock is disallowed on variables in "
                         "the StorageBuffer storage class"));
@@ -2880,9 +2882,11 @@ TEST_F(ValidateDecorations, VulkanPushConstantMissingBlockBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-PushConstant-06675"));
   EXPECT_THAT(getDiagnosticString(),
               HasSubstr("PushConstant id '2' is missing Block decoration.\n"
-                        "From Vulkan spec, section 14.5.1:\n"
+                        "From Vulkan spec:\n"
                         "Such variables must be identified with a Block "
                         "decoration"));
 }
@@ -3033,11 +3037,13 @@ TEST_F(ValidateDecorations, VulkanMultiplePushConstantsSingleEntryPointBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-06674"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr(
           "Entry point id '1' uses more than one PushConstant interface.\n"
-          "From Vulkan spec, section 14.5.1:\n"
+          "From Vulkan spec:\n"
           "There must be no more than one push constant block "
           "statically used per shader entry point."));
 }
@@ -3144,11 +3150,13 @@ TEST_F(ValidateDecorations,
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-OpEntryPoint-06674"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr(
           "Entry point id '1' uses more than one PushConstant interface.\n"
-          "From Vulkan spec, section 14.5.1:\n"
+          "From Vulkan spec:\n"
           "There must be no more than one push constant block "
           "statically used per shader entry point."));
 }
@@ -3185,9 +3193,11 @@ TEST_F(ValidateDecorations, VulkanUniformMissingDescriptorSetBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(getDiagnosticString(),
               HasSubstr("Uniform id '3' is missing DescriptorSet decoration.\n"
-                        "From Vulkan spec, section 14.5.2:\n"
+                        "From Vulkan spec:\n"
                         "These variables must have DescriptorSet and Binding "
                         "decorations specified"));
 }
@@ -3224,9 +3234,11 @@ TEST_F(ValidateDecorations, VulkanUniformMissingBindingBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(getDiagnosticString(),
               HasSubstr("Uniform id '3' is missing Binding decoration.\n"
-                        "From Vulkan spec, section 14.5.2:\n"
+                        "From Vulkan spec:\n"
                         "These variables must have DescriptorSet and Binding "
                         "decorations specified"));
 }
@@ -3256,10 +3268,12 @@ TEST_F(ValidateDecorations, VulkanUniformConstantMissingDescriptorSetBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr("UniformConstant id '2' is missing DescriptorSet decoration.\n"
-                "From Vulkan spec, section 14.5.2:\n"
+                "From Vulkan spec:\n"
                 "These variables must have DescriptorSet and Binding "
                 "decorations specified"));
 }
@@ -3289,10 +3303,12 @@ TEST_F(ValidateDecorations, VulkanUniformConstantMissingBindingBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr("UniformConstant id '2' is missing Binding decoration.\n"
-                "From Vulkan spec, section 14.5.2:\n"
+                "From Vulkan spec:\n"
                 "These variables must have DescriptorSet and Binding "
                 "decorations specified"));
 }
@@ -3329,10 +3345,12 @@ TEST_F(ValidateDecorations, VulkanStorageBufferMissingDescriptorSetBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr("StorageBuffer id '3' is missing DescriptorSet decoration.\n"
-                "From Vulkan spec, section 14.5.2:\n"
+                "From Vulkan spec:\n"
                 "These variables must have DescriptorSet and Binding "
                 "decorations specified"));
 }
@@ -3369,9 +3387,11 @@ TEST_F(ValidateDecorations, VulkanStorageBufferMissingBindingBad) {
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(getDiagnosticString(),
               HasSubstr("StorageBuffer id '3' is missing Binding decoration.\n"
-                        "From Vulkan spec, section 14.5.2:\n"
+                        "From Vulkan spec:\n"
                         "These variables must have DescriptorSet and Binding "
                         "decorations specified"));
 }
@@ -3414,10 +3434,12 @@ TEST_F(ValidateDecorations,
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_1);
   EXPECT_EQ(SPV_ERROR_INVALID_ID,
             ValidateAndRetrieveValidationState(SPV_ENV_VULKAN_1_1));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-UniformConstant-06677"));
   EXPECT_THAT(
       getDiagnosticString(),
       HasSubstr("StorageBuffer id '3' is missing DescriptorSet decoration.\n"
-                "From Vulkan spec, section 14.5.2:\n"
+                "From Vulkan spec:\n"
                 "These variables must have DescriptorSet and Binding "
                 "decorations specified"));
 }
@@ -7158,7 +7180,9 @@ OpFunctionEnd
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
   EXPECT_THAT(getDiagnosticString(),
-              HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables "
+              AnyVUID("VUID-StandaloneSpirv-PushConstant-06675"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables "
                         "must be identified with a Block decoration"));
 }
 
@@ -7186,7 +7210,9 @@ OpFunctionEnd
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
   EXPECT_THAT(getDiagnosticString(),
-              HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables "
+              AnyVUID("VUID-StandaloneSpirv-PushConstant-06675"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables "
                         "must be identified with a Block decoration"));
 }
 
@@ -7215,7 +7241,9 @@ OpFunctionEnd
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
   EXPECT_THAT(getDiagnosticString(),
-              HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables "
+              AnyVUID("VUID-StandaloneSpirv-PushConstant-06675"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables "
                         "must be identified with a Block decoration"));
 }
 
@@ -7287,10 +7315,11 @@ OpFunctionEnd
 
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
-  EXPECT_THAT(
-      getDiagnosticString(),
-      HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables must be "
-                "identified with a Block or BufferBlock decoration"));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-Uniform-06676"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables must be "
+                        "identified with a Block or BufferBlock decoration"));
 }
 
 TEST_F(ValidateDecorations, VulkanUniformArrayMissingBlock) {
@@ -7315,10 +7344,11 @@ OpFunctionEnd
 
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
-  EXPECT_THAT(
-      getDiagnosticString(),
-      HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables must be "
-                "identified with a Block or BufferBlock decoration"));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-Uniform-06676"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables must be "
+                        "identified with a Block or BufferBlock decoration"));
 }
 
 TEST_F(ValidateDecorations, VulkanUniformRuntimeArrayMissingBlock) {
@@ -7344,10 +7374,11 @@ OpFunctionEnd
 
   CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
   EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
-  EXPECT_THAT(
-      getDiagnosticString(),
-      HasSubstr("From Vulkan spec, section 14.5.2:\nSuch variables must be "
-                "identified with a Block or BufferBlock decoration"));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-Uniform-06676"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("From Vulkan spec:\nSuch variables must be "
+                        "identified with a Block or BufferBlock decoration"));
 }
 
 TEST_F(ValidateDecorations, VulkanArrayStrideZero) {
@@ -8189,6 +8220,149 @@ OpFunctionEnd
                         "Offset decorations"));
 }
 
+TEST_F(ValidateDecorations, PerVertexVulkanGood) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability FragmentBarycentricKHR
+               OpExtension "SPV_KHR_fragment_shader_barycentric"
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %main "main" %vertexIDs
+               OpExecutionMode %main OriginUpperLeft
+               OpDecorate %vertexIDs Location 0
+               OpDecorate %vertexIDs PerVertexKHR
+       %void = OpTypeVoid
+       %func = OpTypeFunction %void
+      %float = OpTypeFloat 32
+       %uint = OpTypeInt 32 0
+%ptrFloat = OpTypePointer Input %float
+     %uint_3 = OpConstant %uint 3
+%floatArray = OpTypeArray %float %uint_3
+%ptrFloatArray = OpTypePointer Input %floatArray
+  %vertexIDs = OpVariable %ptrFloatArray Input
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+       %main = OpFunction %void None %func
+      %label = OpLabel
+     %access = OpAccessChain %ptrFloat %vertexIDs %int_0
+       %load = OpLoad %float %access
+               OpReturn
+               OpFunctionEnd
+)";
+
+  CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+  EXPECT_EQ(SPV_SUCCESS, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+}
+
+TEST_F(ValidateDecorations, PerVertexVulkanOutput) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability FragmentBarycentricKHR
+               OpExtension "SPV_KHR_fragment_shader_barycentric"
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %main "main" %vertexIDs
+               OpExecutionMode %main OriginUpperLeft
+               OpDecorate %vertexIDs Location 0
+               OpDecorate %vertexIDs PerVertexKHR
+       %void = OpTypeVoid
+       %func = OpTypeFunction %void
+      %float = OpTypeFloat 32
+       %uint = OpTypeInt 32 0
+%ptrFloat = OpTypePointer Output %float
+     %uint_3 = OpConstant %uint 3
+%floatArray = OpTypeArray %float %uint_3
+%ptrFloatArray = OpTypePointer Output %floatArray
+  %vertexIDs = OpVariable %ptrFloatArray Output
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+       %main = OpFunction %void None %func
+      %label = OpLabel
+     %access = OpAccessChain %ptrFloat %vertexIDs %int_0
+       %load = OpLoad %float %access
+               OpReturn
+               OpFunctionEnd
+)";
+
+  CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+  EXPECT_EQ(SPV_ERROR_INVALID_ID, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-PerVertexKHR-06777"));
+  EXPECT_THAT(getDiagnosticString(), HasSubstr("storage class must be Input"));
+}
+
+TEST_F(ValidateDecorations, PerVertexVulkanNonFragment) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability FragmentBarycentricKHR
+               OpExtension "SPV_KHR_fragment_shader_barycentric"
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Vertex %main "main" %vertexIDs
+               OpDecorate %vertexIDs Location 0
+               OpDecorate %vertexIDs PerVertexKHR
+       %void = OpTypeVoid
+       %func = OpTypeFunction %void
+      %float = OpTypeFloat 32
+       %uint = OpTypeInt 32 0
+%ptrFloat = OpTypePointer Input %float
+     %uint_3 = OpConstant %uint 3
+%floatArray = OpTypeArray %float %uint_3
+%ptrFloatArray = OpTypePointer Input %floatArray
+  %vertexIDs = OpVariable %ptrFloatArray Input
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+       %main = OpFunction %void None %func
+      %label = OpLabel
+     %access = OpAccessChain %ptrFloat %vertexIDs %int_0
+       %load = OpLoad %float %access
+               OpReturn
+               OpFunctionEnd
+)";
+
+  CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+  EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-PerVertexKHR-06777"));
+  EXPECT_THAT(
+      getDiagnosticString(),
+      HasSubstr(
+          "PerVertexKHR can only be applied to Fragment Execution Models"));
+}
+
+TEST_F(ValidateDecorations, PerVertexVulkanNonArray) {
+  const std::string spirv = R"(
+               OpCapability Shader
+               OpCapability FragmentBarycentricKHR
+               OpExtension "SPV_KHR_fragment_shader_barycentric"
+          %1 = OpExtInstImport "GLSL.std.450"
+               OpMemoryModel Logical GLSL450
+               OpEntryPoint Fragment %main "main" %vertexIDs
+               OpExecutionMode %main OriginUpperLeft
+               OpDecorate %vertexIDs Location 0
+               OpDecorate %vertexIDs PerVertexKHR
+       %void = OpTypeVoid
+       %func = OpTypeFunction %void
+      %float = OpTypeFloat 32
+   %ptrFloat = OpTypePointer Input %float
+  %vertexIDs = OpVariable %ptrFloat Input
+        %int = OpTypeInt 32 1
+      %int_0 = OpConstant %int 0
+       %main = OpFunction %void None %func
+      %label = OpLabel
+       %load = OpLoad %float %vertexIDs
+               OpReturn
+               OpFunctionEnd
+)";
+
+  CompileSuccessfully(spirv, SPV_ENV_VULKAN_1_0);
+  EXPECT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions(SPV_ENV_VULKAN_1_0));
+  EXPECT_THAT(getDiagnosticString(),
+              AnyVUID("VUID-StandaloneSpirv-Input-06778"));
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("PerVertexKHR must be declared as arrays"));
+}
+
 }  // namespace
 }  // namespace val
 }  // namespace spvtools

+ 352 - 0
ThirdParty/Glslang/External/spirv-tools/test/val/val_extension_spv_khr_subgroup_rotate.cpp

@@ -0,0 +1,352 @@
+// Copyright (c) 2022 The Khronos Group Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include <string>
+#include <vector>
+
+#include "gmock/gmock.h"
+#include "test/val/val_fixtures.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+using ::testing::HasSubstr;
+using ::testing::Values;
+using ::testing::ValuesIn;
+
+struct Case {
+  std::vector<std::string> caps;
+  bool shader;
+  std::string result_type;
+  std::string scope;
+  std::string delta;
+  std::string cluster_size;
+  std::string expected_error;  // empty for no error.
+};
+
+inline std::ostream& operator<<(std::ostream& out, Case c) {
+  out << "\nSPV_KHR_subgroup_rotate Case{{";
+  for (auto& cap : c.caps) {
+    out << cap;
+  }
+  out << "} ";
+  out << (c.shader ? "shader " : "kernel ");
+  out << c.result_type + " ";
+  out << c.scope + " ";
+  out << c.delta + " ";
+  out << c.cluster_size + " ";
+  out << "err'" << c.expected_error << "'";
+  out << "}";
+  return out;
+}
+
+std::string AssemblyForCase(const Case& c) {
+  std::ostringstream ss;
+
+  if (c.shader) {
+    ss << "OpCapability Shader\n";
+  } else {
+    ss << "OpCapability Kernel\n";
+    ss << "OpCapability Addresses\n";
+  }
+  for (auto& cap : c.caps) {
+    ss << "OpCapability " << cap << "\n";
+  }
+  ss << "OpExtension \"SPV_KHR_subgroup_rotate\"\n";
+
+  if (c.shader) {
+    ss << "OpMemoryModel Logical GLSL450\n";
+    ss << "OpEntryPoint GLCompute %main \"main\"\n";
+  } else {
+    ss << "OpMemoryModel Physical32 OpenCL\n";
+    ss << "OpEntryPoint Kernel %main \"main\"\n";
+  }
+
+  ss << R"(
+    %void    = OpTypeVoid
+    %void_fn = OpTypeFunction %void
+    %u32 = OpTypeInt 32 0
+    %float = OpTypeFloat 32
+    %ptr = OpTypePointer Function %u32
+  )";
+
+  if (c.shader) {
+    ss << "%i32 = OpTypeInt 32 1\n";
+  }
+
+  ss << R"(
+    %u32_0 = OpConstant %u32 0
+    %u32_1 = OpConstant %u32 1
+    %u32_15 = OpConstant %u32 15
+    %u32_16 = OpConstant %u32 16
+    %u32_undef = OpUndef %u32
+    %u32_spec_1 = OpSpecConstant %u32 1
+    %u32_spec_16 = OpSpecConstant %u32 16
+    %f32_1 = OpConstant %float 1.0
+    %subgroup = OpConstant %u32 3
+    %workgroup = OpConstant %u32 2
+    %invalid_scope = OpConstant %u32 1
+    %val = OpConstant %u32 42
+  )";
+
+  if (c.shader) {
+    ss << "%i32_1 = OpConstant %i32 1\n";
+  }
+
+  ss << R"(
+    %main = OpFunction %void None %void_fn
+    %entry = OpLabel
+  )";
+
+  ss << "%unused = OpGroupNonUniformRotateKHR ";
+  ss << c.result_type + " ";
+  ss << c.scope;
+  ss << " %val ";
+  ss << c.delta;
+  ss << " " + c.cluster_size;
+  ss << "\n";
+
+  ss << R"(
+    OpReturn
+    OpFunctionEnd
+  )";
+
+  return ss.str();
+}
+
+using ValidateSpvKHRSubgroupRotate = spvtest::ValidateBase<Case>;
+
+TEST_P(ValidateSpvKHRSubgroupRotate, Base) {
+  const auto& c = GetParam();
+  const auto& assembly = AssemblyForCase(c);
+  CompileSuccessfully(assembly);
+  if (c.expected_error.empty()) {
+    EXPECT_EQ(SPV_SUCCESS, ValidateInstructions()) << getDiagnosticString();
+  } else {
+    EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+    EXPECT_THAT(getDiagnosticString(), HasSubstr(c.expected_error));
+  }
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    Valid, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(
+        Case{
+            {"GroupNonUniformRotateKHR"}, false, "%u32", "%subgroup", "%u32_1"},
+        Case{{"GroupNonUniformRotateKHR"}, true, "%u32", "%subgroup", "%u32_1"},
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_16"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_16"},
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%subgroup",
+             "%u32_spec_1",
+             "%u32_16"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_spec_16"},
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%workgroup",
+             "%u32_1"},
+        Case{
+            {"GroupNonUniformRotateKHR"}, true, "%u32", "%workgroup", "%u32_1"},
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%workgroup",
+             "%u32_spec_1"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%workgroup",
+             "%u32_spec_1"}));
+
+INSTANTIATE_TEST_SUITE_P(
+    RequiresCapability, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(Case{{},
+                           false,
+                           "%u32",
+                           "%subgroup",
+                           "%u32_1",
+                           "",
+                           "Opcode GroupNonUniformRotateKHR requires one of "
+                           "these capabilities: "
+                           "GroupNonUniformRotateKHR"},
+                      Case{{},
+                           true,
+                           "%u32",
+                           "%subgroup",
+                           "%u32_1",
+                           "",
+                           "Opcode GroupNonUniformRotateKHR requires one of "
+                           "these capabilities: "
+                           "GroupNonUniformRotateKHR"}));
+
+TEST_F(ValidateSpvKHRSubgroupRotate, RequiresExtension) {
+  const std::string str = R"(
+    OpCapability GroupNonUniformRotateKHR
+)";
+  CompileSuccessfully(str.c_str());
+  EXPECT_NE(SPV_SUCCESS, ValidateInstructions());
+  EXPECT_THAT(
+      getDiagnosticString(),
+      HasSubstr(
+          "1st operand of Capability: operand GroupNonUniformRotateKHR(6026) "
+          "requires one of these extensions: SPV_KHR_subgroup_rotate"));
+}
+
+INSTANTIATE_TEST_SUITE_P(
+    InvalidExecutionScope, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%invalid_scope",
+             "%u32_1",
+             "",
+             "Execution scope is limited to Subgroup or Workgroup"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%invalid_scope",
+             "%u32_1",
+             "",
+             "Execution scope is limited to Subgroup or Workgroup"}));
+
+INSTANTIATE_TEST_SUITE_P(
+    InvalidResultType, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(Case{{"GroupNonUniformRotateKHR"},
+                           false,
+                           "%ptr",
+                           "%subgroup",
+                           "%u32_1",
+                           "",
+                           "Expected Result Type to be a scalar or vector of "
+                           "floating-point, integer or boolean type"},
+                      Case{{"GroupNonUniformRotateKHR"},
+                           true,
+                           "%ptr",
+                           "%subgroup",
+                           "%u32_1",
+                           "",
+                           "Expected Result Type to be a scalar or vector of "
+                           "floating-point, integer or boolean type"}));
+
+INSTANTIATE_TEST_SUITE_P(
+    MismatchedResultAndValueTypes, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%float",
+             "%subgroup",
+             "%u32_1",
+             "",
+             "Result Type must be the same as the type of Value"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%float",
+             "%subgroup",
+             "%u32_1",
+             "",
+             "Result Type must be the same as the type of Value"}));
+
+INSTANTIATE_TEST_SUITE_P(
+    InvalidDelta, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(Case{{"GroupNonUniformRotateKHR"},
+                           false,
+                           "%u32",
+                           "%subgroup",
+                           "%f32_1",
+                           "",
+                           "Delta must be a scalar of integer type, whose "
+                           "Signedness operand is 0"},
+                      Case{{"GroupNonUniformRotateKHR"},
+                           true,
+                           "%u32",
+                           "%subgroup",
+                           "%f32_1",
+                           "",
+                           "Delta must be a scalar of integer type, whose "
+                           "Signedness operand is 0"},
+                      Case{{"GroupNonUniformRotateKHR"},
+                           true,
+                           "%u32",
+                           "%subgroup",
+                           "%i32_1",
+                           "",
+                           "Delta must be a scalar of integer type, whose "
+                           "Signedness operand is 0"}));
+
+INSTANTIATE_TEST_SUITE_P(
+    InvalidClusterSize, ValidateSpvKHRSubgroupRotate,
+    ::testing::Values(
+        Case{{"GroupNonUniformRotateKHR"},
+             false,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%f32_1",
+             "ClusterSize must be a scalar of integer type, whose Signedness "
+             "operand is 0"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%i32_1",
+             "ClusterSize must be a scalar of integer type, whose Signedness "
+             "operand is 0"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_0",
+             "Behavior is undefined unless ClusterSize is at least 1 and a "
+             "power of 2"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_15",
+             "Behavior is undefined unless ClusterSize is at least 1 and a "
+             "power of 2"},
+        Case{{"GroupNonUniformRotateKHR"},
+             true,
+             "%u32",
+             "%subgroup",
+             "%u32_1",
+             "%u32_undef",
+             "ClusterSize must come from a constant instruction"}));
+
+}  // namespace
+}  // namespace val
+}  // namespace spvtools

+ 20 - 0
ThirdParty/Glslang/External/spirv-tools/test/val/val_image_test.cpp

@@ -1043,6 +1043,26 @@ TEST_F(ValidateImage, SampledImageNotSampler) {
               HasSubstr("Expected Sampler to be of type OpTypeSampler"));
 }
 
+TEST_F(ValidateImage, SampledImageIsStorage) {
+  const std::string declarations = R"(
+%type_sampled_image_f32_2d_0002 = OpTypeSampledImage %type_image_f32_2d_0002
+)";
+  const std::string body = R"(
+%img = OpLoad %type_image_f32_2d_0002 %uniform_image_f32_2d_0002
+%sampler = OpLoad %type_sampler %uniform_sampler
+%simg = OpSampledImage %type_sampled_image_f32_2d_0002 %img %sampler
+)";
+
+  CompileSuccessfully(GenerateShaderCode(body, "", "Fragment", "",
+                                         SPV_ENV_UNIVERSAL_1_0, "GLSL450",
+                                         declarations)
+                          .c_str());
+  ASSERT_EQ(SPV_ERROR_INVALID_DATA, ValidateInstructions());
+  EXPECT_THAT(getDiagnosticString(),
+              HasSubstr("Sampled image type requires an image type with "
+                        "\"Sampled\" operand set to 0 or 1"));
+}
+
 TEST_F(ValidateImage, ImageTexelPointerSuccess) {
   const std::string body = R"(
 %texel_ptr = OpImageTexelPointer %ptr_Image_u32 %private_image_u32_buffer_0002_r32ui %u32_0 %u32_0

+ 2 - 2
ThirdParty/Glslang/External/spirv-tools/test/val/val_memory_test.cpp

@@ -3252,8 +3252,8 @@ OpFunctionEnd
     EXPECT_EQ(SPV_ERROR_INVALID_ID,
               ValidateInstructions(SPV_ENV_UNIVERSAL_1_4));
     EXPECT_THAT(getDiagnosticString(),
-                HasSubstr("Instruction cannot be used without a variable "
-                          "pointers capability"));
+                HasSubstr("Instruction cannot for logical addressing model be "
+                          "used without a variable pointers capability"));
   }
 }
 

+ 4 - 9
ThirdParty/Glslang/External/spirv-tools/tools/opt/opt.cpp

@@ -157,12 +157,6 @@ Options (in lexicographical order):)",
                another.  It will only propagate an array if the source is never
                written to, and the only store to the target is the copy.)");
   printf(R"(
-  --decompose-initialized-variables
-               Decomposes initialized variable declarations into a declaration
-               followed by a store of the initial value. This is done to work
-               around known issues with some Vulkan drivers for initialize
-               variables.)");
-  printf(R"(
   --replace-desc-array-access-using-var-index
                Replaces accesses to descriptor arrays based on a variable index
                with a switch that has a case for every possible value of the
@@ -237,6 +231,10 @@ Options (in lexicographical order):)",
                loads and stores. Performed only on entry point call tree
                functions.)");
   printf(R"(
+  --fix-func-call-param
+               fix non memory argument for the function call, replace 
+               accesschain pointer argument with a variable.)");
+  printf(R"(
   --flatten-decorations
                Replace decoration groups with repeated OpDecorate and
                OpMemberDecorate instructions.)");
@@ -487,9 +485,6 @@ Options (in lexicographical order):)",
   --strength-reduction
                Replaces instructions with equivalent and less expensive ones.)");
   printf(R"(
-  --strip-atomic-counter-memory
-               Removes AtomicCountMemory bit from memory semantics values.)");
-  printf(R"(
   --strip-debug
                Remove all debug instructions.)");
   printf(R"(

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/utils/roll_deps.sh

@@ -39,6 +39,8 @@ if [[ $(git diff --stat) != '' ]]; then
     exit 1
 fi
 
+echo "*** Ignore messages about running 'git cl upload' ***"
+
 old_head=$(git rev-parse HEAD)
 
 set +e

+ 11 - 12
ThirdParty/Glslang/External/spirv-tools/utils/update_build_version.py

@@ -17,16 +17,16 @@
 # Updates an output file with version info unless the new content is the same
 # as the existing content.
 #
-# Args: <spirv-tools_dir> <output-file>
+# Args: <changes-file> <output-file>
 #
 # The output file will contain a line of text consisting of two C source syntax
 # string literals separated by a comma:
-#  - The software version deduced from the CHANGES file in the given directory.
+#  - The software version deduced from the given CHANGES file.
 #  - A longer string with the project name, the software version number, and
-#    git commit information for the directory.  The commit information
-#    is the output of "git describe" if that succeeds, or "git rev-parse HEAD"
-#    if that succeeds, or otherwise a message containing the phrase
-#    "unknown hash".
+#    git commit information for the CHANGES file's directory.  The commit
+#    information is the output of "git describe" if that succeeds, or "git
+#    rev-parse HEAD" if that succeeds, or otherwise a message containing the
+#    phrase "unknown hash".
 # The string contents are escaped as necessary.
 
 import datetime
@@ -73,9 +73,8 @@ def command_output(cmd, directory):
     return stdout
 
 
-def deduce_software_version(directory):
-    """Returns a software version number parsed from the CHANGES file
-    in the given directory.
+def deduce_software_version(changes_file):
+    """Returns a software version number parsed from the given CHANGES file.
 
     The CHANGES file describes most recent versions first.
     """
@@ -85,7 +84,6 @@ def deduce_software_version(directory):
     # unexpected carriage returns on a linefeed-only system such as
     # Linux.
     pattern = re.compile(r'^(v\d+\.\d+(-dev)?) \d\d\d\d-\d\d-\d\d\s*$')
-    changes_file = os.path.join(directory, 'CHANGES')
     with open(changes_file, mode='r') as f:
         for line in f.readlines():
             match = pattern.match(line)
@@ -125,16 +123,17 @@ def describe(directory):
 
 def main():
     if len(sys.argv) != 3:
-        print('usage: {} <spirv-tools-dir> <output-file>'.format(sys.argv[0]))
+        print('usage: {} <changes-files> <output-file>'.format(sys.argv[0]))
         sys.exit(1)
 
     output_file = sys.argv[2]
     mkdir_p(os.path.dirname(output_file))
 
     software_version = deduce_software_version(sys.argv[1])
+    directory = os.path.dirname(sys.argv[1])
     new_content = '"{}", "SPIRV-Tools {} {}"\n'.format(
         software_version, software_version,
-        describe(sys.argv[1]).replace('"', '\\"'))
+        describe(directory).replace('"', '\\"'))
 
     if os.path.isfile(output_file):
         with open(output_file, 'r') as f:

+ 2511 - 2511
ThirdParty/Glslang/SPIRV/spirv.hpp

@@ -1,2511 +1,2511 @@
-// 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 0x10600
-#define SPV_REVISION 1
-
-static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010600;
-static const unsigned int Revision = 1;
-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,
-    SourceLanguageCPP_for_OpenCL = 6,
-    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,
-    ImageOperandsNontemporalShift = 14,
-    ImageOperandsOffsetsShift = 16,
-    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,
-    ImageOperandsNontemporalMask = 0x00004000,
-    ImageOperandsOffsetsMask = 0x00010000,
-};
-
-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,
-    DecorationPerVertexKHR = 5285,
-    DecorationPerVertexNV = 5285,
-    DecorationNonUniform = 5300,
-    DecorationNonUniformEXT = 5300,
-    DecorationRestrictPointer = 5355,
-    DecorationRestrictPointerEXT = 5355,
-    DecorationAliasedPointer = 5356,
-    DecorationAliasedPointerEXT = 5356,
-    DecorationBindlessSamplerNV = 5398,
-    DecorationBindlessImageNV = 5399,
-    DecorationBoundSamplerNV = 5400,
-    DecorationBoundImageNV = 5401,
-    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,
-    DecorationMediaBlockIOINTEL = 6140,
-    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,
-    BuiltInBaryCoordKHR = 5286,
-    BuiltInBaryCoordNV = 5286,
-    BuiltInBaryCoordNoPerspKHR = 5287,
-    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,
-    BuiltInCullMaskKHR = 6021,
-    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,
-    FunctionControlOptNoneINTELShift = 16,
-    FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
-    FunctionControlMaskNone = 0,
-    FunctionControlInlineMask = 0x00000001,
-    FunctionControlDontInlineMask = 0x00000002,
-    FunctionControlPureMask = 0x00000004,
-    FunctionControlConstMask = 0x00000008,
-    FunctionControlOptNoneINTELMask = 0x00010000,
-};
-
-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,
-    CapabilityUniformDecoration = 71,
-    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,
-    CapabilityFragmentBarycentricKHR = 5284,
-    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,
-    CapabilityBindlessTextureNV = 5390,
-    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,
-    CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
-    CapabilityUnstructuredLoopControlsINTEL = 5886,
-    CapabilityFPGALoopControlsINTEL = 5888,
-    CapabilityKernelAttributesINTEL = 5892,
-    CapabilityFPGAKernelAttributesINTEL = 5897,
-    CapabilityFPGAMemoryAccessesINTEL = 5898,
-    CapabilityFPGAClusterAttributesINTEL = 5904,
-    CapabilityLoopFuseINTEL = 5906,
-    CapabilityFPGABufferLocationINTEL = 5920,
-    CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
-    CapabilityUSMStorageClassesINTEL = 5935,
-    CapabilityIOPipesINTEL = 5943,
-    CapabilityBlockingPipesINTEL = 5945,
-    CapabilityFPGARegINTEL = 5948,
-    CapabilityDotProductInputAll = 6016,
-    CapabilityDotProductInputAllKHR = 6016,
-    CapabilityDotProductInput4x8Bit = 6017,
-    CapabilityDotProductInput4x8BitKHR = 6017,
-    CapabilityDotProductInput4x8BitPacked = 6018,
-    CapabilityDotProductInput4x8BitPackedKHR = 6018,
-    CapabilityDotProduct = 6019,
-    CapabilityDotProductKHR = 6019,
-    CapabilityRayCullMaskKHR = 6020,
-    CapabilityBitInstructions = 6025,
-    CapabilityAtomicFloat32AddEXT = 6033,
-    CapabilityAtomicFloat64AddEXT = 6034,
-    CapabilityLongConstantCompositeINTEL = 6089,
-    CapabilityOptNoneINTEL = 6094,
-    CapabilityAtomicFloat16AddEXT = 6095,
-    CapabilityDebugInfoModuleINTEL = 6114,
-    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 QuantizationModes {
-    QuantizationModesTRN = 0,
-    QuantizationModesTRN_ZERO = 1,
-    QuantizationModesRND = 2,
-    QuantizationModesRND_ZERO = 3,
-    QuantizationModesRND_INF = 4,
-    QuantizationModesRND_MIN_INF = 5,
-    QuantizationModesRND_CONV = 6,
-    QuantizationModesRND_CONV_ODD = 7,
-    QuantizationModesMax = 0x7fffffff,
-};
-
-enum OverflowModes {
-    OverflowModesWRAP = 0,
-    OverflowModesSAT = 1,
-    OverflowModesSAT_ZERO = 2,
-    OverflowModesSAT_SYM = 3,
-    OverflowModesMax = 0x7fffffff,
-};
-
-enum PackedVectorFormat {
-    PackedVectorFormatPackedVectorFormat4x8Bit = 0,
-    PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
-    PackedVectorFormatMax = 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,
-    OpSDot = 4450,
-    OpSDotKHR = 4450,
-    OpUDot = 4451,
-    OpUDotKHR = 4451,
-    OpSUDot = 4452,
-    OpSUDotKHR = 4452,
-    OpSDotAccSat = 4453,
-    OpSDotAccSatKHR = 4453,
-    OpUDotAccSat = 4454,
-    OpUDotAccSatKHR = 4454,
-    OpSUDotAccSat = 4455,
-    OpSUDotAccSatKHR = 4455,
-    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,
-    OpDemoteToHelperInvocation = 5380,
-    OpDemoteToHelperInvocationEXT = 5380,
-    OpIsHelperInvocationEXT = 5381,
-    OpConvertUToImageNV = 5391,
-    OpConvertUToSamplerNV = 5392,
-    OpConvertImageToUNV = 5393,
-    OpConvertSamplerToUNV = 5394,
-    OpConvertUToSampledImageNV = 5395,
-    OpConvertSampledImageToUNV = 5396,
-    OpSamplerImageAddressingModeNV = 5397,
-    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,
-    OpConstantFunctionPointerINTEL = 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,
-    OpArbitraryFloatSinCosPiINTEL = 5840,
-    OpArbitraryFloatCastINTEL = 5841,
-    OpArbitraryFloatCastFromIntINTEL = 5842,
-    OpArbitraryFloatCastToIntINTEL = 5843,
-    OpArbitraryFloatAddINTEL = 5846,
-    OpArbitraryFloatSubINTEL = 5847,
-    OpArbitraryFloatMulINTEL = 5848,
-    OpArbitraryFloatDivINTEL = 5849,
-    OpArbitraryFloatGTINTEL = 5850,
-    OpArbitraryFloatGEINTEL = 5851,
-    OpArbitraryFloatLTINTEL = 5852,
-    OpArbitraryFloatLEINTEL = 5853,
-    OpArbitraryFloatEQINTEL = 5854,
-    OpArbitraryFloatRecipINTEL = 5855,
-    OpArbitraryFloatRSqrtINTEL = 5856,
-    OpArbitraryFloatCbrtINTEL = 5857,
-    OpArbitraryFloatHypotINTEL = 5858,
-    OpArbitraryFloatSqrtINTEL = 5859,
-    OpArbitraryFloatLogINTEL = 5860,
-    OpArbitraryFloatLog2INTEL = 5861,
-    OpArbitraryFloatLog10INTEL = 5862,
-    OpArbitraryFloatLog1pINTEL = 5863,
-    OpArbitraryFloatExpINTEL = 5864,
-    OpArbitraryFloatExp2INTEL = 5865,
-    OpArbitraryFloatExp10INTEL = 5866,
-    OpArbitraryFloatExpm1INTEL = 5867,
-    OpArbitraryFloatSinINTEL = 5868,
-    OpArbitraryFloatCosINTEL = 5869,
-    OpArbitraryFloatSinCosINTEL = 5870,
-    OpArbitraryFloatSinPiINTEL = 5871,
-    OpArbitraryFloatCosPiINTEL = 5872,
-    OpArbitraryFloatASinINTEL = 5873,
-    OpArbitraryFloatASinPiINTEL = 5874,
-    OpArbitraryFloatACosINTEL = 5875,
-    OpArbitraryFloatACosPiINTEL = 5876,
-    OpArbitraryFloatATanINTEL = 5877,
-    OpArbitraryFloatATanPiINTEL = 5878,
-    OpArbitraryFloatATan2INTEL = 5879,
-    OpArbitraryFloatPowINTEL = 5880,
-    OpArbitraryFloatPowRINTEL = 5881,
-    OpArbitraryFloatPowNINTEL = 5882,
-    OpLoopControlINTEL = 5887,
-    OpFixedSqrtINTEL = 5923,
-    OpFixedRecipINTEL = 5924,
-    OpFixedRsqrtINTEL = 5925,
-    OpFixedSinINTEL = 5926,
-    OpFixedCosINTEL = 5927,
-    OpFixedSinCosINTEL = 5928,
-    OpFixedSinPiINTEL = 5929,
-    OpFixedCosPiINTEL = 5930,
-    OpFixedSinCosPiINTEL = 5931,
-    OpFixedLogINTEL = 5932,
-    OpFixedExpINTEL = 5933,
-    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 OpSDot: *hasResult = true; *hasResultType = true; break;
-    case OpUDot: *hasResult = true; *hasResultType = true; break;
-    case OpSUDot: *hasResult = true; *hasResultType = true; break;
-    case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
-    case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
-    case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
-    case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
-    case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
-    case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
-    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 OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
-    case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
-    case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
-    case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
-    case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
-    case OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
-    case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
-    case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
-    case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; 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 OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
-    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 OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
-    case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
-    case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; 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 0x10600
+#define SPV_REVISION 1
+
+static const unsigned int MagicNumber = 0x07230203;
+static const unsigned int Version = 0x00010600;
+static const unsigned int Revision = 1;
+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,
+    SourceLanguageCPP_for_OpenCL = 6,
+    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,
+    ImageOperandsNontemporalShift = 14,
+    ImageOperandsOffsetsShift = 16,
+    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,
+    ImageOperandsNontemporalMask = 0x00004000,
+    ImageOperandsOffsetsMask = 0x00010000,
+};
+
+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,
+    DecorationPerVertexKHR = 5285,
+    DecorationPerVertexNV = 5285,
+    DecorationNonUniform = 5300,
+    DecorationNonUniformEXT = 5300,
+    DecorationRestrictPointer = 5355,
+    DecorationRestrictPointerEXT = 5355,
+    DecorationAliasedPointer = 5356,
+    DecorationAliasedPointerEXT = 5356,
+    DecorationBindlessSamplerNV = 5398,
+    DecorationBindlessImageNV = 5399,
+    DecorationBoundSamplerNV = 5400,
+    DecorationBoundImageNV = 5401,
+    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,
+    DecorationMediaBlockIOINTEL = 6140,
+    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,
+    BuiltInBaryCoordKHR = 5286,
+    BuiltInBaryCoordNV = 5286,
+    BuiltInBaryCoordNoPerspKHR = 5287,
+    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,
+    BuiltInCullMaskKHR = 6021,
+    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,
+    FunctionControlOptNoneINTELShift = 16,
+    FunctionControlMax = 0x7fffffff,
+};
+
+enum FunctionControlMask {
+    FunctionControlMaskNone = 0,
+    FunctionControlInlineMask = 0x00000001,
+    FunctionControlDontInlineMask = 0x00000002,
+    FunctionControlPureMask = 0x00000004,
+    FunctionControlConstMask = 0x00000008,
+    FunctionControlOptNoneINTELMask = 0x00010000,
+};
+
+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,
+    CapabilityUniformDecoration = 71,
+    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,
+    CapabilityFragmentBarycentricKHR = 5284,
+    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,
+    CapabilityBindlessTextureNV = 5390,
+    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,
+    CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
+    CapabilityUnstructuredLoopControlsINTEL = 5886,
+    CapabilityFPGALoopControlsINTEL = 5888,
+    CapabilityKernelAttributesINTEL = 5892,
+    CapabilityFPGAKernelAttributesINTEL = 5897,
+    CapabilityFPGAMemoryAccessesINTEL = 5898,
+    CapabilityFPGAClusterAttributesINTEL = 5904,
+    CapabilityLoopFuseINTEL = 5906,
+    CapabilityFPGABufferLocationINTEL = 5920,
+    CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
+    CapabilityUSMStorageClassesINTEL = 5935,
+    CapabilityIOPipesINTEL = 5943,
+    CapabilityBlockingPipesINTEL = 5945,
+    CapabilityFPGARegINTEL = 5948,
+    CapabilityDotProductInputAll = 6016,
+    CapabilityDotProductInputAllKHR = 6016,
+    CapabilityDotProductInput4x8Bit = 6017,
+    CapabilityDotProductInput4x8BitKHR = 6017,
+    CapabilityDotProductInput4x8BitPacked = 6018,
+    CapabilityDotProductInput4x8BitPackedKHR = 6018,
+    CapabilityDotProduct = 6019,
+    CapabilityDotProductKHR = 6019,
+    CapabilityRayCullMaskKHR = 6020,
+    CapabilityBitInstructions = 6025,
+    CapabilityAtomicFloat32AddEXT = 6033,
+    CapabilityAtomicFloat64AddEXT = 6034,
+    CapabilityLongConstantCompositeINTEL = 6089,
+    CapabilityOptNoneINTEL = 6094,
+    CapabilityAtomicFloat16AddEXT = 6095,
+    CapabilityDebugInfoModuleINTEL = 6114,
+    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 QuantizationModes {
+    QuantizationModesTRN = 0,
+    QuantizationModesTRN_ZERO = 1,
+    QuantizationModesRND = 2,
+    QuantizationModesRND_ZERO = 3,
+    QuantizationModesRND_INF = 4,
+    QuantizationModesRND_MIN_INF = 5,
+    QuantizationModesRND_CONV = 6,
+    QuantizationModesRND_CONV_ODD = 7,
+    QuantizationModesMax = 0x7fffffff,
+};
+
+enum OverflowModes {
+    OverflowModesWRAP = 0,
+    OverflowModesSAT = 1,
+    OverflowModesSAT_ZERO = 2,
+    OverflowModesSAT_SYM = 3,
+    OverflowModesMax = 0x7fffffff,
+};
+
+enum PackedVectorFormat {
+    PackedVectorFormatPackedVectorFormat4x8Bit = 0,
+    PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
+    PackedVectorFormatMax = 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,
+    OpSDot = 4450,
+    OpSDotKHR = 4450,
+    OpUDot = 4451,
+    OpUDotKHR = 4451,
+    OpSUDot = 4452,
+    OpSUDotKHR = 4452,
+    OpSDotAccSat = 4453,
+    OpSDotAccSatKHR = 4453,
+    OpUDotAccSat = 4454,
+    OpUDotAccSatKHR = 4454,
+    OpSUDotAccSat = 4455,
+    OpSUDotAccSatKHR = 4455,
+    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,
+    OpDemoteToHelperInvocation = 5380,
+    OpDemoteToHelperInvocationEXT = 5380,
+    OpIsHelperInvocationEXT = 5381,
+    OpConvertUToImageNV = 5391,
+    OpConvertUToSamplerNV = 5392,
+    OpConvertImageToUNV = 5393,
+    OpConvertSamplerToUNV = 5394,
+    OpConvertUToSampledImageNV = 5395,
+    OpConvertSampledImageToUNV = 5396,
+    OpSamplerImageAddressingModeNV = 5397,
+    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,
+    OpConstantFunctionPointerINTEL = 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,
+    OpArbitraryFloatSinCosPiINTEL = 5840,
+    OpArbitraryFloatCastINTEL = 5841,
+    OpArbitraryFloatCastFromIntINTEL = 5842,
+    OpArbitraryFloatCastToIntINTEL = 5843,
+    OpArbitraryFloatAddINTEL = 5846,
+    OpArbitraryFloatSubINTEL = 5847,
+    OpArbitraryFloatMulINTEL = 5848,
+    OpArbitraryFloatDivINTEL = 5849,
+    OpArbitraryFloatGTINTEL = 5850,
+    OpArbitraryFloatGEINTEL = 5851,
+    OpArbitraryFloatLTINTEL = 5852,
+    OpArbitraryFloatLEINTEL = 5853,
+    OpArbitraryFloatEQINTEL = 5854,
+    OpArbitraryFloatRecipINTEL = 5855,
+    OpArbitraryFloatRSqrtINTEL = 5856,
+    OpArbitraryFloatCbrtINTEL = 5857,
+    OpArbitraryFloatHypotINTEL = 5858,
+    OpArbitraryFloatSqrtINTEL = 5859,
+    OpArbitraryFloatLogINTEL = 5860,
+    OpArbitraryFloatLog2INTEL = 5861,
+    OpArbitraryFloatLog10INTEL = 5862,
+    OpArbitraryFloatLog1pINTEL = 5863,
+    OpArbitraryFloatExpINTEL = 5864,
+    OpArbitraryFloatExp2INTEL = 5865,
+    OpArbitraryFloatExp10INTEL = 5866,
+    OpArbitraryFloatExpm1INTEL = 5867,
+    OpArbitraryFloatSinINTEL = 5868,
+    OpArbitraryFloatCosINTEL = 5869,
+    OpArbitraryFloatSinCosINTEL = 5870,
+    OpArbitraryFloatSinPiINTEL = 5871,
+    OpArbitraryFloatCosPiINTEL = 5872,
+    OpArbitraryFloatASinINTEL = 5873,
+    OpArbitraryFloatASinPiINTEL = 5874,
+    OpArbitraryFloatACosINTEL = 5875,
+    OpArbitraryFloatACosPiINTEL = 5876,
+    OpArbitraryFloatATanINTEL = 5877,
+    OpArbitraryFloatATanPiINTEL = 5878,
+    OpArbitraryFloatATan2INTEL = 5879,
+    OpArbitraryFloatPowINTEL = 5880,
+    OpArbitraryFloatPowRINTEL = 5881,
+    OpArbitraryFloatPowNINTEL = 5882,
+    OpLoopControlINTEL = 5887,
+    OpFixedSqrtINTEL = 5923,
+    OpFixedRecipINTEL = 5924,
+    OpFixedRsqrtINTEL = 5925,
+    OpFixedSinINTEL = 5926,
+    OpFixedCosINTEL = 5927,
+    OpFixedSinCosINTEL = 5928,
+    OpFixedSinPiINTEL = 5929,
+    OpFixedCosPiINTEL = 5930,
+    OpFixedSinCosPiINTEL = 5931,
+    OpFixedLogINTEL = 5932,
+    OpFixedExpINTEL = 5933,
+    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 OpSDot: *hasResult = true; *hasResultType = true; break;
+    case OpUDot: *hasResult = true; *hasResultType = true; break;
+    case OpSUDot: *hasResult = true; *hasResultType = true; break;
+    case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
+    case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
+    case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
+    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 OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
+    case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+    case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+    case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+    case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+    case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+    case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; 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 OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
+    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 OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; 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
+

+ 57 - 57
ThirdParty/Glslang/gen_extension_headers.py

@@ -12,67 +12,67 @@
 # distributed under the License is distributed on an "AS IS" BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
-# limitations under the License.
-
-import glob
-import sys
-import os
-
-def generate_main(glsl_files, output_header_file):
-    # Write commit ID to output header file
-    with open(output_header_file, "w") as header_file:
-        # Copyright Notice
-        header_string =  '/***************************************************************************\n'
-        header_string += ' *\n'
-        header_string += ' * Copyright (c) 2015-2021 The Khronos Group Inc.\n'
-        header_string += ' * Copyright (c) 2015-2021 Valve Corporation\n'
-        header_string += ' * Copyright (c) 2015-2021 LunarG, Inc.\n'
-        header_string += ' * Copyright (c) 2015-2021 Google Inc.\n'
-        header_string += ' * Copyright (c) 2021 Advanced Micro Devices, Inc.All rights reserved.\n'
-        header_string += ' *\n'
-        header_string += ' ****************************************************************************/\n'
-        header_string += '#pragma once\n\n'
-        header_string += '#ifndef _INTRINSIC_EXTENSION_HEADER_H_\n'
-        header_string += '#define _INTRINSIC_EXTENSION_HEADER_H_\n\n'
-        header_file.write(header_string)
-
-        symbol_name_list = []
-
-        for i in glsl_files:
-            glsl_contents = open(i,"r").read()
-
-            filename = os.path.basename(i)
-            symbol_name = filename.split(".")[0]
-            symbol_name_list.append(symbol_name)
-            header_name = symbol_name + ".h"
-            header_str = 'std::string %s_GLSL = R"(\n%s\n)";\n' % (symbol_name, glsl_contents)
-            header_str += '\n'
-            header_file.write(header_str)
-
-        contents = ''
+# limitations under the License.
+
+import glob
+import sys
+import os
+
+def generate_main(glsl_files, output_header_file):
+    # Write commit ID to output header file
+    with open(output_header_file, "w") as header_file:
+        # Copyright Notice
+        header_string =  '/***************************************************************************\n'
+        header_string += ' *\n'
+        header_string += ' * Copyright (c) 2015-2021 The Khronos Group Inc.\n'
+        header_string += ' * Copyright (c) 2015-2021 Valve Corporation\n'
+        header_string += ' * Copyright (c) 2015-2021 LunarG, Inc.\n'
+        header_string += ' * Copyright (c) 2015-2021 Google Inc.\n'
+        header_string += ' * Copyright (c) 2021 Advanced Micro Devices, Inc.All rights reserved.\n'
+        header_string += ' *\n'
+        header_string += ' ****************************************************************************/\n'
+        header_string += '#pragma once\n\n'
+        header_string += '#ifndef _INTRINSIC_EXTENSION_HEADER_H_\n'
+        header_string += '#define _INTRINSIC_EXTENSION_HEADER_H_\n\n'
+        header_file.write(header_string)
+
+        symbol_name_list = []
+
+        for i in glsl_files:
+            glsl_contents = open(i,"r").read()
+
+            filename = os.path.basename(i)
+            symbol_name = filename.split(".")[0]
+            symbol_name_list.append(symbol_name)
+            header_name = symbol_name + ".h"
+            header_str = 'std::string %s_GLSL = R"(\n%s\n)";\n' % (symbol_name, glsl_contents)
+            header_str += '\n'
+            header_file.write(header_str)
+
+        contents = ''
         contents += '\n'
         contents += 'std::string getIntrinsic(const char* const* shaders, int n) {\n'
         contents += '\tstd::string shaderString = "";\n';
 
         contents += '\tfor (int i = 0; i < n; i++) {\n'
 
-        for symbol_name in symbol_name_list:
+        for symbol_name in symbol_name_list:
             contents += '\t\tif (strstr(shaders[i], "%s") != NULL) {\n'   % (symbol_name)
             contents += '\t\t    shaderString.append(%s_GLSL);\n' % (symbol_name)
-            contents += '\t\t}\n'
+            contents += '\t\t}\n'
 
         contents += '\t}\n'
         contents += '\treturn shaderString;\n';
-        contents += '}\n'
-
-        contents += '\n#endif\n'
-        header_file.write(contents)
-
-def main():
+        contents += '}\n'
+
+        contents += '\n#endif\n'
+        header_file.write(contents)
+
+def main():
     if len(sys.argv) < 2:
-        raise Exception("Invalid number of arguments")
-
-    i = 0
+        raise Exception("Invalid number of arguments")
+
+    i = 0
     while i < len(sys.argv):
         opt = sys.argv[i]
         i = i + 1
@@ -87,12 +87,12 @@ def main():
             elif (opt == "-o"):
                 output_file = val
             else:
-                raise Exception("Unknown flag {}".format(opt))
-
-    glsl_files = glob.glob(input_dir + '/*.glsl')
-
-    # Generate main header
-    generate_main(glsl_files, output_file)
-
-if __name__ == '__main__':
+                raise Exception("Unknown flag {}".format(opt))
+
+    glsl_files = glob.glob(input_dir + '/*.glsl')
+
+    # Generate main header
+    generate_main(glsl_files, output_file)
+
+if __name__ == '__main__':
     main()