Panagiotis Christopoulos Charitos vor 3 Jahren
Ursprung
Commit
a1fa01e941
100 geänderte Dateien mit 5692 neuen und 1476 gelöschten Zeilen
  1. 2 1
      AnKi/Shaders/GBufferGeneric.ankiprog
  2. 53 4
      Sandbox/Main.cpp
  3. 3 0
      ThirdParty/Glslang/.appveyor.yml
  4. 0 138
      ThirdParty/Glslang/.travis.yml
  5. 3 0
      ThirdParty/Glslang/Android.mk
  6. 18 2
      ThirdParty/Glslang/BUILD.bazel
  7. 29 0
      ThirdParty/Glslang/BUILD.gn
  8. 78 0
      ThirdParty/Glslang/CHANGES.md
  9. 52 54
      ThirdParty/Glslang/CMakeLists.txt
  10. 0 90
      ThirdParty/Glslang/External/spirv-tools/.appveyor.yml
  11. 15 1
      ThirdParty/Glslang/External/spirv-tools/Android.mk
  12. 45 0
      ThirdParty/Glslang/External/spirv-tools/BUILD.bazel
  13. 644 150
      ThirdParty/Glslang/External/spirv-tools/BUILD.gn
  14. 149 2
      ThirdParty/Glslang/External/spirv-tools/CHANGES
  15. 18 5
      ThirdParty/Glslang/External/spirv-tools/CMakeLists.txt
  16. 0 7
      ThirdParty/Glslang/External/spirv-tools/CONTRIBUTING.md
  17. 4 4
      ThirdParty/Glslang/External/spirv-tools/DEPS
  18. 136 60
      ThirdParty/Glslang/External/spirv-tools/README.md
  19. 55 0
      ThirdParty/Glslang/External/spirv-tools/build_defs.bzl
  20. 17 3
      ThirdParty/Glslang/External/spirv-tools/docs/downloads.md
  21. 1 1
      ThirdParty/Glslang/External/spirv-tools/docs/spirv-fuzz.md
  22. 5 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/BUILD.bazel
  23. 8 2
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt
  24. 12 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/README.md
  25. 84 9
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml
  26. 1 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/DebugInfo.h
  27. 2 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
  28. 2 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h
  29. 4 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json
  30. 8 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
  31. 19 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
  32. 1345 36
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
  33. 178 9
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs
  34. 267 13
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h
  35. 267 13
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp
  36. 261 7
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11
  37. 182 11
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json
  38. 167 3
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua
  39. 167 3
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py
  40. 170 3
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d
  41. 1 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt
  42. 1 1
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders
  43. 8 5
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp
  44. 46 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp
  45. 3 0
      ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h
  46. 5 1
      ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/instrument.hpp
  47. 46 12
      ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/libspirv.h
  48. 10 2
      ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp
  49. 89 20
      ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp
  50. 2 1
      ThirdParty/Glslang/External/spirv-tools/kokoro/check-format/build.sh
  51. 5 5
      ThirdParty/Glslang/External/spirv-tools/kokoro/macos-clang-release-bazel/build.sh
  52. 14 3
      ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/linux/build-docker.sh
  53. 2 0
      ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/linux/build.sh
  54. 1 1
      ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/macos/build.sh
  55. 6 19
      ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/windows/build.bat
  56. 0 16
      ThirdParty/Glslang/External/spirv-tools/kokoro/windows-msvc-2013-release/continuous.cfg
  57. 2 3
      ThirdParty/Glslang/External/spirv-tools/kokoro/windows-msvc-2015-release-bazel/build.bat
  58. 23 5
      ThirdParty/Glslang/External/spirv-tools/source/CMakeLists.txt
  59. 3 3
      ThirdParty/Glslang/External/spirv-tools/source/assembly_grammar.cpp
  60. 29 21
      ThirdParty/Glslang/External/spirv-tools/source/binary.cpp
  61. 7 0
      ThirdParty/Glslang/External/spirv-tools/source/binary.h
  62. 1 1
      ThirdParty/Glslang/External/spirv-tools/source/cfa.h
  63. 1 1
      ThirdParty/Glslang/External/spirv-tools/source/diagnostic.cpp
  64. 267 237
      ThirdParty/Glslang/External/spirv-tools/source/disassemble.cpp
  65. 59 0
      ThirdParty/Glslang/External/spirv-tools/source/disassemble.h
  66. 11 0
      ThirdParty/Glslang/External/spirv-tools/source/ext_inst.cpp
  67. 2 2
      ThirdParty/Glslang/External/spirv-tools/source/ext_inst.h
  68. 3 1
      ThirdParty/Glslang/External/spirv-tools/source/extensions.cpp
  69. 14 0
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/CMakeLists.txt
  70. 4 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fact_manager/fact_manager.h
  71. 1 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/force_render_red.cpp
  72. 1 1
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/force_render_red.h
  73. 230 245
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer.cpp
  74. 72 57
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer.h
  75. 34 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_context.cpp
  76. 52 6
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_context.h
  77. 50 6
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass.cpp
  78. 8 27
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass.h
  79. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp
  80. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.h
  81. 8 21
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp
  82. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h
  83. 22 29
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp
  84. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.h
  85. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp
  86. 2 2
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.h
  87. 6 5
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp
  88. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.h
  89. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp
  90. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.h
  91. 23 7
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_blocks.cpp
  92. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_blocks.h
  93. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_breaks.cpp
  94. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_breaks.h
  95. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_continues.cpp
  96. 5 6
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_continues.h
  97. 3 5
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.cpp
  98. 2 3
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.h
  99. 3 4
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp
  100. 5 6
      ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.h

+ 2 - 1
AnKi/Shaders/GBufferGeneric.ankiprog

@@ -368,7 +368,8 @@ void main()
 	const Vec2 velocity = Vec2(1.0);
 #	endif
 
-	packGBuffer(diffColor, normal, specColor, roughness, localUniforms.m_subsurface, emission, metallic, velocity);
+	packGBuffer(diffColor, normal, specColor, roughness, localUniforms.m_subsurface, emission * 0.00001, metallic,
+				velocity);
 #elif ANKI_TECHNIQUE == RENDERING_TECHNIQUE_GBUFFER_EZ
 	out_gbuffer0 = Vec4(0.0);
 	out_gbuffer1 = Vec4(0.0);

+ 53 - 4
Sandbox/Main.cpp

@@ -19,6 +19,11 @@ public:
 	Bool m_profile = false;
 	ConfigSet m_config;
 
+	AnimationResourcePtr m_danceAnim;
+	AnimationResourcePtr m_punchAnim;
+	AnimationResourcePtr m_capoeiraAnim;
+	AnimationResourcePtr m_kickAnim;
+
 	Error init(int argc, char* argv[]);
 	Error userMainLoop(Bool& quit, Second elapsedTime) override;
 };
@@ -72,6 +77,50 @@ Error MyApp::init(int argc, char* argv[])
 	pnode->addChild(&cam);
 #endif
 
+	ANKI_CHECK(getResourceManager().loadResource("Assets/Dance_5502fb39d4a4ca65.ankianim", m_danceAnim));
+	ANKI_CHECK(getResourceManager().loadResource("Assets/Kick_645abd9bd3a36a5b.ankianim", m_kickAnim));
+	ANKI_CHECK(getResourceManager().loadResource("Assets/Punch_3850f7b59d10e18a.ankianim", m_punchAnim));
+	ANKI_CHECK(getResourceManager().loadResource("Assets/Capoeira_b753bfdd90ac4b7f.ankianim", m_capoeiraAnim));
+
+	AnimationPlayInfo animInfo;
+	animInfo.m_startTime = 2.0;
+	animInfo.m_repeatTimes = -1.0;
+	getSceneGraph()
+		.findSceneNode("Alpha_Surface")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_capoeiraAnim, animInfo);
+	getSceneGraph()
+		.findSceneNode("Alpha_Joints")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_capoeiraAnim, animInfo);
+
+	getSceneGraph()
+		.findSceneNode("Alpha_Surface.001")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_danceAnim, animInfo);
+	getSceneGraph()
+		.findSceneNode("Alpha_Joints.001")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_danceAnim, animInfo);
+
+	getSceneGraph()
+		.findSceneNode("Alpha_Surface.002")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_punchAnim, animInfo);
+	getSceneGraph()
+		.findSceneNode("Alpha_Joints.002")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_punchAnim, animInfo);
+
+	getSceneGraph()
+		.findSceneNode("Alpha_Surface.003")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_kickAnim, animInfo);
+	getSceneGraph()
+		.findSceneNode("Alpha_Joints.003")
+		.getFirstComponentOfType<SkinComponent>()
+		.playAnimation(0, m_kickAnim, animInfo);
+
 	return Error::NONE;
 }
 
@@ -147,10 +196,10 @@ Error MyApp::userMainLoop(Bool& quit, Second elapsedTime)
 		renderer.getDbg().switchDepthTestEnabled();
 	}
 
-	if(in.getKey(KeyCode::F11) == 1)
+	/*if(in.getKey(KeyCode::F11) == 1)
 	{
 		TracerSingleton::get().setEnabled(!TracerSingleton::get().getEnabled());
-	}
+	}*/
 
 #if !PLAYER
 	static Vec2 mousePosOn1stClick = in.getMousePosition();
@@ -261,10 +310,10 @@ Error MyApp::userMainLoop(Bool& quit, Second elapsedTime)
 			mover->moveLocalZ(moveDistance);
 		}
 
-		if(in.getKey(KeyCode::F12) == 1 && ANKI_ENABLE_TRACE)
+		/* if(in.getKey(KeyCode::F12) == 1 && ANKI_ENABLE_TRACE)
 		{
 			TracerSingleton::get().setEnabled(!TracerSingleton::get().getEnabled());
-		}
+		}*/
 
 		const Vec2 velocity = in.getMousePosition() - mousePosOn1stClick;
 		in.moveCursor(mousePosOn1stClick);

+ 3 - 0
ThirdParty/Glslang/.appveyor.yml

@@ -77,8 +77,11 @@ after_test:
     bin\glslangValidator.exe
     bin\spirv-remap.exe
     include\glslang\*
+    lib\GenericCodeGen%SUFFIX%.lib
     lib\glslang%SUFFIX%.lib
+    lib\glslang-default-resource-limits%SUFFIX%.lib
     lib\HLSL%SUFFIX%.lib
+    lib\MachineIndependent%SUFFIX%.lib
     lib\OGLCompiler%SUFFIX%.lib
     lib\OSDependent%SUFFIX%.lib
     lib\SPIRV%SUFFIX%.lib

+ 0 - 138
ThirdParty/Glslang/.travis.yml

@@ -1,138 +0,0 @@
-# Linux and Mac Build Configuration for Travis
-
-language: cpp
-
-os:
-  - linux
-  - osx
-
-# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
-sudo: false
-dist: trusty
-
-env:
-  global:
-    - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI=
-  matrix:
-    - GLSLANG_BUILD_TYPE=Release
-    - GLSLANG_BUILD_TYPE=Debug
-
-compiler:
-  - clang
-  - gcc
-
-matrix:
-  fast_finish: true # Show final status immediately if a test fails.
-  exclude:
-    # Skip GCC builds on Mac OS X.
-    - os: osx
-      compiler: gcc
-  include:
-    # Additional build using Android NDK.
-    - env: BUILD_NDK=ON
-
-cache:
-  apt: true
-
-branches:
-  only:
-    - master
-
-addons:
-  apt:
-    packages:
-      - clang-3.6
-
-install:
-  # Make sure that clang-3.6 is selected on Linux.
-  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
-      export CC=clang-3.6 CXX=clang++-3.6;
-    fi
-  # Download a recent Android NDK and use its android.toolchain.cmake file.
-  - if [[ "$BUILD_NDK" == "ON" ]]; then
-      export ANDROID_NDK=$HOME/android-ndk;
-      git init $ANDROID_NDK;
-      pushd $ANDROID_NDK;
-        git remote add dneto0 https://github.com/dneto0/android-ndk.git;
-        git fetch --depth=1 dneto0 r17b-strip;
-        git checkout FETCH_HEAD;
-      popd;
-      export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake;
-    fi
-
-before_script:
-  # check out pre-breakage version of googletest; can be deleted when
-  # issue 3128 is fixed
-  # git clone --depth=1 https://github.com/google/googletest.git External/googletest
-  - mkdir -p External/googletest
-  - cd External/googletest
-  - git init
-  - git remote add origin https://github.com/google/googletest.git
-  - git fetch --depth 1 origin 0c400f67fcf305869c5fb113dd296eca266c9725
-  - git reset --hard FETCH_HEAD
-  - cd ../..
-  # get spirv-tools and spirv-headers
-  - ./update_glslang_sources.py
-
-script:
-  - mkdir build && cd build
-  # For Android, do release building using NDK without testing.
-  # Use android-14, the oldest native API level supporeted by NDK r17b.
-  # We can use newer API levels if we want.
-  # For Linux and macOS, do debug/release building with testing.
-  - if [[ "$BUILD_NDK" == "ON" ]]; then
-      cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
-            -DANDROID_NATIVE_API_LEVEL=android-14
-            -DCMAKE_BUILD_TYPE=Release
-            -DANDROID_ABI="armeabi-v7a with NEON"
-            -DBUILD_TESTING=OFF ..;
-      make -j4;
-    else
-      cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE}
-            -DCMAKE_INSTALL_PREFIX=`pwd`/install ..;
-      make -j4 install;
-      ctest --output-on-failure &&
-      cd ../Test && ./runtests;
-    fi
-
-after_success:
-  # For debug build, the generated dll has a postfix "d" in its name.
-  - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then
-      export SUFFIX="d";
-    else
-      export SUFFIX="";
-    fi
-  # Create tarball for deployment
-  - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then
-      cd ../build/install;
-      export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip;
-      zip ${TARBALL}
-        bin/glslangValidator
-        include/glslang/*
-        lib/libglslang${SUFFIX}.a
-        lib/libHLSL${SUFFIX}.a
-        lib/libOGLCompiler${SUFFIX}.a
-        lib/libOSDependent${SUFFIX}.a
-        lib/libSPIRV${SUFFIX}.a
-        lib/libSPVRemapper${SUFFIX}.a
-        lib/libSPIRV-Tools${SUFFIX}.a
-        lib/libSPIRV-Tools-opt${SUFFIX}.a;
-    fi
-
-before_deploy:
-  # Tag the current top of the tree as "master-tot".
-  # Travis CI replies on the tag name to properly push to GitHub Releases.
-  - git config --global user.name "Travis CI"
-  - git config --global user.email "[email protected]"
-  - git tag -f master-tot
-  - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags
-
-deploy:
-  provider: releases
-  api_key: ${glslangtoken}
-  on:
-    branch: master
-    condition: ${CC} == clang* && ${BUILD_NDK} != ON
-  file: ${TARBALL}
-  skip_cleanup: true
-  overwrite: true

+ 3 - 0
ThirdParty/Glslang/Android.mk

@@ -96,6 +96,7 @@ LOCAL_MODULE:=glslang
 LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti $(GLSLANG_DEFINES)
 LOCAL_EXPORT_C_INCLUDES:=$(LOCAL_PATH)
 LOCAL_SRC_FILES:= \
+		glslang/CInterface/glslang_c_interface.cpp \
 		glslang/GenericCodeGen/CodeGen.cpp \
 		glslang/GenericCodeGen/Link.cpp \
 		glslang/HLSL/hlslAttributes.cpp \
@@ -125,6 +126,7 @@ LOCAL_SRC_FILES:= \
 		glslang/MachineIndependent/RemoveTree.cpp \
 		glslang/MachineIndependent/Scan.cpp \
 		glslang/MachineIndependent/ShaderLang.cpp \
+		glslang/MachineIndependent/SpirvIntrinsics.cpp \
 		glslang/MachineIndependent/SymbolTable.cpp \
 		glslang/MachineIndependent/Versions.cpp \
 		glslang/MachineIndependent/preprocessor/PpAtom.cpp \
@@ -148,6 +150,7 @@ $(LOCAL_PATH)/SPIRV/GlslangToSpv.cpp: \
 LOCAL_MODULE:=SPIRV
 LOCAL_CXXFLAGS:=-std=c++11 -fno-exceptions -fno-rtti -Werror $(GLSLANG_DEFINES)
 LOCAL_SRC_FILES:= \
+	SPIRV/CInterface/spirv_c_interface.cpp \
 	SPIRV/GlslangToSpv.cpp \
 	SPIRV/InReadableOrder.cpp \
 	SPIRV/Logger.cpp \

+ 18 - 2
ThirdParty/Glslang/BUILD.bazel

@@ -49,14 +49,28 @@ py_binary(
     srcs = ["build_info.py"],
 )
 
+py_binary(
+    name = "gen_extension_headers",
+    srcs = ["gen_extension_headers.py"],
+)
+
 genrule(
     name = "gen_build_info_h",
     srcs = ["CHANGES.md", "build_info.h.tmpl"],
     outs = ["glslang/build_info.h"],
-    cmd = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
+    cmd_bash = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
+    cmd_bat = "for %F in ($(location CHANGES.md)) do $(location build_info) %~dpF -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
     tools = [":build_info"],
 )
 
+genrule(
+    name = "gen_extension_headers_h",
+    srcs = ["glslang/ExtensionHeaders", "gen_extension_headers.py"],
+    outs = ["glslang/glsl_intrinsic_header.h"],
+    cmd_bash = "$(location gen_extension_headers) -i  $(location glslang/ExtensionHeaders) -o $(location glslang/glsl_intrinsic_header.h)",
+    tools = [":gen_extension_headers"],
+)
+
 COMMON_COPTS = select({
     "@bazel_tools//src/conditions:windows": [""],
     "//conditions:default": [
@@ -143,7 +157,8 @@ genrule(
         "include/SPIRV/NonSemanticDebugPrintf.h",
         "include/SPIRV/spirv.hpp",
     ],
-    cmd = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
+    cmd_bash = "mkdir -p $(@D)/include/SPIRV && cp $(SRCS) $(@D)/include/SPIRV/",
+    cmd_bat = "(if not exist $(@D)\\include\\SPIRV mkdir $(@D)\\include\\SPIRV) && (for %S in ($(SRCS)) do @xcopy /q %S $(@D)\\include\\SPIRV\\ >NUL)",
 )
 
 cc_library(
@@ -204,6 +219,7 @@ cc_binary(
     srcs = [
         "StandAlone/StandAlone.cpp",
         "StandAlone/Worklist.h",
+        ":glslang/glsl_intrinsic_header.h"
     ],
     copts = COMMON_COPTS,
     deps = [

+ 29 - 0
ThirdParty/Glslang/BUILD.gn

@@ -69,6 +69,32 @@ action("glslang_build_info") {
   ]
 }
 
+action("glslang_extension_headers") {
+  script = "gen_extension_headers.py"
+
+  out_file = "${target_gen_dir}/include/glslang/glsl_intrinsic_header.h"
+
+  # Fuchsia GN build rules require all GN actions to be hermetic and they
+  # should correctly and fully state their inputs and outpus (see
+  # https://fuchsia.dev/fuchsia-src/development/build/hermetic_actions
+  # for details). All input files of the script should be added to the
+  # |sources| list.
+  sources = [
+    "glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl",
+  ]
+
+  inputs = [
+    script
+  ]
+  outputs = [ out_file ]
+  args = [
+    "-i",
+    rebase_path("glslang/ExtensionHeaders", root_build_dir),
+    "-o",
+    rebase_path(out_file, root_build_dir),
+  ]
+}
+
 spirv_tools_dir = glslang_spirv_tools_dir
 if (!defined(glslang_angle)) {
   glslang_angle = false
@@ -131,6 +157,7 @@ template("glslang_sources_common") {
       "glslang/Include/PoolAlloc.h",
       "glslang/Include/ResourceLimits.h",
       "glslang/Include/ShHandle.h",
+      "glslang/Include/SpirvIntrinsics.h",
       "glslang/Include/Types.h",
       "glslang/Include/arrays.h",
       "glslang/Include/intermediate.h",
@@ -151,6 +178,7 @@ template("glslang_sources_common") {
       "glslang/MachineIndependent/Scan.h",
       "glslang/MachineIndependent/ScanContext.h",
       "glslang/MachineIndependent/ShaderLang.cpp",
+      "glslang/MachineIndependent/SpirvIntrinsics.cpp",
       "glslang/MachineIndependent/SymbolTable.cpp",
       "glslang/MachineIndependent/SymbolTable.h",
       "glslang/MachineIndependent/Versions.cpp",
@@ -300,6 +328,7 @@ executable("glslang_validator") {
     ":glslang_build_info",
     ":glslang_default_resource_limits_sources",
     ":glslang_sources",
+    ":glslang_extension_headers",
   ]
   public_configs = [ ":glslang_hlsl" ]
 

+ 78 - 0
ThirdParty/Glslang/CHANGES.md

@@ -3,6 +3,84 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](https://semver.org/).
 
+## 11.10.0 2022-06-02
+
+### Other changes
+* Generate OpLine before OpFunction
+* Add support for VK_EXT_fragment_shader_barycentric
+* Add whitelist filtering for debug comments in SPIRV-Remap
+* Add support for GL_EXT_ray_cull_mask
+
+## 11.9.0 2022-04-06
+
+### Other changes
+* Add GLSL version override functionality
+* Add eliminate-dead-input-components to -Os
+* Add enhanced-msgs option
+* Explicitly use Python 3 for builds
+
+## 11.8.0 2022-01-27
+
+### Other changes
+* Add support for SPIR-V 1.6
+* Add support for Vulkan 1.3
+* Add --hlsl-dx-position-w option
+
+## 11.7.0 2021-11-11
+
+### Other changes
+* Add support for targeting Vulkan 1.2 in the C API
+
+## 11.6.0 2021-08-25
+
+### Other changes
+* Atomic memory function only for shader storage block member or shared variable
+* Add support for gl_MaxVaryingVectors for ogl
+* Fix loading bool arrays from interface blocks
+* Generate separate stores for partially swizzled memory stores
+* Allow layout(std430) uniform with GL_EXT_scalar_block_layout
+* Support for pragma STDGL invariant(all)
+* Support for GL_NV_ray_tracing_motion_blur
+
+## 11.5.0 2021-06-23
+
+### Other changes
+* Implement GLSL_EXT_shader_atomic_float2
+* Implement GL_EXT_spirv_intrinsics
+* Fixed SPIR-V remapper not remapping OpExtInst instruction set IDs
+* only declare compatibility gl_ variables in compatibility mode
+* Add support for float spec const vector initialization
+* Implement GL_EXT_subgroup_uniform_control_flow.
+* Fix arrays dimensioned with spec constant sized gl_WorkGroupSize
+* Add support for 64bit integer scalar and vector types to bitCount() builtin
+
+## 11.4.0 2021-04-22
+
+### Other changes
+* Fix to keep source compatible with CMake 3.10.2
+
+## 11.3.0 2021-04-21
+
+### Other changes
+* Added --depfile
+* Added --auto-sampled-textures
+* Now supports InterpolateAt-based functions
+* Supports cross-stage automatic IO mapping
+* Supports GL_EXT_vulkan_glsl_relaxed (-R option)
+
+## 11.2.0 2021-02-18
+
+### Other changes
+* Removed Python requirement when not building with spirv-tools
+* Add support for GL_EXT_shared_memory_block
+* Implement GL_EXT_null_initializer
+* Add CMake support for Fuschia
+
+## 11.1.0 2020-12-07
+
+### Other changes
+* Added ray-tracing extension support
+
 ## 11.0.0 2020-07-20
 
 ### Breaking changes

+ 52 - 54
ThirdParty/Glslang/CMakeLists.txt

@@ -31,15 +31,18 @@
 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-project(glslang
-    LANGUAGES CXX)
-
 # increase to 3.1 once all major distributions
 # include a version of CMake >= 3.1
 cmake_minimum_required(VERSION 2.8.12)
 if (POLICY CMP0048)
   cmake_policy(SET CMP0048 NEW)
 endif()
+if(POLICY CMP0054)
+  cmake_policy(SET CMP0054 NEW)
+endif()
+
+project(glslang LANGUAGES CXX)
+
 set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 
 # Enable compile commands database
@@ -103,10 +106,17 @@ CMAKE_DEPENDENT_OPTION(ENABLE_HLSL
 option(ENABLE_RTTI "Enables RTTI" OFF)
 option(ENABLE_EXCEPTIONS "Enables Exceptions" OFF)
 option(ENABLE_OPT "Enables spirv-opt capability if present" ON)
-option(ENABLE_PCH "Enables Precompiled header" ON)
-option(ENABLE_CTEST "Enables testing" OFF)
 
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
+if(MINGW OR (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU"))
+    # Workaround for CMake behavior on Mac OS with gcc, cmake generates -Xarch_* arguments
+    # which gcc rejects
+    option(ENABLE_PCH "Enables Precompiled header" OFF)
+else()
+    option(ENABLE_PCH "Enables Precompiled header" ON)
+endif()
+option(ENABLE_CTEST "Enables testing" ON)
+
+if(ENABLE_GLSLANG_INSTALL AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND WIN32)
     set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "..." FORCE)
 endif()
 
@@ -115,7 +125,7 @@ if(USE_CCACHE)
     find_program(CCACHE_FOUND ccache)
     if(CCACHE_FOUND)
         set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
-    endif(CCACHE_FOUND)
+    endif()
 endif()
 
 if(ENABLE_CTEST)
@@ -124,26 +134,27 @@ endif()
 
 if(ENABLE_HLSL)
     add_definitions(-DENABLE_HLSL)
-endif(ENABLE_HLSL)
+endif()
 
 if(ENABLE_GLSLANG_WEBMIN)
     add_definitions(-DGLSLANG_WEB)
     if(ENABLE_GLSLANG_WEBMIN_DEVEL)
         add_definitions(-DGLSLANG_WEB_DEVEL)
-    endif(ENABLE_GLSLANG_WEBMIN_DEVEL)
-endif(ENABLE_GLSLANG_WEBMIN)
+    endif()
+endif()
 
 if(WIN32)
     set(CMAKE_DEBUG_POSTFIX "d")
-    if(MSVC)
+    option(OVERRIDE_MSVCCRT "Overrides runtime of MSVC " ON)
+    if(MSVC AND OVERRIDE_MSVCCRT)
         include(ChooseMSVCCRT.cmake)
-    endif(MSVC)
+    endif()
     add_definitions(-DGLSLANG_OSINCLUDE_WIN32)
 elseif(UNIX)
     add_definitions(-DGLSLANG_OSINCLUDE_UNIX)
-else(WIN32)
+else()
     message("unknown platform")
-endif(WIN32)
+endif()
 
 if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
     add_compile_options(-Wall -Wmaybe-uninitialized -Wuninitialized -Wunused -Wunused-local-typedefs
@@ -159,7 +170,7 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
         add_compile_options(-Werror=deprecated-copy)
     endif()
 
-    if(NOT CMAKE_VERSION VERSION_LESS "3.13")
+    if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
         # Error if there's symbols that are not found at link time.
         # add_link_options() was added in CMake 3.13 - if using an earlier
         # version don't set this - it should be caught by presubmits anyway.
@@ -180,7 +191,11 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT MSVC)
         # Error if there's symbols that are not found at link time.
         # add_link_options() was added in CMake 3.13 - if using an earlier
         # version don't set this - it should be caught by presubmits anyway.
-        add_link_options("-Wl,-undefined,error")
+        if (WIN32)
+            add_link_options("-Wl,--no-undefined")
+        else()
+            add_link_options("-Wl,-undefined,error")
+        endif()
     endif()
 elseif(MSVC)
     if(NOT ENABLE_RTTI)
@@ -193,6 +208,9 @@ elseif(MSVC)
     endif()
     if(ENABLE_EXCEPTIONS)
         add_compile_options(/EHsc) # Enable Exceptions
+	else()
+        string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # Try to remove default /EHsc cxx_flag
+        add_compile_options(/D_HAS_EXCEPTIONS=0)
     endif()
 endif()
 
@@ -206,7 +224,7 @@ if(ENABLE_GLSLANG_JS)
             add_compile_options(-Wno-unused-variable -Wno-unused-const-variable)
         endif()
     endif()
-endif(ENABLE_GLSLANG_JS)
+endif()
 
 # Request C++11
 if(${CMAKE_VERSION} VERSION_LESS 3.1)
@@ -234,55 +252,33 @@ if(NOT COMMAND find_host_package)
     endmacro()
 endif()
 
-# CMake needs to find the right version of python, right from the beginning,
-# otherwise, it will find the wrong version and fail later
-find_host_package(PythonInterp 3 REQUIRED)
-
 # Root directory for build-time generated include files
 set(GLSLANG_GENERATED_INCLUDEDIR "${CMAKE_BINARY_DIR}/include")
 
 ################################################################################
 # Build version information generation
 ################################################################################
+include(parse_version.cmake)
 set(GLSLANG_CHANGES_FILE      "${CMAKE_CURRENT_SOURCE_DIR}/CHANGES.md")
-set(GLSLANG_BUILD_INFO_PY     "${CMAKE_CURRENT_SOURCE_DIR}/build_info.py")
 set(GLSLANG_BUILD_INFO_H_TMPL "${CMAKE_CURRENT_SOURCE_DIR}/build_info.h.tmpl")
 set(GLSLANG_BUILD_INFO_H      "${GLSLANG_GENERATED_INCLUDEDIR}/glslang/build_info.h")
 
-# Command to build the build_info.h file
-add_custom_command(
-    OUTPUT  ${GLSLANG_BUILD_INFO_H}
-    COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_BUILD_INFO_PY}"
-            ${CMAKE_CURRENT_SOURCE_DIR}
-            "-i" ${GLSLANG_BUILD_INFO_H_TMPL}
-            "-o" ${GLSLANG_BUILD_INFO_H}
-    DEPENDS ${GLSLANG_BUILD_INFO_PY}
-            ${GLSLANG_CHANGES_FILE}
-            ${GLSLANG_BUILD_INFO_H_TMPL}
-    COMMENT "Generating ${GLSLANG_BUILD_INFO_H}")
-
-# Target to build the build_info.h file
-add_custom_target(glslang-build-info DEPENDS ${GLSLANG_BUILD_INFO_H})
-
-# Populate the CMake GLSLANG_VERSION* variables with the build version
-# information.
-execute_process(
-    COMMAND ${PYTHON_EXECUTABLE} "${GLSLANG_BUILD_INFO_PY}"
-            ${CMAKE_CURRENT_SOURCE_DIR} "<major>.<minor>.<patch><-flavor>;<major>;<minor>;<patch>;<flavor>"
-    OUTPUT_VARIABLE "GLSLANG_VERSIONS"
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-list(GET "GLSLANG_VERSIONS" 0 "GLSLANG_VERSION")
-list(GET "GLSLANG_VERSIONS" 1 "GLSLANG_VERSION_MAJOR")
-list(GET "GLSLANG_VERSIONS" 2 "GLSLANG_VERSION_MINOR")
-list(GET "GLSLANG_VERSIONS" 3 "GLSLANG_VERSION_PATCH")
-list(GET "GLSLANG_VERSIONS" 4 "GLSLANG_VERSION_FLAVOR")
-configure_file(${GLSLANG_CHANGES_FILE} "${CMAKE_CURRENT_BINARY_DIR}/CHANGES.md") # Required to re-run cmake on version change
+parse_version(${GLSLANG_CHANGES_FILE} GLSLANG)
+
+function(configurate_version)
+    set(major ${GLSLANG_VERSION_MAJOR})
+    set(minor ${GLSLANG_VERSION_MINOR})
+    set(patch ${GLSLANG_VERSION_PATCH})
+    set(flavor ${GLSLANG_VERSION_FLAVOR})
+    configure_file(${GLSLANG_BUILD_INFO_H_TMPL} ${GLSLANG_BUILD_INFO_H} @ONLY)
+endfunction()
+
+configurate_version()
 
 # glslang_add_build_info_dependency() adds the glslang-build-info dependency and
 # generated include directories to target.
 function(glslang_add_build_info_dependency target)
     target_include_directories(${target} PUBLIC $<BUILD_INTERFACE:${GLSLANG_GENERATED_INCLUDEDIR}>)
-    add_dependencies(${target} glslang-build-info)
 endfunction()
 
 # glslang_only_export_explicit_symbols() makes the symbol visibility hidden by
@@ -316,6 +312,8 @@ else()
 endif()
 
 if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
+    find_host_package(PythonInterp 3 REQUIRED)
+
     # We depend on these for later projects, so they should come first.
     add_subdirectory(External)
 endif()
@@ -342,7 +340,7 @@ endif()
 add_subdirectory(SPIRV)
 if(ENABLE_HLSL)
     add_subdirectory(hlsl)
-endif(ENABLE_HLSL)
+endif()
 if(ENABLE_CTEST)
     add_subdirectory(gtests)
 endif()
@@ -359,11 +357,11 @@ if(ENABLE_CTEST AND BUILD_TESTING)
         set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/localResults)
         set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/glslangValidator)
         set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/$<CONFIGURATION>/spirv-remap)
-    else(CMAKE_CONFIGURATION_TYPES)
+    else()
         set(RESULTS_PATH ${CMAKE_CURRENT_BINARY_DIR}/localResults)
         set(VALIDATOR_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/glslangValidator)
         set(REMAP_PATH ${CMAKE_CURRENT_BINARY_DIR}/StandAlone/spirv-remap)
-    endif(CMAKE_CONFIGURATION_TYPES)
+    endif()
 
     add_test(NAME glslang-testsuite
         COMMAND bash ${IGNORE_CR_FLAG} runtests ${RESULTS_PATH} ${VALIDATOR_PATH} ${REMAP_PATH}

+ 0 - 90
ThirdParty/Glslang/External/spirv-tools/.appveyor.yml

@@ -1,90 +0,0 @@
-# Windows Build Configuration for AppVeyor
-# http://www.appveyor.com/docs/appveyor-yml
-
-# version format
-version: "{build}"
-
-# The most recent compiler gives the most interesting new results.
-# Put it first so we get its feedback first.
-os:
-  - Visual Studio 2017
-  #- Visual Studio 2013
-
-platform:
-  - x64
-
-configuration:
-  - Debug
-  #- Release
-
-branches:
-  only:
-    - master
-
-# Travis advances the master-tot tag to current top of the tree after
-# each push into the master branch, because it relies on that tag to
-# upload build artifacts to the master-tot release. This will cause
-# double testing for each push on Appveyor: one for the push, one for
-# the tag advance. Disable testing tags.
-skip_tags: true
-
-clone_depth: 1
-
-matrix:
-  fast_finish: true # Show final status immediately if a test fails.
-  #exclude:
-  #  - os: Visual Studio 2013
-  #    configuration: Debug
-
-# scripts that run after cloning repository
-install:
-  # Install ninja
-  - set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip"
-  - appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
-  - 7z x ninja.zip -oC:\ninja > nul
-  - set PATH=C:\ninja;C:\Python36;%PATH%
-
-before_build:
-  - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
-  - git clone https://github.com/google/googletest.git external/googletest
-  - cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd ..
-  - git clone --depth=1 https://github.com/google/effcee.git external/effcee
-  - git clone --depth=1 https://github.com/google/re2.git external/re2
-  # Set path and environment variables for the current Visual Studio version
-  - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2013" (call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64)
-  - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017" (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64)
-
-build:
-  parallel: true  # enable MSBuild parallel builds
-  verbosity: minimal
-
-build_script:
-  - mkdir build && cd build
-  - cmake -GNinja -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DCMAKE_INSTALL_PREFIX=install -DRE2_BUILD_TESTING=OFF ..
-  - ninja install
-
-test_script:
-  - ctest -C %CONFIGURATION% --output-on-failure --timeout 310
-
-after_test:
-  # Zip build artifacts for uploading and deploying
-  - cd install
-  - 7z a SPIRV-Tools-master-windows-"%PLATFORM%"-"%CONFIGURATION%".zip *\*
-
-artifacts:
-  - path: build\install\*.zip
-    name: artifacts-zip
-
-deploy:
-  - provider: GitHub
-    auth_token:
-      secure: TMfcScKzzFIm1YgeV/PwCRXFDCw8Xm0wY2Vb2FU6WKlbzb5eUITTpr6I5vHPnAxS
-    release: master-tot
-    description: "Continuous build of the latest master branch by Appveyor and Travis CI"
-    artifact: artifacts-zip
-    draft: false
-    prerelease: false
-    force_update: true
-    on:
-      branch: master
-      APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017

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

@@ -88,8 +88,11 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/composite.cpp \
 		source/opt/const_folding_rules.cpp \
 		source/opt/constants.cpp \
+		source/opt/control_dependence.cpp \
+		source/opt/convert_to_sampled_image_pass.cpp \
 		source/opt/convert_to_half_pass.cpp \
 		source/opt/copy_prop_arrays.cpp \
+		source/opt/dataflow.cpp \
 		source/opt/dead_branch_elim_pass.cpp \
 		source/opt/dead_insert_elim_pass.cpp \
 		source/opt/dead_variable_elimination.cpp \
@@ -97,11 +100,13 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/debug_info_manager.cpp \
 		source/opt/def_use_manager.cpp \
 		source/opt/desc_sroa.cpp \
+		source/opt/desc_sroa_util.cpp \
 		source/opt/dominator_analysis.cpp \
 		source/opt/dominator_tree.cpp \
 		source/opt/eliminate_dead_constant_pass.cpp \
 		source/opt/eliminate_dead_functions_pass.cpp \
 		source/opt/eliminate_dead_functions_util.cpp \
+		source/opt/eliminate_dead_input_components_pass.cpp \
 		source/opt/eliminate_dead_members_pass.cpp \
 		source/opt/feature_manager.cpp \
 		source/opt/fix_storage_class.cpp \
@@ -122,6 +127,7 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/instruction.cpp \
 		source/opt/instruction_list.cpp \
 		source/opt/instrument_pass.cpp \
+		source/opt/interp_fixup_pass.cpp \
 		source/opt/ir_context.cpp \
 		source/opt/ir_loader.cpp \
 		source/opt/licm_pass.cpp \
@@ -151,17 +157,21 @@ SPVTOOLS_OPT_SRC_FILES := \
 		source/opt/redundancy_elimination.cpp \
 		source/opt/register_pressure.cpp \
 		source/opt/relax_float_ops_pass.cpp \
+		source/opt/remove_dontinline_pass.cpp \
 		source/opt/remove_duplicates_pass.cpp \
+		source/opt/remove_unused_interface_variables_pass.cpp \
+		source/opt/replace_desc_array_access_using_var_index.cpp \
 		source/opt/replace_invalid_opc.cpp \
 		source/opt/scalar_analysis.cpp \
 		source/opt/scalar_analysis_simplification.cpp \
 		source/opt/scalar_replacement_pass.cpp \
 		source/opt/set_spec_constant_default_value_pass.cpp \
 		source/opt/simplification_pass.cpp \
+		source/opt/spread_volatile_semantics.cpp \
 		source/opt/ssa_rewrite_pass.cpp \
 		source/opt/strength_reduction_pass.cpp \
 		source/opt/strip_debug_info_pass.cpp \
-		source/opt/strip_reflect_info_pass.cpp \
+		source/opt/strip_nonsemantic_info_pass.cpp \
 		source/opt/struct_cfg_analysis.cpp \
 		source/opt/type_manager.cpp \
 		source/opt/types.cpp \
@@ -179,6 +189,7 @@ SPV_GLSL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.glsl.st
 SPV_OPENCL_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.opencl.std.100.grammar.json
 SPV_DEBUGINFO_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.debuginfo.grammar.json
 SPV_CLDEBUGINFO100_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json
+SPV_VKDEBUGINFO100_GRAMMAR=$(SPVHEADERS_LOCAL_PATH)/include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json
 
 define gen_spvtools_grammar_tables
 $(call generate-file-dir,$(1)/core.insts-unified1.inc)
@@ -210,6 +221,7 @@ $(LOCAL_PATH)/source/ext_inst.cpp: \
 	$(1)/opencl.std.insts.inc \
 	$(1)/debuginfo.insts.inc \
 	$(1)/opencl.debuginfo.100.insts.inc \
+	$(1)/nonsemantic.shader.debuginfo.100.insts.inc \
 	$(1)/spv-amd-gcn-shader.insts.inc \
 	$(1)/spv-amd-shader-ballot.insts.inc \
 	$(1)/spv-amd-shader-explicit-vertex-parameter.insts.inc \
@@ -239,6 +251,7 @@ endef
 # We generate language-specific headers for DebugInfo and OpenCL.DebugInfo.100
 $(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),DebugInfo,$(SPV_DEBUGINFO_GRAMMAR)))
 $(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),OpenCLDebugInfo100,$(SPV_CLDEBUGINFO100_GRAMMAR)))
+$(eval $(call gen_spvtools_lang_headers,$(SPVTOOLS_OUT_PATH),NonSemanticShaderDebugInfo100,$(SPV_VKDEBUGINFO100_GRAMMAR)))
 
 
 define gen_spvtools_vendor_tables
@@ -256,6 +269,7 @@ endef
 # Vendor and debug extended instruction sets, with grammars from SPIRV-Tools source tree.
 $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),debuginfo,""))
 $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),opencl.debuginfo.100,"CLDEBUG100_"))
+$(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),nonsemantic.shader.debuginfo.100,"SHDEBUG100_"))
 $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-gcn-shader,""))
 $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-ballot,""))
 $(eval $(call gen_spvtools_vendor_tables,$(SPVTOOLS_OUT_PATH),spv-amd-shader-explicit-vertex-parameter,""))

+ 45 - 0
ThirdParty/Glslang/External/spirv-tools/BUILD.bazel

@@ -3,6 +3,7 @@ load(
     "COMMON_COPTS",
     "DEBUGINFO_GRAMMAR_JSON_FILE",
     "CLDEBUGINFO100_GRAMMAR_JSON_FILE",
+    "SHDEBUGINFO100_GRAMMAR_JSON_FILE",
     "TEST_COPTS",
     "base_test",
     "generate_core_tables",
@@ -12,6 +13,7 @@ load(
     "generate_opencl_tables",
     "generate_vendor_tables",
     "link_test",
+    "lint_test",
     "opt_test",
     "reduce_test",
     "util_test",
@@ -59,12 +61,16 @@ generate_vendor_tables("debuginfo")
 
 generate_vendor_tables("opencl.debuginfo.100", "CLDEBUG100_")
 
+generate_vendor_tables("nonsemantic.shader.debuginfo.100", "SHDEBUG100_")
+
 generate_vendor_tables("nonsemantic.clspvreflection")
 
 generate_extinst_lang_headers("DebugInfo", DEBUGINFO_GRAMMAR_JSON_FILE)
 
 generate_extinst_lang_headers("OpenCLDebugInfo100", CLDEBUGINFO100_GRAMMAR_JSON_FILE)
 
+generate_extinst_lang_headers("NonSemanticShaderDebugInfo100", SHDEBUGINFO100_GRAMMAR_JSON_FILE)
+
 py_binary(
     name = "generate_registry_tables",
     srcs = ["utils/generate_registry_tables.py"],
@@ -75,6 +81,7 @@ genrule(
     srcs = ["@spirv_headers//:spirv_xml_registry"],
     outs = ["generators.inc"],
     cmd = "$(location generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
+    cmd_bat = "$(location //:generate_registry_tables) --xml=$(location @spirv_headers//:spirv_xml_registry) --generator-output=$(location generators.inc)",
     tools = [":generate_registry_tables"],
 )
 
@@ -88,6 +95,7 @@ genrule(
     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)",
     tools = [":update_build_version"],
 )
 
@@ -101,12 +109,14 @@ cc_library(
         ":gen_enum_string_mapping",
         ":gen_extinst_lang_headers_DebugInfo",
         ":gen_extinst_lang_headers_OpenCLDebugInfo100",
+        ":gen_extinst_lang_headers_NonSemanticShaderDebugInfo100",
         ":gen_glsl_tables_unified1",
         ":gen_opencl_tables_unified1",
         ":gen_registry_tables",
         ":gen_vendor_tables_debuginfo",
         ":gen_vendor_tables_nonsemantic_clspvreflection",
         ":gen_vendor_tables_opencl_debuginfo_100",
+        ":gen_vendor_tables_nonsemantic_shader_debuginfo_100",
         ":gen_vendor_tables_spv_amd_gcn_shader",
         ":gen_vendor_tables_spv_amd_shader_ballot",
         ":gen_vendor_tables_spv_amd_shader_explicit_vertex_parameter",
@@ -225,6 +235,19 @@ cc_library(
     ],
 )
 
+cc_library(
+    name = "spirv_tools_lint",
+    srcs = glob(["source/lint/*.cpp", "source/lint/*.h"]),
+    hdrs = ["include/spirv-tools/linter.hpp"],
+    copts = COMMON_COPTS,
+    linkstatic = 1,
+    visibility = ["//visibility:public"],
+    deps = [
+        ":spirv_tools",
+        ":spirv_tools_opt",
+    ],
+)
+
 cc_library(
     name = "tools_util",
     srcs = glob(["tools/util/*.cpp"]),
@@ -322,6 +345,21 @@ cc_binary(
     ],
 )
 
+cc_binary(
+    name = "spirv-lint",
+    srcs = [
+        "tools/io.h",
+        "tools/lint/lint.cpp",
+    ],
+    copts = COMMON_COPTS,
+    visibility = ["//visibility:public"],
+    deps = [
+        ":spirv_tools",
+        ":spirv_tools_lint",
+        ":tools_util",
+    ],
+)
+
 cc_binary(
     name = "spirv-cfg",
     srcs = [
@@ -465,6 +503,13 @@ base_test(
     ["test/link/*.cpp"],
 )]
 
+[lint_test(
+    name = f[10:-4],  # strip test/lint/, .cpp
+    srcs = [f],
+) for f in glob(
+    ["test/lint/*.cpp"],
+)]
+
 [opt_test(
     name = f[9:-4],  # strip test/opt/, .cpp
     srcs = [f],

Datei-Diff unterdrückt, da er zu groß ist
+ 644 - 150
ThirdParty/Glslang/External/spirv-tools/BUILD.gn


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

@@ -1,7 +1,154 @@
 Revision history for SPIRV-Tools
 
-v2020.7-dev 2020-12-07
- - Start v2020.7-dev
+v2022.2-dev 2022-01-26
+  - Start v2022.2-dev
+
+v2022.1 2022-01-26
+  - General
+    - Add SPIR-V 1.6 support to wasm build (#4674)
+    - Improvements to disassembly within PassManager (#4677)
+    - Basic support for SPIR-V 1.6 (#4663)
+    - reflect debug (#4662)
+    - Fix endianness of string literals (#4622)
+  - Optimizer
+    - spirv-opt: add pass to Spread Volatile semantics (#4667)
+    - Fix constant propagation and folding of FClamp instructions (#4651)
+    - Manually fold floating point division by zero (#4637)
+    - Allow ADCE to remove dead inputs (#4629)
+  - Linker
+    - Linker improvements (#4679)
+      * test/linker: Code factorisation and small tweaks
+      * linker: Do not fail when going over limits
+  - Validator
+    - val: interface struct with builtins must be Block (#4665)
+  - Fuzzer
+    - Avoid id bound errors during opt fuzzing (#4658)
+    - Avoid uninitialised read when parsing hex float (#4646)
+
+v2021.4 2021-11-11
+  - General
+    - Add a WebAssembly build (#3752)
+    - Make cxx exceptions controllable (#4591)
+  - Validator
+    - Improve decoration validation (#4490)
+  - Optimizer
+    - Add spirv-opt pass to replace descriptor accesses based on variable indices (#4574)
+    - Do not fold snegate feeding sdiv (#4600)
+    - Handle overflowing id in merge return (#4606)
+  - Fuzzer
+    - Add libFuzzer target for spirv-fuzz (#4434)
+  - Linter
+
+v2021.3 2021-08-24
+ - General
+    - Initial support for SPV_KHR_integer_dot_product (#4327)
+    - Add non-semantic vulkan extended instruction set (#4362)
+    - Add common enum for debug info instructions from either opencl or vulkan (#4377)
+ - Validator
+    - Add validation for SPV_EXT_shader_atomic_float16_add (#4325)
+    - Disallow loading a runtime-sized array (#4473)
+    - spirv-val: Validate vulkan debug info similarly to opencl debug info (#4466)
+ - Optimizer
+    - spirv-opt: support SPV_EXT_shader_image_int64 (#4379)
+    - spirv-opt: Add dataflow analysis framework (#4402)
+    - Add control dependence analysis to opt (#4380)
+    - Add spirv-opt convert-to-sampled-image pass (#4340)
+    - spirv-opt: Add handling of vulkan debug info to DebugInfoManager (#4423)
+ - Fuzz
+    - spirv-fuzz: support AtomicLoad (#4330)
+    - spirv-fuzz: Support AtomicStore (#4440)
+    - spirv-fuzz: TransformationWrapVectorSynonym that rewrites scalar operations using vectors (#4376)
+    - spirv-fuzz: Add minimal SPIR-V example to test shaders (#4415)
+    - spirv-fuzz: support building using gn (#4365)
+ - Linter
+    - Add new target for spirv-lint (#4446)
+    - spirv-lint: add basic CLI argument handling (#4478)
+    - Add divergence analysis to linter (#4465)
+
+v2021.2 2021-06-18
+ - General
+    - Support SPV_KHR_subgroup_uniform_control_flow (#4318)
+    - Support Intel extensions for fixed point and hls-float (#4321)
+    - Fix crash when optimizing shaders with DebugPrintf (#4280)
+
+ - Validator
+    - Support Vulkan Storage Class for Execution Model (#4212)
+
+ - Optimizer
+    - Handle SPV_KHR_vulkan_memory_model in dead-code elimination (#4320)
+    - Support folding OpBitcast with numeric constants (#4247)
+
+ - Fuzz
+    - Add tests for MaybeGet* functions in fuzzerutil (#4284)
+    - Fix OutlineFunction in presence of unreachable blocks (#4308)
+    - Fix def-use update in PermutePhiOperands (#4309)
+    - Swap positions of two functions in a module (#4236)
+
+v2021.1 2021-04-19
+ - General
+    - Support SPV_KHR_linkonce_odr, SPV_KHR_expect_assume (#4161)
+    - Fixes for the vscode language server extension (#4150)
+ - Validator
+    - Add validation for SPV_EXT_shader_atomic_float_min_max (#4105)
+    - Add Vulkan Execution Scope checks (#4183)
+    - Vulkan 64-bit OpAtomicStore check (#4163)
+ - Optimizer
+    - Add interpolate legalization pass (#4220)
+ - Fuzz
+    - Various performance optimizations
+    - Do not add too many dead blocks (#4217)
+    - Add WGSL compatibility flag to context (#4193)
+    - Add persistent state to the fuzzer (#4137)
+
+v2020.7 2021-02-16
+ - General
+    - Support pending Intel extensions (#4116)
+    - Remove WebGPU support (#4108)
+ - Validator
+    - Vulkan image gather constant component (#4133)
+    - Add Vulkan PSB64 convert VUID (#4122)
+    - Validate SPV_KHR_workgroup_memory_explicit_layout (#4128)
+    - Validate VK_KHR_zero_initialize_workgroup_memory (#4124)
+    - Add Vulkan image gather offset VUID (#4118)
+    - Label Vulkan atomic semantics VUIDs (#4120)
+    - Label VUID 04662 (#4123)
+    - Label VUID 04683 (#4121)
+    - Add Vulkan EXT builtins (#4115)
+    - Validate Sampled=1 for Vulkan ImageQuerySizeLod, ImageQueryLevels, ImageQueryLod (#4103)
+    - Add Vulkan Memory Scope VUs (#4106)
+    - Add Vulkan Addressing Model check (#4107)
+    - Vulkan atomic storage class (#4079)
+    - Label standalone Vulkan VUID (#4091)
+    - Add Vulkan decroation VUID (#4090)
+    - Add Vulkan FP Mode VUID (#4088)
+    - Fix Vulkan image sampled check (#4085)
+    - Add Vulkan ForwardPointer VUID (#4089)
+    - Add Vulkan ImageTexelPointer format check (#4087)
+    - Add Vulkan Group Operation VUID (#4086)
+    - Add first StandAlone VUID 04633 (#4077)
+    - Add Subgroup VUIDs (#4074)
+    - validate return type of OpImageRead (#4072)
+    - tighter validation of multisampled images (#4059)
+    - validate OpTypeImage Sampled values for environemnts (#4064)
+    - validate StorageImageMultisampled capability (#4062)
+    - Add last TessLevelOuter and TessLevelInner VUID (#4055)
+    - Add last ClipDistance and CullDistance VUID (#4054)
+    - Add last ViewportIndex and Layer VUID (#4053)
+    - Add last Position VUID (#4052)
+    - Allow forward pointer to be used in types generally (#4044)
+ - Optimizer
+    - Mark module as modified if convert-to-half removes decorations (#4127)
+    - Fix binding number calculation in desc sroa (#4095)
+    - Run DCE when SPV_KHR_shader_clock is used (#4049)
+ - Debug Info
+    - Set correct scope and line info for DebugValue (#4125)
+    - Avoid integrity check failures caused by propagating line instructions (#4096)
+ - Linker
+    - Linker usability improvements (#4084)
+ - Instrumentation
+    - Generate differentiated error codes for buffer oob checking (#4097)
+ - Fuzz
+    - Fix OpPhi handling in DuplicateRegionWithSelection (#4065)
 
 v2020.6 2020-12-07
  - General

+ 18 - 5
ThirdParty/Glslang/External/spirv-tools/CMakeLists.txt

@@ -33,6 +33,7 @@ include(GNUInstallDirs)
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 set(CMAKE_CXX_STANDARD 11)
 
+option(ENABLE_RTTI "Enables RTTI" OFF)
 option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
 
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
@@ -48,6 +49,8 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
   add_definitions(-DSPIRV_MAC)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS")
   add_definitions(-DSPIRV_IOS)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "tvOS")
+  add_definitions(-DSPIRV_TVOS)
 elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
   add_definitions(-DSPIRV_ANDROID)
   set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
@@ -81,6 +84,10 @@ endif(SPIRV_BUILD_COMPRESSION)
 
 option(SPIRV_BUILD_FUZZER "Build spirv-fuzz" OFF)
 
+set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to control, via link options, which fuzzing engine should be used")
+
+option(SPIRV_BUILD_LIBFUZZER_TARGETS "Build libFuzzer targets" OFF)
+
 option(SPIRV_WERROR "Enable error on warning" ON)
 if(("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") AND (NOT CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")))
   set(COMPILER_IS_LIKE_GNU TRUE)
@@ -109,7 +116,7 @@ if(${COMPILER_IS_LIKE_GNU})
     set(SPIRV_WARNINGS ${SPIRV_WARNINGS} -Werror)
   endif()
 elseif(MSVC)
-  set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800)
+  set(SPIRV_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS /wd4800 /wd4819)
 
   if(${SPIRV_WERROR})
     set(SPIRV_WARNINGS ${SPIRV_WARNINGS} /WX)
@@ -157,6 +164,7 @@ endif()
 #   Note this target provides no API stability guarantees.
 #
 # Ideally, all of these will go away - see https://github.com/KhronosGroup/SPIRV-Tools/issues/3909.
+option(ENABLE_EXCEPTIONS_ON_MSVC "Build SPIRV-TOOLS with c++ exceptions enabled in MSVC" ON)
 option(SPIRV_TOOLS_BUILD_STATIC "Build ${SPIRV_TOOLS}-static target. ${SPIRV_TOOLS} will alias to ${SPIRV_TOOLS}-static or ${SPIRV_TOOLS}-shared based on BUILD_SHARED_LIBS" ON)
 if(SPIRV_TOOLS_BUILD_STATIC)
   set(SPIRV_TOOLS_FULL_VISIBILITY ${SPIRV_TOOLS}-static)
@@ -176,11 +184,14 @@ function(spvtools_default_compile_options TARGET)
   target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS})
 
   if (${COMPILER_IS_LIKE_GNU})
-    target_compile_options(${TARGET} PRIVATE
-      -std=c++11 -fno-exceptions -fno-rtti)
+    target_compile_options(${TARGET} PRIVATE -std=c++11 -fno-exceptions)
     target_compile_options(${TARGET} PRIVATE
       -Wall -Wextra -Wno-long-long -Wshadow -Wundef -Wconversion
       -Wno-sign-conversion)
+
+    if(NOT ENABLE_RTTI)
+        add_compile_options(-fno-rtti)
+    endif()
     # For good call stacks in profiles, keep the frame pointers.
     if(NOT "${SPIRV_PERF}" STREQUAL "")
       target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer)
@@ -205,7 +216,9 @@ function(spvtools_default_compile_options TARGET)
   if (MSVC)
     # Specify /EHs for exception handling. This makes using SPIRV-Tools as
     # dependencies in other projects easier.
-    target_compile_options(${TARGET} PRIVATE /EHs)
+    if(ENABLE_EXCEPTIONS_ON_MSVC)
+      target_compile_options(${TARGET} PRIVATE /EHs)
+    endif()
   endif()
 
   # For MinGW cross compile, statically link to the C++ runtime.
@@ -286,7 +299,7 @@ endif()
 # Turn off if they take too long.
 option(SPIRV_CHECK_CONTEXT "In a debug build, check if the IR context is in a valid state." ON)
 if (${SPIRV_CHECK_CONTEXT})
-  add_definitions(-DSPIRV_CHECK_CONTEXT)
+  add_compile_options($<$<CONFIG:Debug>:-DSPIRV_CHECK_CONTEXT>)
 endif()
 
 # Precompiled header macro. Parameters are source file list and filename for pch cpp file.

+ 0 - 7
ThirdParty/Glslang/External/spirv-tools/CONTRIBUTING.md

@@ -98,13 +98,6 @@ should pay particular attention to:
     scenarios? The respective SPIR-V dialects are slightly different.
 *   Changes are made to a container while iterating through it. You have to be
     careful that iterators are not invalidated or that elements are not skipped.
-*   C++11 and VS2013. We generally assume that we have a C++11 compliant
-    compiler. However, on Windows, we still support Visual Studio 2013, which is
-    not fully C++11 compliant. See
-    [here](https://msdn.microsoft.com/en-us/library/hh567368.aspx). In
-    particular, note that it does not provide default move-constructors or
-    move-assignments for classes. In general, r-value references do not work the
-    way you might assume they do.
 *   For SPIR-V transforms: The module is changed, but the analyses are not
     updated. For example, a new instruction is added, but the def-use manager is
     not updated. Later on, it is possible that the def-use manager will be used,

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

@@ -3,10 +3,10 @@ use_relative_paths = True
 vars = {
   'github': 'https://github.com',
 
-  'effcee_revision': '2ec8f8738118cc483b67c04a759fee53496c5659',
-  'googletest_revision': '3af06fe1664d30f98de1e78c53a7087e842a2547',
-  're2_revision': 'ca11026a032ce2a3de4b3c389ee53d2bdc8794d6',
-  'spirv_headers_revision': 'faa570afbc91ac73d594d787486bcf8f2df1ace0',
+  'effcee_revision': 'ddf5e2bb92957dc8a12c5392f8495333d6844133',
+  'googletest_revision': 'f45d5865ed0b2b8912244627cdf508a24cc6ccb4',
+  're2_revision': '611baecbcedc9cec1f46e38616b6d8880b676c03',
+  'spirv_headers_revision': '6a55fade62dec6a406a5a721148f88a2211cbefa',
 }
 
 deps = {

+ 136 - 60
ThirdParty/Glslang/External/spirv-tools/README.md

@@ -21,7 +21,6 @@ headers, and XML registry.
 
 ## Downloads
 
-[![Build status](https://ci.appveyor.com/api/projects/status/gpue87cesrx3pi0d/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/spirv-tools/branch/master)
 <img alt="Linux" src="kokoro/img/linux.png" width="20px" height="20px" hspace="2px"/>[![Linux Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_linux_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html)
 <img alt="MacOS" src="kokoro/img/macos.png" width="20px" height="20px" hspace="2px"/>[![MacOS Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_macos_clang_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html)
 <img alt="Windows" src="kokoro/img/windows.png" width="20px" height="20px" hspace="2px"/>[![Windows Build Status](https://storage.googleapis.com/spirv-tools/badges/build_status_windows_release.svg)](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_release.html)
@@ -45,6 +44,20 @@ following versions are ordered from oldest to newest:
 Use the `--version` option on each command line tool to see the software
 version.  An API call reports the software version as a C-style string.
 
+## Releases
+
+Some versions of SPIRV-Tools are tagged as stable releases (see
+[tags](https://github.com/KhronosGroup/SPIRV-Tools/tags) on github).
+These versions undergo extra testing.
+Releases are not directly related to releases (or versions) of
+[SPIRV-Headers][spirv-headers].
+Releases of SPIRV-Tools are tested against the version of SPIRV-Headers listed
+in the [DEPS](DEPS) file.
+The release generally uses the most recent compatible version of SPIRV-Headers
+available at the time of release.
+No version of SPIRV-Headers other than the one listed in the DEPS file is
+guaranteed to work with the SPIRV-Tools release.
+
 ## Supported features
 
 ### Assembler, binary parser, and disassembler
@@ -199,6 +212,24 @@ issue](https://github.com/KhronosGroup/SPIRV-Tools/issues]) with
 "Fuzzer:" as the start of its title.
 
 
+### Diff
+
+*Note:* The diff tool is still under development.
+
+The diff tool takes two SPIR-V files, either in binary or text format and
+produces a diff-style comparison between the two.  The instructions between the
+src and dst modules are matched as best as the tool can, and output is produced
+(in src id-space) that shows which instructions are removed in src, added in dst
+or modified between them.  The order of instructions are not retained.
+
+Matching instructions between two SPIR-V modules is not trivial, and thus a
+number of heuristics are applied in this tool.  In particular, without debug
+information, match functions is nontrivial as they can be reordered.  As such,
+this tool is primarily useful to produce the diff of two SPIR-V modules derived
+from the same source, for example before and after a modification to the shader,
+before and after a transformation, or SPIR-V produced from different tools.
+
+
 ### Extras
 
 * [Utility filters](#utility-filters)
@@ -242,6 +273,34 @@ Contributions via merge request are welcome. Changes should:
 
 We intend to maintain a linear history on the GitHub `master` branch.
 
+### Getting the source
+
+Example of getting sources, assuming SPIRV-Tools is configured as a standalone project:
+
+    git clone https://github.com/KhronosGroup/SPIRV-Tools.git   spirv-tools
+    cd spirv-tools
+
+    # Check out sources for dependencies, at versions known to work together,
+    # as listed in the DEPS file.
+    python3 utils/git-sync-deps
+
+For some kinds of development, you may need the latest sources from the third-party projects:
+
+    git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers
+    git clone https://github.com/google/googletest.git          spirv-tools/external/googletest
+    git clone https://github.com/google/effcee.git              spirv-tools/external/effcee
+    git clone https://github.com/google/re2.git                 spirv-tools/external/re2
+
+#### Dependency on Effcee
+
+Some tests depend on the [Effcee][effcee] library for stateful matching.
+Effcee itself depends on [RE2][re2].
+
+* If SPIRV-Tools is configured as part of a larger project that already uses
+  Effcee, then that project should include Effcee before SPIRV-Tools.
+* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee`
+  and RE2 sources to appear in `external/re2`.
+
 ### Source code organization
 
 * `example`: demo code of using SPIRV-Tools APIs
@@ -260,14 +319,6 @@ We intend to maintain a linear history on the GitHub `master` branch.
 * `test/`: Tests, using the [googletest][googletest] framework
 * `tools/`: Command line executables
 
-Example of getting sources, assuming SPIRV-Tools is configured as a standalone project:
-
-    git clone https://github.com/KhronosGroup/SPIRV-Tools.git   spirv-tools
-    git clone https://github.com/KhronosGroup/SPIRV-Headers.git spirv-tools/external/spirv-headers
-    git clone https://github.com/google/googletest.git          spirv-tools/external/googletest
-    git clone https://github.com/google/effcee.git              spirv-tools/external/effcee
-    git clone https://github.com/google/re2.git                 spirv-tools/external/re2
-
 ### Tests
 
 The project contains a number of tests, used to drive development
@@ -281,46 +332,12 @@ tests:
   `googletest` source into the `<spirv-dir>/external/googletest` directory before
   configuring and building the project.
 
-*Note*: You must use a version of googletest that includes
-[a fix][googletest-pull-612] for [googletest issue 610][googletest-issue-610].
-The fix is included on the googletest master branch any time after 2015-11-10.
-In particular, googletest must be newer than version 1.7.0.
-
-### Dependency on Effcee
-
-Some tests depend on the [Effcee][effcee] library for stateful matching.
-Effcee itself depends on [RE2][re2].
-
-* If SPIRV-Tools is configured as part of a larger project that already uses
-  Effcee, then that project should include Effcee before SPIRV-Tools.
-* Otherwise, SPIRV-Tools expects Effcee sources to appear in `external/effcee`
-  and RE2 sources to appear in `external/re2`.
-
-
 ## Build
 
-Instead of building manually, you can also download the binaries for your
-platform directly from the [master-tot release][master-tot-release] on GitHub.
-Those binaries are automatically uploaded by the buildbots after successful
-testing and they always reflect the current top of the tree of the master
-branch.
-
-In order to build the code, you first need to sync the external repositories
-that it depends on. Assume that `<spirv-dir>` is the root directory of the
-checked out code:
-
-```sh
-cd <spirv-dir>
-git clone https://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
-git clone https://github.com/google/effcee.git external/effcee
-git clone https://github.com/google/re2.git external/re2
-git clone https://github.com/google/googletest.git external/googletest # optional
-
-```
+*Note*: Prebuilt binaries are available from the [downloads](docs/downloads.md) page.
 
-*Note*:
-The script `utils/git-sync-deps` can be used to checkout and/or update the
-contents of the repos under `external/` instead of manually maintaining them.
+First [get the sources](#getting-the-source).
+Then build using CMake, Bazel, Android ndk-build, or the Emscripten SDK.
 
 ### Build using CMake
 You can build the project using [CMake][cmake]:
@@ -348,7 +365,7 @@ option, like so:
 
 ```sh
 # In <spirv-dir> (the SPIRV-Tools repo root):
-git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf
+git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf
 
 # In your build directory:
 cmake [-G <platform-generator>] <spirv-dir> -DSPIRV_BUILD_FUZZER=ON
@@ -365,6 +382,30 @@ You can also use [Bazel](https://bazel.build/) to build the project.
 cd <spirv-dir>
 bazel build :all
 ```
+### Build a node.js package using Emscripten
+
+The SPIRV-Tools core library can be built to a WebAssembly [node.js](https://nodejs.org)
+module. The resulting `SpirvTools` WebAssembly module only exports methods to
+assemble and disassemble SPIR-V modules.
+
+First, make sure you have the [Emscripten SDK](https://emscripten.org).
+Then:
+
+```sh
+cd <spirv-dir>
+./source/wasm/build.sh
+```
+
+The resulting node package, with JavaScript and TypeScript bindings, is
+written to `<spirv-dir>/out/web`.
+
+Note: This builds the package locally. It does *not* publish it to [npm](https://npmjs.org).
+
+To test the result:
+
+```sh
+node ./test/wasm/test.js
+```
 
 ### Tools you'll need
 
@@ -376,17 +417,19 @@ targets, you need to install CMake Version 2.8.12 or later.
 - [Python 3](http://www.python.org/): for utility scripts and running the test
 suite.
 - [Bazel](https://bazel.build/) (optional): if building the source with Bazel,
-you need to install Bazel Version 0.29.1 on your machine. Other versions may
+you need to install Bazel Version 5.0.0 on your machine. Other versions may
 also work, but are not verified.
+- [Emscripten SDK](https://emscripten.org) (optional): if building the
+  WebAssembly module.
 
 SPIRV-Tools is regularly tested with the following compilers:
 
 On Linux
-- GCC version 4.8.5
-- Clang version 3.8
+- GCC version 9.3
+- Clang version 10.0
 
 On MacOS
-- AppleClang 10.0
+- AppleClang 11.0
 
 On Windows
 - Visual Studio 2015
@@ -421,7 +464,7 @@ via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to
 `/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and
 iterator debugging.
 
-### Android
+### Android ndk-build
 
 SPIR-V Tools supports building static libraries `libSPIRV-Tools.a` and
 `libSPIRV-Tools-opt.a` for Android:
@@ -442,11 +485,12 @@ $ANDROID_NDK/ndk-build -C ../android_test     \
 ```
 
 ### Updating DEPS
-Occasionally the entries in DEPS will need to be updated. This is done on demand
-when there is a request to do this, often due to downstream breakages. There is
-a script `utils/roll_deps.sh` provided, which will generate a patch with the
-updated DEPS values. This will still need to be tested in your checkout to
-confirm that there are no integration issues that need to be resolved.
+
+Occasionally the entries in [DEPS](DEPS) will need to be updated. This is done on
+demand when there is a request to do this, often due to downstream breakages.
+To update `DEPS`, run `utils/roll_deps.sh` and confirm that tests pass.
+The script requires Chromium's
+[`depot_tools`](https://chromium.googlesource.com/chromium/tools/depot_tools).
 
 ## Library
 
@@ -598,6 +642,15 @@ This is experimental.
 * `spirv-cfg` - the control flow graph dumper
   * `<spirv-dir>/tools/cfg`
 
+### Diff tool
+
+*Warning:* This functionality is under development, and is incomplete.
+
+The diff tool produces a diff-style comparison between two SPIR-V modules.
+
+* `spirv-diff` - the standalone diff tool
+  * `<spirv-dir>`/tools/diff`
+
 ### Utility filters
 
 * `spirv-lesspipe.sh` - Automatically disassembles `.spv` binary files for the
@@ -643,8 +696,32 @@ This is experimental.
 
 ### Tests
 
-Tests are only built when googletest is found. Use `ctest` to run all the
-tests.
+Tests are only built when googletest is found.
+
+#### Running test with CMake
+
+Use `ctest -j <num threads>` to run all the tests. To run tests using all threads:
+```shell
+ctest -j$(nproc)
+```
+
+To run a single test target, use `ctest [-j <N>] -R <test regex>`. For example,
+you can run all `opt` tests with:
+```shell
+ctest -R 'spirv-tools-test_opt'
+```
+
+#### Running test with Bazel
+
+Use `bazel test :all` to run all tests. This will run tests in parallel by default.
+
+To run a single test target, specify `:my_test_target` instead of `:all`. Test target
+names get printed when you run `bazel test :all`. For example, you can run
+`opt_def_use_test` with:
+```shell
+bazel test :opt_def_use_test
+```
+
 
 ## Future Work
 <a name="future"></a>
@@ -705,4 +782,3 @@ limitations under the License.
 [CMake]: https://cmake.org/
 [cpp-style-guide]: https://google.github.io/styleguide/cppguide.html
 [clang-sanitizers]: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
-[master-tot-release]: https://github.com/KhronosGroup/SPIRV-Tools/releases/tag/master-tot

+ 55 - 0
ThirdParty/Glslang/External/spirv-tools/build_defs.bzl

@@ -41,6 +41,7 @@ TEST_COPTS = COMMON_COPTS + select({
 
 DEBUGINFO_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_debuginfo_grammar_unified1"
 CLDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_opencl_debuginfo_100_grammar_unified1"
+SHDEBUGINFO100_GRAMMAR_JSON_FILE = "@spirv_headers//:spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1"
 
 def generate_core_tables(version = None):
     if not version:
@@ -67,6 +68,14 @@ def generate_core_tables(version = None):
             "--core-insts-output=$(location {3}) " +
             "--operand-kinds-output=$(location {4})"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_grammar_tables) " +
+            "--spirv-core-grammar=$(location {0}) " +
+            "--extinst-debuginfo-grammar=$(location {1}) " +
+            "--extinst-cldebuginfo100-grammar=$(location {2}) " +
+            "--core-insts-output=$(location {3}) " +
+            "--operand-kinds-output=$(location {4})"
+        ).format(*fmtargs),
         tools = [":generate_grammar_tables"],
         visibility = ["//visibility:private"],
     )
@@ -96,6 +105,14 @@ def generate_enum_string_mapping(version = None):
             "--extension-enum-output=$(location {3}) " +
             "--enum-string-mapping-output=$(location {4})"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_grammar_tables) " +
+            "--spirv-core-grammar=$(location {0}) " +
+            "--extinst-debuginfo-grammar=$(location {1}) " +
+            "--extinst-cldebuginfo100-grammar=$(location {2}) " +
+            "--extension-enum-output=$(location {3}) " +
+            "--enum-string-mapping-output=$(location {4})"
+        ).format(*fmtargs),
         tools = [":generate_grammar_tables"],
         visibility = ["//visibility:private"],
     )
@@ -117,6 +134,11 @@ def generate_opencl_tables(version = None):
             "--extinst-opencl-grammar=$(location {0}) " +
             "--opencl-insts-output=$(location {1})"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_grammar_tables) " +
+            "--extinst-opencl-grammar=$(location {0}) " +
+            "--opencl-insts-output=$(location {1})"
+        ).format(*fmtargs),
         tools = [":generate_grammar_tables"],
         visibility = ["//visibility:private"],
     )
@@ -138,6 +160,11 @@ def generate_glsl_tables(version = None):
             "--extinst-glsl-grammar=$(location {0}) " +
             "--glsl-insts-output=$(location {1})"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_grammar_tables) " +
+            "--extinst-glsl-grammar=$(location {0}) " +
+            "--glsl-insts-output=$(location {1})"
+        ).format(*fmtargs),
         tools = [":generate_grammar_tables"],
         visibility = ["//visibility:private"],
     )
@@ -160,6 +187,12 @@ def generate_vendor_tables(extension, operand_kind_prefix = ""):
             "--vendor-insts-output=$(location {1}) " +
             "--vendor-operand-kind-prefix={2}"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_grammar_tables) " +
+            "--extinst-vendor-grammar=$(location {0}) " +
+            "--vendor-insts-output=$(location {1}) " +
+            "--vendor-operand-kind-prefix={2}"
+        ).format(*fmtargs),
         tools = [":generate_grammar_tables"],
         visibility = ["//visibility:private"],
     )
@@ -178,6 +211,11 @@ def generate_extinst_lang_headers(name, grammar = None):
             "--extinst-grammar=$< " +
             "--extinst-output-path=$(location {0})"
         ).format(*fmtargs),
+        cmd_bat = (
+            "$(location :generate_language_headers) " +
+            "--extinst-grammar=$< " +
+            "--extinst-output-path=$(location {0})"
+        ).format(*fmtargs),
         tools = [":generate_language_headers"],
         visibility = ["//visibility:private"],
     )
@@ -201,6 +239,23 @@ def base_test(name, srcs, deps = []):
         ] + deps,
     )
 
+def lint_test(name, srcs, deps = []):
+    if name[-5:] != "_test":
+        name = name + "_test"
+    native.cc_test(
+        name = "lint_" + name,
+        srcs = srcs,
+        compatible_with = [],
+        copts = TEST_COPTS,
+        size = "large",
+        deps = [
+            ":spirv_tools_lint",
+            "@com_google_googletest//:gtest_main",
+            "@com_google_googletest//:gtest",
+            "@com_google_effcee//:effcee",
+        ] + deps,
+    )
+
 def link_test(name, srcs, deps = []):
     if name[-5:] != "_test":
         name = name + "_test"

+ 17 - 3
ThirdParty/Glslang/External/spirv-tools/docs/downloads.md

@@ -1,14 +1,28 @@
 # Downloads
-Download the latest builds.
 
-## Release
+## Latest builds
+
+Download the latest builds of the [master](https://github.com/KhronosGroup/SPIRV-Tools/tree/master) branch.
+
+### Release build
 | Windows | Linux | MacOS |
 | --- | --- | --- |
 | [MSVC 2017](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_release.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_release.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_release.html) |
 | | [gcc](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_release.html) | |
 
-## Debug
+### Debug build
 | Windows | Linux | MacOS |
 | --- | --- | --- |
 | [MSVC 2017](https://storage.googleapis.com/spirv-tools/badges/build_link_windows_vs2017_debug.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_clang_debug.html) | [clang](https://storage.googleapis.com/spirv-tools/badges/build_link_macos_clang_debug.html) |
 | | [gcc](https://storage.googleapis.com/spirv-tools/badges/build_link_linux_gcc_debug.html) | |
+
+
+## Vulkan SDK
+
+SPIRV-Tools is published as part of the [LunarG Vulkan SDK](https://www.lunarg.com/vulkan-sdk/).
+The Vulkan SDK is updated approximately every six weeks.
+
+## Android NDK
+
+SPIRV-Tools host executables, and library sources are published as
+part of the [Android NDK](https://developer.android.com/ndk/downloads).

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/docs/spirv-fuzz.md

@@ -53,7 +53,7 @@ See `transformation_set_selection_control.h` for an example.
 
 The `IsApplicable` method should have a comment in the header file describing the conditions for applicability in simple terms.  These conditions should be implemented in the body of this method in the `.cpp` file.
 
-In the case of `TransformationSetSelectionControl`, `IsApplicable` involves checking that `block_id` is indeed the id of a block that has an `OpSelectoinMerge` instruction, and that `selection_control` is a valid selection mask.
+In the case of `TransformationSetSelectionControl`, `IsApplicable` involves checking that `block_id` is indeed the id of a block that has an `OpSelectionMerge` instruction, and that `selection_control` is a valid selection mask.
 
 The `Apply` method should have a comment in the header file summarising the result of applying the transformation.  It should be implemented in the `.cpp` file, and you should assume that `IsApplicable` holds whenever `Apply` is invoked.
 

+ 5 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/BUILD.bazel

@@ -91,6 +91,11 @@ filegroup(
     srcs = ["include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json"],
 )
 
+filegroup(
+    name = "spirv_ext_inst_nonsemantic_shader_debuginfo_100_grammar_unified1",
+    srcs = ["include/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json"],
+)
+
 filegroup(
     name = "spirv_ext_inst_spv_amd_gcn_shader_grammar_unified1",
     srcs = ["include/spirv/unified1/extinst.spv-amd-gcn-shader.grammar.json"],

+ 8 - 2
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/CMakeLists.txt

@@ -29,7 +29,7 @@
 # https://www.khronos.org/registry/spir-v/
 #
 cmake_minimum_required(VERSION 3.0)
-project(SPIRV-Headers VERSION 1.5.1)
+project(SPIRV-Headers VERSION 1.5.5)
 
 # There are two ways to use this project.
 #
@@ -79,7 +79,7 @@ target_include_directories(${PROJECT_NAME} INTERFACE
 if (SPIRV_HEADERS_ENABLE_INSTALL)
     message(STATUS "Installing SPIRV-Header")
 
-    set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+    set(config_install_dir "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}")
 
     set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
 
@@ -124,4 +124,10 @@ if (SPIRV_HEADERS_ENABLE_INSTALL)
         NAMESPACE "${namespace}"
         DESTINATION "${config_install_dir}"
     )
+
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SPIRV-Headers.pc.in ${CMAKE_BINARY_DIR}/SPIRV-Headers.pc @ONLY)
+    install(
+        FILES "${CMAKE_BINARY_DIR}/SPIRV-Headers.pc"
+        DESTINATION ${CMAKE_INSTALL_DATADIR}/pkgconfig
+    )
 endif()

+ 12 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/README.md

@@ -140,10 +140,21 @@ and can be used to test a PR, or even to include the results in the PR.
 This is not required though.
 
 The header-generation project is under the `tools/buildHeaders` directory.
-Use CMake to build the project, in a `build` subdirectory (under `tools/buildHeaders`).
+Use CMake to build and install the project, in a `build` subdirectory (under `tools/buildHeaders`).
 There is then a bash script at `bin/makeHeaders` that shows how to use the built
 header-generator binary to generate the headers from the JSON grammar.
 (Execute `bin/makeHeaders` from the `tools/buildHeaders` directory.)
+Here's a complete example:
+
+```
+cd tools/buildHeaders
+mkdir build
+cd build
+cmake ..
+cmake --build . --target install
+cd ..
+./bin/makeHeaders
+```
 
 Notes:
 - this generator is used in a broader context within Khronos to generate the specification,

+ 84 - 9
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml

@@ -55,7 +55,7 @@
         <id value="2"   vendor="Valve"      comment="Contact TBD"/>
         <id value="3"   vendor="Codeplay"   comment="Contact Victor Lomuller, [email protected]"/>
         <id value="4"   vendor="NVIDIA"     comment="Contact Kerch Holt, [email protected]"/>
-        <id value="5"   vendor="ARM"        comment="Contact Alexander Galazin, alexander.galazin@arm.com"/>
+        <id value="5"   vendor="ARM"        comment="Contact Kevin Petit, kevin.petit@arm.com"/>
         <id value="6"   vendor="Khronos" tool="LLVM/SPIR-V Translator" comment="Contact Yaxun (Sam) Liu, [email protected]"/>
         <id value="7"   vendor="Khronos" tool="SPIR-V Tools Assembler" comment="Contact David Neto, [email protected]"/>
         <id value="8"   vendor="Khronos" tool="Glslang Reference Front End" comment="Contact John Kessenich, [email protected]"/>
@@ -69,7 +69,7 @@
         <id value="16"  vendor="X-LEGEND"   tool="Mesa-IR/SPIR-V Translator" comment="Contact Metora Wang, github:metora/MesaGLSLCompiler"/>
         <id value="17"  vendor="Khronos" tool="SPIR-V Tools Linker" comment="Contact David Neto, [email protected]"/>
         <id value="18"  vendor="Wine" tool="VKD3D Shader Compiler" comment="Contact [email protected]"/>
-        <id value="19"  vendor="Clay" tool="Clay Shader Compiler" comment="Contact info@clayengine.com"/>
+        <id value="19"  vendor="Tellusim" tool="Clay Shader Compiler" comment="Contact info@tellusim.com"/>
         <id value="20"  vendor="W3C WebGPU Group" tool="WHLSL Shader Translator" comment="https://github.com/gpuweb/WHLSL"/>
         <id value="21"  vendor="Google" tool="Clspv" comment="Contact David Neto, [email protected]"/>
         <id value="22"  vendor="Google" tool="MLIR SPIR-V Serializer" comment="Contact Lei Zhang, [email protected]"/>
@@ -78,7 +78,13 @@
         <id value="25"  vendor="Netease Games" tool="Messiah Shader Compiler" comment="Contact Yuwen Wu, [email protected]"/>
         <id value="26"  vendor="Xenia" tool="Xenia Emulator Microcode Translator" comment="Contact Vitaliy Kuzmin, [email protected], https://github.com/xenia-project/xenia"/>
         <id value="27"  vendor="Embark Studios" tool="Rust GPU Compiler Backend" comment="https://github.com/embarkstudios/rust-gpu"/>
-        <unused start="28" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
+        <id value="28"  vendor="gfx-rs community" tool="Naga" comment="https://github.com/gfx-rs/naga"/>
+        <id value="29"  vendor="Mikkosoft Productions" tool="MSP Shader Compiler" comment="Contact Mikko Rasa, [email protected]"/>
+        <id value="30"  vendor="SpvGenTwo community" tool="SpvGenTwo SPIR-V IR Tools" comment="https://github.com/rAzoR8/SpvGenTwo"/>
+        <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"/>
     </ids>
 
     <!-- SECTION: SPIR-V Opcodes and Enumerants -->
@@ -115,7 +121,7 @@
     <!-- Begin reservations of opcode enumerants -->
     <ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
     <ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
-    <ids type="opcode" start="4160" end="4415" vendor="ARM"/>
+    <ids type="opcode" start="4160" end="4415" vendor="ARM" comment="Contact [email protected]"/>
     <ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, [email protected]"/>
     <ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact [email protected]"/>
     <ids type="opcode" start="4992" end="5247" vendor="AMD"/>
@@ -128,20 +134,23 @@
     <ids type="opcode" start="5952" end="6015" vendor="Codeplay" comment="Contact [email protected]"/>
     <ids type="opcode" start="6016" end="6079" vendor="Khronos" comment="Contact @tobski"/>
     <ids type="opcode" start="6080" end="6143" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="opcode" start="6144" end="6271" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="opcode" start="6272" end="6399" vendor="Huawei" comment="Contact [email protected]"/>
+    <ids type="opcode" start="6400" end="6463" vendor="Intel" comment="Contact [email protected]"/>
     <!-- Opcode enumerants to reserve for future use. To get a block, allocate
          multiples of 64 starting at the lowest available point in this
          block and add a corresponding <ids> tag immediately above. Make
          sure to fill in the vendor attribute, and preferably add a contact
          person/address in a comment attribute. -->
     <!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
-    <ids type="opcode" start="6144" end="65535" comment="Opcode range reservable for future use by vendors"/>
+    <ids type="opcode" start="6464" end="65535" comment="Opcode range reservable for future use by vendors"/>
     <!-- End reservations of opcodes -->
 
 
     <!-- Begin reservations of non-opcode enumerants -->
     <ids type="enumerant" start="0" end="4095" vendor="Khronos" comment="Reserved enumerants, not available to vendors - see the SPIR-V Specification"/>
     <ids type="enumerant" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
-    <ids type="enumerant" start="4160" end="4415" vendor="ARM"/>
+    <ids type="enumerant" start="4160" end="4415" vendor="ARM" comment="Contact [email protected]"/>
     <ids type="enumerant" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, [email protected]"/>
     <ids type="enumerant" start="4480" end="4991" vendor="Qualcomm" comment="Contact [email protected]"/>
     <ids type="enumerant" start="4992" end="5247" vendor="AMD"/>
@@ -154,13 +163,17 @@
     <ids type="enumerant" start="5952" end="6015" vendor="Codeplay" comment="Contact [email protected]"/>
     <ids type="enumerant" start="6016" end="6079" vendor="Khronos" comment="Contact @tobski"/>
     <ids type="enumerant" start="6080" end="6143" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="enumerant" start="6144" end="6271" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="enumerant" start="6272" end="6399" vendor="Huawei" comment="Contact [email protected]"/>
+    <ids type="enumerant" start="6400" end="6463" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="enumerant" start="6464" end="6527" vendor="Mikkosoft Productions" comment="Contact Mikko Rasa, [email protected]"/>
     <!-- Enumerants to reserve for future use. To get a block, allocate
          multiples of 64 starting at the lowest available point in this
          block and add a corresponding <ids> tag immediately above. Make
          sure to fill in the vendor attribute, and preferably add a contact
          person/address in a comment attribute. -->
     <!-- Example new block: <ids type="enumerant" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
-    <ids type="enumerant" start="6144" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
+    <ids type="enumerant" start="6528" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
     <!-- End reservations of enumerants -->
 
 
@@ -180,11 +193,32 @@
 
     <!-- Reserved loop control bits -->
     <ids type="LoopControl" start="0" end="15" vendor="Khronos" comment="Reserved LoopControl bits, not available to vendors - see the SPIR-V Specification"/>
-    <ids type="LoopControl" start="16" end="23" vendor="Intel" comment="Contact [email protected]"/>
-    <ids type="LoopControl" start="24" end="30" comment="Unreserved bits reservable for use by vendors"/>
+    <ids type="LoopControl" start="16" end="25" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="LoopControl" start="26" end="30" comment="Unreserved bits reservable for use by vendors"/>
     <ids type="LoopControl" start="31" end="31" vendor="Khronos" comment="Reserved LoopControl bit, not available to vendors"/>
 
 
+    <!-- SECTION: SPIR-V Function Control Bit Reservations -->
+    <!-- Reserve ranges of bits in the function control bitfield.
+
+         Each vendor determines the use of values in their own ranges.
+         Vendors are not required to disclose those uses.  If the use of a
+         value is included in an extension that is adopted by a Khronos
+         extension or specification, then that value's use may be permanently
+         fixed as if originally reserved in a Khronos range.
+
+         The SPIR Working Group strongly recommends:
+         - Each value is used for only one purpose.
+         - All values in a range should be used before allocating a new range.
+         -->
+
+    <!-- Reserved function control bits -->
+    <ids type="FunctionControl" start="0" end="15" vendor="Khronos" comment="Reserved FunctionControl bits, not available to vendors - see the SPIR-V Specification"/>
+    <ids type="FunctionControl" start="16" end="16" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="FunctionControl" start="17" end="30" comment="Unreserved bits reservable for use by vendors"/>
+    <ids type="FunctionControl" start="31" end="31" vendor="Khronos" comment="Reserved FunctionControl bit, not available to vendors"/>
+
+
     <!-- SECTION: SPIR-V FP Fast Math Mode Bit Reservations -->
     <!-- Reserve ranges of bits in the "FP Fast Math Mode" bitfield.
          Each vendor determines the use of values in their own ranges.
@@ -202,4 +236,45 @@
     <ids type="FPFastMathMode" start="16" end="17" vendor="Intel" comment="Contact [email protected]"/>
     <ids type="FPFastMathMode" start="18" end="31" comment="Unreserved bits reservable for use by vendors"/>
 
+
+    <!-- SECTION: SPIR-V Memory Operand Bit Reservations -->
+    <!-- Reserve ranges of bits in the memory operands bitfield.
+
+         Each vendor determines the use of values in their own ranges.
+         Vendors are not required to disclose those uses.  If the use of a
+         value is included in an extension that is adopted by a Khronos
+         extension or specification, then that value's use may be permanently
+         fixed as if originally reserved in a Khronos range.
+
+         The SPIR Working Group strongly recommends:
+         - Each value is used for only one purpose.
+         - All values in a range should be used before allocating a new range.
+         -->
+
+    <!-- Reserved memory operand bits -->
+    <ids type="MemoryOperand" start="0" end="15" vendor="Khronos" comment="Reserved MemoryOperand bits, not available to vendors - see the SPIR-V Specification"/>
+    <ids type="MemoryOperand" start="16" end="17" vendor="Intel" comment="Contact [email protected]"/>
+    <ids type="MemoryOperand" start="18" end="30" comment="Unreserved bits reservable for use by vendors"/>
+    <ids type="MemoryOperand" start="31" end="31" vendor="Khronos" comment="Reserved MemoryOperand bit, not available to vendors"/>
+
+    <!-- SECTION: SPIR-V Image Operand Bit Reservations -->
+    <!-- Reserve ranges of bits in the image operands bitfield.
+
+         Each vendor determines the use of values in their own ranges.
+         Vendors are not required to disclose those uses.  If the use of a
+         value is included in an extension that is adopted by a Khronos
+         extension or specification, then that value's use may be permanently
+         fixed as if originally reserved in a Khronos range.
+
+         The SPIR Working Group strongly recommends:
+         - Each value is used for only one purpose.
+         - All values in a range should be used before allocating a new range.
+         -->
+
+    <!-- Reserved image operand bits -->
+    <ids type="ImageOperand" start="0" end="15" vendor="Khronos" comment="Reserved ImageOperand bits, not available to vendors - see the SPIR-V Specification"/>
+    <ids type="ImageOperand" start="16" end="16" vendor="Nvidia" comment="Contact [email protected]"/>
+    <ids type="ImageOperand" start="17" end="30" comment="Unreserved bits reservable for use by vendors"/>
+    <ids type="ImageOperand" start="31" end="31" vendor="Khronos" comment="Reserved ImageOperand bit, not available to vendors"/>
+
 </registry>

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

@@ -78,6 +78,7 @@ enum DebugInfoInstructions {
 
 
 enum DebugInfoDebugInfoFlags {
+    DebugInfoNone = 0x0000,
     DebugInfoFlagIsProtected = 0x01,
     DebugInfoFlagIsPrivate = 0x02,
     DebugInfoFlagIsPublic = 0x03,

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

@@ -33,7 +33,7 @@ extern "C" {
 #endif
 
 enum {
-    NonSemanticClspvReflectionRevision = 1,
+    NonSemanticClspvReflectionRevision = 2,
     NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
 };
 
@@ -62,6 +62,7 @@ enum NonSemanticClspvReflectionInstructions {
     NonSemanticClspvReflectionConstantDataUniform = 22,
     NonSemanticClspvReflectionLiteralSampler = 23,
     NonSemanticClspvReflectionPropertyRequiredWorkgroupSize = 24,
+    NonSemanticClspvReflectionSpecConstantSubgroupMaxSize = 25,
     NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
 };
 

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/OpenCLDebugInfo100.h

@@ -75,11 +75,13 @@ enum OpenCLDebugInfo100Instructions {
     OpenCLDebugInfo100DebugMacroUndef = 33,
     OpenCLDebugInfo100DebugImportedEntity = 34,
     OpenCLDebugInfo100DebugSource = 35,
+    OpenCLDebugInfo100DebugModuleINTEL = 36,
     OpenCLDebugInfo100InstructionsMax = 0x7fffffff
 };
 
 
 enum OpenCLDebugInfo100DebugInfoFlags {
+    OpenCLDebugInfo100None = 0x0000,
     OpenCLDebugInfo100FlagIsProtected = 0x01,
     OpenCLDebugInfo100FlagIsPrivate = 0x02,
     OpenCLDebugInfo100FlagIsPublic = 0x03,

+ 4 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.debuginfo.grammar.json

@@ -376,6 +376,10 @@
       "category" : "BitEnum",
       "kind" : "DebugInfoFlags",
       "enumerants" : [
+        {
+          "enumerant" : "None",
+          "value" : "0x0000"
+        },
         {
           "enumerant" : "FlagIsProtected",
           "value" : "0x01"

+ 8 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json

@@ -1,5 +1,5 @@
 {
-  "revision" : 1,
+  "revision" : 2,
   "instructions" : [
     {
       "opname" : "Kernel",
@@ -232,6 +232,13 @@
         { "kind" : "IdRef", "name" : "Y" },
         { "kind" : "IdRef", "name" : "Z" }
       ]
+    },
+    {
+      "opname" : "SpecConstantSubgroupMaxSize",
+      "opcode" : 25,
+      "operands" : [
+        { "kind" : "IdRef", "name" : "Size" }
+      ]
     }
   ]
 }

+ 19 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json

@@ -395,6 +395,21 @@
         { "kind" : "IdRef", "name" : "'File'" },
         { "kind" : "IdRef", "name" : "'Text'", "quantifier" : "?" }
       ]
+    },
+    {
+      "opname" : "DebugModuleINTEL",
+      "opcode" : 36,
+      "operands" : [
+        { "kind" : "IdRef", "name" : "'Name'" },
+        { "kind" : "IdRef", "name" : "'Source'" },
+        { "kind" : "IdRef", "name" : "'Parent'" },
+        { "kind" : "LiteralInteger", "name" : "'Line'" },
+        { "kind" : "IdRef", "name" : "'ConfigurationMacros'" },
+        { "kind" : "IdRef", "name" : "'IncludePath'" },
+        { "kind" : "IdRef", "name" : "'APINotesFile'" },
+        { "kind" : "LiteralInteger", "name" : "'IsDeclaration'" }
+      ],
+      "capability" : "DebugInfoModuleINTEL"
     }
   ],
   "operand_kinds" : [
@@ -402,6 +417,10 @@
       "category" : "BitEnum",
       "kind" : "DebugInfoFlags",
       "enumerants" : [
+        {
+          "enumerant" : "None",
+          "value" : "0x0000"
+        },
         {
           "enumerant" : "FlagIsProtected",
           "value" : "0x01"

Datei-Diff unterdrückt, da er zu groß ist
+ 1345 - 36
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json


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

@@ -48,8 +48,8 @@ namespace Spv
     public static class Specification
     {
         public const uint MagicNumber = 0x07230203;
-        public const uint Version = 0x00010500;
-        public const uint Revision = 4;
+        public const uint Version = 0x00010600;
+        public const uint Revision = 1;
         public const uint OpCodeMask = 0xffff;
         public const uint WordCountShift = 16;
 
@@ -61,6 +61,7 @@ namespace Spv
             OpenCL_C = 3,
             OpenCL_CPP = 4,
             HLSL = 5,
+            CPP_for_OpenCL = 6,
         }
 
         public enum ExecutionModel
@@ -146,6 +147,7 @@ namespace Spv
             SubgroupsPerWorkgroupId = 37,
             LocalSizeId = 38,
             LocalSizeHintId = 39,
+            SubgroupUniformControlFlowKHR = 4421,
             PostDepthCoverage = 4446,
             DenormPreserve = 4459,
             DenormFlushToZero = 4460,
@@ -347,6 +349,8 @@ namespace Spv
             VolatileTexelKHR = 11,
             SignExtend = 12,
             ZeroExtend = 13,
+            Nontemporal = 14,
+            Offsets = 16,
         }
 
         public enum ImageOperandsMask
@@ -370,6 +374,8 @@ namespace Spv
             VolatileTexelKHR = 0x00000800,
             SignExtend = 0x00001000,
             ZeroExtend = 0x00002000,
+            Nontemporal = 0x00004000,
+            Offsets = 0x00010000,
         }
 
         public enum FPFastMathModeShift
@@ -407,6 +413,7 @@ namespace Spv
         {
             Export = 0,
             Import = 1,
+            LinkOnceODR = 2,
         }
 
         public enum AccessQualifier
@@ -487,6 +494,7 @@ namespace Spv
             PerPrimitiveNV = 5271,
             PerViewNV = 5272,
             PerTaskNV = 5273,
+            PerVertexKHR = 5285,
             PerVertexNV = 5285,
             NonUniform = 5300,
             NonUniformEXT = 5300,
@@ -494,6 +502,10 @@ namespace Spv
             RestrictPointerEXT = 5355,
             AliasedPointer = 5356,
             AliasedPointerEXT = 5356,
+            BindlessSamplerNV = 5398,
+            BindlessImageNV = 5399,
+            BoundSamplerNV = 5400,
+            BoundImageNV = 5401,
             SIMTCallINTEL = 5599,
             ReferencedIndirectlyINTEL = 5602,
             ClobberINTEL = 5607,
@@ -528,11 +540,14 @@ namespace Spv
             PrefetchINTEL = 5902,
             StallEnableINTEL = 5905,
             FuseLoopsInFunctionINTEL = 5907,
+            AliasScopeINTEL = 5914,
+            NoAliasINTEL = 5915,
             BufferLocationINTEL = 5921,
             IOPipeStorageINTEL = 5944,
             FunctionFloatingPointModeINTEL = 6080,
             SingleElementVectorINTEL = 6085,
             VectorComputeCallableFunctionINTEL = 6087,
+            MediaBlockIOINTEL = 6140,
         }
 
         public enum BuiltIn
@@ -617,7 +632,9 @@ namespace Spv
             LayerPerViewNV = 5279,
             MeshViewCountNV = 5280,
             MeshViewIndicesNV = 5281,
+            BaryCoordKHR = 5286,
             BaryCoordNV = 5286,
+            BaryCoordNoPerspKHR = 5287,
             BaryCoordNoPerspNV = 5287,
             FragSizeEXT = 5292,
             FragmentSizeNV = 5292,
@@ -648,6 +665,7 @@ namespace Spv
             HitTNV = 5332,
             HitKindKHR = 5333,
             HitKindNV = 5333,
+            CurrentRayTimeNV = 5334,
             IncomingRayFlagsKHR = 5351,
             IncomingRayFlagsNV = 5351,
             RayGeometryIndexKHR = 5352,
@@ -719,6 +737,7 @@ namespace Spv
             DontInline = 1,
             Pure = 2,
             Const = 3,
+            OptNoneINTEL = 16,
         }
 
         public enum FunctionControlMask
@@ -728,6 +747,7 @@ namespace Spv
             DontInline = 0x00000002,
             Pure = 0x00000004,
             Const = 0x00000008,
+            OptNoneINTEL = 0x00010000,
         }
 
         public enum MemorySemanticsShift
@@ -784,6 +804,8 @@ namespace Spv
             MakePointerVisibleKHR = 4,
             NonPrivatePointer = 5,
             NonPrivatePointerKHR = 5,
+            AliasScopeINTELMask = 16,
+            NoAliasINTELMask = 17,
         }
 
         public enum MemoryAccessMask
@@ -798,6 +820,8 @@ namespace Spv
             MakePointerVisibleKHR = 0x00000010,
             NonPrivatePointer = 0x00000020,
             NonPrivatePointerKHR = 0x00000020,
+            AliasScopeINTELMask = 0x00010000,
+            NoAliasINTELMask = 0x00020000,
         }
 
         public enum Scope
@@ -912,6 +936,7 @@ namespace Spv
             GroupNonUniformQuad = 68,
             ShaderLayer = 69,
             ShaderViewportIndex = 70,
+            UniformDecoration = 71,
             FragmentShadingRateKHR = 4422,
             SubgroupBallotKHR = 4423,
             DrawParameters = 4427,
@@ -960,6 +985,7 @@ namespace Spv
             FragmentFullyCoveredEXT = 5265,
             MeshShadingNV = 5266,
             ImageFootprintNV = 5282,
+            FragmentBarycentricKHR = 5284,
             FragmentBarycentricNV = 5284,
             ComputeDerivativeGroupQuadsNV = 5288,
             FragmentDensityEXT = 5291,
@@ -990,6 +1016,7 @@ namespace Spv
             StorageTexelBufferArrayNonUniformIndexing = 5312,
             StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
             RayTracingNV = 5340,
+            RayTracingMotionBlurNV = 5341,
             VulkanMemoryModel = 5345,
             VulkanMemoryModelKHR = 5345,
             VulkanMemoryModelDeviceScope = 5346,
@@ -1003,7 +1030,9 @@ namespace Spv
             FragmentShaderShadingRateInterlockEXT = 5372,
             ShaderSMBuiltinsNV = 5373,
             FragmentShaderPixelInterlockEXT = 5378,
+            DemoteToHelperInvocation = 5379,
             DemoteToHelperInvocationEXT = 5379,
+            BindlessTextureNV = 5390,
             SubgroupShuffleINTEL = 5568,
             SubgroupBufferBlockIOINTEL = 5569,
             SubgroupImageBlockIOINTEL = 5570,
@@ -1014,8 +1043,12 @@ namespace Spv
             FunctionPointersINTEL = 5603,
             IndirectReferencesINTEL = 5604,
             AsmINTEL = 5606,
+            AtomicFloat32MinMaxEXT = 5612,
+            AtomicFloat64MinMaxEXT = 5613,
+            AtomicFloat16MinMaxEXT = 5616,
             VectorComputeINTEL = 5617,
             VectorAnyINTEL = 5619,
+            ExpectAssumeKHR = 5629,
             SubgroupAvcMotionEstimationINTEL = 5696,
             SubgroupAvcMotionEstimationIntraINTEL = 5697,
             SubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -1024,6 +1057,7 @@ namespace Spv
             FPGAMemoryAttributesINTEL = 5824,
             FPFastMathModeINTEL = 5837,
             ArbitraryPrecisionIntegersINTEL = 5844,
+            ArbitraryPrecisionFloatingPointINTEL = 5845,
             UnstructuredLoopControlsINTEL = 5886,
             FPGALoopControlsINTEL = 5888,
             KernelAttributesINTEL = 5892,
@@ -1031,14 +1065,30 @@ namespace Spv
             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,
+            BitInstructions = 6025,
             AtomicFloat32AddEXT = 6033,
             AtomicFloat64AddEXT = 6034,
             LongConstantCompositeINTEL = 6089,
+            OptNoneINTEL = 6094,
+            AtomicFloat16AddEXT = 6095,
+            DebugInfoModuleINTEL = 6114,
+            SplitBarrierINTEL = 6141,
+            GroupUniformArithmeticKHR = 6400,
         }
 
         public enum RayFlagsShift
@@ -1106,14 +1156,42 @@ namespace Spv
             Horizontal4Pixels = 0x00000008,
         }
 
-        public enum FPDenormMode {
-          Preserve = 0,
-          FlushToZero = 1,
+        public enum FPDenormMode
+        {
+            Preserve = 0,
+            FlushToZero = 1,
+        }
+
+        public enum FPOperationMode
+        {
+            IEEE = 0,
+            ALT = 1,
         }
 
-        public enum FPOperationMode {
-          IEEE = 0,
-          ALT = 1,
+        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,
+        }
+
+        public enum OverflowModes
+        {
+            WRAP = 0,
+            SAT = 1,
+            SAT_ZERO = 2,
+            SAT_SYM = 3,
+        }
+
+        public enum PackedVectorFormat
+        {
+            PackedVectorFormat4x8Bit = 0,
+            PackedVectorFormat4x8BitKHR = 0,
         }
 
         public enum Op
@@ -1474,6 +1552,18 @@ namespace Spv
             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,
@@ -1500,6 +1590,8 @@ namespace Spv
             OpIgnoreIntersectionNV = 5335,
             OpTerminateRayNV = 5336,
             OpTraceNV = 5337,
+            OpTraceMotionNV = 5338,
+            OpTraceRayMotionNV = 5339,
             OpTypeAccelerationStructureKHR = 5341,
             OpTypeAccelerationStructureNV = 5341,
             OpExecuteCallableNV = 5344,
@@ -1510,8 +1602,16 @@ namespace Spv
             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,
@@ -1536,11 +1636,15 @@ namespace Spv
             OpUSubSatINTEL = 5596,
             OpIMul32x16INTEL = 5597,
             OpUMul32x16INTEL = 5598,
-            OpConstFunctionPointerINTEL = 5600,
+            OpConstantFunctionPointerINTEL = 5600,
             OpFunctionPointerCallINTEL = 5601,
             OpAsmTargetINTEL = 5609,
             OpAsmINTEL = 5610,
             OpAsmCallINTEL = 5611,
+            OpAtomicFMinEXT = 5614,
+            OpAtomicFMaxEXT = 5615,
+            OpAssumeTrueKHR = 5630,
+            OpExpectKHR = 5631,
             OpDecorateString = 5632,
             OpDecorateStringGOOGLE = 5632,
             OpMemberDecorateString = 5633,
@@ -1666,7 +1770,62 @@ namespace Spv
             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,
@@ -1694,6 +1853,16 @@ namespace Spv
             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,
         }
     }
 }

+ 267 - 13
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h

@@ -53,12 +53,12 @@
 
 typedef unsigned int SpvId;
 
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
 
 static const unsigned int SpvMagicNumber = 0x07230203;
-static const unsigned int SpvVersion = 0x00010500;
-static const unsigned int SpvRevision = 4;
+static const unsigned int SpvVersion = 0x00010600;
+static const unsigned int SpvRevision = 1;
 static const unsigned int SpvOpCodeMask = 0xffff;
 static const unsigned int SpvWordCountShift = 16;
 
@@ -69,6 +69,7 @@ typedef enum SpvSourceLanguage_ {
     SpvSourceLanguageOpenCL_C = 3,
     SpvSourceLanguageOpenCL_CPP = 4,
     SpvSourceLanguageHLSL = 5,
+    SpvSourceLanguageCPP_for_OpenCL = 6,
     SpvSourceLanguageMax = 0x7fffffff,
 } SpvSourceLanguage;
 
@@ -154,6 +155,7 @@ typedef enum SpvExecutionMode_ {
     SpvExecutionModeSubgroupsPerWorkgroupId = 37,
     SpvExecutionModeLocalSizeId = 38,
     SpvExecutionModeLocalSizeHintId = 39,
+    SpvExecutionModeSubgroupUniformControlFlowKHR = 4421,
     SpvExecutionModePostDepthCoverage = 4446,
     SpvExecutionModeDenormPreserve = 4459,
     SpvExecutionModeDenormFlushToZero = 4460,
@@ -355,6 +357,8 @@ typedef enum SpvImageOperandsShift_ {
     SpvImageOperandsVolatileTexelKHRShift = 11,
     SpvImageOperandsSignExtendShift = 12,
     SpvImageOperandsZeroExtendShift = 13,
+    SpvImageOperandsNontemporalShift = 14,
+    SpvImageOperandsOffsetsShift = 16,
     SpvImageOperandsMax = 0x7fffffff,
 } SpvImageOperandsShift;
 
@@ -378,6 +382,8 @@ typedef enum SpvImageOperandsMask_ {
     SpvImageOperandsVolatileTexelKHRMask = 0x00000800,
     SpvImageOperandsSignExtendMask = 0x00001000,
     SpvImageOperandsZeroExtendMask = 0x00002000,
+    SpvImageOperandsNontemporalMask = 0x00004000,
+    SpvImageOperandsOffsetsMask = 0x00010000,
 } SpvImageOperandsMask;
 
 typedef enum SpvFPFastMathModeShift_ {
@@ -413,6 +419,7 @@ typedef enum SpvFPRoundingMode_ {
 typedef enum SpvLinkageType_ {
     SpvLinkageTypeExport = 0,
     SpvLinkageTypeImport = 1,
+    SpvLinkageTypeLinkOnceODR = 2,
     SpvLinkageTypeMax = 0x7fffffff,
 } SpvLinkageType;
 
@@ -493,6 +500,7 @@ typedef enum SpvDecoration_ {
     SpvDecorationPerPrimitiveNV = 5271,
     SpvDecorationPerViewNV = 5272,
     SpvDecorationPerTaskNV = 5273,
+    SpvDecorationPerVertexKHR = 5285,
     SpvDecorationPerVertexNV = 5285,
     SpvDecorationNonUniform = 5300,
     SpvDecorationNonUniformEXT = 5300,
@@ -500,6 +508,10 @@ typedef enum SpvDecoration_ {
     SpvDecorationRestrictPointerEXT = 5355,
     SpvDecorationAliasedPointer = 5356,
     SpvDecorationAliasedPointerEXT = 5356,
+    SpvDecorationBindlessSamplerNV = 5398,
+    SpvDecorationBindlessImageNV = 5399,
+    SpvDecorationBoundSamplerNV = 5400,
+    SpvDecorationBoundImageNV = 5401,
     SpvDecorationSIMTCallINTEL = 5599,
     SpvDecorationReferencedIndirectlyINTEL = 5602,
     SpvDecorationClobberINTEL = 5607,
@@ -534,11 +546,14 @@ typedef enum SpvDecoration_ {
     SpvDecorationPrefetchINTEL = 5902,
     SpvDecorationStallEnableINTEL = 5905,
     SpvDecorationFuseLoopsInFunctionINTEL = 5907,
+    SpvDecorationAliasScopeINTEL = 5914,
+    SpvDecorationNoAliasINTEL = 5915,
     SpvDecorationBufferLocationINTEL = 5921,
     SpvDecorationIOPipeStorageINTEL = 5944,
     SpvDecorationFunctionFloatingPointModeINTEL = 6080,
     SpvDecorationSingleElementVectorINTEL = 6085,
     SpvDecorationVectorComputeCallableFunctionINTEL = 6087,
+    SpvDecorationMediaBlockIOINTEL = 6140,
     SpvDecorationMax = 0x7fffffff,
 } SpvDecoration;
 
@@ -623,7 +638,9 @@ typedef enum SpvBuiltIn_ {
     SpvBuiltInLayerPerViewNV = 5279,
     SpvBuiltInMeshViewCountNV = 5280,
     SpvBuiltInMeshViewIndicesNV = 5281,
+    SpvBuiltInBaryCoordKHR = 5286,
     SpvBuiltInBaryCoordNV = 5286,
+    SpvBuiltInBaryCoordNoPerspKHR = 5287,
     SpvBuiltInBaryCoordNoPerspNV = 5287,
     SpvBuiltInFragSizeEXT = 5292,
     SpvBuiltInFragmentSizeNV = 5292,
@@ -654,6 +671,7 @@ typedef enum SpvBuiltIn_ {
     SpvBuiltInHitTNV = 5332,
     SpvBuiltInHitKindKHR = 5333,
     SpvBuiltInHitKindNV = 5333,
+    SpvBuiltInCurrentRayTimeNV = 5334,
     SpvBuiltInIncomingRayFlagsKHR = 5351,
     SpvBuiltInIncomingRayFlagsNV = 5351,
     SpvBuiltInRayGeometryIndexKHR = 5352,
@@ -723,6 +741,7 @@ typedef enum SpvFunctionControlShift_ {
     SpvFunctionControlDontInlineShift = 1,
     SpvFunctionControlPureShift = 2,
     SpvFunctionControlConstShift = 3,
+    SpvFunctionControlOptNoneINTELShift = 16,
     SpvFunctionControlMax = 0x7fffffff,
 } SpvFunctionControlShift;
 
@@ -732,6 +751,7 @@ typedef enum SpvFunctionControlMask_ {
     SpvFunctionControlDontInlineMask = 0x00000002,
     SpvFunctionControlPureMask = 0x00000004,
     SpvFunctionControlConstMask = 0x00000008,
+    SpvFunctionControlOptNoneINTELMask = 0x00010000,
 } SpvFunctionControlMask;
 
 typedef enum SpvMemorySemanticsShift_ {
@@ -786,6 +806,8 @@ typedef enum SpvMemoryAccessShift_ {
     SpvMemoryAccessMakePointerVisibleKHRShift = 4,
     SpvMemoryAccessNonPrivatePointerShift = 5,
     SpvMemoryAccessNonPrivatePointerKHRShift = 5,
+    SpvMemoryAccessAliasScopeINTELMaskShift = 16,
+    SpvMemoryAccessNoAliasINTELMaskShift = 17,
     SpvMemoryAccessMax = 0x7fffffff,
 } SpvMemoryAccessShift;
 
@@ -800,6 +822,8 @@ typedef enum SpvMemoryAccessMask_ {
     SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010,
     SpvMemoryAccessNonPrivatePointerMask = 0x00000020,
     SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+    SpvMemoryAccessAliasScopeINTELMaskMask = 0x00010000,
+    SpvMemoryAccessNoAliasINTELMaskMask = 0x00020000,
 } SpvMemoryAccessMask;
 
 typedef enum SpvScope_ {
@@ -912,6 +936,7 @@ typedef enum SpvCapability_ {
     SpvCapabilityGroupNonUniformQuad = 68,
     SpvCapabilityShaderLayer = 69,
     SpvCapabilityShaderViewportIndex = 70,
+    SpvCapabilityUniformDecoration = 71,
     SpvCapabilityFragmentShadingRateKHR = 4422,
     SpvCapabilitySubgroupBallotKHR = 4423,
     SpvCapabilityDrawParameters = 4427,
@@ -960,6 +985,7 @@ typedef enum SpvCapability_ {
     SpvCapabilityFragmentFullyCoveredEXT = 5265,
     SpvCapabilityMeshShadingNV = 5266,
     SpvCapabilityImageFootprintNV = 5282,
+    SpvCapabilityFragmentBarycentricKHR = 5284,
     SpvCapabilityFragmentBarycentricNV = 5284,
     SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
     SpvCapabilityFragmentDensityEXT = 5291,
@@ -990,6 +1016,7 @@ typedef enum SpvCapability_ {
     SpvCapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
     SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
     SpvCapabilityRayTracingNV = 5340,
+    SpvCapabilityRayTracingMotionBlurNV = 5341,
     SpvCapabilityVulkanMemoryModel = 5345,
     SpvCapabilityVulkanMemoryModelKHR = 5345,
     SpvCapabilityVulkanMemoryModelDeviceScope = 5346,
@@ -1003,7 +1030,9 @@ typedef enum SpvCapability_ {
     SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372,
     SpvCapabilityShaderSMBuiltinsNV = 5373,
     SpvCapabilityFragmentShaderPixelInterlockEXT = 5378,
+    SpvCapabilityDemoteToHelperInvocation = 5379,
     SpvCapabilityDemoteToHelperInvocationEXT = 5379,
+    SpvCapabilityBindlessTextureNV = 5390,
     SpvCapabilitySubgroupShuffleINTEL = 5568,
     SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
     SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1014,8 +1043,12 @@ typedef enum SpvCapability_ {
     SpvCapabilityFunctionPointersINTEL = 5603,
     SpvCapabilityIndirectReferencesINTEL = 5604,
     SpvCapabilityAsmINTEL = 5606,
+    SpvCapabilityAtomicFloat32MinMaxEXT = 5612,
+    SpvCapabilityAtomicFloat64MinMaxEXT = 5613,
+    SpvCapabilityAtomicFloat16MinMaxEXT = 5616,
     SpvCapabilityVectorComputeINTEL = 5617,
     SpvCapabilityVectorAnyINTEL = 5619,
+    SpvCapabilityExpectAssumeKHR = 5629,
     SpvCapabilitySubgroupAvcMotionEstimationINTEL = 5696,
     SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
     SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -1024,6 +1057,7 @@ typedef enum SpvCapability_ {
     SpvCapabilityFPGAMemoryAttributesINTEL = 5824,
     SpvCapabilityFPFastMathModeINTEL = 5837,
     SpvCapabilityArbitraryPrecisionIntegersINTEL = 5844,
+    SpvCapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
     SpvCapabilityUnstructuredLoopControlsINTEL = 5886,
     SpvCapabilityFPGALoopControlsINTEL = 5888,
     SpvCapabilityKernelAttributesINTEL = 5892,
@@ -1031,14 +1065,30 @@ typedef enum SpvCapability_ {
     SpvCapabilityFPGAMemoryAccessesINTEL = 5898,
     SpvCapabilityFPGAClusterAttributesINTEL = 5904,
     SpvCapabilityLoopFuseINTEL = 5906,
+    SpvCapabilityMemoryAccessAliasingINTEL = 5910,
     SpvCapabilityFPGABufferLocationINTEL = 5920,
+    SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922,
     SpvCapabilityUSMStorageClassesINTEL = 5935,
     SpvCapabilityIOPipesINTEL = 5943,
     SpvCapabilityBlockingPipesINTEL = 5945,
     SpvCapabilityFPGARegINTEL = 5948,
+    SpvCapabilityDotProductInputAll = 6016,
+    SpvCapabilityDotProductInputAllKHR = 6016,
+    SpvCapabilityDotProductInput4x8Bit = 6017,
+    SpvCapabilityDotProductInput4x8BitKHR = 6017,
+    SpvCapabilityDotProductInput4x8BitPacked = 6018,
+    SpvCapabilityDotProductInput4x8BitPackedKHR = 6018,
+    SpvCapabilityDotProduct = 6019,
+    SpvCapabilityDotProductKHR = 6019,
+    SpvCapabilityBitInstructions = 6025,
     SpvCapabilityAtomicFloat32AddEXT = 6033,
     SpvCapabilityAtomicFloat64AddEXT = 6034,
     SpvCapabilityLongConstantCompositeINTEL = 6089,
+    SpvCapabilityOptNoneINTEL = 6094,
+    SpvCapabilityAtomicFloat16AddEXT = 6095,
+    SpvCapabilityDebugInfoModuleINTEL = 6114,
+    SpvCapabilitySplitBarrierINTEL = 6141,
+    SpvCapabilityGroupUniformArithmeticKHR = 6400,
     SpvCapabilityMax = 0x7fffffff,
 } SpvCapability;
 
@@ -1106,17 +1156,43 @@ typedef enum SpvFragmentShadingRateMask_ {
 } SpvFragmentShadingRateMask;
 
 typedef enum SpvFPDenormMode_ {
-  SpvFPDenormModePreserve = 0,
-  SpvFPDenormModeFlushToZero = 1,
-  SpvFPDenormModeMax = 0x7fffffff,
+    SpvFPDenormModePreserve = 0,
+    SpvFPDenormModeFlushToZero = 1,
+    SpvFPDenormModeMax = 0x7fffffff,
 } SpvFPDenormMode;
 
 typedef enum SpvFPOperationMode_ {
-  SpvFPOperationModeIEEE = 0,
-  SpvFPOperationModeALT = 1,
-  SpvFPOperationModeMax = 0x7fffffff,
+    SpvFPOperationModeIEEE = 0,
+    SpvFPOperationModeALT = 1,
+    SpvFPOperationModeMax = 0x7fffffff,
 } SpvFPOperationMode;
 
+typedef enum SpvQuantizationModes_ {
+    SpvQuantizationModesTRN = 0,
+    SpvQuantizationModesTRN_ZERO = 1,
+    SpvQuantizationModesRND = 2,
+    SpvQuantizationModesRND_ZERO = 3,
+    SpvQuantizationModesRND_INF = 4,
+    SpvQuantizationModesRND_MIN_INF = 5,
+    SpvQuantizationModesRND_CONV = 6,
+    SpvQuantizationModesRND_CONV_ODD = 7,
+    SpvQuantizationModesMax = 0x7fffffff,
+} SpvQuantizationModes;
+
+typedef enum SpvOverflowModes_ {
+    SpvOverflowModesWRAP = 0,
+    SpvOverflowModesSAT = 1,
+    SpvOverflowModesSAT_ZERO = 2,
+    SpvOverflowModesSAT_SYM = 3,
+    SpvOverflowModesMax = 0x7fffffff,
+} SpvOverflowModes;
+
+typedef enum SpvPackedVectorFormat_ {
+    SpvPackedVectorFormatPackedVectorFormat4x8Bit = 0,
+    SpvPackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
+    SpvPackedVectorFormatMax = 0x7fffffff,
+} SpvPackedVectorFormat;
+
 typedef enum SpvOp_ {
     SpvOpNop = 0,
     SpvOpUndef = 1,
@@ -1474,6 +1550,18 @@ typedef enum SpvOp_ {
     SpvOpConvertUToAccelerationStructureKHR = 4447,
     SpvOpIgnoreIntersectionKHR = 4448,
     SpvOpTerminateRayKHR = 4449,
+    SpvOpSDot = 4450,
+    SpvOpSDotKHR = 4450,
+    SpvOpUDot = 4451,
+    SpvOpUDotKHR = 4451,
+    SpvOpSUDot = 4452,
+    SpvOpSUDotKHR = 4452,
+    SpvOpSDotAccSat = 4453,
+    SpvOpSDotAccSatKHR = 4453,
+    SpvOpUDotAccSat = 4454,
+    SpvOpUDotAccSatKHR = 4454,
+    SpvOpSUDotAccSat = 4455,
+    SpvOpSUDotAccSatKHR = 4455,
     SpvOpTypeRayQueryKHR = 4472,
     SpvOpRayQueryInitializeKHR = 4473,
     SpvOpRayQueryTerminateKHR = 4474,
@@ -1500,6 +1588,8 @@ typedef enum SpvOp_ {
     SpvOpIgnoreIntersectionNV = 5335,
     SpvOpTerminateRayNV = 5336,
     SpvOpTraceNV = 5337,
+    SpvOpTraceMotionNV = 5338,
+    SpvOpTraceRayMotionNV = 5339,
     SpvOpTypeAccelerationStructureKHR = 5341,
     SpvOpTypeAccelerationStructureNV = 5341,
     SpvOpExecuteCallableNV = 5344,
@@ -1510,8 +1600,16 @@ typedef enum SpvOp_ {
     SpvOpCooperativeMatrixLengthNV = 5362,
     SpvOpBeginInvocationInterlockEXT = 5364,
     SpvOpEndInvocationInterlockEXT = 5365,
+    SpvOpDemoteToHelperInvocation = 5380,
     SpvOpDemoteToHelperInvocationEXT = 5380,
     SpvOpIsHelperInvocationEXT = 5381,
+    SpvOpConvertUToImageNV = 5391,
+    SpvOpConvertUToSamplerNV = 5392,
+    SpvOpConvertImageToUNV = 5393,
+    SpvOpConvertSamplerToUNV = 5394,
+    SpvOpConvertUToSampledImageNV = 5395,
+    SpvOpConvertSampledImageToUNV = 5396,
+    SpvOpSamplerImageAddressingModeNV = 5397,
     SpvOpSubgroupShuffleINTEL = 5571,
     SpvOpSubgroupShuffleDownINTEL = 5572,
     SpvOpSubgroupShuffleUpINTEL = 5573,
@@ -1536,11 +1634,15 @@ typedef enum SpvOp_ {
     SpvOpUSubSatINTEL = 5596,
     SpvOpIMul32x16INTEL = 5597,
     SpvOpUMul32x16INTEL = 5598,
-    SpvOpConstFunctionPointerINTEL = 5600,
+    SpvOpConstantFunctionPointerINTEL = 5600,
     SpvOpFunctionPointerCallINTEL = 5601,
     SpvOpAsmTargetINTEL = 5609,
     SpvOpAsmINTEL = 5610,
     SpvOpAsmCallINTEL = 5611,
+    SpvOpAtomicFMinEXT = 5614,
+    SpvOpAtomicFMaxEXT = 5615,
+    SpvOpAssumeTrueKHR = 5630,
+    SpvOpExpectKHR = 5631,
     SpvOpDecorateString = 5632,
     SpvOpDecorateStringGOOGLE = 5632,
     SpvOpMemberDecorateString = 5633,
@@ -1666,7 +1768,62 @@ typedef enum SpvOp_ {
     SpvOpVariableLengthArrayINTEL = 5818,
     SpvOpSaveMemoryINTEL = 5819,
     SpvOpRestoreMemoryINTEL = 5820,
+    SpvOpArbitraryFloatSinCosPiINTEL = 5840,
+    SpvOpArbitraryFloatCastINTEL = 5841,
+    SpvOpArbitraryFloatCastFromIntINTEL = 5842,
+    SpvOpArbitraryFloatCastToIntINTEL = 5843,
+    SpvOpArbitraryFloatAddINTEL = 5846,
+    SpvOpArbitraryFloatSubINTEL = 5847,
+    SpvOpArbitraryFloatMulINTEL = 5848,
+    SpvOpArbitraryFloatDivINTEL = 5849,
+    SpvOpArbitraryFloatGTINTEL = 5850,
+    SpvOpArbitraryFloatGEINTEL = 5851,
+    SpvOpArbitraryFloatLTINTEL = 5852,
+    SpvOpArbitraryFloatLEINTEL = 5853,
+    SpvOpArbitraryFloatEQINTEL = 5854,
+    SpvOpArbitraryFloatRecipINTEL = 5855,
+    SpvOpArbitraryFloatRSqrtINTEL = 5856,
+    SpvOpArbitraryFloatCbrtINTEL = 5857,
+    SpvOpArbitraryFloatHypotINTEL = 5858,
+    SpvOpArbitraryFloatSqrtINTEL = 5859,
+    SpvOpArbitraryFloatLogINTEL = 5860,
+    SpvOpArbitraryFloatLog2INTEL = 5861,
+    SpvOpArbitraryFloatLog10INTEL = 5862,
+    SpvOpArbitraryFloatLog1pINTEL = 5863,
+    SpvOpArbitraryFloatExpINTEL = 5864,
+    SpvOpArbitraryFloatExp2INTEL = 5865,
+    SpvOpArbitraryFloatExp10INTEL = 5866,
+    SpvOpArbitraryFloatExpm1INTEL = 5867,
+    SpvOpArbitraryFloatSinINTEL = 5868,
+    SpvOpArbitraryFloatCosINTEL = 5869,
+    SpvOpArbitraryFloatSinCosINTEL = 5870,
+    SpvOpArbitraryFloatSinPiINTEL = 5871,
+    SpvOpArbitraryFloatCosPiINTEL = 5872,
+    SpvOpArbitraryFloatASinINTEL = 5873,
+    SpvOpArbitraryFloatASinPiINTEL = 5874,
+    SpvOpArbitraryFloatACosINTEL = 5875,
+    SpvOpArbitraryFloatACosPiINTEL = 5876,
+    SpvOpArbitraryFloatATanINTEL = 5877,
+    SpvOpArbitraryFloatATanPiINTEL = 5878,
+    SpvOpArbitraryFloatATan2INTEL = 5879,
+    SpvOpArbitraryFloatPowINTEL = 5880,
+    SpvOpArbitraryFloatPowRINTEL = 5881,
+    SpvOpArbitraryFloatPowNINTEL = 5882,
     SpvOpLoopControlINTEL = 5887,
+    SpvOpAliasDomainDeclINTEL = 5911,
+    SpvOpAliasScopeDeclINTEL = 5912,
+    SpvOpAliasScopeListDeclINTEL = 5913,
+    SpvOpFixedSqrtINTEL = 5923,
+    SpvOpFixedRecipINTEL = 5924,
+    SpvOpFixedRsqrtINTEL = 5925,
+    SpvOpFixedSinINTEL = 5926,
+    SpvOpFixedCosINTEL = 5927,
+    SpvOpFixedSinCosINTEL = 5928,
+    SpvOpFixedSinPiINTEL = 5929,
+    SpvOpFixedCosPiINTEL = 5930,
+    SpvOpFixedSinCosPiINTEL = 5931,
+    SpvOpFixedLogINTEL = 5932,
+    SpvOpFixedExpINTEL = 5933,
     SpvOpPtrCastToCrossWorkgroupINTEL = 5934,
     SpvOpCrossWorkgroupCastToPtrINTEL = 5938,
     SpvOpReadPipeBlockingINTEL = 5946,
@@ -1694,10 +1851,23 @@ typedef enum SpvOp_ {
     SpvOpTypeStructContinuedINTEL = 6090,
     SpvOpConstantCompositeContinuedINTEL = 6091,
     SpvOpSpecConstantCompositeContinuedINTEL = 6092,
+    SpvOpControlBarrierArriveINTEL = 6142,
+    SpvOpControlBarrierWaitINTEL = 6143,
+    SpvOpGroupIMulKHR = 6401,
+    SpvOpGroupFMulKHR = 6402,
+    SpvOpGroupBitwiseAndKHR = 6403,
+    SpvOpGroupBitwiseOrKHR = 6404,
+    SpvOpGroupBitwiseXorKHR = 6405,
+    SpvOpGroupLogicalAndKHR = 6406,
+    SpvOpGroupLogicalOrKHR = 6407,
+    SpvOpGroupLogicalXorKHR = 6408,
     SpvOpMax = 0x7fffffff,
 } SpvOp;
 
 #ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
 inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) {
     *hasResult = *hasResultType = false;
     switch (opcode) {
@@ -2058,6 +2228,12 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
     case SpvOpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+    case SpvOpSDot: *hasResult = true; *hasResultType = true; break;
+    case SpvOpUDot: *hasResult = true; *hasResultType = true; break;
+    case SpvOpSUDot: *hasResult = true; *hasResultType = true; break;
+    case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
     case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
     case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
     case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2083,6 +2259,8 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
     case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
     case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break;
+    case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+    case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
     case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
     case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
     case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
@@ -2092,8 +2270,15 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
     case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
     case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
-    case SpvOpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+    case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
     case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
     case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2118,11 +2303,15 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
-    case SpvOpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpAsmINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
+    case SpvOpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
+    case SpvOpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
+    case SpvOpExpectKHR: *hasResult = true; *hasResultType = true; break;
     case SpvOpDecorateString: *hasResult = false; *hasResultType = false; break;
     case SpvOpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
     case SpvOpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2246,7 +2435,62 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+    case SpvOpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+    case SpvOpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case SpvOpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case SpvOpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case SpvOpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case SpvOpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
     case SpvOpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2274,6 +2518,16 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
     case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
+    case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+    case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
+    case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
     }
 }
 #endif /* SPV_ENABLE_UTILITY_CODE */

+ 267 - 13
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp

@@ -49,12 +49,12 @@ namespace spv {
 
 typedef unsigned int Id;
 
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
 
 static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
+static const unsigned int Version = 0x00010600;
+static const unsigned int Revision = 1;
 static const unsigned int OpCodeMask = 0xffff;
 static const unsigned int WordCountShift = 16;
 
@@ -65,6 +65,7 @@ enum SourceLanguage {
     SourceLanguageOpenCL_C = 3,
     SourceLanguageOpenCL_CPP = 4,
     SourceLanguageHLSL = 5,
+    SourceLanguageCPP_for_OpenCL = 6,
     SourceLanguageMax = 0x7fffffff,
 };
 
@@ -150,6 +151,7 @@ enum ExecutionMode {
     ExecutionModeSubgroupsPerWorkgroupId = 37,
     ExecutionModeLocalSizeId = 38,
     ExecutionModeLocalSizeHintId = 39,
+    ExecutionModeSubgroupUniformControlFlowKHR = 4421,
     ExecutionModePostDepthCoverage = 4446,
     ExecutionModeDenormPreserve = 4459,
     ExecutionModeDenormFlushToZero = 4460,
@@ -351,6 +353,8 @@ enum ImageOperandsShift {
     ImageOperandsVolatileTexelKHRShift = 11,
     ImageOperandsSignExtendShift = 12,
     ImageOperandsZeroExtendShift = 13,
+    ImageOperandsNontemporalShift = 14,
+    ImageOperandsOffsetsShift = 16,
     ImageOperandsMax = 0x7fffffff,
 };
 
@@ -374,6 +378,8 @@ enum ImageOperandsMask {
     ImageOperandsVolatileTexelKHRMask = 0x00000800,
     ImageOperandsSignExtendMask = 0x00001000,
     ImageOperandsZeroExtendMask = 0x00002000,
+    ImageOperandsNontemporalMask = 0x00004000,
+    ImageOperandsOffsetsMask = 0x00010000,
 };
 
 enum FPFastMathModeShift {
@@ -409,6 +415,7 @@ enum FPRoundingMode {
 enum LinkageType {
     LinkageTypeExport = 0,
     LinkageTypeImport = 1,
+    LinkageTypeLinkOnceODR = 2,
     LinkageTypeMax = 0x7fffffff,
 };
 
@@ -489,6 +496,7 @@ enum Decoration {
     DecorationPerPrimitiveNV = 5271,
     DecorationPerViewNV = 5272,
     DecorationPerTaskNV = 5273,
+    DecorationPerVertexKHR = 5285,
     DecorationPerVertexNV = 5285,
     DecorationNonUniform = 5300,
     DecorationNonUniformEXT = 5300,
@@ -496,6 +504,10 @@ enum Decoration {
     DecorationRestrictPointerEXT = 5355,
     DecorationAliasedPointer = 5356,
     DecorationAliasedPointerEXT = 5356,
+    DecorationBindlessSamplerNV = 5398,
+    DecorationBindlessImageNV = 5399,
+    DecorationBoundSamplerNV = 5400,
+    DecorationBoundImageNV = 5401,
     DecorationSIMTCallINTEL = 5599,
     DecorationReferencedIndirectlyINTEL = 5602,
     DecorationClobberINTEL = 5607,
@@ -530,11 +542,14 @@ enum Decoration {
     DecorationPrefetchINTEL = 5902,
     DecorationStallEnableINTEL = 5905,
     DecorationFuseLoopsInFunctionINTEL = 5907,
+    DecorationAliasScopeINTEL = 5914,
+    DecorationNoAliasINTEL = 5915,
     DecorationBufferLocationINTEL = 5921,
     DecorationIOPipeStorageINTEL = 5944,
     DecorationFunctionFloatingPointModeINTEL = 6080,
     DecorationSingleElementVectorINTEL = 6085,
     DecorationVectorComputeCallableFunctionINTEL = 6087,
+    DecorationMediaBlockIOINTEL = 6140,
     DecorationMax = 0x7fffffff,
 };
 
@@ -619,7 +634,9 @@ enum BuiltIn {
     BuiltInLayerPerViewNV = 5279,
     BuiltInMeshViewCountNV = 5280,
     BuiltInMeshViewIndicesNV = 5281,
+    BuiltInBaryCoordKHR = 5286,
     BuiltInBaryCoordNV = 5286,
+    BuiltInBaryCoordNoPerspKHR = 5287,
     BuiltInBaryCoordNoPerspNV = 5287,
     BuiltInFragSizeEXT = 5292,
     BuiltInFragmentSizeNV = 5292,
@@ -650,6 +667,7 @@ enum BuiltIn {
     BuiltInHitTNV = 5332,
     BuiltInHitKindKHR = 5333,
     BuiltInHitKindNV = 5333,
+    BuiltInCurrentRayTimeNV = 5334,
     BuiltInIncomingRayFlagsKHR = 5351,
     BuiltInIncomingRayFlagsNV = 5351,
     BuiltInRayGeometryIndexKHR = 5352,
@@ -719,6 +737,7 @@ enum FunctionControlShift {
     FunctionControlDontInlineShift = 1,
     FunctionControlPureShift = 2,
     FunctionControlConstShift = 3,
+    FunctionControlOptNoneINTELShift = 16,
     FunctionControlMax = 0x7fffffff,
 };
 
@@ -728,6 +747,7 @@ enum FunctionControlMask {
     FunctionControlDontInlineMask = 0x00000002,
     FunctionControlPureMask = 0x00000004,
     FunctionControlConstMask = 0x00000008,
+    FunctionControlOptNoneINTELMask = 0x00010000,
 };
 
 enum MemorySemanticsShift {
@@ -782,6 +802,8 @@ enum MemoryAccessShift {
     MemoryAccessMakePointerVisibleKHRShift = 4,
     MemoryAccessNonPrivatePointerShift = 5,
     MemoryAccessNonPrivatePointerKHRShift = 5,
+    MemoryAccessAliasScopeINTELMaskShift = 16,
+    MemoryAccessNoAliasINTELMaskShift = 17,
     MemoryAccessMax = 0x7fffffff,
 };
 
@@ -796,6 +818,8 @@ enum MemoryAccessMask {
     MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
     MemoryAccessNonPrivatePointerMask = 0x00000020,
     MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+    MemoryAccessAliasScopeINTELMaskMask = 0x00010000,
+    MemoryAccessNoAliasINTELMaskMask = 0x00020000,
 };
 
 enum Scope {
@@ -908,6 +932,7 @@ enum Capability {
     CapabilityGroupNonUniformQuad = 68,
     CapabilityShaderLayer = 69,
     CapabilityShaderViewportIndex = 70,
+    CapabilityUniformDecoration = 71,
     CapabilityFragmentShadingRateKHR = 4422,
     CapabilitySubgroupBallotKHR = 4423,
     CapabilityDrawParameters = 4427,
@@ -956,6 +981,7 @@ enum Capability {
     CapabilityFragmentFullyCoveredEXT = 5265,
     CapabilityMeshShadingNV = 5266,
     CapabilityImageFootprintNV = 5282,
+    CapabilityFragmentBarycentricKHR = 5284,
     CapabilityFragmentBarycentricNV = 5284,
     CapabilityComputeDerivativeGroupQuadsNV = 5288,
     CapabilityFragmentDensityEXT = 5291,
@@ -986,6 +1012,7 @@ enum Capability {
     CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
     CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
     CapabilityRayTracingNV = 5340,
+    CapabilityRayTracingMotionBlurNV = 5341,
     CapabilityVulkanMemoryModel = 5345,
     CapabilityVulkanMemoryModelKHR = 5345,
     CapabilityVulkanMemoryModelDeviceScope = 5346,
@@ -999,7 +1026,9 @@ enum Capability {
     CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
     CapabilityShaderSMBuiltinsNV = 5373,
     CapabilityFragmentShaderPixelInterlockEXT = 5378,
+    CapabilityDemoteToHelperInvocation = 5379,
     CapabilityDemoteToHelperInvocationEXT = 5379,
+    CapabilityBindlessTextureNV = 5390,
     CapabilitySubgroupShuffleINTEL = 5568,
     CapabilitySubgroupBufferBlockIOINTEL = 5569,
     CapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1010,8 +1039,12 @@ enum Capability {
     CapabilityFunctionPointersINTEL = 5603,
     CapabilityIndirectReferencesINTEL = 5604,
     CapabilityAsmINTEL = 5606,
+    CapabilityAtomicFloat32MinMaxEXT = 5612,
+    CapabilityAtomicFloat64MinMaxEXT = 5613,
+    CapabilityAtomicFloat16MinMaxEXT = 5616,
     CapabilityVectorComputeINTEL = 5617,
     CapabilityVectorAnyINTEL = 5619,
+    CapabilityExpectAssumeKHR = 5629,
     CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
     CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
     CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -1020,6 +1053,7 @@ enum Capability {
     CapabilityFPGAMemoryAttributesINTEL = 5824,
     CapabilityFPFastMathModeINTEL = 5837,
     CapabilityArbitraryPrecisionIntegersINTEL = 5844,
+    CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
     CapabilityUnstructuredLoopControlsINTEL = 5886,
     CapabilityFPGALoopControlsINTEL = 5888,
     CapabilityKernelAttributesINTEL = 5892,
@@ -1027,14 +1061,30 @@ enum Capability {
     CapabilityFPGAMemoryAccessesINTEL = 5898,
     CapabilityFPGAClusterAttributesINTEL = 5904,
     CapabilityLoopFuseINTEL = 5906,
+    CapabilityMemoryAccessAliasingINTEL = 5910,
     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,
+    CapabilityBitInstructions = 6025,
     CapabilityAtomicFloat32AddEXT = 6033,
     CapabilityAtomicFloat64AddEXT = 6034,
     CapabilityLongConstantCompositeINTEL = 6089,
+    CapabilityOptNoneINTEL = 6094,
+    CapabilityAtomicFloat16AddEXT = 6095,
+    CapabilityDebugInfoModuleINTEL = 6114,
+    CapabilitySplitBarrierINTEL = 6141,
+    CapabilityGroupUniformArithmeticKHR = 6400,
     CapabilityMax = 0x7fffffff,
 };
 
@@ -1102,15 +1152,41 @@ enum FragmentShadingRateMask {
 };
 
 enum FPDenormMode {
-  FPDenormModePreserve = 0,
-  FPDenormModeFlushToZero = 1,
-  FPDenormModeMax = 0x7fffffff,
+    FPDenormModePreserve = 0,
+    FPDenormModeFlushToZero = 1,
+    FPDenormModeMax = 0x7fffffff,
 };
 
 enum FPOperationMode {
-  FPOperationModeIEEE = 0,
-  FPOperationModeALT = 1,
-  FPOperationModeMax = 0x7fffffff,
+    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 {
@@ -1470,6 +1546,18 @@ enum Op {
     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,
@@ -1496,6 +1584,8 @@ enum Op {
     OpIgnoreIntersectionNV = 5335,
     OpTerminateRayNV = 5336,
     OpTraceNV = 5337,
+    OpTraceMotionNV = 5338,
+    OpTraceRayMotionNV = 5339,
     OpTypeAccelerationStructureKHR = 5341,
     OpTypeAccelerationStructureNV = 5341,
     OpExecuteCallableNV = 5344,
@@ -1506,8 +1596,16 @@ enum Op {
     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,
@@ -1532,11 +1630,15 @@ enum Op {
     OpUSubSatINTEL = 5596,
     OpIMul32x16INTEL = 5597,
     OpUMul32x16INTEL = 5598,
-    OpConstFunctionPointerINTEL = 5600,
+    OpConstantFunctionPointerINTEL = 5600,
     OpFunctionPointerCallINTEL = 5601,
     OpAsmTargetINTEL = 5609,
     OpAsmINTEL = 5610,
     OpAsmCallINTEL = 5611,
+    OpAtomicFMinEXT = 5614,
+    OpAtomicFMaxEXT = 5615,
+    OpAssumeTrueKHR = 5630,
+    OpExpectKHR = 5631,
     OpDecorateString = 5632,
     OpDecorateStringGOOGLE = 5632,
     OpMemberDecorateString = 5633,
@@ -1662,7 +1764,62 @@ enum Op {
     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,
@@ -1690,10 +1847,23 @@ enum Op {
     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,
     OpMax = 0x7fffffff,
 };
 
 #ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
 inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     *hasResult = *hasResultType = false;
     switch (opcode) {
@@ -2054,6 +2224,12 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     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;
@@ -2079,6 +2255,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
     case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
     case OpTraceNV: *hasResult = false; *hasResultType = false; break;
+    case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+    case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
     case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
     case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
     case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
@@ -2088,8 +2266,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
     case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
     case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
-    case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+    case 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;
@@ -2114,11 +2299,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
     case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
     case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
-    case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+    case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
     case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
     case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
     case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
     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;
@@ -2242,7 +2431,62 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     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 OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case OpAliasScopeListDeclINTEL: *hasResult = true; *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;
@@ -2270,6 +2514,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+    case OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
+    case OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
     }
 }
 #endif /* SPV_ENABLE_UTILITY_CODE */

+ 261 - 7
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11

@@ -49,12 +49,12 @@ namespace spv {
 
 typedef unsigned int Id;
 
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
 
 static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
+static const unsigned int Version = 0x00010600;
+static const unsigned int Revision = 1;
 static const unsigned int OpCodeMask = 0xffff;
 static const unsigned int WordCountShift = 16;
 
@@ -65,6 +65,7 @@ enum class SourceLanguage : unsigned {
     OpenCL_C = 3,
     OpenCL_CPP = 4,
     HLSL = 5,
+    CPP_for_OpenCL = 6,
     Max = 0x7fffffff,
 };
 
@@ -150,6 +151,7 @@ enum class ExecutionMode : unsigned {
     SubgroupsPerWorkgroupId = 37,
     LocalSizeId = 38,
     LocalSizeHintId = 39,
+    SubgroupUniformControlFlowKHR = 4421,
     PostDepthCoverage = 4446,
     DenormPreserve = 4459,
     DenormFlushToZero = 4460,
@@ -351,6 +353,8 @@ enum class ImageOperandsShift : unsigned {
     VolatileTexelKHR = 11,
     SignExtend = 12,
     ZeroExtend = 13,
+    Nontemporal = 14,
+    Offsets = 16,
     Max = 0x7fffffff,
 };
 
@@ -374,6 +378,8 @@ enum class ImageOperandsMask : unsigned {
     VolatileTexelKHR = 0x00000800,
     SignExtend = 0x00001000,
     ZeroExtend = 0x00002000,
+    Nontemporal = 0x00004000,
+    Offsets = 0x00010000,
 };
 
 enum class FPFastMathModeShift : unsigned {
@@ -409,6 +415,7 @@ enum class FPRoundingMode : unsigned {
 enum class LinkageType : unsigned {
     Export = 0,
     Import = 1,
+    LinkOnceODR = 2,
     Max = 0x7fffffff,
 };
 
@@ -489,6 +496,7 @@ enum class Decoration : unsigned {
     PerPrimitiveNV = 5271,
     PerViewNV = 5272,
     PerTaskNV = 5273,
+    PerVertexKHR = 5285,
     PerVertexNV = 5285,
     NonUniform = 5300,
     NonUniformEXT = 5300,
@@ -496,6 +504,10 @@ enum class Decoration : unsigned {
     RestrictPointerEXT = 5355,
     AliasedPointer = 5356,
     AliasedPointerEXT = 5356,
+    BindlessSamplerNV = 5398,
+    BindlessImageNV = 5399,
+    BoundSamplerNV = 5400,
+    BoundImageNV = 5401,
     SIMTCallINTEL = 5599,
     ReferencedIndirectlyINTEL = 5602,
     ClobberINTEL = 5607,
@@ -530,11 +542,14 @@ enum class Decoration : unsigned {
     PrefetchINTEL = 5902,
     StallEnableINTEL = 5905,
     FuseLoopsInFunctionINTEL = 5907,
+    AliasScopeINTEL = 5914,
+    NoAliasINTEL = 5915,
     BufferLocationINTEL = 5921,
     IOPipeStorageINTEL = 5944,
     FunctionFloatingPointModeINTEL = 6080,
     SingleElementVectorINTEL = 6085,
     VectorComputeCallableFunctionINTEL = 6087,
+    MediaBlockIOINTEL = 6140,
     Max = 0x7fffffff,
 };
 
@@ -619,7 +634,9 @@ enum class BuiltIn : unsigned {
     LayerPerViewNV = 5279,
     MeshViewCountNV = 5280,
     MeshViewIndicesNV = 5281,
+    BaryCoordKHR = 5286,
     BaryCoordNV = 5286,
+    BaryCoordNoPerspKHR = 5287,
     BaryCoordNoPerspNV = 5287,
     FragSizeEXT = 5292,
     FragmentSizeNV = 5292,
@@ -650,6 +667,7 @@ enum class BuiltIn : unsigned {
     HitTNV = 5332,
     HitKindKHR = 5333,
     HitKindNV = 5333,
+    CurrentRayTimeNV = 5334,
     IncomingRayFlagsKHR = 5351,
     IncomingRayFlagsNV = 5351,
     RayGeometryIndexKHR = 5352,
@@ -719,6 +737,7 @@ enum class FunctionControlShift : unsigned {
     DontInline = 1,
     Pure = 2,
     Const = 3,
+    OptNoneINTEL = 16,
     Max = 0x7fffffff,
 };
 
@@ -728,6 +747,7 @@ enum class FunctionControlMask : unsigned {
     DontInline = 0x00000002,
     Pure = 0x00000004,
     Const = 0x00000008,
+    OptNoneINTEL = 0x00010000,
 };
 
 enum class MemorySemanticsShift : unsigned {
@@ -782,6 +802,8 @@ enum class MemoryAccessShift : unsigned {
     MakePointerVisibleKHR = 4,
     NonPrivatePointer = 5,
     NonPrivatePointerKHR = 5,
+    AliasScopeINTELMask = 16,
+    NoAliasINTELMask = 17,
     Max = 0x7fffffff,
 };
 
@@ -796,6 +818,8 @@ enum class MemoryAccessMask : unsigned {
     MakePointerVisibleKHR = 0x00000010,
     NonPrivatePointer = 0x00000020,
     NonPrivatePointerKHR = 0x00000020,
+    AliasScopeINTELMask = 0x00010000,
+    NoAliasINTELMask = 0x00020000,
 };
 
 enum class Scope : unsigned {
@@ -908,6 +932,7 @@ enum class Capability : unsigned {
     GroupNonUniformQuad = 68,
     ShaderLayer = 69,
     ShaderViewportIndex = 70,
+    UniformDecoration = 71,
     FragmentShadingRateKHR = 4422,
     SubgroupBallotKHR = 4423,
     DrawParameters = 4427,
@@ -956,6 +981,7 @@ enum class Capability : unsigned {
     FragmentFullyCoveredEXT = 5265,
     MeshShadingNV = 5266,
     ImageFootprintNV = 5282,
+    FragmentBarycentricKHR = 5284,
     FragmentBarycentricNV = 5284,
     ComputeDerivativeGroupQuadsNV = 5288,
     FragmentDensityEXT = 5291,
@@ -986,6 +1012,7 @@ enum class Capability : unsigned {
     StorageTexelBufferArrayNonUniformIndexing = 5312,
     StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
     RayTracingNV = 5340,
+    RayTracingMotionBlurNV = 5341,
     VulkanMemoryModel = 5345,
     VulkanMemoryModelKHR = 5345,
     VulkanMemoryModelDeviceScope = 5346,
@@ -999,7 +1026,9 @@ enum class Capability : unsigned {
     FragmentShaderShadingRateInterlockEXT = 5372,
     ShaderSMBuiltinsNV = 5373,
     FragmentShaderPixelInterlockEXT = 5378,
+    DemoteToHelperInvocation = 5379,
     DemoteToHelperInvocationEXT = 5379,
+    BindlessTextureNV = 5390,
     SubgroupShuffleINTEL = 5568,
     SubgroupBufferBlockIOINTEL = 5569,
     SubgroupImageBlockIOINTEL = 5570,
@@ -1010,8 +1039,12 @@ enum class Capability : unsigned {
     FunctionPointersINTEL = 5603,
     IndirectReferencesINTEL = 5604,
     AsmINTEL = 5606,
+    AtomicFloat32MinMaxEXT = 5612,
+    AtomicFloat64MinMaxEXT = 5613,
+    AtomicFloat16MinMaxEXT = 5616,
     VectorComputeINTEL = 5617,
     VectorAnyINTEL = 5619,
+    ExpectAssumeKHR = 5629,
     SubgroupAvcMotionEstimationINTEL = 5696,
     SubgroupAvcMotionEstimationIntraINTEL = 5697,
     SubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -1020,6 +1053,7 @@ enum class Capability : unsigned {
     FPGAMemoryAttributesINTEL = 5824,
     FPFastMathModeINTEL = 5837,
     ArbitraryPrecisionIntegersINTEL = 5844,
+    ArbitraryPrecisionFloatingPointINTEL = 5845,
     UnstructuredLoopControlsINTEL = 5886,
     FPGALoopControlsINTEL = 5888,
     KernelAttributesINTEL = 5892,
@@ -1027,14 +1061,30 @@ enum class Capability : unsigned {
     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,
+    BitInstructions = 6025,
     AtomicFloat32AddEXT = 6033,
     AtomicFloat64AddEXT = 6034,
     LongConstantCompositeINTEL = 6089,
+    OptNoneINTEL = 6094,
+    AtomicFloat16AddEXT = 6095,
+    DebugInfoModuleINTEL = 6114,
+    SplitBarrierINTEL = 6141,
+    GroupUniformArithmeticKHR = 6400,
     Max = 0x7fffffff,
 };
 
@@ -1113,6 +1163,32 @@ enum class FPOperationMode : unsigned {
     Max = 0x7fffffff,
 };
 
+enum class QuantizationModes : unsigned {
+    TRN = 0,
+    TRN_ZERO = 1,
+    RND = 2,
+    RND_ZERO = 3,
+    RND_INF = 4,
+    RND_MIN_INF = 5,
+    RND_CONV = 6,
+    RND_CONV_ODD = 7,
+    Max = 0x7fffffff,
+};
+
+enum class OverflowModes : unsigned {
+    WRAP = 0,
+    SAT = 1,
+    SAT_ZERO = 2,
+    SAT_SYM = 3,
+    Max = 0x7fffffff,
+};
+
+enum class PackedVectorFormat : unsigned {
+    PackedVectorFormat4x8Bit = 0,
+    PackedVectorFormat4x8BitKHR = 0,
+    Max = 0x7fffffff,
+};
+
 enum class Op : unsigned {
     OpNop = 0,
     OpUndef = 1,
@@ -1470,6 +1546,18 @@ enum class Op : unsigned {
     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,
@@ -1496,6 +1584,8 @@ enum class Op : unsigned {
     OpIgnoreIntersectionNV = 5335,
     OpTerminateRayNV = 5336,
     OpTraceNV = 5337,
+    OpTraceMotionNV = 5338,
+    OpTraceRayMotionNV = 5339,
     OpTypeAccelerationStructureKHR = 5341,
     OpTypeAccelerationStructureNV = 5341,
     OpExecuteCallableNV = 5344,
@@ -1506,8 +1596,16 @@ enum class Op : unsigned {
     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,
@@ -1532,11 +1630,15 @@ enum class Op : unsigned {
     OpUSubSatINTEL = 5596,
     OpIMul32x16INTEL = 5597,
     OpUMul32x16INTEL = 5598,
-    OpConstFunctionPointerINTEL = 5600,
+    OpConstantFunctionPointerINTEL = 5600,
     OpFunctionPointerCallINTEL = 5601,
     OpAsmTargetINTEL = 5609,
     OpAsmINTEL = 5610,
     OpAsmCallINTEL = 5611,
+    OpAtomicFMinEXT = 5614,
+    OpAtomicFMaxEXT = 5615,
+    OpAssumeTrueKHR = 5630,
+    OpExpectKHR = 5631,
     OpDecorateString = 5632,
     OpDecorateStringGOOGLE = 5632,
     OpMemberDecorateString = 5633,
@@ -1662,7 +1764,62 @@ enum class Op : unsigned {
     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,
@@ -1690,10 +1847,23 @@ enum class Op : unsigned {
     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,
     Max = 0x7fffffff,
 };
 
 #ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
 inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     *hasResult = *hasResultType = false;
     switch (opcode) {
@@ -2054,6 +2224,12 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
     case Op::OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+    case Op::OpSDot: *hasResult = true; *hasResultType = true; break;
+    case Op::OpUDot: *hasResult = true; *hasResultType = true; break;
+    case Op::OpSUDot: *hasResult = true; *hasResultType = true; break;
+    case Op::OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case Op::OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+    case Op::OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
     case Op::OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
     case Op::OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
     case Op::OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2079,6 +2255,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
     case Op::OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
     case Op::OpTraceNV: *hasResult = false; *hasResultType = false; break;
+    case Op::OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+    case Op::OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
     case Op::OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
     case Op::OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
     case Op::OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
@@ -2088,8 +2266,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
     case Op::OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
     case Op::OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
-    case Op::OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+    case Op::OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
     case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+    case Op::OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
     case Op::OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2114,11 +2299,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
-    case Op::OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
+    case Op::OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
+    case Op::OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
+    case Op::OpExpectKHR: *hasResult = true; *hasResultType = true; break;
     case Op::OpDecorateString: *hasResult = false; *hasResultType = false; break;
     case Op::OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
     case Op::OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2242,7 +2431,62 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+    case Op::OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+    case Op::OpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case Op::OpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case Op::OpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
+    case Op::OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+    case Op::OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
     case Op::OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2270,6 +2514,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
     case Op::OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case Op::OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
     case Op::OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+    case Op::OpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
+    case Op::OpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+    case Op::OpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
+    case Op::OpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
     }
 }
 #endif /* SPV_ENABLE_UTILITY_CODE */

+ 182 - 11
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json

@@ -54,8 +54,8 @@
                 ]
             ],
             "MagicNumber": 119734787,
-            "Version": 66816,
-            "Revision": 4,
+            "Version": 67072,
+            "Revision": 1,
             "OpCodeMask": 65535,
             "WordCountShift": 16
         },
@@ -71,7 +71,8 @@
                     "GLSL": 2,
                     "OpenCL_C": 3,
                     "OpenCL_CPP": 4,
-                    "HLSL": 5
+                    "HLSL": 5,
+                    "CPP_for_OpenCL": 6
                 }
             },
             {
@@ -169,6 +170,7 @@
                     "SubgroupsPerWorkgroupId": 37,
                     "LocalSizeId": 38,
                     "LocalSizeHintId": 39,
+                    "SubgroupUniformControlFlowKHR": 4421,
                     "PostDepthCoverage": 4446,
                     "DenormPreserve": 4459,
                     "DenormFlushToZero": 4460,
@@ -393,7 +395,9 @@
                     "VolatileTexel": 11,
                     "VolatileTexelKHR": 11,
                     "SignExtend": 12,
-                    "ZeroExtend": 13
+                    "ZeroExtend": 13,
+                    "Nontemporal": 14,
+                    "Offsets": 16
                 }
             },
             {
@@ -427,7 +431,8 @@
                 "Values":
                 {
                     "Export": 0,
-                    "Import": 1
+                    "Import": 1,
+                    "LinkOnceODR": 2
                 }
             },
             {
@@ -517,6 +522,7 @@
                     "PerPrimitiveNV": 5271,
                     "PerViewNV": 5272,
                     "PerTaskNV": 5273,
+                    "PerVertexKHR": 5285,
                     "PerVertexNV": 5285,
                     "NonUniform": 5300,
                     "NonUniformEXT": 5300,
@@ -524,6 +530,10 @@
                     "RestrictPointerEXT": 5355,
                     "AliasedPointer": 5356,
                     "AliasedPointerEXT": 5356,
+                    "BindlessSamplerNV": 5398,
+                    "BindlessImageNV": 5399,
+                    "BoundSamplerNV": 5400,
+                    "BoundImageNV": 5401,
                     "SIMTCallINTEL": 5599,
                     "ReferencedIndirectlyINTEL": 5602,
                     "ClobberINTEL": 5607,
@@ -558,11 +568,14 @@
                     "PrefetchINTEL": 5902,
                     "StallEnableINTEL": 5905,
                     "FuseLoopsInFunctionINTEL": 5907,
+                    "AliasScopeINTEL": 5914,
+                    "NoAliasINTEL": 5915,
                     "BufferLocationINTEL": 5921,
                     "IOPipeStorageINTEL": 5944,
                     "FunctionFloatingPointModeINTEL": 6080,
                     "SingleElementVectorINTEL": 6085,
-                    "VectorComputeCallableFunctionINTEL": 6087
+                    "VectorComputeCallableFunctionINTEL": 6087,
+                    "MediaBlockIOINTEL": 6140
                 }
             },
             {
@@ -650,7 +663,9 @@
                     "LayerPerViewNV": 5279,
                     "MeshViewCountNV": 5280,
                     "MeshViewIndicesNV": 5281,
+                    "BaryCoordKHR": 5286,
                     "BaryCoordNV": 5286,
+                    "BaryCoordNoPerspKHR": 5287,
                     "BaryCoordNoPerspNV": 5287,
                     "FragSizeEXT": 5292,
                     "FragmentSizeNV": 5292,
@@ -681,6 +696,7 @@
                     "HitTNV": 5332,
                     "HitKindKHR": 5333,
                     "HitKindNV": 5333,
+                    "CurrentRayTimeNV": 5334,
                     "IncomingRayFlagsKHR": 5351,
                     "IncomingRayFlagsNV": 5351,
                     "RayGeometryIndexKHR": 5352,
@@ -731,7 +747,8 @@
                     "Inline": 0,
                     "DontInline": 1,
                     "Pure": 2,
-                    "Const": 3
+                    "Const": 3,
+                    "OptNoneINTEL": 16
                 }
             },
             {
@@ -771,7 +788,9 @@
                     "MakePointerVisible": 4,
                     "MakePointerVisibleKHR": 4,
                     "NonPrivatePointer": 5,
-                    "NonPrivatePointerKHR": 5
+                    "NonPrivatePointerKHR": 5,
+                    "AliasScopeINTELMask": 16,
+                    "NoAliasINTELMask": 17
                 }
             },
             {
@@ -895,6 +914,7 @@
                     "GroupNonUniformQuad": 68,
                     "ShaderLayer": 69,
                     "ShaderViewportIndex": 70,
+                    "UniformDecoration": 71,
                     "FragmentShadingRateKHR": 4422,
                     "SubgroupBallotKHR": 4423,
                     "DrawParameters": 4427,
@@ -943,6 +963,7 @@
                     "FragmentFullyCoveredEXT": 5265,
                     "MeshShadingNV": 5266,
                     "ImageFootprintNV": 5282,
+                    "FragmentBarycentricKHR": 5284,
                     "FragmentBarycentricNV": 5284,
                     "ComputeDerivativeGroupQuadsNV": 5288,
                     "FragmentDensityEXT": 5291,
@@ -973,6 +994,7 @@
                     "StorageTexelBufferArrayNonUniformIndexing": 5312,
                     "StorageTexelBufferArrayNonUniformIndexingEXT": 5312,
                     "RayTracingNV": 5340,
+                    "RayTracingMotionBlurNV": 5341,
                     "VulkanMemoryModel": 5345,
                     "VulkanMemoryModelKHR": 5345,
                     "VulkanMemoryModelDeviceScope": 5346,
@@ -986,7 +1008,9 @@
                     "FragmentShaderShadingRateInterlockEXT": 5372,
                     "ShaderSMBuiltinsNV": 5373,
                     "FragmentShaderPixelInterlockEXT": 5378,
+                    "DemoteToHelperInvocation": 5379,
                     "DemoteToHelperInvocationEXT": 5379,
+                    "BindlessTextureNV": 5390,
                     "SubgroupShuffleINTEL": 5568,
                     "SubgroupBufferBlockIOINTEL": 5569,
                     "SubgroupImageBlockIOINTEL": 5570,
@@ -997,8 +1021,12 @@
                     "FunctionPointersINTEL": 5603,
                     "IndirectReferencesINTEL": 5604,
                     "AsmINTEL": 5606,
+                    "AtomicFloat32MinMaxEXT": 5612,
+                    "AtomicFloat64MinMaxEXT": 5613,
+                    "AtomicFloat16MinMaxEXT": 5616,
                     "VectorComputeINTEL": 5617,
                     "VectorAnyINTEL": 5619,
+                    "ExpectAssumeKHR": 5629,
                     "SubgroupAvcMotionEstimationINTEL": 5696,
                     "SubgroupAvcMotionEstimationIntraINTEL": 5697,
                     "SubgroupAvcMotionEstimationChromaINTEL": 5698,
@@ -1007,6 +1035,7 @@
                     "FPGAMemoryAttributesINTEL": 5824,
                     "FPFastMathModeINTEL": 5837,
                     "ArbitraryPrecisionIntegersINTEL": 5844,
+                    "ArbitraryPrecisionFloatingPointINTEL": 5845,
                     "UnstructuredLoopControlsINTEL": 5886,
                     "FPGALoopControlsINTEL": 5888,
                     "KernelAttributesINTEL": 5892,
@@ -1014,14 +1043,30 @@
                     "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,
+                    "BitInstructions": 6025,
                     "AtomicFloat32AddEXT": 6033,
                     "AtomicFloat64AddEXT": 6034,
-                    "LongConstantCompositeINTEL": 6089
+                    "LongConstantCompositeINTEL": 6089,
+                    "OptNoneINTEL": 6094,
+                    "AtomicFloat16AddEXT": 6095,
+                    "DebugInfoModuleINTEL": 6114,
+                    "SplitBarrierINTEL": 6141,
+                    "GroupUniformArithmeticKHR": 6400
                 }
             },
             {
@@ -1098,6 +1143,41 @@
                     "ALT": 1
                 }
             },
+            {
+                "Name": "QuantizationModes",
+                "Type": "Value",
+                "Values":
+                {
+                    "TRN": 0,
+                    "TRN_ZERO": 1,
+                    "RND": 2,
+                    "RND_ZERO": 3,
+                    "RND_INF": 4,
+                    "RND_MIN_INF": 5,
+                    "RND_CONV": 6,
+                    "RND_CONV_ODD": 7
+                }
+            },
+            {
+                "Name": "OverflowModes",
+                "Type": "Value",
+                "Values":
+                {
+                    "WRAP": 0,
+                    "SAT": 1,
+                    "SAT_ZERO": 2,
+                    "SAT_SYM": 3
+                }
+            },
+            {
+                "Name": "PackedVectorFormat",
+                "Type": "Value",
+                "Values":
+                {
+                    "PackedVectorFormat4x8Bit": 0,
+                    "PackedVectorFormat4x8BitKHR": 0
+                }
+            },
             {
                 "Name": "Op",
                 "Type": "Value",
@@ -1459,6 +1539,18 @@
                     "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,
@@ -1485,6 +1577,8 @@
                     "OpIgnoreIntersectionNV": 5335,
                     "OpTerminateRayNV": 5336,
                     "OpTraceNV": 5337,
+                    "OpTraceMotionNV": 5338,
+                    "OpTraceRayMotionNV": 5339,
                     "OpTypeAccelerationStructureKHR": 5341,
                     "OpTypeAccelerationStructureNV": 5341,
                     "OpExecuteCallableNV": 5344,
@@ -1495,8 +1589,16 @@
                     "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,
@@ -1521,11 +1623,15 @@
                     "OpUSubSatINTEL": 5596,
                     "OpIMul32x16INTEL": 5597,
                     "OpUMul32x16INTEL": 5598,
-                    "OpConstFunctionPointerINTEL": 5600,
+                    "OpConstantFunctionPointerINTEL": 5600,
                     "OpFunctionPointerCallINTEL": 5601,
                     "OpAsmTargetINTEL": 5609,
                     "OpAsmINTEL": 5610,
                     "OpAsmCallINTEL": 5611,
+                    "OpAtomicFMinEXT": 5614,
+                    "OpAtomicFMaxEXT": 5615,
+                    "OpAssumeTrueKHR": 5630,
+                    "OpExpectKHR": 5631,
                     "OpDecorateString": 5632,
                     "OpDecorateStringGOOGLE": 5632,
                     "OpMemberDecorateString": 5633,
@@ -1651,7 +1757,62 @@
                     "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,
@@ -1678,7 +1839,17 @@
                     "OpTypeBufferSurfaceINTEL": 6086,
                     "OpTypeStructContinuedINTEL": 6090,
                     "OpConstantCompositeContinuedINTEL": 6091,
-                    "OpSpecConstantCompositeContinuedINTEL": 6092
+                    "OpSpecConstantCompositeContinuedINTEL": 6092,
+                    "OpControlBarrierArriveINTEL": 6142,
+                    "OpControlBarrierWaitINTEL": 6143,
+                    "OpGroupIMulKHR": 6401,
+                    "OpGroupFMulKHR": 6402,
+                    "OpGroupBitwiseAndKHR": 6403,
+                    "OpGroupBitwiseOrKHR": 6404,
+                    "OpGroupBitwiseXorKHR": 6405,
+                    "OpGroupLogicalAndKHR": 6406,
+                    "OpGroupLogicalOrKHR": 6407,
+                    "OpGroupLogicalXorKHR": 6408
                 }
             }
         ]

+ 167 - 3
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua

@@ -44,8 +44,8 @@
 
 spv = {
     MagicNumber = 0x07230203,
-    Version = 0x00010500,
-    Revision = 4,
+    Version = 0x00010600,
+    Revision = 1,
     OpCodeMask = 0xffff,
     WordCountShift = 16,
 
@@ -56,6 +56,7 @@ spv = {
         OpenCL_C = 3,
         OpenCL_CPP = 4,
         HLSL = 5,
+        CPP_for_OpenCL = 6,
     },
 
     ExecutionModel = {
@@ -137,6 +138,7 @@ spv = {
         SubgroupsPerWorkgroupId = 37,
         LocalSizeId = 38,
         LocalSizeHintId = 39,
+        SubgroupUniformControlFlowKHR = 4421,
         PostDepthCoverage = 4446,
         DenormPreserve = 4459,
         DenormFlushToZero = 4460,
@@ -330,6 +332,8 @@ spv = {
         VolatileTexelKHR = 11,
         SignExtend = 12,
         ZeroExtend = 13,
+        Nontemporal = 14,
+        Offsets = 16,
     },
 
     ImageOperandsMask = {
@@ -352,6 +356,8 @@ spv = {
         VolatileTexelKHR = 0x00000800,
         SignExtend = 0x00001000,
         ZeroExtend = 0x00002000,
+        Nontemporal = 0x00004000,
+        Offsets = 0x00010000,
     },
 
     FPFastMathModeShift = {
@@ -385,6 +391,7 @@ spv = {
     LinkageType = {
         Export = 0,
         Import = 1,
+        LinkOnceODR = 2,
     },
 
     AccessQualifier = {
@@ -462,6 +469,7 @@ spv = {
         PerPrimitiveNV = 5271,
         PerViewNV = 5272,
         PerTaskNV = 5273,
+        PerVertexKHR = 5285,
         PerVertexNV = 5285,
         NonUniform = 5300,
         NonUniformEXT = 5300,
@@ -469,6 +477,10 @@ spv = {
         RestrictPointerEXT = 5355,
         AliasedPointer = 5356,
         AliasedPointerEXT = 5356,
+        BindlessSamplerNV = 5398,
+        BindlessImageNV = 5399,
+        BoundSamplerNV = 5400,
+        BoundImageNV = 5401,
         SIMTCallINTEL = 5599,
         ReferencedIndirectlyINTEL = 5602,
         ClobberINTEL = 5607,
@@ -503,11 +515,14 @@ spv = {
         PrefetchINTEL = 5902,
         StallEnableINTEL = 5905,
         FuseLoopsInFunctionINTEL = 5907,
+        AliasScopeINTEL = 5914,
+        NoAliasINTEL = 5915,
         BufferLocationINTEL = 5921,
         IOPipeStorageINTEL = 5944,
         FunctionFloatingPointModeINTEL = 6080,
         SingleElementVectorINTEL = 6085,
         VectorComputeCallableFunctionINTEL = 6087,
+        MediaBlockIOINTEL = 6140,
     },
 
     BuiltIn = {
@@ -591,7 +606,9 @@ spv = {
         LayerPerViewNV = 5279,
         MeshViewCountNV = 5280,
         MeshViewIndicesNV = 5281,
+        BaryCoordKHR = 5286,
         BaryCoordNV = 5286,
+        BaryCoordNoPerspKHR = 5287,
         BaryCoordNoPerspNV = 5287,
         FragSizeEXT = 5292,
         FragmentSizeNV = 5292,
@@ -622,6 +639,7 @@ spv = {
         HitTNV = 5332,
         HitKindKHR = 5333,
         HitKindNV = 5333,
+        CurrentRayTimeNV = 5334,
         IncomingRayFlagsKHR = 5351,
         IncomingRayFlagsNV = 5351,
         RayGeometryIndexKHR = 5352,
@@ -688,6 +706,7 @@ spv = {
         DontInline = 1,
         Pure = 2,
         Const = 3,
+        OptNoneINTEL = 16,
     },
 
     FunctionControlMask = {
@@ -696,6 +715,7 @@ spv = {
         DontInline = 0x00000002,
         Pure = 0x00000004,
         Const = 0x00000008,
+        OptNoneINTEL = 0x00010000,
     },
 
     MemorySemanticsShift = {
@@ -749,6 +769,8 @@ spv = {
         MakePointerVisibleKHR = 4,
         NonPrivatePointer = 5,
         NonPrivatePointerKHR = 5,
+        AliasScopeINTELMask = 16,
+        NoAliasINTELMask = 17,
     },
 
     MemoryAccessMask = {
@@ -762,6 +784,8 @@ spv = {
         MakePointerVisibleKHR = 0x00000010,
         NonPrivatePointer = 0x00000020,
         NonPrivatePointerKHR = 0x00000020,
+        AliasScopeINTELMask = 0x00010000,
+        NoAliasINTELMask = 0x00020000,
     },
 
     Scope = {
@@ -870,6 +894,7 @@ spv = {
         GroupNonUniformQuad = 68,
         ShaderLayer = 69,
         ShaderViewportIndex = 70,
+        UniformDecoration = 71,
         FragmentShadingRateKHR = 4422,
         SubgroupBallotKHR = 4423,
         DrawParameters = 4427,
@@ -918,6 +943,7 @@ spv = {
         FragmentFullyCoveredEXT = 5265,
         MeshShadingNV = 5266,
         ImageFootprintNV = 5282,
+        FragmentBarycentricKHR = 5284,
         FragmentBarycentricNV = 5284,
         ComputeDerivativeGroupQuadsNV = 5288,
         FragmentDensityEXT = 5291,
@@ -948,6 +974,7 @@ spv = {
         StorageTexelBufferArrayNonUniformIndexing = 5312,
         StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
         RayTracingNV = 5340,
+        RayTracingMotionBlurNV = 5341,
         VulkanMemoryModel = 5345,
         VulkanMemoryModelKHR = 5345,
         VulkanMemoryModelDeviceScope = 5346,
@@ -961,7 +988,9 @@ spv = {
         FragmentShaderShadingRateInterlockEXT = 5372,
         ShaderSMBuiltinsNV = 5373,
         FragmentShaderPixelInterlockEXT = 5378,
+        DemoteToHelperInvocation = 5379,
         DemoteToHelperInvocationEXT = 5379,
+        BindlessTextureNV = 5390,
         SubgroupShuffleINTEL = 5568,
         SubgroupBufferBlockIOINTEL = 5569,
         SubgroupImageBlockIOINTEL = 5570,
@@ -972,8 +1001,12 @@ spv = {
         FunctionPointersINTEL = 5603,
         IndirectReferencesINTEL = 5604,
         AsmINTEL = 5606,
+        AtomicFloat32MinMaxEXT = 5612,
+        AtomicFloat64MinMaxEXT = 5613,
+        AtomicFloat16MinMaxEXT = 5616,
         VectorComputeINTEL = 5617,
         VectorAnyINTEL = 5619,
+        ExpectAssumeKHR = 5629,
         SubgroupAvcMotionEstimationINTEL = 5696,
         SubgroupAvcMotionEstimationIntraINTEL = 5697,
         SubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -982,6 +1015,7 @@ spv = {
         FPGAMemoryAttributesINTEL = 5824,
         FPFastMathModeINTEL = 5837,
         ArbitraryPrecisionIntegersINTEL = 5844,
+        ArbitraryPrecisionFloatingPointINTEL = 5845,
         UnstructuredLoopControlsINTEL = 5886,
         FPGALoopControlsINTEL = 5888,
         KernelAttributesINTEL = 5892,
@@ -989,14 +1023,30 @@ spv = {
         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,
+        BitInstructions = 6025,
         AtomicFloat32AddEXT = 6033,
         AtomicFloat64AddEXT = 6034,
         LongConstantCompositeINTEL = 6089,
+        OptNoneINTEL = 6094,
+        AtomicFloat16AddEXT = 6095,
+        DebugInfoModuleINTEL = 6114,
+        SplitBarrierINTEL = 6141,
+        GroupUniformArithmeticKHR = 6400,
     },
 
     RayFlagsShift = {
@@ -1067,6 +1117,29 @@ spv = {
         ALT = 1,
     },
 
+    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,
+    },
+
+    OverflowModes = {
+        WRAP = 0,
+        SAT = 1,
+        SAT_ZERO = 2,
+        SAT_SYM = 3,
+    },
+
+    PackedVectorFormat = {
+        PackedVectorFormat4x8Bit = 0,
+        PackedVectorFormat4x8BitKHR = 0,
+    },
+
     Op = {
         OpNop = 0,
         OpUndef = 1,
@@ -1424,6 +1497,18 @@ spv = {
         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,
@@ -1450,6 +1535,8 @@ spv = {
         OpIgnoreIntersectionNV = 5335,
         OpTerminateRayNV = 5336,
         OpTraceNV = 5337,
+        OpTraceMotionNV = 5338,
+        OpTraceRayMotionNV = 5339,
         OpTypeAccelerationStructureKHR = 5341,
         OpTypeAccelerationStructureNV = 5341,
         OpExecuteCallableNV = 5344,
@@ -1460,8 +1547,16 @@ spv = {
         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,
@@ -1486,11 +1581,15 @@ spv = {
         OpUSubSatINTEL = 5596,
         OpIMul32x16INTEL = 5597,
         OpUMul32x16INTEL = 5598,
-        OpConstFunctionPointerINTEL = 5600,
+        OpConstantFunctionPointerINTEL = 5600,
         OpFunctionPointerCallINTEL = 5601,
         OpAsmTargetINTEL = 5609,
         OpAsmINTEL = 5610,
         OpAsmCallINTEL = 5611,
+        OpAtomicFMinEXT = 5614,
+        OpAtomicFMaxEXT = 5615,
+        OpAssumeTrueKHR = 5630,
+        OpExpectKHR = 5631,
         OpDecorateString = 5632,
         OpDecorateStringGOOGLE = 5632,
         OpMemberDecorateString = 5633,
@@ -1616,7 +1715,62 @@ spv = {
         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,
@@ -1644,6 +1798,16 @@ spv = {
         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,
     },
 
 }

+ 167 - 3
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py

@@ -44,8 +44,8 @@
 
 spv = {
     'MagicNumber' : 0x07230203,
-    'Version' : 0x00010500,
-    'Revision' : 4,
+    'Version' : 0x00010600,
+    'Revision' : 1,
     'OpCodeMask' : 0xffff,
     'WordCountShift' : 16,
 
@@ -56,6 +56,7 @@ spv = {
         'OpenCL_C' : 3,
         'OpenCL_CPP' : 4,
         'HLSL' : 5,
+        'CPP_for_OpenCL' : 6,
     },
 
     'ExecutionModel' : {
@@ -137,6 +138,7 @@ spv = {
         'SubgroupsPerWorkgroupId' : 37,
         'LocalSizeId' : 38,
         'LocalSizeHintId' : 39,
+        'SubgroupUniformControlFlowKHR' : 4421,
         'PostDepthCoverage' : 4446,
         'DenormPreserve' : 4459,
         'DenormFlushToZero' : 4460,
@@ -330,6 +332,8 @@ spv = {
         'VolatileTexelKHR' : 11,
         'SignExtend' : 12,
         'ZeroExtend' : 13,
+        'Nontemporal' : 14,
+        'Offsets' : 16,
     },
 
     'ImageOperandsMask' : {
@@ -352,6 +356,8 @@ spv = {
         'VolatileTexelKHR' : 0x00000800,
         'SignExtend' : 0x00001000,
         'ZeroExtend' : 0x00002000,
+        'Nontemporal' : 0x00004000,
+        'Offsets' : 0x00010000,
     },
 
     'FPFastMathModeShift' : {
@@ -385,6 +391,7 @@ spv = {
     'LinkageType' : {
         'Export' : 0,
         'Import' : 1,
+        'LinkOnceODR' : 2,
     },
 
     'AccessQualifier' : {
@@ -462,6 +469,7 @@ spv = {
         'PerPrimitiveNV' : 5271,
         'PerViewNV' : 5272,
         'PerTaskNV' : 5273,
+        'PerVertexKHR' : 5285,
         'PerVertexNV' : 5285,
         'NonUniform' : 5300,
         'NonUniformEXT' : 5300,
@@ -469,6 +477,10 @@ spv = {
         'RestrictPointerEXT' : 5355,
         'AliasedPointer' : 5356,
         'AliasedPointerEXT' : 5356,
+        'BindlessSamplerNV' : 5398,
+        'BindlessImageNV' : 5399,
+        'BoundSamplerNV' : 5400,
+        'BoundImageNV' : 5401,
         'SIMTCallINTEL' : 5599,
         'ReferencedIndirectlyINTEL' : 5602,
         'ClobberINTEL' : 5607,
@@ -503,11 +515,14 @@ spv = {
         'PrefetchINTEL' : 5902,
         'StallEnableINTEL' : 5905,
         'FuseLoopsInFunctionINTEL' : 5907,
+        'AliasScopeINTEL' : 5914,
+        'NoAliasINTEL' : 5915,
         'BufferLocationINTEL' : 5921,
         'IOPipeStorageINTEL' : 5944,
         'FunctionFloatingPointModeINTEL' : 6080,
         'SingleElementVectorINTEL' : 6085,
         'VectorComputeCallableFunctionINTEL' : 6087,
+        'MediaBlockIOINTEL' : 6140,
     },
 
     'BuiltIn' : {
@@ -591,7 +606,9 @@ spv = {
         'LayerPerViewNV' : 5279,
         'MeshViewCountNV' : 5280,
         'MeshViewIndicesNV' : 5281,
+        'BaryCoordKHR' : 5286,
         'BaryCoordNV' : 5286,
+        'BaryCoordNoPerspKHR' : 5287,
         'BaryCoordNoPerspNV' : 5287,
         'FragSizeEXT' : 5292,
         'FragmentSizeNV' : 5292,
@@ -622,6 +639,7 @@ spv = {
         'HitTNV' : 5332,
         'HitKindKHR' : 5333,
         'HitKindNV' : 5333,
+        'CurrentRayTimeNV' : 5334,
         'IncomingRayFlagsKHR' : 5351,
         'IncomingRayFlagsNV' : 5351,
         'RayGeometryIndexKHR' : 5352,
@@ -688,6 +706,7 @@ spv = {
         'DontInline' : 1,
         'Pure' : 2,
         'Const' : 3,
+        'OptNoneINTEL' : 16,
     },
 
     'FunctionControlMask' : {
@@ -696,6 +715,7 @@ spv = {
         'DontInline' : 0x00000002,
         'Pure' : 0x00000004,
         'Const' : 0x00000008,
+        'OptNoneINTEL' : 0x00010000,
     },
 
     'MemorySemanticsShift' : {
@@ -749,6 +769,8 @@ spv = {
         'MakePointerVisibleKHR' : 4,
         'NonPrivatePointer' : 5,
         'NonPrivatePointerKHR' : 5,
+        'AliasScopeINTELMask' : 16,
+        'NoAliasINTELMask' : 17,
     },
 
     'MemoryAccessMask' : {
@@ -762,6 +784,8 @@ spv = {
         'MakePointerVisibleKHR' : 0x00000010,
         'NonPrivatePointer' : 0x00000020,
         'NonPrivatePointerKHR' : 0x00000020,
+        'AliasScopeINTELMask' : 0x00010000,
+        'NoAliasINTELMask' : 0x00020000,
     },
 
     'Scope' : {
@@ -870,6 +894,7 @@ spv = {
         'GroupNonUniformQuad' : 68,
         'ShaderLayer' : 69,
         'ShaderViewportIndex' : 70,
+        'UniformDecoration' : 71,
         'FragmentShadingRateKHR' : 4422,
         'SubgroupBallotKHR' : 4423,
         'DrawParameters' : 4427,
@@ -918,6 +943,7 @@ spv = {
         'FragmentFullyCoveredEXT' : 5265,
         'MeshShadingNV' : 5266,
         'ImageFootprintNV' : 5282,
+        'FragmentBarycentricKHR' : 5284,
         'FragmentBarycentricNV' : 5284,
         'ComputeDerivativeGroupQuadsNV' : 5288,
         'FragmentDensityEXT' : 5291,
@@ -948,6 +974,7 @@ spv = {
         'StorageTexelBufferArrayNonUniformIndexing' : 5312,
         'StorageTexelBufferArrayNonUniformIndexingEXT' : 5312,
         'RayTracingNV' : 5340,
+        'RayTracingMotionBlurNV' : 5341,
         'VulkanMemoryModel' : 5345,
         'VulkanMemoryModelKHR' : 5345,
         'VulkanMemoryModelDeviceScope' : 5346,
@@ -961,7 +988,9 @@ spv = {
         'FragmentShaderShadingRateInterlockEXT' : 5372,
         'ShaderSMBuiltinsNV' : 5373,
         'FragmentShaderPixelInterlockEXT' : 5378,
+        'DemoteToHelperInvocation' : 5379,
         'DemoteToHelperInvocationEXT' : 5379,
+        'BindlessTextureNV' : 5390,
         'SubgroupShuffleINTEL' : 5568,
         'SubgroupBufferBlockIOINTEL' : 5569,
         'SubgroupImageBlockIOINTEL' : 5570,
@@ -972,8 +1001,12 @@ spv = {
         'FunctionPointersINTEL' : 5603,
         'IndirectReferencesINTEL' : 5604,
         'AsmINTEL' : 5606,
+        'AtomicFloat32MinMaxEXT' : 5612,
+        'AtomicFloat64MinMaxEXT' : 5613,
+        'AtomicFloat16MinMaxEXT' : 5616,
         'VectorComputeINTEL' : 5617,
         'VectorAnyINTEL' : 5619,
+        'ExpectAssumeKHR' : 5629,
         'SubgroupAvcMotionEstimationINTEL' : 5696,
         'SubgroupAvcMotionEstimationIntraINTEL' : 5697,
         'SubgroupAvcMotionEstimationChromaINTEL' : 5698,
@@ -982,6 +1015,7 @@ spv = {
         'FPGAMemoryAttributesINTEL' : 5824,
         'FPFastMathModeINTEL' : 5837,
         'ArbitraryPrecisionIntegersINTEL' : 5844,
+        'ArbitraryPrecisionFloatingPointINTEL' : 5845,
         'UnstructuredLoopControlsINTEL' : 5886,
         'FPGALoopControlsINTEL' : 5888,
         'KernelAttributesINTEL' : 5892,
@@ -989,14 +1023,30 @@ spv = {
         '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,
+        'BitInstructions' : 6025,
         'AtomicFloat32AddEXT' : 6033,
         'AtomicFloat64AddEXT' : 6034,
         'LongConstantCompositeINTEL' : 6089,
+        'OptNoneINTEL' : 6094,
+        'AtomicFloat16AddEXT' : 6095,
+        'DebugInfoModuleINTEL' : 6114,
+        'SplitBarrierINTEL' : 6141,
+        'GroupUniformArithmeticKHR' : 6400,
     },
 
     'RayFlagsShift' : {
@@ -1067,6 +1117,29 @@ spv = {
         'ALT' : 1,
     },
 
+    '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,
+    },
+
+    'OverflowModes' : {
+        'WRAP' : 0,
+        'SAT' : 1,
+        'SAT_ZERO' : 2,
+        'SAT_SYM' : 3,
+    },
+
+    'PackedVectorFormat' : {
+        'PackedVectorFormat4x8Bit' : 0,
+        'PackedVectorFormat4x8BitKHR' : 0,
+    },
+
     'Op' : {
         'OpNop' : 0,
         'OpUndef' : 1,
@@ -1424,6 +1497,18 @@ spv = {
         '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,
@@ -1450,6 +1535,8 @@ spv = {
         'OpIgnoreIntersectionNV' : 5335,
         'OpTerminateRayNV' : 5336,
         'OpTraceNV' : 5337,
+        'OpTraceMotionNV' : 5338,
+        'OpTraceRayMotionNV' : 5339,
         'OpTypeAccelerationStructureKHR' : 5341,
         'OpTypeAccelerationStructureNV' : 5341,
         'OpExecuteCallableNV' : 5344,
@@ -1460,8 +1547,16 @@ spv = {
         '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,
@@ -1486,11 +1581,15 @@ spv = {
         'OpUSubSatINTEL' : 5596,
         'OpIMul32x16INTEL' : 5597,
         'OpUMul32x16INTEL' : 5598,
-        'OpConstFunctionPointerINTEL' : 5600,
+        'OpConstantFunctionPointerINTEL' : 5600,
         'OpFunctionPointerCallINTEL' : 5601,
         'OpAsmTargetINTEL' : 5609,
         'OpAsmINTEL' : 5610,
         'OpAsmCallINTEL' : 5611,
+        'OpAtomicFMinEXT' : 5614,
+        'OpAtomicFMaxEXT' : 5615,
+        'OpAssumeTrueKHR' : 5630,
+        'OpExpectKHR' : 5631,
         'OpDecorateString' : 5632,
         'OpDecorateStringGOOGLE' : 5632,
         'OpMemberDecorateString' : 5633,
@@ -1616,7 +1715,62 @@ spv = {
         '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,
@@ -1644,6 +1798,16 @@ spv = {
         '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,
     },
 
 }

+ 170 - 3
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d

@@ -51,8 +51,8 @@
 module spv;
 
 enum uint MagicNumber = 0x07230203;
-enum uint Version = 0x00010500;
-enum uint Revision = 4;
+enum uint Version = 0x00010600;
+enum uint Revision = 1;
 enum uint OpCodeMask = 0xffff;
 enum uint WordCountShift = 16;
 
@@ -64,6 +64,7 @@ enum SourceLanguage : uint
     OpenCL_C = 3,
     OpenCL_CPP = 4,
     HLSL = 5,
+    CPP_for_OpenCL = 6,
 }
 
 enum ExecutionModel : uint
@@ -149,6 +150,7 @@ enum ExecutionMode : uint
     SubgroupsPerWorkgroupId = 37,
     LocalSizeId = 38,
     LocalSizeHintId = 39,
+    SubgroupUniformControlFlowKHR = 4421,
     PostDepthCoverage = 4446,
     DenormPreserve = 4459,
     DenormFlushToZero = 4460,
@@ -350,6 +352,8 @@ enum ImageOperandsShift : uint
     VolatileTexelKHR = 11,
     SignExtend = 12,
     ZeroExtend = 13,
+    Nontemporal = 14,
+    Offsets = 16,
 }
 
 enum ImageOperandsMask : uint
@@ -373,6 +377,8 @@ enum ImageOperandsMask : uint
     VolatileTexelKHR = 0x00000800,
     SignExtend = 0x00001000,
     ZeroExtend = 0x00002000,
+    Nontemporal = 0x00004000,
+    Offsets = 0x00010000,
 }
 
 enum FPFastMathModeShift : uint
@@ -410,6 +416,7 @@ enum LinkageType : uint
 {
     Export = 0,
     Import = 1,
+    LinkOnceODR = 2,
 }
 
 enum AccessQualifier : uint
@@ -490,6 +497,7 @@ enum Decoration : uint
     PerPrimitiveNV = 5271,
     PerViewNV = 5272,
     PerTaskNV = 5273,
+    PerVertexKHR = 5285,
     PerVertexNV = 5285,
     NonUniform = 5300,
     NonUniformEXT = 5300,
@@ -497,6 +505,10 @@ enum Decoration : uint
     RestrictPointerEXT = 5355,
     AliasedPointer = 5356,
     AliasedPointerEXT = 5356,
+    BindlessSamplerNV = 5398,
+    BindlessImageNV = 5399,
+    BoundSamplerNV = 5400,
+    BoundImageNV = 5401,
     SIMTCallINTEL = 5599,
     ReferencedIndirectlyINTEL = 5602,
     ClobberINTEL = 5607,
@@ -531,11 +543,14 @@ enum Decoration : uint
     PrefetchINTEL = 5902,
     StallEnableINTEL = 5905,
     FuseLoopsInFunctionINTEL = 5907,
+    AliasScopeINTEL = 5914,
+    NoAliasINTEL = 5915,
     BufferLocationINTEL = 5921,
     IOPipeStorageINTEL = 5944,
     FunctionFloatingPointModeINTEL = 6080,
     SingleElementVectorINTEL = 6085,
     VectorComputeCallableFunctionINTEL = 6087,
+    MediaBlockIOINTEL = 6140,
 }
 
 enum BuiltIn : uint
@@ -620,7 +635,9 @@ enum BuiltIn : uint
     LayerPerViewNV = 5279,
     MeshViewCountNV = 5280,
     MeshViewIndicesNV = 5281,
+    BaryCoordKHR = 5286,
     BaryCoordNV = 5286,
+    BaryCoordNoPerspKHR = 5287,
     BaryCoordNoPerspNV = 5287,
     FragSizeEXT = 5292,
     FragmentSizeNV = 5292,
@@ -651,6 +668,7 @@ enum BuiltIn : uint
     HitTNV = 5332,
     HitKindKHR = 5333,
     HitKindNV = 5333,
+    CurrentRayTimeNV = 5334,
     IncomingRayFlagsKHR = 5351,
     IncomingRayFlagsNV = 5351,
     RayGeometryIndexKHR = 5352,
@@ -722,6 +740,7 @@ enum FunctionControlShift : uint
     DontInline = 1,
     Pure = 2,
     Const = 3,
+    OptNoneINTEL = 16,
 }
 
 enum FunctionControlMask : uint
@@ -731,6 +750,7 @@ enum FunctionControlMask : uint
     DontInline = 0x00000002,
     Pure = 0x00000004,
     Const = 0x00000008,
+    OptNoneINTEL = 0x00010000,
 }
 
 enum MemorySemanticsShift : uint
@@ -787,6 +807,8 @@ enum MemoryAccessShift : uint
     MakePointerVisibleKHR = 4,
     NonPrivatePointer = 5,
     NonPrivatePointerKHR = 5,
+    AliasScopeINTELMask = 16,
+    NoAliasINTELMask = 17,
 }
 
 enum MemoryAccessMask : uint
@@ -801,6 +823,8 @@ enum MemoryAccessMask : uint
     MakePointerVisibleKHR = 0x00000010,
     NonPrivatePointer = 0x00000020,
     NonPrivatePointerKHR = 0x00000020,
+    AliasScopeINTELMask = 0x00010000,
+    NoAliasINTELMask = 0x00020000,
 }
 
 enum Scope : uint
@@ -915,6 +939,7 @@ enum Capability : uint
     GroupNonUniformQuad = 68,
     ShaderLayer = 69,
     ShaderViewportIndex = 70,
+    UniformDecoration = 71,
     FragmentShadingRateKHR = 4422,
     SubgroupBallotKHR = 4423,
     DrawParameters = 4427,
@@ -963,6 +988,7 @@ enum Capability : uint
     FragmentFullyCoveredEXT = 5265,
     MeshShadingNV = 5266,
     ImageFootprintNV = 5282,
+    FragmentBarycentricKHR = 5284,
     FragmentBarycentricNV = 5284,
     ComputeDerivativeGroupQuadsNV = 5288,
     FragmentDensityEXT = 5291,
@@ -993,6 +1019,7 @@ enum Capability : uint
     StorageTexelBufferArrayNonUniformIndexing = 5312,
     StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
     RayTracingNV = 5340,
+    RayTracingMotionBlurNV = 5341,
     VulkanMemoryModel = 5345,
     VulkanMemoryModelKHR = 5345,
     VulkanMemoryModelDeviceScope = 5346,
@@ -1006,7 +1033,9 @@ enum Capability : uint
     FragmentShaderShadingRateInterlockEXT = 5372,
     ShaderSMBuiltinsNV = 5373,
     FragmentShaderPixelInterlockEXT = 5378,
+    DemoteToHelperInvocation = 5379,
     DemoteToHelperInvocationEXT = 5379,
+    BindlessTextureNV = 5390,
     SubgroupShuffleINTEL = 5568,
     SubgroupBufferBlockIOINTEL = 5569,
     SubgroupImageBlockIOINTEL = 5570,
@@ -1017,8 +1046,12 @@ enum Capability : uint
     FunctionPointersINTEL = 5603,
     IndirectReferencesINTEL = 5604,
     AsmINTEL = 5606,
+    AtomicFloat32MinMaxEXT = 5612,
+    AtomicFloat64MinMaxEXT = 5613,
+    AtomicFloat16MinMaxEXT = 5616,
     VectorComputeINTEL = 5617,
     VectorAnyINTEL = 5619,
+    ExpectAssumeKHR = 5629,
     SubgroupAvcMotionEstimationINTEL = 5696,
     SubgroupAvcMotionEstimationIntraINTEL = 5697,
     SubgroupAvcMotionEstimationChromaINTEL = 5698,
@@ -1027,6 +1060,7 @@ enum Capability : uint
     FPGAMemoryAttributesINTEL = 5824,
     FPFastMathModeINTEL = 5837,
     ArbitraryPrecisionIntegersINTEL = 5844,
+    ArbitraryPrecisionFloatingPointINTEL = 5845,
     UnstructuredLoopControlsINTEL = 5886,
     FPGALoopControlsINTEL = 5888,
     KernelAttributesINTEL = 5892,
@@ -1034,14 +1068,30 @@ enum Capability : uint
     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,
+    BitInstructions = 6025,
     AtomicFloat32AddEXT = 6033,
     AtomicFloat64AddEXT = 6034,
     LongConstantCompositeINTEL = 6089,
+    OptNoneINTEL = 6094,
+    AtomicFloat16AddEXT = 6095,
+    DebugInfoModuleINTEL = 6114,
+    SplitBarrierINTEL = 6141,
+    GroupUniformArithmeticKHR = 6400,
 }
 
 enum RayFlagsShift : uint
@@ -1121,6 +1171,32 @@ enum FPOperationMode : uint
     ALT = 1,
 }
 
+enum QuantizationModes : uint
+{
+    TRN = 0,
+    TRN_ZERO = 1,
+    RND = 2,
+    RND_ZERO = 3,
+    RND_INF = 4,
+    RND_MIN_INF = 5,
+    RND_CONV = 6,
+    RND_CONV_ODD = 7,
+}
+
+enum OverflowModes : uint
+{
+    WRAP = 0,
+    SAT = 1,
+    SAT_ZERO = 2,
+    SAT_SYM = 3,
+}
+
+enum PackedVectorFormat : uint
+{
+    PackedVectorFormat4x8Bit = 0,
+    PackedVectorFormat4x8BitKHR = 0,
+}
+
 enum Op : uint
 {
     OpNop = 0,
@@ -1479,6 +1555,18 @@ enum Op : uint
     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,
@@ -1505,6 +1593,8 @@ enum Op : uint
     OpIgnoreIntersectionNV = 5335,
     OpTerminateRayNV = 5336,
     OpTraceNV = 5337,
+    OpTraceMotionNV = 5338,
+    OpTraceRayMotionNV = 5339,
     OpTypeAccelerationStructureKHR = 5341,
     OpTypeAccelerationStructureNV = 5341,
     OpExecuteCallableNV = 5344,
@@ -1515,8 +1605,16 @@ enum Op : uint
     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,
@@ -1541,11 +1639,15 @@ enum Op : uint
     OpUSubSatINTEL = 5596,
     OpIMul32x16INTEL = 5597,
     OpUMul32x16INTEL = 5598,
-    OpConstFunctionPointerINTEL = 5600,
+    OpConstantFunctionPointerINTEL = 5600,
     OpFunctionPointerCallINTEL = 5601,
     OpAsmTargetINTEL = 5609,
     OpAsmINTEL = 5610,
     OpAsmCallINTEL = 5611,
+    OpAtomicFMinEXT = 5614,
+    OpAtomicFMaxEXT = 5615,
+    OpAssumeTrueKHR = 5630,
+    OpExpectKHR = 5631,
     OpDecorateString = 5632,
     OpDecorateStringGOOGLE = 5632,
     OpMemberDecorateString = 5633,
@@ -1671,7 +1773,62 @@ enum Op : uint
     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,
@@ -1699,6 +1856,16 @@ enum Op : uint
     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,
 }
 
 

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/CMakeLists.txt

@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.0)
 
 set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix" FORCE)
 

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/bin/makeHeaders

@@ -4,4 +4,4 @@ python3 bin/makeExtinstHeaders.py
 
 cd ../../include/spirv/unified1
 ../../../tools/buildHeaders/build/install/bin/buildSpvHeaders -H spirv.core.grammar.json
-dos2unix spirv.* SpirV.* spv.*
+dos2unix spirv.* spv.*

+ 8 - 5
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp

@@ -69,9 +69,9 @@ namespace {
         TPrinter();
 
         static const int         DocMagicNumber = 0x07230203;
-        static const int         DocVersion     = 0x00010500;
-        static const int         DocRevision    = 4;
-        #define DocRevisionString                "4"
+        static const int         DocVersion     = 0x00010600;
+        static const int         DocRevision    = 1;
+        #define DocRevisionString                "1"
         static const std::string DocCopyright;
         static const std::string DocComment1;
         static const std::string DocComment2;
@@ -500,7 +500,7 @@ namespace {
 
         virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return pre() + name; }
 
-        virtual void printHasResultType(std::ostream& out) const
+        virtual void printHasResultType(std::ostream& out) const override
         {
             const Json::Value& enums = spvRoot["spv"]["enum"];
 
@@ -513,6 +513,9 @@ namespace {
                 }
 
                 out << "#ifdef SPV_ENABLE_UTILITY_CODE" << std::endl;
+                out << "#ifndef __cplusplus" << std::endl;
+                out << "#include <stdbool.h>" << std::endl;
+                out << "#endif" << std::endl;
                 out << "inline void " << pre() << "HasResultAndType(" << pre() << opName << " opcode, bool *hasResult, bool *hasResultType) {" << std::endl;
                 out << "    *hasResult = *hasResultType = false;" << std::endl;
                 out << "    switch (opcode) {" << std::endl;
@@ -643,7 +646,7 @@ namespace {
         }
 
         // Add type prefix for scoped enum
-        virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const { return opPrefix + "::" + name; }
+        virtual std::string fmtEnumUse(const std::string& opPrefix, const std::string& name) const override { return opPrefix + "::" + name; }
 
         std::string headerGuardSuffix() const override { return "HPP"; }
     };

+ 46 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.cpp

@@ -25,6 +25,7 @@
 #include <assert.h>
 #include <string.h>
 #include <algorithm>
+#include <cstdlib>
 #include <iostream>
 #include <unordered_map>
 #include <unordered_set>
@@ -63,6 +64,8 @@ EnumValues FPFastMathParams;
 EnumValues FPRoundingModeParams;
 EnumValues FPDenormModeParams;
 EnumValues FPOperationModeParams;
+EnumValues QuantizationModesParams;
+EnumValues OverflowModesParams;
 EnumValues LinkageTypeParams;
 EnumValues DecorationParams;
 EnumValues BuiltInParams;
@@ -84,6 +87,7 @@ EnumValues RayQueryIntersectionParams;
 EnumValues RayQueryCommittedIntersectionTypeParams;
 EnumValues RayQueryCandidateIntersectionTypeParams;
 EnumValues FragmentShadingRateParams;
+EnumValues PackedVectorFormatParams;
 
 std::pair<bool, std::string> ReadFile(const std::string& path)
 {
@@ -184,6 +188,10 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
             type = OperandFPDenormMode;
         } else if (operandKind == "FPOperationMode") {
             type = OperandFPOperationMode;
+        } else if (operandKind == "QuantizationModes") {
+            type = OperandQuantizationModes;
+        } else if (operandKind == "OverflowModes") {
+            type = OperandOverflowModes;
         } else if (operandKind == "LinkageType") {
             type = OperandLinkageType;
         } else if (operandKind == "AccessQualifier") {
@@ -224,6 +232,8 @@ ClassOptionality ToOperandClassAndOptionality(const std::string& operandKind, co
             type = OperandRayQueryCandidateIntersectionType;
         } else if (operandKind == "FragmentShadingRate") {
             type = OperandFragmentShadingRate;
+        } else if (operandKind == "PackedVectorFormat") {
+            type = OperandPackedVectorFormat;
         }
 
         if (type == OperandNone) {
@@ -326,6 +336,8 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
 
     // process the instructions
     const Json::Value insts = root["instructions"];
+    unsigned maxOpcode = 0;
+    bool firstOpcode = true;
     for (const auto& inst : insts) {
         const auto printingClass = inst["class"].asString();
         if (printingClass.size() == 0) {
@@ -341,6 +353,19 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
         }
         const auto opcode = inst["opcode"].asUInt();
         const std::string name = inst["opname"].asString();
+        if (firstOpcode) {
+          maxOpcode = opcode;
+          firstOpcode = false;
+        } else {
+          if (maxOpcode > opcode) {
+            std::cerr << "Error: " << name
+                      << " is out of order. It follows the instruction with opcode " << maxOpcode
+                      << std::endl;
+            std::exit(1);
+          } else {
+            maxOpcode = opcode;
+          }
+        }
         EnumCaps caps = getCaps(inst);
         std::string version = inst["version"].asString();
         std::string lastVersion = inst["lastVersion"].asString();
@@ -384,12 +409,27 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
             return result;
         };
 
+        unsigned maxValue = 0;
+        bool firstValue = true;
         for (const auto& enumerant : source["enumerants"]) {
             unsigned value;
             bool skip_zero_in_bitfield;
             std::tie(value, skip_zero_in_bitfield) = getValue(enumerant);
             if (skip_zero_in_bitfield)
                 continue;
+            if (firstValue) {
+              maxValue = value;
+              firstValue = false;
+            } else {
+              if (maxValue > value) {
+                std::cerr << "Error: " << source["kind"] << " enumerant " << enumerant["enumerant"]
+                          << " is out of order. It has value " <<  value
+                          << " but follows the enumerant with value " << maxValue << std::endl;
+                std::exit(1);
+              } else {
+                maxValue = value;
+              }
+            }
             EnumCaps caps(getCaps(enumerant));
             std::string version = enumerant["version"].asString();
             std::string lastVersion = enumerant["lastVersion"].asString();
@@ -462,6 +502,10 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
             establishOperandClass(enumName, OperandFPDenormMode, &FPDenormModeParams, operandEnum, category);
         } else if (enumName == "FPOperationMode") {
             establishOperandClass(enumName, OperandFPOperationMode, &FPOperationModeParams, operandEnum, category);
+        } else if (enumName == "QuantizationModes") {
+            establishOperandClass(enumName, OperandQuantizationModes, &QuantizationModesParams, operandEnum, category);
+        } else if (enumName == "OverflowModes") {
+            establishOperandClass(enumName, OperandOverflowModes, &OverflowModesParams, operandEnum, category);
         } else if (enumName == "LinkageType") {
             establishOperandClass(enumName, OperandLinkageType, &LinkageTypeParams, operandEnum, category);
         } else if (enumName == "FunctionParameterAttribute") {
@@ -498,6 +542,8 @@ void jsonToSpirv(const std::string& jsonPath, bool buildingHeaders)
             establishOperandClass(enumName, OperandRayQueryCandidateIntersectionType, &RayQueryCandidateIntersectionTypeParams, operandEnum, category);
         } else if (enumName == "FragmentShadingRate") {
             establishOperandClass(enumName, OperandFragmentShadingRate, &FragmentShadingRateParams, operandEnum, category);
+        } else if (enumName == "PackedVectorFormat") {
+            establishOperandClass(enumName, OperandPackedVectorFormat, &PackedVectorFormatParams, operandEnum, category);
         }
     }
 }

+ 3 - 0
ThirdParty/Glslang/External/spirv-tools/external/spirv-headers/tools/buildHeaders/jsonToSpirv.h

@@ -93,6 +93,9 @@ enum OperandClass {
     OperandFragmentShadingRate,
     OperandFPDenormMode,
     OperandFPOperationMode,
+    OperandQuantizationModes,
+    OperandOverflowModes,
+    OperandPackedVectorFormat,
 
     OperandOpcode,
 

+ 5 - 1
ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/instrument.hpp

@@ -170,11 +170,15 @@ static const int kInstMaxOutCnt = kInstStageOutCnt + 4;
 static const int kInstErrorBindlessBounds = 0;
 static const int kInstErrorBindlessUninit = 1;
 static const int kInstErrorBuffAddrUnallocRef = 2;
-static const int kInstErrorBindlessBuffOOB = 3;
+// Deleted: static const int kInstErrorBindlessBuffOOB = 3;
+// This comment will will remain for 2 releases to allow
+// for the transition of all builds. Buffer OOB is
+// generating the following four differentiated codes instead:
 static const int kInstErrorBuffOOBUniform = 4;
 static const int kInstErrorBuffOOBStorage = 5;
 static const int kInstErrorBuffOOBUniformTexel = 6;
 static const int kInstErrorBuffOOBStorageTexel = 7;
+static const int kInstErrorMax = kInstErrorBuffOOBStorageTexel;
 
 // Direct Input Buffer Offsets
 //

+ 46 - 12
ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/libspirv.h

@@ -113,6 +113,9 @@ typedef enum spv_endianness_t {
 // Sometimes we also need to be able to express the fact that an operand
 // is a member of an optional tuple of values.  In that case the first member
 // would be optional, and the subsequent members would be required.
+//
+// NOTE: Although we don't promise binary compatibility, as a courtesy, please
+// add new enum values at the end.
 typedef enum spv_operand_type_t {
   // A sentinel value.
   SPV_OPERAND_TYPE_NONE = 0,
@@ -167,12 +170,8 @@ typedef enum spv_operand_type_t {
   SPV_OPERAND_TYPE_KERNEL_ENQ_FLAGS,              // SPIR-V Sec 3.29
   SPV_OPERAND_TYPE_KERNEL_PROFILING_INFO,         // SPIR-V Sec 3.30
   SPV_OPERAND_TYPE_CAPABILITY,                    // SPIR-V Sec 3.31
-  SPV_OPERAND_TYPE_RAY_FLAGS,                     // SPIR-V Sec 3.RF
-  SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION,        // SPIR-V Sec 3.RQIntersection
-  SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE,  // SPIR-V Sec
-                                                           // 3.RQCommitted
-  SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE,  // SPIR-V Sec
-                                                           // 3.RQCandidate
+
+  // NOTE: New concrete enum values should be added at the end.
 
   // Set 5:  Operands that are a single word bitmask.
   // Sometimes a set bit indicates the instruction requires still more operands.
@@ -184,7 +183,10 @@ typedef enum spv_operand_type_t {
   SPV_OPERAND_TYPE_MEMORY_ACCESS,          // SPIR-V Sec 3.26
   SPV_OPERAND_TYPE_FRAGMENT_SHADING_RATE,  // SPIR-V Sec 3.FSR
 
-// The remaining operand types are only used internally by the assembler.
+// NOTE: New concrete enum values should be added at the end.
+
+// The "optional" and "variable"  operand types are only used internally by
+// the assembler and the binary parser.
 // There are two categories:
 //    Optional : expands to 0 or 1 operand, like ? in regular expressions.
 //    Variable : expands to 0, 1 or many operands or pairs of operands.
@@ -264,6 +266,24 @@ typedef enum spv_operand_type_t {
   // https://github.com/intel/llvm/blob/39fa9b0cbfbae88327118990a05c5b387b56d2ef/sycl/doc/extensions/SPIRV/SPV_INTEL_float_controls2.asciidoc
   SPV_OPERAND_TYPE_FPDENORM_MODE,     // Sec 3.17 FP Denorm Mode
   SPV_OPERAND_TYPE_FPOPERATION_MODE,  // Sec 3.18 FP Operation Mode
+  // A value enum from https://github.com/KhronosGroup/SPIRV-Headers/pull/177
+  SPV_OPERAND_TYPE_QUANTIZATION_MODES,
+  // A value enum from https://github.com/KhronosGroup/SPIRV-Headers/pull/177
+  SPV_OPERAND_TYPE_OVERFLOW_MODES,
+
+  // Concrete operand types for the provisional Vulkan ray tracing feature.
+  SPV_OPERAND_TYPE_RAY_FLAGS,               // SPIR-V Sec 3.RF
+  SPV_OPERAND_TYPE_RAY_QUERY_INTERSECTION,  // SPIR-V Sec 3.RQIntersection
+  SPV_OPERAND_TYPE_RAY_QUERY_COMMITTED_INTERSECTION_TYPE,  // SPIR-V Sec
+                                                           // 3.RQCommitted
+  SPV_OPERAND_TYPE_RAY_QUERY_CANDIDATE_INTERSECTION_TYPE,  // SPIR-V Sec
+                                                           // 3.RQCandidate
+
+  // Concrete operand types for integer dot product.
+  // Packed vector format
+  SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT,  // SPIR-V Sec 3.x
+  // An optional packed vector format
+  SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT,
 
   // This is a sentinel value, and does not represent an operand type.
   // It should come last.
@@ -289,6 +309,7 @@ typedef enum spv_ext_inst_type_t {
   SPV_EXT_INST_TYPE_DEBUGINFO,
   SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100,
   SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
+  SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100,
 
   // Multiple distinct extended instruction set types could return this
   // value, if they are prefixed with NonSemantic. and are otherwise
@@ -461,6 +482,7 @@ SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void);
 //    SPV_ENV_VULKAN_1_1           ->  SPIR-V 1.3
 //    SPV_ENV_VULKAN_1_1_SPIRV_1_4 ->  SPIR-V 1.4
 //    SPV_ENV_VULKAN_1_2           ->  SPIR-V 1.5
+//    SPV_ENV_VULKAN_1_3           ->  SPIR-V 1.6
 // Consult the description of API entry points for specific rules.
 typedef enum {
   SPV_ENV_UNIVERSAL_1_0,  // SPIR-V 1.0 latest revision, no other restrictions.
@@ -495,6 +517,11 @@ typedef enum {
 
   SPV_ENV_UNIVERSAL_1_5,  // SPIR-V 1.5 latest revision, no other restrictions.
   SPV_ENV_VULKAN_1_2,     // Vulkan 1.2 latest revision.
+
+  SPV_ENV_UNIVERSAL_1_6,  // SPIR-V 1.6 latest revision, no other restrictions.
+  SPV_ENV_VULKAN_1_3,     // Vulkan 1.3 latest revision.
+
+  SPV_ENV_MAX  // Keep this as the last enum value.
 } spv_target_env;
 
 // SPIR-V Validator can be parameterized with the following Universal Limits.
@@ -533,7 +560,7 @@ SPIRV_TOOLS_EXPORT bool spvParseVulkanEnv(uint32_t vulkan_ver,
 // Creates a context object for most of the SPIRV-Tools API.
 // Returns null if env is invalid.
 //
-// See specific API calls for how the target environment is interpeted
+// See specific API calls for how the target environment is interpreted
 // (particularly assembly and validation).
 SPIRV_TOOLS_EXPORT spv_context spvContextCreate(spv_target_env env);
 
@@ -585,9 +612,11 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxLogicalPointer(
 //    set that option.
 // 2) Pointers that are pass as parameters to function calls do not have to
 //    match the storage class of the formal parameter.
-// 3) Pointers that are actaul parameters on function calls do not have to point
+// 3) Pointers that are actual parameters on function calls do not have to point
 //    to the same type pointed as the formal parameter.  The types just need to
 //    logically match.
+// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
+//    for a first argument.
 SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetBeforeHlslLegalization(
     spv_validator_options options, bool val);
 
@@ -609,7 +638,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetUniformBufferStandardLayout(
 // Records whether the validator should use "scalar" block layout rules.
 // Scalar layout rules are more permissive than relaxed block layout.
 //
-// See Vulkan extnesion VK_EXT_scalar_block_layout.  The scalar alignment is
+// See Vulkan extension VK_EXT_scalar_block_layout.  The scalar alignment is
 // defined as follows:
 // - scalar alignment of a scalar is the scalar size
 // - scalar alignment of a vector is the scalar alignment of its component
@@ -636,6 +665,11 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetWorkgroupScalarBlockLayout(
 SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetSkipBlockLayout(
     spv_validator_options options, bool val);
 
+// Records whether or not the validator should allow the LocalSizeId
+// decoration where the environment otherwise would not allow it.
+SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowLocalSizeId(
+    spv_validator_options options, bool val);
+
 // Creates an optimizer options object with default options. Returns a valid
 // options object. The object remains valid until it is passed into
 // |spvOptimizerOptionsDestroy|.
@@ -671,7 +705,7 @@ SPIRV_TOOLS_EXPORT void spvOptimizerOptionsSetPreserveSpecConstants(
 // Creates a reducer options object with default options. Returns a valid
 // options object. The object remains valid until it is passed into
 // |spvReducerOptionsDestroy|.
-SPIRV_TOOLS_EXPORT spv_reducer_options spvReducerOptionsCreate();
+SPIRV_TOOLS_EXPORT spv_reducer_options spvReducerOptionsCreate(void);
 
 // Destroys the given reducer options object.
 SPIRV_TOOLS_EXPORT void spvReducerOptionsDestroy(spv_reducer_options options);
@@ -698,7 +732,7 @@ SPIRV_TOOLS_EXPORT void spvReducerOptionsSetTargetFunction(
 // Creates a fuzzer options object with default options. Returns a valid
 // options object. The object remains valid until it is passed into
 // |spvFuzzerOptionsDestroy|.
-SPIRV_TOOLS_EXPORT spv_fuzzer_options spvFuzzerOptionsCreate();
+SPIRV_TOOLS_EXPORT spv_fuzzer_options spvFuzzerOptionsCreate(void);
 
 // Destroys the given fuzzer options object.
 SPIRV_TOOLS_EXPORT void spvFuzzerOptionsDestroy(spv_fuzzer_options options);

+ 10 - 2
ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/libspirv.hpp

@@ -36,7 +36,7 @@ class Context {
  public:
   // Constructs a context targeting the given environment |env|.
   //
-  // See specific API calls for how the target environment is interpeted
+  // See specific API calls for how the target environment is interpreted
   // (particularly assembly and validation).
   //
   // The constructed instance will have an empty message consumer, which just
@@ -115,6 +115,12 @@ class ValidatorOptions {
     spvValidatorOptionsSetSkipBlockLayout(options_, val);
   }
 
+  // Enables LocalSizeId decorations where the environment would not otherwise
+  // allow them.
+  void SetAllowLocalSizeId(bool val) {
+    spvValidatorOptionsSetAllowLocalSizeId(options_, val);
+  }
+
   // Records whether or not the validator should relax the rules on pointer
   // usage in logical addressing mode.
   //
@@ -133,9 +139,11 @@ class ValidatorOptions {
   //    set that option.
   // 2) Pointers that are pass as parameters to function calls do not have to
   //    match the storage class of the formal parameter.
-  // 3) Pointers that are actaul parameters on function calls do not have to
+  // 3) Pointers that are actual parameters on function calls do not have to
   //    point to the same type pointed as the formal parameter.  The types just
   //    need to logically match.
+  // 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
+  //    for a first argument.
   void SetBeforeHlslLegalization(bool val) {
     spvValidatorOptionsSetBeforeHlslLegalization(options_, val);
   }

+ 89 - 20
ThirdParty/Glslang/External/spirv-tools/include/spirv-tools/optimizer.hpp

@@ -19,6 +19,7 @@
 #include <ostream>
 #include <string>
 #include <unordered_map>
+#include <utility>
 #include <vector>
 
 #include "libspirv.hpp"
@@ -27,7 +28,8 @@ namespace spvtools {
 
 namespace opt {
 class Pass;
-}
+struct DescriptorSetAndBinding;
+}  // namespace opt
 
 // C++ interface for SPIR-V optimization functionalities. It wraps the context
 // (including target environment and the corresponding SPIR-V grammar) and
@@ -41,7 +43,7 @@ class Optimizer {
   // consumed by the RegisterPass() method. Tokens are one-time objects that
   // only support move; copying is not allowed.
   struct PassToken {
-    struct Impl;  // Opaque struct for holding inernal data.
+    struct Impl;  // Opaque struct for holding internal data.
 
     PassToken(std::unique_ptr<Impl>);
 
@@ -225,16 +227,17 @@ Optimizer::PassToken CreateNullPass();
 
 // Creates a strip-debug-info pass.
 // A strip-debug-info pass removes all debug instructions (as documented in
-// Section 3.32.2 of the SPIR-V spec) of the SPIR-V module to be optimized.
+// Section 3.42.2 of the SPIR-V spec) of the SPIR-V module to be optimized.
 Optimizer::PassToken CreateStripDebugInfoPass();
 
-// Creates a strip-reflect-info pass.
-// A strip-reflect-info pass removes all reflections instructions.
-// For now, this is limited to removing decorations defined in
-// SPV_GOOGLE_hlsl_functionality1.  The coverage may expand in
-// the future.
+// [Deprecated] This will create a strip-nonsemantic-info pass.  See below.
 Optimizer::PassToken CreateStripReflectInfoPass();
 
+// Creates a strip-nonsemantic-info pass.
+// A strip-nonsemantic-info pass removes all reflections and explicitly
+// non-semantic instructions.
+Optimizer::PassToken CreateStripNonSemanticInfoPass();
+
 // Creates an eliminate-dead-functions pass.
 // An eliminate-dead-functions pass will remove all functions that are not in
 // the call trees rooted at entry points and exported functions.  These
@@ -293,11 +296,11 @@ Optimizer::PassToken CreateFreezeSpecConstantValuePass();
 // and can be changed in future. A spec constant is foldable if all of its
 // value(s) can be determined from the module. E.g., an integer spec constant
 // defined with OpSpecConstantOp instruction can be folded if its value won't
-// change later. This pass will replace the original OpSpecContantOp instruction
-// with an OpConstant instruction. When folding composite spec constants,
-// new instructions may be inserted to define the components of the composite
-// constant first, then the original spec constants will be replaced by
-// OpConstantComposite instructions.
+// change later. This pass will replace the original OpSpecConstantOp
+// instruction with an OpConstant instruction. When folding composite spec
+// constants, new instructions may be inserted to define the components of the
+// composite constant first, then the original spec constants will be replaced
+// by OpConstantComposite instructions.
 //
 // There are some operations not supported yet:
 //   OpSConvert, OpFConvert, OpQuantizeToF16 and
@@ -323,7 +326,7 @@ Optimizer::PassToken CreateUnifyConstantPass();
 
 // Creates a eliminate-dead-constant pass.
 // A eliminate-dead-constant pass removes dead constants, including normal
-// contants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
+// constants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
 // OpConstantFalse and spec constants defined by OpSpecConstant,
 // OpSpecConstantComposite, OpSpecConstantTrue, OpSpecConstantFalse or
 // OpSpecConstantOp.
@@ -387,7 +390,7 @@ Optimizer::PassToken CreateInlineOpaquePass();
 // Only modules with relaxed logical addressing (see opt/instruction.h) are
 // currently processed.
 //
-// This pass is most effective if preceeded by Inlining and
+// This pass is most effective if preceded by Inlining and
 // LocalAccessChainConvert. This pass will reduce the work needed to be done
 // by LocalSingleStoreElim and LocalMultiStoreElim.
 //
@@ -405,7 +408,7 @@ Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass();
 // Note that some branches and blocks may be left to avoid creating invalid
 // control flow. Improving this is left to future work.
 //
-// This pass is most effective when preceeded by passes which eliminate
+// This pass is most effective when preceded by passes which eliminate
 // local loads and stores, effectively propagating constant values where
 // possible.
 Optimizer::PassToken CreateDeadBranchElimPass();
@@ -422,7 +425,7 @@ Optimizer::PassToken CreateDeadBranchElimPass();
 // are currently processed. Currently modules with any extensions enabled are
 // not processed. This is left for future work.
 //
-// This pass is most effective if preceeded by Inlining and
+// This pass is most effective if preceded by Inlining and
 // LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim
 // will reduce the work that this pass has to do.
 Optimizer::PassToken CreateLocalMultiStoreElimPass();
@@ -512,7 +515,20 @@ Optimizer::PassToken CreateDeadInsertElimPass();
 // Conversion, which tends to cause cycles of dead code to be left after
 // Store/Load elimination passes are completed. These cycles cannot be
 // eliminated with standard dead code elimination.
+//
+// If |preserve_interface| is true, all non-io variables in the entry point
+// interface are considered live and are not eliminated. This mode is needed
+// by GPU-Assisted validation instrumentation, where a change in the interface
+// is not allowed.
 Optimizer::PassToken CreateAggressiveDCEPass();
+Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface);
+
+// Creates a remove-unused-interface-variables pass.
+// Removes variables referenced on the |OpEntryPoint| instruction that are not
+// referenced in the entry point function or any function in its call tree. Note
+// that this could cause the shader interface to no longer match other shader
+// stages.
+Optimizer::PassToken CreateRemoveUnusedInterfaceVariablesPass();
 
 // Creates an empty pass.
 // This is deprecated and will be removed.
@@ -614,7 +630,7 @@ Optimizer::PassToken CreateRedundancyEliminationPass();
 Optimizer::PassToken CreateScalarReplacementPass(uint32_t size_limit = 100);
 
 // Create a private to local pass.
-// This pass looks for variables delcared in the private storage class that are
+// This pass looks for variables declared in the private storage class that are
 // used in only one function.  Those variables are moved to the function storage
 // class in the function that they are used.
 Optimizer::PassToken CreatePrivateToLocalPass();
@@ -692,8 +708,11 @@ Optimizer::PassToken CreateVectorDCEPass();
 // Create a pass to reduce the size of loads.
 // This pass looks for loads of structures where only a few of its members are
 // used.  It replaces the loads feeding an OpExtract with an OpAccessChain and
-// a load of the specific elements.
-Optimizer::PassToken CreateReduceLoadSizePass();
+// a load of the specific elements.  The parameter is a threshold to determine
+// whether we have to replace the load or not.  If the ratio of the used
+// components of the load is less than the threshold, we replace the load.
+Optimizer::PassToken CreateReduceLoadSizePass(
+    double load_replacement_threshold = 0.9);
 
 // Create a pass to combine chained access chains.
 // This pass looks for access chains fed by other access chains and combines
@@ -816,6 +835,26 @@ Optimizer::PassToken CreateFixStorageClassPass();
 //   inclusive.
 Optimizer::PassToken CreateGraphicsRobustAccessPass();
 
+// Create a pass to spread Volatile semantics to variables with SMIDNV,
+// WarpIDNV, SubgroupSize, SubgroupLocalInvocationId, SubgroupEqMask,
+// SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or SubgroupLtMask BuiltIn
+// decorations or OpLoad for them when the shader model is the ray generation,
+// closest hit, miss, intersection, or callable. This pass can be used for
+// VUID-StandaloneSpirv-VulkanMemoryModel-04678 and
+// VUID-StandaloneSpirv-VulkanMemoryModel-04679 (See "Standalone SPIR-V
+// Validation" section of Vulkan spec "Appendix A: Vulkan Environment for
+// SPIR-V"). When the SPIR-V version is 1.6 or above, the pass also spreads
+// the Volatile semantics to a variable with HelperInvocation BuiltIn decoration
+// in the fragement shader.
+Optimizer::PassToken CreateSpreadVolatileSemanticsPass();
+
+// Create a pass to replace a descriptor access using variable index.
+// This pass replaces every access using a variable index to array variable
+// |desc| that has a DescriptorSet and Binding decorations with a constant
+// element of the array. In order to replace the access using a variable index
+// with the constant element, it uses a switch statement.
+Optimizer::PassToken CreateReplaceDescArrayAccessUsingVarIndexPass();
+
 // Create descriptor scalar replacement pass.
 // This pass replaces every array variable |desc| that has a DescriptorSet and
 // Binding decorations with a new variable for each element of the array.
@@ -838,6 +877,36 @@ Optimizer::PassToken CreateWrapOpKillPass();
 // capabilities.
 Optimizer::PassToken CreateAmdExtToKhrPass();
 
+// Replaces the internal version of GLSLstd450 InterpolateAt* extended
+// instructions with the externally valid version. The internal version allows
+// an OpLoad of the interpolant for the first argument. This pass removes the
+// OpLoad and replaces it with its pointer. glslang and possibly other
+// frontends will create the internal version for HLSL. This pass will be part
+// of HLSL legalization and should be called after interpolants have been
+// propagated into their final positions.
+Optimizer::PassToken CreateInterpolateFixupPass();
+
+// Removes unused components from composite input variables. Current
+// implementation just removes trailing unused components from input arrays.
+// The pass performs best after maximizing dead code removal. A subsequent dead
+// code elimination pass would be beneficial in removing newly unused component
+// types.
+Optimizer::PassToken CreateEliminateDeadInputComponentsPass();
+
+// Creates a convert-to-sampled-image pass to convert images and/or
+// samplers with given pairs of descriptor set and binding to sampled image.
+// If a pair of an image and a sampler have the same pair of descriptor set and
+// binding that is one of the given pairs, they will be converted to a sampled
+// image. In addition, if only an image has the descriptor set and binding that
+// is one of the given pairs, it will be converted to a sampled image as well.
+Optimizer::PassToken CreateConvertToSampledImagePass(
+    const std::vector<opt::DescriptorSetAndBinding>&
+        descriptor_set_binding_pairs);
+
+// 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();
 }  // namespace spvtools
 
 #endif  // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_

+ 2 - 1
ThirdParty/Glslang/External/spirv-tools/kokoro/check-format/build.sh

@@ -35,7 +35,8 @@ git clone https://github.com/google/googletest          external/googletest
 cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd ..
 git clone --depth=1 https://github.com/google/effcee              external/effcee
 git clone --depth=1 https://github.com/google/re2                 external/re2
-curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py;
+# The --fail flag causes the command to fail on HTTP error response codes, like 404.
+curl -L --fail https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/clang-format-diff.py -o utils/clang-format-diff.py
 
 echo $(date): Check formatting...
 ./utils/check_code_format.sh;

+ 5 - 5
ThirdParty/Glslang/External/spirv-tools/kokoro/macos-clang-release-bazel/build.sh

@@ -31,14 +31,14 @@ cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31
 git clone --depth=1 https://github.com/google/effcee              external/effcee
 git clone --depth=1 https://github.com/google/re2                 external/re2
 
-# Get bazel 0.29.1.
-gsutil cp gs://bazel/0.29.1/release/bazel-0.29.1-darwin-x86_64 .
-chmod +x bazel-0.29.1-darwin-x86_64
+# Get bazel 5.0.0
+gsutil cp gs://bazel/5.0.0/release/bazel-5.0.0-darwin-x86_64 .
+chmod +x bazel-5.0.0-darwin-x86_64
 
 echo $(date): Build everything...
-./bazel-0.29.1-darwin-x86_64 build :all
+./bazel-5.0.0-darwin-x86_64 build :all
 echo $(date): Build completed.
 
 echo $(date): Starting bazel test...
-./bazel-0.29.1-darwin-x86_64 test :all
+./bazel-5.0.0-darwin-x86_64 test :all
 echo $(date): Bazel test completed.

+ 14 - 3
ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/linux/build-docker.sh

@@ -51,14 +51,14 @@ clone_if_missing https://github.com/google/googletest          external/googlete
 pushd external/googletest; git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7; popd
 clone_if_missing https://github.com/google/effcee              external/effcee        --depth=1
 clone_if_missing https://github.com/google/re2                 external/re2           --depth=1
-clone_if_missing https://github.com/protocolbuffers/protobuf   external/protobuf      --branch v3.13.0
+clone_if_missing https://github.com/protocolbuffers/protobuf   external/protobuf      --branch v3.13.0.1
 
 if [ $TOOL = "cmake" ]; then
   using cmake-3.17.2
   using ninja-1.10.0
 
   # Possible configurations are:
-  # ASAN, COVERAGE, RELEASE, DEBUG, DEBUG_EXCEPTION, RELEASE_MINGW
+  # ASAN, UBSAN, COVERAGE, RELEASE, DEBUG, DEBUG_EXCEPTION, RELEASE_MINGW
   BUILD_TYPE="Debug"
   if [ $CONFIG = "RELEASE" ] || [ $CONFIG = "RELEASE_MINGW" ]; then
     BUILD_TYPE="RelWithDebInfo"
@@ -69,6 +69,13 @@ if [ $TOOL = "cmake" ]; then
   if [ $CONFIG = "ASAN" ]; then
     ADDITIONAL_CMAKE_FLAGS="-DSPIRV_USE_SANITIZER=address,bounds,null"
     [ $COMPILER = "clang" ] || { echo "$CONFIG requires clang"; exit 1; }
+  elif [ $CONFIG = "UBSAN" ]; then
+    # UBSan requires RTTI, and by default UBSan does not exit when errors are
+    # encountered - additional compiler options are required to force this.
+    # The -DSPIRV_USE_SANITIZER=undefined option instructs SPIR-V Tools to be
+    # built with UBSan enabled.
+    ADDITIONAL_CMAKE_FLAGS="-DSPIRV_USE_SANITIZER=undefined -DENABLE_RTTI=ON -DCMAKE_C_FLAGS=-fno-sanitize-recover=all -DCMAKE_CXX_FLAGS=-fno-sanitize-recover=all"
+    [ $COMPILER = "clang" ] || { echo "$CONFIG requires clang"; exit 1; }
   elif [ $CONFIG = "COVERAGE" ]; then
     ADDITIONAL_CMAKE_FLAGS="-DENABLE_CODE_COVERAGE=ON"
     SKIP_TESTS="True"
@@ -79,6 +86,10 @@ if [ $TOOL = "cmake" ]; then
     SKIP_TESTS="True"
   fi
 
+  if [ $COMPILER = "clang" ]; then
+    ADDITIONAL_CMAKE_FLAGS="$ADDITIONAL_CMAKE_FLAGS -DSPIRV_BUILD_LIBFUZZER_TARGETS=ON"
+  fi
+
   clean_dir "$ROOT_DIR/build"
   cd "$ROOT_DIR/build"
 
@@ -184,7 +195,7 @@ elif [ $TOOL = "android-ndk-build" ]; then
 
   echo $(date): ndk-build completed.
 elif [ $TOOL = "bazel" ]; then
-  using bazel-3.1.0
+  using bazel-5.0.0
 
   echo $(date): Build everything...
   bazel build :all

+ 2 - 0
ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/linux/build.sh

@@ -26,7 +26,9 @@ COMPILER=$2
 TOOL=$3
 BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
 
+# "--privileged" is required to run ptrace in the asan builds.
 docker run --rm -i \
+  --privileged \
   --volume "${ROOT_DIR}:${ROOT_DIR}" \
   --volume "${KOKORO_ARTIFACTS_DIR}:${KOKORO_ARTIFACTS_DIR}" \
   --workdir "${ROOT_DIR}" \

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/kokoro/scripts/macos/build.sh

@@ -36,7 +36,7 @@ git clone https://github.com/google/googletest          external/googletest
 cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd ..
 git clone --depth=1 https://github.com/google/effcee              external/effcee
 git clone --depth=1 https://github.com/google/re2                 external/re2
-git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf
+git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf
 
 mkdir build && cd $SRC/build
 

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

@@ -30,7 +30,7 @@ git clone https://github.com/google/googletest          external/googletest
 cd external && cd googletest && git reset --hard 1fb1bb23bb8418dc73a5a9a82bbed31dc610fec7 && cd .. && cd ..
 git clone --depth=1 https://github.com/google/effcee              external/effcee
 git clone --depth=1 https://github.com/google/re2                 external/re2
-git clone --depth=1 --branch v3.13.0 https://github.com/protocolbuffers/protobuf external/protobuf
+git clone --depth=1 --branch v3.13.0.1 https://github.com/protocolbuffers/protobuf external/protobuf
 
 :: #########################################
 :: set up msvc build env
@@ -41,9 +41,6 @@ if %VS_VERSION% == 2017 (
 ) else if %VS_VERSION% == 2015 (
   call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
   echo "Using VS 2015..."
-) else if %VS_VERSION% == 2013 (
-  call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
-  echo "Using VS 2013..."
 )
 
 cd %SRC%
@@ -62,15 +59,8 @@ if "%KOKORO_GITHUB_COMMIT%." == "." (
 
 set CMAKE_FLAGS=-DCMAKE_INSTALL_PREFIX=%KOKORO_ARTIFACTS_DIR%\install -GNinja -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRE2_BUILD_TESTING=OFF -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
 
-:: Skip building tests for VS2013
-if %VS_VERSION% == 2013 (
-  set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_SKIP_TESTS=ON
-)
-
-:: Skip building spirv-fuzz for VS2013; it relies on protobufs which VS2013 cannot handle.
-if %VS_VERSION% NEQ 2013 (
-  set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON
-)
+:: Build spirv-fuzz
+set CMAKE_FLAGS=%CMAKE_FLAGS% -DSPIRV_BUILD_FUZZER=ON
 
 cmake %CMAKE_FLAGS% ..
 
@@ -85,13 +75,11 @@ echo "Build Completed %DATE% %TIME%"
 setlocal ENABLEDELAYEDEXPANSION
 
 :: ################################################
-:: Run the tests (We no longer run tests on VS2013)
+:: Run the tests
 :: ################################################
 echo "Running Tests... %DATE% %TIME%"
-if %VS_VERSION% NEQ 2013 (
-  ctest -C %BUILD_TYPE% --output-on-failure --timeout 300
-  if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL!
-)
+ctest -C %BUILD_TYPE% --output-on-failure --timeout 300
+if !ERRORLEVEL! NEQ 0 exit /b !ERRORLEVEL!
 echo "Tests Completed %DATE% %TIME%"
 
 :: ################################################
@@ -106,4 +94,3 @@ rm -rf %SRC%\build
 rm -rf %SRC%\external
 
 exit /b 0
-

+ 0 - 16
ThirdParty/Glslang/External/spirv-tools/kokoro/windows-msvc-2013-release/continuous.cfg

@@ -1,16 +0,0 @@
-# Copyright (c) 2018 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.
-
-# Continuous build configuration.
-build_file: "SPIRV-Tools/kokoro/windows-msvc-2013-release/build.bat"

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/kokoro/windows-msvc-2015-release-bazel/build.bat

@@ -30,14 +30,13 @@ git clone --depth=1 https://github.com/google/effcee              external/effce
 git clone --depth=1 https://github.com/google/re2                 external/re2
 
 :: REM Install Bazel.
-wget -q https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-windows-x86_64.zip
-unzip -q bazel-0.29.1-windows-x86_64.zip
+wget -q https://github.com/bazelbuild/bazel/releases/download/5.0.0/bazel-5.0.0-windows-x86_64.zip
+unzip -q bazel-5.0.0-windows-x86_64.zip
 
 :: Set up MSVC
 call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64
 set BAZEL_VS=C:\Program Files (x86)\Microsoft Visual Studio 14.0
 set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
-set BAZEL_SH=c:\tools\msys64\usr\bin\bash.exe
 set BAZEL_PYTHON=c:\tools\python2\python.exe
 
 :: #########################################

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

@@ -17,10 +17,10 @@ set(VIMSYNTAX_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_vim_sy
 set(XML_REGISTRY_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_registry_tables.py")
 set(LANG_HEADER_PROCESSING_SCRIPT "${spirv-tools_SOURCE_DIR}/utils/generate_language_headers.py")
 
-# For now, assume the DebugInfo grammar file is in the current directory.
-# It might migrate to SPIRV-Headers.
+# Pull in grammar files that have migrated to SPIRV-Headers
 set(DEBUGINFO_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.debuginfo.grammar.json")
 set(CLDEBUGINFO100_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.opencl.debuginfo.100.grammar.json")
+set(VKDEBUGINFO100_GRAMMAR_JSON_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.nonsemantic.shader.debuginfo.100.grammar.json")
 
 # macro() definitions are used in the following because we need to append .inc
 # file paths into some global lists (*_CPP_DEPENDS). And those global lists are
@@ -113,6 +113,9 @@ endmacro(spvtools_opencl_tables)
 macro(spvtools_vendor_tables VENDOR_TABLE SHORT_NAME OPERAND_KIND_PREFIX)
   set(INSTS_FILE "${spirv-tools_BINARY_DIR}/${VENDOR_TABLE}.insts.inc")
   set(GRAMMAR_FILE "${SPIRV_HEADER_INCLUDE_DIR}/spirv/unified1/extinst.${VENDOR_TABLE}.grammar.json")
+  if(NOT EXISTS ${GRAMMAR_FILE})
+    set(GRAMMAR_FILE "${spirv-tools_SOURCE_DIR}/source/extinst.${VENDOR_TABLE}.grammar.json")
+  endif()
   add_custom_command(OUTPUT ${INSTS_FILE}
     COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT}
       --extinst-vendor-grammar=${GRAMMAR_FILE}
@@ -148,9 +151,11 @@ spvtools_vendor_tables("spv-amd-gcn-shader" "spv-amd-gs" "")
 spvtools_vendor_tables("spv-amd-shader-ballot" "spv-amd-sb" "")
 spvtools_vendor_tables("debuginfo" "debuginfo" "")
 spvtools_vendor_tables("opencl.debuginfo.100" "cldi100" "CLDEBUG100_")
+spvtools_vendor_tables("nonsemantic.shader.debuginfo.100" "shdi100" "SHDEBUG100_")
 spvtools_vendor_tables("nonsemantic.clspvreflection" "clspvreflection" "")
 spvtools_extinst_lang_headers("DebugInfo" ${DEBUGINFO_GRAMMAR_JSON_FILE})
 spvtools_extinst_lang_headers("OpenCLDebugInfo100" ${CLDEBUGINFO100_GRAMMAR_JSON_FILE})
+spvtools_extinst_lang_headers("NonSemanticShaderDebugInfo100" ${VKDEBUGINFO100_GRAMMAR_JSON_FILE})
 
 spvtools_vimsyntax("unified1" "1.0")
 add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE})
@@ -211,21 +216,26 @@ add_subdirectory(opt)
 add_subdirectory(reduce)
 add_subdirectory(fuzz)
 add_subdirectory(link)
+add_subdirectory(lint)
+add_subdirectory(diff)
 
 set(SPIRV_SOURCES
   ${spirv-tools_SOURCE_DIR}/include/spirv-tools/libspirv.h
 
   ${CMAKE_CURRENT_SOURCE_DIR}/util/bitutils.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/bit_vector.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/util/hash_combine.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/hex_float.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/make_unique.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/parse_number.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/util/pooled_linked_list.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/small_vector.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/string_utils.h
   ${CMAKE_CURRENT_SOURCE_DIR}/util/timer.h
   ${CMAKE_CURRENT_SOURCE_DIR}/assembly_grammar.h
   ${CMAKE_CURRENT_SOURCE_DIR}/binary.h
   ${CMAKE_CURRENT_SOURCE_DIR}/cfa.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/common_debug_info.h
   ${CMAKE_CURRENT_SOURCE_DIR}/diagnostic.h
   ${CMAKE_CURRENT_SOURCE_DIR}/disassemble.h
   ${CMAKE_CURRENT_SOURCE_DIR}/enum_set.h
@@ -359,7 +369,7 @@ function(spirv_tools_default_target_options target)
   )
   set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools libraries")
   spvtools_check_symbol_exports(${target})
-  add_dependencies(${target} core_tables enum_string_mapping extinst_tables)
+  add_dependencies(${target} spirv-tools-build-version core_tables enum_string_mapping extinst_tables)
 endfunction()
 
 # Always build ${SPIRV_TOOLS}-shared. This is expected distro packages, and
@@ -402,6 +412,12 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   endif()
 endif()
 
+if (ANDROID)
+    foreach(target ${SPIRV_TOOLS_TARGETS})
+        target_link_libraries(${target} PRIVATE android log)
+    endforeach()
+endif()
+
 if(ENABLE_SPIRV_TOOLS_INSTALL)
   install(TARGETS ${SPIRV_TOOLS_TARGETS} EXPORT ${SPIRV_TOOLS}Targets
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -415,8 +431,10 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
   # Special config file for root library compared to other libs.
   file(WRITE ${CMAKE_BINARY_DIR}/${SPIRV_TOOLS}Config.cmake
     "include(\${CMAKE_CURRENT_LIST_DIR}/${SPIRV_TOOLS}Target.cmake)\n"
-    "set(${SPIRV_TOOLS}_LIBRARIES ${SPIRV_TOOLS})\n"
-    "get_target_property(${SPIRV_TOOLS}_INCLUDE_DIRS ${SPIRV_TOOLS} INTERFACE_INCLUDE_DIRECTORIES)\n")
+    "if(TARGET ${SPIRV_TOOLS})\n"
+    "    set(${SPIRV_TOOLS}_LIBRARIES ${SPIRV_TOOLS})\n"
+    "    get_target_property(${SPIRV_TOOLS}_INCLUDE_DIRS ${SPIRV_TOOLS} INTERFACE_INCLUDE_DIRECTORIES)\n"
+    "endif()\n")
   install(FILES ${CMAKE_BINARY_DIR}/${SPIRV_TOOLS}Config.cmake DESTINATION ${PACKAGE_DIR})
 endif(ENABLE_SPIRV_TOOLS_INSTALL)
 

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

@@ -62,9 +62,9 @@ spv_result_t spvTextParseMaskOperand(spv_target_env env,
     end = std::find(begin, text_end, separator);
 
     spv_operand_desc entry = nullptr;
-    if (spvOperandTableNameLookup(env, operandTable, type, begin, end - begin,
-                                  &entry)) {
-      return SPV_ERROR_INVALID_TEXT;
+    if (auto error = spvOperandTableNameLookup(env, operandTable, type, begin,
+                                               end - begin, &entry)) {
+      return error;
     }
     value |= entry->value;
 

+ 29 - 21
ThirdParty/Glslang/External/spirv-tools/source/binary.cpp

@@ -33,6 +33,7 @@
 #include "source/operand.h"
 #include "source/spirv_constant.h"
 #include "source/spirv_endian.h"
+#include "source/util/string_utils.h"
 
 spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
                                 const spv_endianness_t endian,
@@ -62,6 +63,15 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
   return SPV_SUCCESS;
 }
 
+std::string spvDecodeLiteralStringOperand(const spv_parsed_instruction_t& inst,
+                                          const uint16_t operand_index) {
+  assert(operand_index < inst.num_operands);
+  const spv_parsed_operand_t& operand = inst.operands[operand_index];
+
+  return spvtools::utils::MakeString(inst.words + operand.offset,
+                                     operand.num_words);
+}
+
 namespace {
 
 // A SPIR-V binary parser.  A parser instance communicates detailed parse
@@ -205,7 +215,7 @@ class Parser {
     size_t word_index;           // The current position in words.
     size_t instruction_count;    // The count of processed instructions
     spv_endianness_t endian;     // The endianness of the binary.
-    // Is the SPIR-V binary in a different endiannes from the host native
+    // Is the SPIR-V binary in a different endianness from the host native
     // endianness?
     bool requires_endian_conversion;
 
@@ -290,7 +300,7 @@ spv_result_t Parser::parseInstruction() {
   const uint32_t first_word = peek();
 
   // If the module's endianness is different from the host native endianness,
-  // then converted_words contains the the endian-translated words in the
+  // then converted_words contains the endian-translated words in the
   // instruction.
   _.endian_converted_words.clear();
   _.endian_converted_words.push_back(first_word);
@@ -507,7 +517,8 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
 
     case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: {
       assert(SpvOpSpecConstantOp == opcode);
-      if (grammar_.lookupSpecConstantOpcode(SpvOp(word))) {
+      if (word > static_cast<uint32_t>(SpvOp::SpvOpMax) ||
+          grammar_.lookupSpecConstantOpcode(SpvOp(word))) {
         return diagnostic()
                << "Invalid " << spvOperandTypeStr(type) << ": " << word;
       }
@@ -576,27 +587,18 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
 
     case SPV_OPERAND_TYPE_LITERAL_STRING:
     case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: {
-      convert_operand_endianness = false;
-      const char* string =
-          reinterpret_cast<const char*>(_.words + _.word_index);
-      // Compute the length of the string, but make sure we don't run off the
-      // end of the input.
-      const size_t remaining_input_bytes =
-          sizeof(uint32_t) * (_.num_words - _.word_index);
-      const size_t string_num_content_bytes =
-          spv_strnlen_s(string, remaining_input_bytes);
-      // If there was no terminating null byte, then that's an end-of-input
-      // error.
-      if (string_num_content_bytes == remaining_input_bytes)
+      const size_t max_words = _.num_words - _.word_index;
+      std::string string =
+          spvtools::utils::MakeString(_.words + _.word_index, max_words, false);
+
+      if (string.length() == max_words * 4)
         return exhaustedInputDiagnostic(inst_offset, opcode, type);
-      // Account for null in the word length, so add 1 for null, then add 3 to
-      // make sure we round up.  The following is equivalent to:
-      //    (string_num_content_bytes + 1 + 3) / 4
-      const size_t string_num_words = string_num_content_bytes / 4 + 1;
+
       // Make sure we can record the word count without overflow.
       //
       // This error can't currently be triggered because of validity
       // checks elsewhere.
+      const size_t string_num_words = string.length() / 4 + 1;
       if (string_num_words > std::numeric_limits<uint16_t>::max()) {
         return diagnostic() << "Literal string is longer than "
                             << std::numeric_limits<uint16_t>::max()
@@ -610,7 +612,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
         // There is only one string literal argument to OpExtInstImport,
         // so it's sufficient to guard this just on the opcode.
         const spv_ext_inst_type_t ext_inst_type =
-            spvExtInstImportTypeGet(string);
+            spvExtInstImportTypeGet(string.c_str());
         if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) {
           return diagnostic()
                  << "Invalid extended instruction import '" << string << "'";
@@ -657,12 +659,18 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
     case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION:
     case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
     case SPV_OPERAND_TYPE_FPDENORM_MODE:
-    case SPV_OPERAND_TYPE_FPOPERATION_MODE: {
+    case SPV_OPERAND_TYPE_FPOPERATION_MODE:
+    case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
+    case SPV_OPERAND_TYPE_OVERFLOW_MODES:
+    case SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT:
+    case SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT: {
       // A single word that is a plain enum value.
 
       // Map an optional operand type to its corresponding concrete type.
       if (type == SPV_OPERAND_TYPE_OPTIONAL_ACCESS_QUALIFIER)
         parsed_operand.type = SPV_OPERAND_TYPE_ACCESS_QUALIFIER;
+      if (type == SPV_OPERAND_TYPE_OPTIONAL_PACKED_VECTOR_FORMAT)
+        parsed_operand.type = SPV_OPERAND_TYPE_PACKED_VECTOR_FORMAT;
 
       spv_operand_desc entry;
       if (grammar_.lookupOperand(type, word, &entry)) {

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

@@ -15,6 +15,8 @@
 #ifndef SOURCE_BINARY_H_
 #define SOURCE_BINARY_H_
 
+#include <string>
+
 #include "source/spirv_definition.h"
 #include "spirv-tools/libspirv.h"
 
@@ -33,4 +35,9 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
 // replacement for C11's strnlen_s which might not exist in all environments.
 size_t spv_strnlen_s(const char* str, size_t strsz);
 
+// Decode the string literal operand with index operand_index from instruction
+// inst.
+std::string spvDecodeLiteralStringOperand(const spv_parsed_instruction_t& inst,
+                                          const uint16_t operand_index);
+
 #endif  // SOURCE_BINARY_H_

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/source/cfa.h

@@ -42,7 +42,7 @@ class CFA {
 
   /// Returns true if a block with @p id is found in the @p work_list vector
   ///
-  /// @param[in] work_list  Set of blocks visited in the the depth first
+  /// @param[in] work_list  Set of blocks visited in the depth first
   /// traversal
   ///                       of the CFG
   /// @param[in] id         The ID of the block being checked

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

@@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position,
   diagnostic->position = *position;
   diagnostic->isTextSource = false;
   memset(diagnostic->error, 0, length);
-  strncpy(diagnostic->error, message, length);
+  strcpy(diagnostic->error, message);
   return diagnostic;
 }
 

+ 267 - 237
ThirdParty/Glslang/External/spirv-tools/source/disassemble.cpp

@@ -17,6 +17,8 @@
 // This file contains a disassembler:  It converts a SPIR-V binary
 // to text.
 
+#include "source/disassemble.h"
+
 #include <algorithm>
 #include <cassert>
 #include <cstring>
@@ -28,9 +30,7 @@
 #include "source/assembly_grammar.h"
 #include "source/binary.h"
 #include "source/diagnostic.h"
-#include "source/disassemble.h"
 #include "source/ext_inst.h"
-#include "source/name_mapper.h"
 #include "source/opcode.h"
 #include "source/parsed_operand.h"
 #include "source/print.h"
@@ -40,29 +40,21 @@
 #include "source/util/make_unique.h"
 #include "spirv-tools/libspirv.h"
 
+namespace spvtools {
 namespace {
 
 // A Disassembler instance converts a SPIR-V binary to its assembly
 // representation.
 class Disassembler {
  public:
-  Disassembler(const spvtools::AssemblyGrammar& grammar, uint32_t options,
-               spvtools::NameMapper name_mapper)
-      : grammar_(grammar),
-        print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
-        color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
-        indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options)
-                    ? kStandardIndent
-                    : 0),
-        comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)),
+  Disassembler(const AssemblyGrammar& grammar, uint32_t options,
+               NameMapper name_mapper)
+      : print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
         text_(),
         out_(print_ ? out_stream() : out_stream(text_)),
-        stream_(out_.get()),
+        instruction_disassembler_(grammar, out_.get(), options, name_mapper),
         header_(!spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, options)),
-        show_byte_offset_(spvIsInBitfield(
-            SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)),
-        byte_offset_(0),
-        name_mapper_(std::move(name_mapper)) {}
+        byte_offset_(0) {}
 
   // Emits the assembly header for the module, and sets up internal state
   // so subsequent callbacks can handle the cases where the entire module
@@ -78,56 +70,13 @@ class Disassembler {
   spv_result_t SaveTextResult(spv_text* text_result) const;
 
  private:
-  enum { kStandardIndent = 15 };
-
-  using out_stream = spvtools::out_stream;
-
-  // Emits an operand for the given instruction, where the instruction
-  // is at offset words from the start of the binary.
-  void EmitOperand(const spv_parsed_instruction_t& inst,
-                   const uint16_t operand_index);
-
-  // Emits a mask expression for the given mask word of the specified type.
-  void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word);
-
-  // Resets the output color, if color is turned on.
-  void ResetColor() {
-    if (color_) out_.get() << spvtools::clr::reset{print_};
-  }
-  // Sets the output to grey, if color is turned on.
-  void SetGrey() {
-    if (color_) out_.get() << spvtools::clr::grey{print_};
-  }
-  // Sets the output to blue, if color is turned on.
-  void SetBlue() {
-    if (color_) out_.get() << spvtools::clr::blue{print_};
-  }
-  // Sets the output to yellow, if color is turned on.
-  void SetYellow() {
-    if (color_) out_.get() << spvtools::clr::yellow{print_};
-  }
-  // Sets the output to red, if color is turned on.
-  void SetRed() {
-    if (color_) out_.get() << spvtools::clr::red{print_};
-  }
-  // Sets the output to green, if color is turned on.
-  void SetGreen() {
-    if (color_) out_.get() << spvtools::clr::green{print_};
-  }
-
-  const spvtools::AssemblyGrammar& grammar_;
   const bool print_;  // Should we also print to the standard output stream?
-  const bool color_;  // Should we print in colour?
-  const int indent_;  // How much to indent. 0 means don't indent
-  const int comment_;        // Should we comment the source
   spv_endianness_t endian_;  // The detected endianness of the binary.
   std::stringstream text_;   // Captures the text, if not printing.
   out_stream out_;  // The Output stream.  Either to text_ or standard output.
-  std::ostream& stream_;  // The output std::stream.
-  const bool header_;     // Should we output header as the leading comment?
-  const bool show_byte_offset_;  // Should we print byte offset, in hex?
-  size_t byte_offset_;           // The number of bytes processed so far.
-  spvtools::NameMapper name_mapper_;
+  disassemble::InstructionDisassembler instruction_disassembler_;
+  const bool header_;   // Should we output header as the leading comment?
+  size_t byte_offset_;  // The number of bytes processed so far.
   bool inserted_decoration_space_ = false;
   bool inserted_debug_space_ = false;
   bool inserted_type_space_ = false;
@@ -139,21 +88,11 @@ spv_result_t Disassembler::HandleHeader(spv_endianness_t endian,
   endian_ = endian;
 
   if (header_) {
-    const char* generator_tool =
-        spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator));
-    stream_ << "; SPIR-V\n"
-            << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "."
-            << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n"
-            << "; Generator: " << generator_tool;
-    // For unknown tools, print the numeric tool value.
-    if (0 == strcmp("Unknown", generator_tool)) {
-      stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")";
-    }
-    // Print the miscellaneous part of the generator word on the same
-    // line as the tool name.
-    stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n"
-            << "; Bound: " << id_bound << "\n"
-            << "; Schema: " << schema << "\n";
+    instruction_disassembler_.EmitHeaderSpirv();
+    instruction_disassembler_.EmitHeaderVersion(version);
+    instruction_disassembler_.EmitHeaderGenerator(generator);
+    instruction_disassembler_.EmitHeaderIdBound(id_bound);
+    instruction_disassembler_.EmitHeaderSchema(schema);
   }
 
   byte_offset_ = SPV_INDEX_INSTRUCTION * sizeof(uint32_t);
@@ -163,31 +102,149 @@ spv_result_t Disassembler::HandleHeader(spv_endianness_t endian,
 
 spv_result_t Disassembler::HandleInstruction(
     const spv_parsed_instruction_t& inst) {
-  auto opcode = static_cast<SpvOp>(inst.opcode);
-  if (comment_ && opcode == SpvOpFunction) {
-    stream_ << std::endl;
-    stream_ << std::string(indent_, ' ');
-    stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
-  }
-  if (comment_ && !inserted_decoration_space_ &&
-      spvOpcodeIsDecoration(opcode)) {
-    inserted_decoration_space_ = true;
-    stream_ << std::endl;
-    stream_ << std::string(indent_, ' ');
-    stream_ << "; Annotations" << std::endl;
+  instruction_disassembler_.EmitSectionComment(inst, inserted_decoration_space_,
+                                               inserted_debug_space_,
+                                               inserted_type_space_);
+
+  instruction_disassembler_.EmitInstruction(inst, byte_offset_);
+
+  byte_offset_ += inst.num_words * sizeof(uint32_t);
+
+  return SPV_SUCCESS;
+}
+
+spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
+  if (!print_) {
+    size_t length = text_.str().size();
+    char* str = new char[length + 1];
+    if (!str) return SPV_ERROR_OUT_OF_MEMORY;
+    strncpy(str, text_.str().c_str(), length + 1);
+    spv_text text = new spv_text_t();
+    if (!text) {
+      delete[] str;
+      return SPV_ERROR_OUT_OF_MEMORY;
+    }
+    text->str = str;
+    text->length = length;
+    *text_result = text;
   }
-  if (comment_ && !inserted_debug_space_ && spvOpcodeIsDebug(opcode)) {
-    inserted_debug_space_ = true;
-    stream_ << std::endl;
-    stream_ << std::string(indent_, ' ');
-    stream_ << "; Debug Information" << std::endl;
+  return SPV_SUCCESS;
+}
+
+spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian,
+                               uint32_t /* magic */, uint32_t version,
+                               uint32_t generator, uint32_t id_bound,
+                               uint32_t schema) {
+  assert(user_data);
+  auto disassembler = static_cast<Disassembler*>(user_data);
+  return disassembler->HandleHeader(endian, version, generator, id_bound,
+                                    schema);
+}
+
+spv_result_t DisassembleInstruction(
+    void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
+  assert(user_data);
+  auto disassembler = static_cast<Disassembler*>(user_data);
+  return disassembler->HandleInstruction(*parsed_instruction);
+}
+
+// Simple wrapper class to provide extra data necessary for targeted
+// instruction disassembly.
+class WrappedDisassembler {
+ public:
+  WrappedDisassembler(Disassembler* dis, const uint32_t* binary, size_t wc)
+      : disassembler_(dis), inst_binary_(binary), word_count_(wc) {}
+
+  Disassembler* disassembler() { return disassembler_; }
+  const uint32_t* inst_binary() const { return inst_binary_; }
+  size_t word_count() const { return word_count_; }
+
+ private:
+  Disassembler* disassembler_;
+  const uint32_t* inst_binary_;
+  const size_t word_count_;
+};
+
+spv_result_t DisassembleTargetHeader(void* user_data, spv_endianness_t endian,
+                                     uint32_t /* magic */, uint32_t version,
+                                     uint32_t generator, uint32_t id_bound,
+                                     uint32_t schema) {
+  assert(user_data);
+  auto wrapped = static_cast<WrappedDisassembler*>(user_data);
+  return wrapped->disassembler()->HandleHeader(endian, version, generator,
+                                               id_bound, schema);
+}
+
+spv_result_t DisassembleTargetInstruction(
+    void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
+  assert(user_data);
+  auto wrapped = static_cast<WrappedDisassembler*>(user_data);
+  // Check if this is the instruction we want to disassemble.
+  if (wrapped->word_count() == parsed_instruction->num_words &&
+      std::equal(wrapped->inst_binary(),
+                 wrapped->inst_binary() + wrapped->word_count(),
+                 parsed_instruction->words)) {
+    // Found the target instruction. Disassemble it and signal that we should
+    // stop searching so we don't output the same instruction again.
+    if (auto error =
+            wrapped->disassembler()->HandleInstruction(*parsed_instruction))
+      return error;
+    return SPV_REQUESTED_TERMINATION;
   }
-  if (comment_ && !inserted_type_space_ && spvOpcodeGeneratesType(opcode)) {
-    inserted_type_space_ = true;
-    stream_ << std::endl;
-    stream_ << std::string(indent_, ' ');
-    stream_ << "; Types, variables and constants" << std::endl;
+  return SPV_SUCCESS;
+}
+
+constexpr int kStandardIndent = 15;
+}  // namespace
+
+namespace disassemble {
+InstructionDisassembler::InstructionDisassembler(const AssemblyGrammar& grammar,
+                                                 std::ostream& stream,
+                                                 uint32_t options,
+                                                 NameMapper name_mapper)
+    : grammar_(grammar),
+      stream_(stream),
+      print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
+      color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
+      indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options)
+                  ? kStandardIndent
+                  : 0),
+      comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)),
+      show_byte_offset_(
+          spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)),
+      name_mapper_(std::move(name_mapper)) {}
+
+void InstructionDisassembler::EmitHeaderSpirv() { stream_ << "; SPIR-V\n"; }
+
+void InstructionDisassembler::EmitHeaderVersion(uint32_t version) {
+  stream_ << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "."
+          << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderGenerator(uint32_t generator) {
+  const char* generator_tool =
+      spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator));
+  stream_ << "; Generator: " << generator_tool;
+  // For unknown tools, print the numeric tool value.
+  if (0 == strcmp("Unknown", generator_tool)) {
+    stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")";
   }
+  // Print the miscellaneous part of the generator word on the same
+  // line as the tool name.
+  stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderIdBound(uint32_t id_bound) {
+  stream_ << "; Bound: " << id_bound << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderSchema(uint32_t schema) {
+  stream_ << "; Schema: " << schema << "\n";
+}
+
+void InstructionDisassembler::EmitInstruction(
+    const spv_parsed_instruction_t& inst, size_t inst_byte_offset) {
+  auto opcode = static_cast<SpvOp>(inst.opcode);
 
   if (inst.result_id) {
     SetBlue();
@@ -222,20 +279,45 @@ spv_result_t Disassembler::HandleInstruction(
     auto saved_flags = stream_.flags();
     auto saved_fill = stream_.fill();
     stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0')
-            << byte_offset_;
+            << inst_byte_offset;
     stream_.flags(saved_flags);
     stream_.fill(saved_fill);
     ResetColor();
   }
-
-  byte_offset_ += inst.num_words * sizeof(uint32_t);
-
   stream_ << "\n";
-  return SPV_SUCCESS;
 }
 
-void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
-                               const uint16_t operand_index) {
+void InstructionDisassembler::EmitSectionComment(
+    const spv_parsed_instruction_t& inst, bool& inserted_decoration_space,
+    bool& inserted_debug_space, bool& inserted_type_space) {
+  auto opcode = static_cast<SpvOp>(inst.opcode);
+  if (comment_ && opcode == SpvOpFunction) {
+    stream_ << std::endl;
+    stream_ << std::string(indent_, ' ');
+    stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
+  }
+  if (comment_ && !inserted_decoration_space && spvOpcodeIsDecoration(opcode)) {
+    inserted_decoration_space = true;
+    stream_ << std::endl;
+    stream_ << std::string(indent_, ' ');
+    stream_ << "; Annotations" << std::endl;
+  }
+  if (comment_ && !inserted_debug_space && spvOpcodeIsDebug(opcode)) {
+    inserted_debug_space = true;
+    stream_ << std::endl;
+    stream_ << std::string(indent_, ' ');
+    stream_ << "; Debug Information" << std::endl;
+  }
+  if (comment_ && !inserted_type_space && spvOpcodeGeneratesType(opcode)) {
+    inserted_type_space = true;
+    stream_ << std::endl;
+    stream_ << std::string(indent_, ' ');
+    stream_ << "; Types, variables and constants" << std::endl;
+  }
+}
+
+void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst,
+                                          const uint16_t operand_index) {
   assert(operand_index < inst.num_operands);
   const spv_parsed_operand_t& operand = inst.operands[operand_index];
   const uint32_t word = inst.words[operand.offset];
@@ -277,19 +359,17 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
     case SPV_OPERAND_TYPE_LITERAL_INTEGER:
     case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: {
       SetRed();
-      spvtools::EmitNumericLiteral(&stream_, inst, operand);
+      EmitNumericLiteral(&stream_, inst, operand);
       ResetColor();
     } break;
     case SPV_OPERAND_TYPE_LITERAL_STRING: {
       stream_ << "\"";
       SetGreen();
-      // Strings are always little-endian, and null-terminated.
-      // Write out the characters, escaping as needed, and without copying
-      // the entire string.
-      auto c_str = reinterpret_cast<const char*>(inst.words + operand.offset);
-      for (auto p = c_str; *p; ++p) {
-        if (*p == '"' || *p == '\\') stream_ << '\\';
-        stream_ << *p;
+
+      std::string str = spvDecodeLiteralStringOperand(inst, operand_index);
+      for (char const& c : str) {
+        if (c == '"' || c == '\\') stream_ << '\\';
+        stream_ << c;
       }
       ResetColor();
       stream_ << '"';
@@ -328,7 +408,9 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
     case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_OPERATION:
     case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_IMPORTED_ENTITY:
     case SPV_OPERAND_TYPE_FPDENORM_MODE:
-    case SPV_OPERAND_TYPE_FPOPERATION_MODE: {
+    case SPV_OPERAND_TYPE_FPOPERATION_MODE:
+    case SPV_OPERAND_TYPE_QUANTIZATION_MODES:
+    case SPV_OPERAND_TYPE_OVERFLOW_MODES: {
       spv_operand_desc entry;
       if (grammar_.lookupOperand(operand.type, word, &entry))
         assert(false && "should have caught this earlier");
@@ -345,13 +427,23 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
       EmitMaskOperand(operand.type, word);
       break;
     default:
-      assert(false && "unhandled or invalid case");
+      if (spvOperandIsConcreteMask(operand.type)) {
+        EmitMaskOperand(operand.type, word);
+      } else if (spvOperandIsConcrete(operand.type)) {
+        spv_operand_desc entry;
+        if (grammar_.lookupOperand(operand.type, word, &entry))
+          assert(false && "should have caught this earlier");
+        stream_ << entry->name;
+      } else {
+        assert(false && "unhandled or invalid case");
+      }
+      break;
   }
   ResetColor();
 }
 
-void Disassembler::EmitMaskOperand(const spv_operand_type_t type,
-                                   const uint32_t word) {
+void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type,
+                                              const uint32_t word) {
   // Scan the mask from least significant bit to most significant bit.  For each
   // set bit, emit the name of that bit. Separate multiple names with '|'.
   uint32_t remaining_word = word;
@@ -377,88 +469,66 @@ void Disassembler::EmitMaskOperand(const spv_operand_type_t type,
   }
 }
 
-spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
-  if (!print_) {
-    size_t length = text_.str().size();
-    char* str = new char[length + 1];
-    if (!str) return SPV_ERROR_OUT_OF_MEMORY;
-    strncpy(str, text_.str().c_str(), length + 1);
-    spv_text text = new spv_text_t();
-    if (!text) {
-      delete[] str;
-      return SPV_ERROR_OUT_OF_MEMORY;
-    }
-    text->str = str;
-    text->length = length;
-    *text_result = text;
-  }
-  return SPV_SUCCESS;
+void InstructionDisassembler::ResetColor() {
+  if (color_) stream_ << spvtools::clr::reset{print_};
 }
-
-spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian,
-                               uint32_t /* magic */, uint32_t version,
-                               uint32_t generator, uint32_t id_bound,
-                               uint32_t schema) {
-  assert(user_data);
-  auto disassembler = static_cast<Disassembler*>(user_data);
-  return disassembler->HandleHeader(endian, version, generator, id_bound,
-                                    schema);
+void InstructionDisassembler::SetGrey() {
+  if (color_) stream_ << spvtools::clr::grey{print_};
 }
-
-spv_result_t DisassembleInstruction(
-    void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
-  assert(user_data);
-  auto disassembler = static_cast<Disassembler*>(user_data);
-  return disassembler->HandleInstruction(*parsed_instruction);
+void InstructionDisassembler::SetBlue() {
+  if (color_) stream_ << spvtools::clr::blue{print_};
 }
+void InstructionDisassembler::SetYellow() {
+  if (color_) stream_ << spvtools::clr::yellow{print_};
+}
+void InstructionDisassembler::SetRed() {
+  if (color_) stream_ << spvtools::clr::red{print_};
+}
+void InstructionDisassembler::SetGreen() {
+  if (color_) stream_ << spvtools::clr::green{print_};
+}
+}  // namespace disassemble
+
+std::string spvInstructionBinaryToText(const spv_target_env env,
+                                       const uint32_t* instCode,
+                                       const size_t instWordCount,
+                                       const uint32_t* code,
+                                       const size_t wordCount,
+                                       const uint32_t options) {
+  spv_context context = spvContextCreate(env);
+  const AssemblyGrammar grammar(context);
+  if (!grammar.isValid()) {
+    spvContextDestroy(context);
+    return "";
+  }
 
-// Simple wrapper class to provide extra data necessary for targeted
-// instruction disassembly.
-class WrappedDisassembler {
- public:
-  WrappedDisassembler(Disassembler* dis, const uint32_t* binary, size_t wc)
-      : disassembler_(dis), inst_binary_(binary), word_count_(wc) {}
-
-  Disassembler* disassembler() { return disassembler_; }
-  const uint32_t* inst_binary() const { return inst_binary_; }
-  size_t word_count() const { return word_count_; }
-
- private:
-  Disassembler* disassembler_;
-  const uint32_t* inst_binary_;
-  const size_t word_count_;
-};
+  // Generate friendly names for Ids if requested.
+  std::unique_ptr<FriendlyNameMapper> friendly_mapper;
+  NameMapper name_mapper = GetTrivialNameMapper();
+  if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) {
+    friendly_mapper = MakeUnique<FriendlyNameMapper>(context, code, wordCount);
+    name_mapper = friendly_mapper->GetNameMapper();
+  }
 
-spv_result_t DisassembleTargetHeader(void* user_data, spv_endianness_t endian,
-                                     uint32_t /* magic */, uint32_t version,
-                                     uint32_t generator, uint32_t id_bound,
-                                     uint32_t schema) {
-  assert(user_data);
-  auto wrapped = static_cast<WrappedDisassembler*>(user_data);
-  return wrapped->disassembler()->HandleHeader(endian, version, generator,
-                                               id_bound, schema);
-}
+  // Now disassemble!
+  Disassembler disassembler(grammar, options, name_mapper);
+  WrappedDisassembler wrapped(&disassembler, instCode, instWordCount);
+  spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader,
+                 DisassembleTargetInstruction, nullptr);
 
-spv_result_t DisassembleTargetInstruction(
-    void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
-  assert(user_data);
-  auto wrapped = static_cast<WrappedDisassembler*>(user_data);
-  // Check if this is the instruction we want to disassemble.
-  if (wrapped->word_count() == parsed_instruction->num_words &&
-      std::equal(wrapped->inst_binary(),
-                 wrapped->inst_binary() + wrapped->word_count(),
-                 parsed_instruction->words)) {
-    // Found the target instruction. Disassemble it and signal that we should
-    // stop searching so we don't output the same instruction again.
-    if (auto error =
-            wrapped->disassembler()->HandleInstruction(*parsed_instruction))
-      return error;
-    return SPV_REQUESTED_TERMINATION;
+  spv_text text = nullptr;
+  std::string output;
+  if (disassembler.SaveTextResult(&text) == SPV_SUCCESS) {
+    output.assign(text->str, text->str + text->length);
+    // Drop trailing newline characters.
+    while (!output.empty() && output.back() == '\n') output.pop_back();
   }
-  return SPV_SUCCESS;
-}
+  spvTextDestroy(text);
+  spvContextDestroy(context);
 
-}  // namespace
+  return output;
+}
+}  // namespace spvtools
 
 spv_result_t spvBinaryToText(const spv_const_context context,
                              const uint32_t* code, const size_t wordCount,
@@ -483,53 +553,13 @@ spv_result_t spvBinaryToText(const spv_const_context context,
   }
 
   // Now disassemble!
-  Disassembler disassembler(grammar, options, name_mapper);
-  if (auto error = spvBinaryParse(&hijack_context, &disassembler, code,
-                                  wordCount, DisassembleHeader,
-                                  DisassembleInstruction, pDiagnostic)) {
+  spvtools::Disassembler disassembler(grammar, options, name_mapper);
+  if (auto error =
+          spvBinaryParse(&hijack_context, &disassembler, code, wordCount,
+                         spvtools::DisassembleHeader,
+                         spvtools::DisassembleInstruction, pDiagnostic)) {
     return error;
   }
 
   return disassembler.SaveTextResult(pText);
 }
-
-std::string spvtools::spvInstructionBinaryToText(const spv_target_env env,
-                                                 const uint32_t* instCode,
-                                                 const size_t instWordCount,
-                                                 const uint32_t* code,
-                                                 const size_t wordCount,
-                                                 const uint32_t options) {
-  spv_context context = spvContextCreate(env);
-  const spvtools::AssemblyGrammar grammar(context);
-  if (!grammar.isValid()) {
-    spvContextDestroy(context);
-    return "";
-  }
-
-  // Generate friendly names for Ids if requested.
-  std::unique_ptr<spvtools::FriendlyNameMapper> friendly_mapper;
-  spvtools::NameMapper name_mapper = spvtools::GetTrivialNameMapper();
-  if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) {
-    friendly_mapper = spvtools::MakeUnique<spvtools::FriendlyNameMapper>(
-        context, code, wordCount);
-    name_mapper = friendly_mapper->GetNameMapper();
-  }
-
-  // Now disassemble!
-  Disassembler disassembler(grammar, options, name_mapper);
-  WrappedDisassembler wrapped(&disassembler, instCode, instWordCount);
-  spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader,
-                 DisassembleTargetInstruction, nullptr);
-
-  spv_text text = nullptr;
-  std::string output;
-  if (disassembler.SaveTextResult(&text) == SPV_SUCCESS) {
-    output.assign(text->str, text->str + text->length);
-    // Drop trailing newline characters.
-    while (!output.empty() && output.back() == '\n') output.pop_back();
-  }
-  spvTextDestroy(text);
-  spvContextDestroy(context);
-
-  return output;
-}

+ 59 - 0
ThirdParty/Glslang/External/spirv-tools/source/disassemble.h

@@ -15,8 +15,10 @@
 #ifndef SOURCE_DISASSEMBLE_H_
 #define SOURCE_DISASSEMBLE_H_
 
+#include <iosfwd>
 #include <string>
 
+#include "source/name_mapper.h"
 #include "spirv-tools/libspirv.h"
 
 namespace spvtools {
@@ -33,6 +35,63 @@ std::string spvInstructionBinaryToText(const spv_target_env env,
                                        const size_t word_count,
                                        const uint32_t options);
 
+class AssemblyGrammar;
+namespace disassemble {
+
+// Shared code with other tools (than the disassembler) that might need to
+// output disassembly. An InstructionDisassembler instance converts SPIR-V
+// binary for an instruction to its assembly representation.
+class InstructionDisassembler {
+ public:
+  InstructionDisassembler(const AssemblyGrammar& grammar, std::ostream& stream,
+                          uint32_t options, NameMapper name_mapper);
+
+  // Emits the assembly header for the module.
+  void EmitHeaderSpirv();
+  void EmitHeaderVersion(uint32_t version);
+  void EmitHeaderGenerator(uint32_t generator);
+  void EmitHeaderIdBound(uint32_t id_bound);
+  void EmitHeaderSchema(uint32_t schema);
+
+  // Emits the assembly text for the given instruction.
+  void EmitInstruction(const spv_parsed_instruction_t& inst,
+                       size_t inst_byte_offset);
+
+  // Emits a comment between different sections of the module.
+  void EmitSectionComment(const spv_parsed_instruction_t& inst,
+                          bool& inserted_decoration_space,
+                          bool& inserted_debug_space,
+                          bool& inserted_type_space);
+
+  // Resets the output color, if color is turned on.
+  void ResetColor();
+  // Set the output color, if color is turned on.
+  void SetGrey();
+  void SetBlue();
+  void SetYellow();
+  void SetRed();
+  void SetGreen();
+
+ private:
+  // Emits an operand for the given instruction, where the instruction
+  // is at offset words from the start of the binary.
+  void EmitOperand(const spv_parsed_instruction_t& inst,
+                   const uint16_t operand_index);
+
+  // Emits a mask expression for the given mask word of the specified type.
+  void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word);
+
+  const spvtools::AssemblyGrammar& grammar_;
+  std::ostream& stream_;
+  const bool print_;   // Should we also print to the standard output stream?
+  const bool color_;   // Should we print in colour?
+  const int indent_;   // How much to indent. 0 means don't indent
+  const int comment_;  // Should we comment the source
+  const bool show_byte_offset_;  // Should we print byte offset, in hex?
+  spvtools::NameMapper name_mapper_;
+};
+
+}  // namespace disassemble
 }  // namespace spvtools
 
 #endif  // SOURCE_DISASSEMBLE_H_

+ 11 - 0
ThirdParty/Glslang/External/spirv-tools/source/ext_inst.cpp

@@ -29,6 +29,7 @@
 #include "debuginfo.insts.inc"
 #include "glsl.std.450.insts.inc"
 #include "nonsemantic.clspvreflection.insts.inc"
+#include "nonsemantic.shader.debuginfo.100.insts.inc"
 #include "opencl.debuginfo.100.insts.inc"
 #include "opencl.std.insts.inc"
 
@@ -55,6 +56,9 @@ static const spv_ext_inst_group_t kGroups_1_0[] = {
      debuginfo_entries},
     {SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100,
      ARRAY_SIZE(opencl_debuginfo_100_entries), opencl_debuginfo_100_entries},
+    {SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100,
+     ARRAY_SIZE(nonsemantic_shader_debuginfo_100_entries),
+     nonsemantic_shader_debuginfo_100_entries},
     {SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION,
      ARRAY_SIZE(nonsemantic_clspvreflection_entries),
      nonsemantic_clspvreflection_entries},
@@ -92,6 +96,8 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
     case SPV_ENV_UNIVERSAL_1_4:
     case SPV_ENV_UNIVERSAL_1_5:
     case SPV_ENV_VULKAN_1_2:
+    case SPV_ENV_UNIVERSAL_1_6:
+    case SPV_ENV_VULKAN_1_3:
       *pExtInstTable = &kTable_1_0;
       return SPV_SUCCESS;
     default:
@@ -126,6 +132,9 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) {
   if (!strcmp("OpenCL.DebugInfo.100", name)) {
     return SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100;
   }
+  if (!strcmp("NonSemantic.Shader.DebugInfo.100", name)) {
+    return SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100;
+  }
   if (!strncmp("NonSemantic.ClspvReflection.", name, 28)) {
     return SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION;
   }
@@ -139,6 +148,7 @@ spv_ext_inst_type_t spvExtInstImportTypeGet(const char* name) {
 
 bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) {
   if (type == SPV_EXT_INST_TYPE_NONSEMANTIC_UNKNOWN ||
+      type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100 ||
       type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) {
     return true;
   }
@@ -147,6 +157,7 @@ bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type) {
 
 bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type) {
   if (type == SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 ||
+      type == SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100 ||
       type == SPV_EXT_INST_TYPE_DEBUGINFO) {
     return true;
   }

+ 2 - 2
ThirdParty/Glslang/External/spirv-tools/source/ext_inst.h

@@ -27,7 +27,7 @@ bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type);
 // Returns true if the extended instruction set is debug info
 bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type);
 
-// Finds the named extented instruction of the given type in the given extended
+// Finds the named extended instruction of the given type in the given extended
 // instruction table. On success, returns SPV_SUCCESS and writes a handle of
 // the instruction entry into *entry.
 spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
@@ -35,7 +35,7 @@ spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
                                        const char* name,
                                        spv_ext_inst_desc* entry);
 
-// Finds the extented instruction of the given type in the given extended
+// Finds the extended instruction of the given type in the given extended
 // instruction table by value. On success, returns SPV_SUCCESS and writes a
 // handle of the instruction entry into *entry.
 spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,

+ 3 - 1
ThirdParty/Glslang/External/spirv-tools/source/extensions.cpp

@@ -18,6 +18,7 @@
 #include <sstream>
 #include <string>
 
+#include "source/binary.h"
 #include "source/enum_string_mapping.h"
 
 namespace spvtools {
@@ -30,8 +31,9 @@ std::string GetExtensionString(const spv_parsed_instruction_t* inst) {
   const auto& operand = inst->operands[0];
   assert(operand.type == SPV_OPERAND_TYPE_LITERAL_STRING);
   assert(inst->num_words > operand.offset);
+  (void)operand; /* No unused variables in release builds. */
 
-  return reinterpret_cast<const char*>(inst->words + operand.offset);
+  return spvDecodeLiteralStringOperand(*inst, 0);
 }
 
 std::string ExtensionSetToString(const ExtensionSet& extensions) {

+ 14 - 0
ThirdParty/Glslang/External/spirv-tools/source/fuzz/CMakeLists.txt

@@ -37,6 +37,7 @@ if(SPIRV_BUILD_FUZZER)
 
   set(SPIRV_TOOLS_FUZZ_SOURCES
         added_function_reducer.h
+        available_instructions.h
         call_graph.h
         comparator_deep_blocks_first.h
         counter_overflow_id_source.h
@@ -100,6 +101,7 @@ if(SPIRV_BUILD_FUZZER)
         fuzzer_pass_outline_functions.h
         fuzzer_pass_permute_blocks.h
         fuzzer_pass_permute_function_parameters.h
+        fuzzer_pass_permute_function_variables.h
         fuzzer_pass_permute_instructions.h
         fuzzer_pass_permute_phi_operands.h
         fuzzer_pass_propagate_instructions_down.h
@@ -119,8 +121,10 @@ if(SPIRV_BUILD_FUZZER)
         fuzzer_pass_split_blocks.h
         fuzzer_pass_swap_commutable_operands.h
         fuzzer_pass_swap_conditional_branch_operands.h
+        fuzzer_pass_swap_functions.h
         fuzzer_pass_toggle_access_chain_instruction.h
         fuzzer_pass_wrap_regions_in_selections.h
+        fuzzer_pass_wrap_vector_synonym.h
         fuzzer_util.h
         id_use_descriptor.h
         instruction_descriptor.h
@@ -221,14 +225,18 @@ if(SPIRV_BUILD_FUZZER)
         transformation_store.h
         transformation_swap_commutable_operands.h
         transformation_swap_conditional_branch_operands.h
+        transformation_swap_function_variables.h
+        transformation_swap_two_functions.h
         transformation_toggle_access_chain_instruction.h
         transformation_vector_shuffle.h
         transformation_wrap_early_terminator_in_function.h
         transformation_wrap_region_in_selection.h
+        transformation_wrap_vector_synonym.h
         uniform_buffer_element_descriptor.h
         ${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.h
 
         added_function_reducer.cpp
+        available_instructions.cpp
         call_graph.cpp
         counter_overflow_id_source.cpp
         data_descriptor.cpp
@@ -290,6 +298,7 @@ if(SPIRV_BUILD_FUZZER)
         fuzzer_pass_outline_functions.cpp
         fuzzer_pass_permute_blocks.cpp
         fuzzer_pass_permute_function_parameters.cpp
+        fuzzer_pass_permute_function_variables.cpp
         fuzzer_pass_permute_instructions.cpp
         fuzzer_pass_permute_phi_operands.cpp
         fuzzer_pass_propagate_instructions_down.cpp
@@ -309,8 +318,10 @@ if(SPIRV_BUILD_FUZZER)
         fuzzer_pass_split_blocks.cpp
         fuzzer_pass_swap_commutable_operands.cpp
         fuzzer_pass_swap_conditional_branch_operands.cpp
+        fuzzer_pass_swap_functions.cpp
         fuzzer_pass_toggle_access_chain_instruction.cpp
         fuzzer_pass_wrap_regions_in_selections.cpp
+        fuzzer_pass_wrap_vector_synonym.cpp
         fuzzer_util.cpp
         id_use_descriptor.cpp
         instruction_descriptor.cpp
@@ -409,10 +420,13 @@ if(SPIRV_BUILD_FUZZER)
         transformation_store.cpp
         transformation_swap_commutable_operands.cpp
         transformation_swap_conditional_branch_operands.cpp
+        transformation_swap_function_variables.cpp
+        transformation_swap_two_functions.cpp
         transformation_toggle_access_chain_instruction.cpp
         transformation_vector_shuffle.cpp
         transformation_wrap_early_terminator_in_function.cpp
         transformation_wrap_region_in_selection.cpp
+        transformation_wrap_vector_synonym.cpp
         uniform_buffer_element_descriptor.cpp
         ${CMAKE_CURRENT_BINARY_DIR}/protobufs/spvtoolsfuzz.pb.cc
         )

+ 4 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fact_manager/fact_manager.h

@@ -163,7 +163,7 @@ class FactManager {
   std::vector<const protobufs::DataDescriptor*> GetSynonymsForDataDescriptor(
       const protobufs::DataDescriptor& data_descriptor) const;
 
-  // Returns true if and ony if |data_descriptor1| and |data_descriptor2| are
+  // Returns true if and only if |data_descriptor1| and |data_descriptor2| are
   // known to be synonymous.
   bool IsSynonymous(const protobufs::DataDescriptor& data_descriptor1,
                     const protobufs::DataDescriptor& data_descriptor2) const;
@@ -174,7 +174,7 @@ class FactManager {
   //==============================
   // Querying facts about dead blocks
 
-  // Returns true if and ony if |block_id| is the id of a block known to be
+  // Returns true if and only if |block_id| is the id of a block known to be
   // dynamically unreachable.
   bool BlockIsDead(uint32_t block_id) const;
 
@@ -184,7 +184,7 @@ class FactManager {
   //==============================
   // Querying facts about livesafe function
 
-  // Returns true if and ony if |function_id| is the id of a function known
+  // Returns true if and only if |function_id| is the id of a function known
   // to be livesafe.
   bool FunctionIsLivesafe(uint32_t function_id) const;
 
@@ -194,7 +194,7 @@ class FactManager {
   //==============================
   // Querying facts about irrelevant values
 
-  // Returns true if and ony if the value of the pointee associated with
+  // Returns true if and only if the value of the pointee associated with
   // |pointer_id| is irrelevant.
   bool PointeeValueIsIrrelevant(uint32_t pointer_id) const;
 

+ 1 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/force_render_red.cpp

@@ -19,12 +19,10 @@
 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
 #include "source/fuzz/transformation_context.h"
 #include "source/fuzz/transformation_replace_constant_with_uniform.h"
-#include "source/fuzz/uniform_buffer_element_descriptor.h"
 #include "source/opt/build_module.h"
 #include "source/opt/ir_context.h"
 #include "source/opt/types.h"
 #include "source/util/make_unique.h"
-#include "tools/util/cli_consumer.h"
 
 namespace spvtools {
 namespace fuzz {
@@ -160,8 +158,8 @@ bool ForceRenderRed(
     const spv_target_env& target_env, spv_validator_options validator_options,
     const std::vector<uint32_t>& binary_in,
     const spvtools::fuzz::protobufs::FactSequence& initial_facts,
+    const MessageConsumer& message_consumer,
     std::vector<uint32_t>* binary_out) {
-  auto message_consumer = spvtools::utils::CLIMessageConsumer;
   spvtools::SpirvTools tools(target_env);
   if (!tools.IsValid()) {
     message_consumer(SPV_MSG_ERROR, nullptr, {},

+ 1 - 1
ThirdParty/Glslang/External/spirv-tools/source/fuzz/force_render_red.h

@@ -41,7 +41,7 @@ bool ForceRenderRed(
     const spv_target_env& target_env, spv_validator_options validator_options,
     const std::vector<uint32_t>& binary_in,
     const spvtools::fuzz::protobufs::FactSequence& initial_facts,
-    std::vector<uint32_t>* binary_out);
+    const MessageConsumer& message_consumer, std::vector<uint32_t>* binary_out);
 
 }  // namespace fuzz
 }  // namespace spvtools

+ 230 - 245
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer.cpp

@@ -17,9 +17,7 @@
 #include <cassert>
 #include <memory>
 #include <numeric>
-#include <sstream>
 
-#include "source/fuzz/fact_manager/fact_manager.h"
 #include "source/fuzz/fuzzer_context.h"
 #include "source/fuzz/fuzzer_pass_add_access_chains.h"
 #include "source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h"
@@ -69,6 +67,7 @@
 #include "source/fuzz/fuzzer_pass_outline_functions.h"
 #include "source/fuzz/fuzzer_pass_permute_blocks.h"
 #include "source/fuzz/fuzzer_pass_permute_function_parameters.h"
+#include "source/fuzz/fuzzer_pass_permute_function_variables.h"
 #include "source/fuzz/fuzzer_pass_permute_instructions.h"
 #include "source/fuzz/fuzzer_pass_permute_phi_operands.h"
 #include "source/fuzz/fuzzer_pass_propagate_instructions_down.h"
@@ -88,12 +87,11 @@
 #include "source/fuzz/fuzzer_pass_split_blocks.h"
 #include "source/fuzz/fuzzer_pass_swap_commutable_operands.h"
 #include "source/fuzz/fuzzer_pass_swap_conditional_branch_operands.h"
+#include "source/fuzz/fuzzer_pass_swap_functions.h"
 #include "source/fuzz/fuzzer_pass_toggle_access_chain_instruction.h"
 #include "source/fuzz/fuzzer_pass_wrap_regions_in_selections.h"
+#include "source/fuzz/fuzzer_pass_wrap_vector_synonym.h"
 #include "source/fuzz/pass_management/repeated_pass_manager.h"
-#include "source/fuzz/pass_management/repeated_pass_manager_looped_with_recommendations.h"
-#include "source/fuzz/pass_management/repeated_pass_manager_random_with_recommendations.h"
-#include "source/fuzz/pass_management/repeated_pass_manager_simple.h"
 #include "source/fuzz/pass_management/repeated_pass_recommender_standard.h"
 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
 #include "source/fuzz/transformation_context.h"
@@ -104,35 +102,153 @@
 namespace spvtools {
 namespace fuzz {
 
-namespace {
-const uint32_t kIdBoundGap = 100;
-
-}  // namespace
-
-Fuzzer::Fuzzer(spv_target_env target_env, MessageConsumer consumer,
-               const std::vector<uint32_t>& binary_in,
-               const protobufs::FactSequence& initial_facts,
+Fuzzer::Fuzzer(std::unique_ptr<opt::IRContext> ir_context,
+               std::unique_ptr<TransformationContext> transformation_context,
+               std::unique_ptr<FuzzerContext> fuzzer_context,
+               MessageConsumer consumer,
                const std::vector<fuzzerutil::ModuleSupplier>& donor_suppliers,
-               std::unique_ptr<RandomGenerator> random_generator,
                bool enable_all_passes,
                RepeatedPassStrategy repeated_pass_strategy,
                bool validate_after_each_fuzzer_pass,
-               spv_validator_options validator_options)
-    : target_env_(target_env),
-      consumer_(std::move(consumer)),
-      binary_in_(binary_in),
-      initial_facts_(initial_facts),
-      donor_suppliers_(donor_suppliers),
-      random_generator_(std::move(random_generator)),
+               spv_validator_options validator_options,
+               bool ignore_inapplicable_transformations /* = true */)
+    : consumer_(std::move(consumer)),
       enable_all_passes_(enable_all_passes),
-      repeated_pass_strategy_(repeated_pass_strategy),
       validate_after_each_fuzzer_pass_(validate_after_each_fuzzer_pass),
       validator_options_(validator_options),
       num_repeated_passes_applied_(0),
-      ir_context_(nullptr),
-      fuzzer_context_(nullptr),
-      transformation_context_(nullptr),
-      transformation_sequence_out_() {}
+      is_valid_(true),
+      ir_context_(std::move(ir_context)),
+      transformation_context_(std::move(transformation_context)),
+      fuzzer_context_(std::move(fuzzer_context)),
+      transformation_sequence_out_(),
+      pass_instances_(),
+      repeated_pass_recommender_(nullptr),
+      repeated_pass_manager_(nullptr),
+      final_passes_(),
+      ignore_inapplicable_transformations_(
+          ignore_inapplicable_transformations) {
+  assert(ir_context_ && "IRContext is not initialized");
+  assert(fuzzer_context_ && "FuzzerContext is not initialized");
+  assert(transformation_context_ && "TransformationContext is not initialized");
+  assert(fuzzerutil::IsValidAndWellFormed(ir_context_.get(), validator_options_,
+                                          consumer_) &&
+         "IRContext is invalid");
+
+  // The following passes are likely to be very useful: many other passes
+  // introduce synonyms, irrelevant ids and constants that these passes can work
+  // with.  We thus enable them with high probability.
+  MaybeAddRepeatedPass<FuzzerPassObfuscateConstants>(90, &pass_instances_);
+  MaybeAddRepeatedPass<FuzzerPassApplyIdSynonyms>(90, &pass_instances_);
+  MaybeAddRepeatedPass<FuzzerPassReplaceIrrelevantIds>(90, &pass_instances_);
+
+  do {
+    // Each call to MaybeAddRepeatedPass randomly decides whether the given pass
+    // should be enabled, and adds an instance of the pass to |pass_instances|
+    // if it is enabled.
+    MaybeAddRepeatedPass<FuzzerPassAddAccessChains>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddBitInstructionSynonyms>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddCompositeExtract>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddCompositeInserts>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddCompositeTypes>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddCopyMemory>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddDeadBlocks>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddDeadBreaks>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddDeadContinues>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddEquationInstructions>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddFunctionCalls>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddGlobalVariables>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddImageSampleUnusedComponents>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddLoads>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddLocalVariables>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddLoopPreheaders>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddLoopsToCreateIntConstantSynonyms>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddOpPhiSynonyms>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddParameters>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddRelaxedDecorations>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddStores>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddSynonyms>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassAddVectorShuffleInstructions>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassConstructComposites>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassCopyObjects>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassDonateModules>(&pass_instances_,
+                                                  donor_suppliers);
+    MaybeAddRepeatedPass<FuzzerPassDuplicateRegionsWithSelections>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassExpandVectorReductions>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassFlattenConditionalBranches>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassInlineFunctions>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassInvertComparisonOperators>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassMakeVectorOperationsDynamic>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassMergeBlocks>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassMergeFunctionReturns>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassMutatePointers>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassOutlineFunctions>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPermuteBlocks>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPermuteFunctionParameters>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPermuteInstructions>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPropagateInstructionsDown>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPropagateInstructionsUp>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassPushIdsThroughVariables>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceAddsSubsMulsWithCarryingExtended>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceBranchesFromDeadBlocksWithExits>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceCopyMemoriesWithLoadsStores>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceCopyObjectsWithStoresLoads>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceLoadsStoresWithCopyMemories>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceParameterWithGlobal>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceLinearAlgebraInstructions>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceOpPhiIdsFromDeadPredecessors>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceOpSelectsWithConditionalBranches>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassReplaceParamsWithStruct>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassSplitBlocks>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassSwapBranchConditionalOperands>(
+        &pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassWrapRegionsInSelections>(&pass_instances_);
+    MaybeAddRepeatedPass<FuzzerPassWrapVectorSynonym>(&pass_instances_);
+    // There is a theoretical possibility that no pass instances were created
+    // until now; loop again if so.
+  } while (pass_instances_.GetPasses().empty());
+
+  repeated_pass_recommender_ = MakeUnique<RepeatedPassRecommenderStandard>(
+      &pass_instances_, fuzzer_context_.get());
+  repeated_pass_manager_ = RepeatedPassManager::Create(
+      repeated_pass_strategy, fuzzer_context_.get(), &pass_instances_,
+      repeated_pass_recommender_.get());
+
+  MaybeAddFinalPass<FuzzerPassAdjustBranchWeights>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassAdjustFunctionControls>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassAdjustLoopControls>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassAdjustMemoryOperandsMasks>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassAdjustSelectionControls>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassAddNoContractionDecorations>(&final_passes_);
+  if (!fuzzer_context_->IsWgslCompatible()) {
+    // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/4214):
+    //  this is disabled temporarily due to some issues in the Tint compiler.
+    //  Enable it back when the issues are resolved.
+    MaybeAddFinalPass<FuzzerPassInterchangeSignednessOfIntegerOperands>(
+        &final_passes_);
+  }
+  MaybeAddFinalPass<FuzzerPassInterchangeZeroLikeConstants>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassPermuteFunctionVariables>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassPermutePhiOperands>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassSwapCommutableOperands>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassSwapFunctions>(&final_passes_);
+  MaybeAddFinalPass<FuzzerPassToggleAccessChainInstruction>(&final_passes_);
+}
 
 Fuzzer::~Fuzzer() = default;
 
@@ -144,7 +260,8 @@ void Fuzzer::MaybeAddRepeatedPass(uint32_t percentage_chance_of_adding_pass,
       fuzzer_context_->ChoosePercentage(percentage_chance_of_adding_pass)) {
     pass_instances->SetPass(MakeUnique<FuzzerPassT>(
         ir_context_.get(), transformation_context_.get(), fuzzer_context_.get(),
-        &transformation_sequence_out_, std::forward<Args>(extra_args)...));
+        &transformation_sequence_out_, ignore_inapplicable_transformations_,
+        std::forward<Args>(extra_args)...));
   }
 }
 
@@ -154,7 +271,8 @@ void Fuzzer::MaybeAddFinalPass(std::vector<std::unique_ptr<FuzzerPass>>* passes,
   if (enable_all_passes_ || fuzzer_context_->ChooseEven()) {
     passes->push_back(MakeUnique<FuzzerPassT>(
         ir_context_.get(), transformation_context_.get(), fuzzer_context_.get(),
-        &transformation_sequence_out_, std::forward<Args>(extra_args)...));
+        &transformation_sequence_out_, ignore_inapplicable_transformations_,
+        std::forward<Args>(extra_args)...));
   }
 }
 
@@ -165,240 +283,107 @@ bool Fuzzer::ApplyPassAndCheckValidity(FuzzerPass* pass) const {
                                           consumer_);
 }
 
-Fuzzer::FuzzerResult Fuzzer::Run() {
-  // Check compatibility between the library version being linked with and the
-  // header files being used.
-  GOOGLE_PROTOBUF_VERIFY_VERSION;
+opt::IRContext* Fuzzer::GetIRContext() { return ir_context_.get(); }
 
-  assert(ir_context_ == nullptr && fuzzer_context_ == nullptr &&
-         transformation_context_ == nullptr &&
-         transformation_sequence_out_.transformation_size() == 0 &&
-         "'Run' must not be invoked more than once.");
-
-  spvtools::SpirvTools tools(target_env_);
-  tools.SetMessageConsumer(consumer_);
-  if (!tools.IsValid()) {
-    consumer_(SPV_MSG_ERROR, nullptr, {},
-              "Failed to create SPIRV-Tools interface; stopping.");
-    return {Fuzzer::FuzzerResultStatus::kFailedToCreateSpirvToolsInterface,
-            std::vector<uint32_t>(), protobufs::TransformationSequence()};
-  }
-
-  // Initial binary should be valid.
-  if (!tools.Validate(&binary_in_[0], binary_in_.size(), validator_options_)) {
-    consumer_(SPV_MSG_ERROR, nullptr, {},
-              "Initial binary is invalid; stopping.");
-    return {Fuzzer::FuzzerResultStatus::kInitialBinaryInvalid,
-            std::vector<uint32_t>(), protobufs::TransformationSequence()};
-  }
-
-  // Build the module from the input binary.
-  ir_context_ =
-      BuildModule(target_env_, consumer_, binary_in_.data(), binary_in_.size());
-  assert(ir_context_);
-
-  // The fuzzer will introduce new ids into the module.  The module's id bound
-  // gives the smallest id that can be used for this purpose.  We add an offset
-  // to this so that there is a sizeable gap between the ids used in the
-  // original module and the ids used for fuzzing, as a readability aid.
-  //
-  // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/2541) consider the
-  //  case where the maximum id bound is reached.
-  auto minimum_fresh_id = ir_context_->module()->id_bound() + kIdBoundGap;
-  fuzzer_context_ =
-      MakeUnique<FuzzerContext>(random_generator_.get(), minimum_fresh_id);
-
-  transformation_context_ = MakeUnique<TransformationContext>(
-      MakeUnique<FactManager>(ir_context_.get()), validator_options_);
-  transformation_context_->GetFactManager()->AddInitialFacts(consumer_,
-                                                             initial_facts_);
+const protobufs::TransformationSequence& Fuzzer::GetTransformationSequence()
+    const {
+  return transformation_sequence_out_;
+}
 
-  RepeatedPassInstances pass_instances{};
+Fuzzer::Result Fuzzer::Run(uint32_t num_of_transformations_to_apply) {
+  assert(is_valid_ && "The module was invalidated during the previous fuzzing");
 
-  // The following passes are likely to be very useful: many other passes
-  // introduce synonyms, irrelevant ids and constants that these passes can work
-  // with.  We thus enable them with high probability.
-  MaybeAddRepeatedPass<FuzzerPassObfuscateConstants>(90, &pass_instances);
-  MaybeAddRepeatedPass<FuzzerPassApplyIdSynonyms>(90, &pass_instances);
-  MaybeAddRepeatedPass<FuzzerPassReplaceIrrelevantIds>(90, &pass_instances);
+  const auto initial_num_of_transformations =
+      static_cast<uint32_t>(transformation_sequence_out_.transformation_size());
 
+  auto status = Status::kComplete;
   do {
-    // Each call to MaybeAddRepeatedPass randomly decides whether the given pass
-    // should be enabled, and adds an instance of the pass to |pass_instances|
-    // if it is enabled.
-    MaybeAddRepeatedPass<FuzzerPassAddAccessChains>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddBitInstructionSynonyms>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddCompositeExtract>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddCompositeInserts>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddCompositeTypes>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddCopyMemory>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddDeadBlocks>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddDeadBreaks>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddDeadContinues>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddEquationInstructions>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddFunctionCalls>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddGlobalVariables>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddImageSampleUnusedComponents>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddLoads>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddLocalVariables>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddLoopPreheaders>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddLoopsToCreateIntConstantSynonyms>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddOpPhiSynonyms>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddParameters>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddRelaxedDecorations>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddStores>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddSynonyms>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassAddVectorShuffleInstructions>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassConstructComposites>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassCopyObjects>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassDonateModules>(&pass_instances,
-                                                  donor_suppliers_);
-    MaybeAddRepeatedPass<FuzzerPassDuplicateRegionsWithSelections>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassExpandVectorReductions>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassFlattenConditionalBranches>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassInlineFunctions>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassInvertComparisonOperators>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassMakeVectorOperationsDynamic>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassMergeBlocks>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassMergeFunctionReturns>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassMutatePointers>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassOutlineFunctions>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPermuteBlocks>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPermuteFunctionParameters>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPermuteInstructions>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPropagateInstructionsDown>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPropagateInstructionsUp>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassPushIdsThroughVariables>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceAddsSubsMulsWithCarryingExtended>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceBranchesFromDeadBlocksWithExits>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceCopyMemoriesWithLoadsStores>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceCopyObjectsWithStoresLoads>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceLoadsStoresWithCopyMemories>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceParameterWithGlobal>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceLinearAlgebraInstructions>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceOpPhiIdsFromDeadPredecessors>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceOpSelectsWithConditionalBranches>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassReplaceParamsWithStruct>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassSplitBlocks>(&pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassSwapBranchConditionalOperands>(
-        &pass_instances);
-    MaybeAddRepeatedPass<FuzzerPassWrapRegionsInSelections>(&pass_instances);
-    // There is a theoretical possibility that no pass instances were created
-    // until now; loop again if so.
-  } while (pass_instances.GetPasses().empty());
-
-  RepeatedPassRecommenderStandard pass_recommender(&pass_instances,
-                                                   fuzzer_context_.get());
+    if (!ApplyPassAndCheckValidity(
+            repeated_pass_manager_->ChoosePass(transformation_sequence_out_))) {
+      status = Status::kFuzzerPassLedToInvalidModule;
+      break;
+    }
 
-  std::unique_ptr<RepeatedPassManager> repeated_pass_manager = nullptr;
-  switch (repeated_pass_strategy_) {
-    case RepeatedPassStrategy::kSimple:
-      repeated_pass_manager = MakeUnique<RepeatedPassManagerSimple>(
-          fuzzer_context_.get(), &pass_instances);
+    // Check that the module is small enough.
+    if (ir_context_->module()->id_bound() >=
+        fuzzer_context_->GetIdBoundLimit()) {
+      status = Status::kModuleTooBig;
       break;
-    case RepeatedPassStrategy::kLoopedWithRecommendations:
-      repeated_pass_manager =
-          MakeUnique<RepeatedPassManagerLoopedWithRecommendations>(
-              fuzzer_context_.get(), &pass_instances, &pass_recommender);
+    }
+
+    auto transformations_applied_so_far = static_cast<uint32_t>(
+        transformation_sequence_out_.transformation_size());
+    assert(transformations_applied_so_far >= initial_num_of_transformations &&
+           "Number of transformations cannot decrease");
+
+    // Check if we've already applied the maximum number of transformations.
+    if (transformations_applied_so_far >=
+        fuzzer_context_->GetTransformationLimit()) {
+      status = Status::kTransformationLimitReached;
       break;
-    case RepeatedPassStrategy::kRandomWithRecommendations:
-      repeated_pass_manager =
-          MakeUnique<RepeatedPassManagerRandomWithRecommendations>(
-              fuzzer_context_.get(), &pass_instances, &pass_recommender);
+    }
+
+    // Check that we've not got stuck (this can happen if the only available
+    // fuzzer passes are not able to apply any transformations, or can only
+    // apply very few transformations).
+    if (num_repeated_passes_applied_ >=
+        fuzzer_context_->GetTransformationLimit()) {
+      status = Status::kFuzzerStuck;
       break;
-  }
+    }
 
-  do {
-    if (!ApplyPassAndCheckValidity(
-            repeated_pass_manager->ChoosePass(transformation_sequence_out_))) {
-      return {Fuzzer::FuzzerResultStatus::kFuzzerPassLedToInvalidModule,
-              std::vector<uint32_t>(), protobufs::TransformationSequence()};
+    // Check whether we've exceeded the number of transformations we can apply
+    // in a single call to this method.
+    if (num_of_transformations_to_apply != 0 &&
+        transformations_applied_so_far - initial_num_of_transformations >=
+            num_of_transformations_to_apply) {
+      status = Status::kComplete;
+      break;
     }
-  } while (ShouldContinueFuzzing());
 
-  // Now apply some passes that it does not make sense to apply repeatedly,
-  // as they do not unlock other passes.
-  std::vector<std::unique_ptr<FuzzerPass>> final_passes;
-  MaybeAddFinalPass<FuzzerPassAdjustBranchWeights>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassAdjustFunctionControls>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassAdjustLoopControls>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassAdjustMemoryOperandsMasks>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassAdjustSelectionControls>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassAddNoContractionDecorations>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassInterchangeSignednessOfIntegerOperands>(
-      &final_passes);
-  MaybeAddFinalPass<FuzzerPassInterchangeZeroLikeConstants>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassPermutePhiOperands>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassSwapCommutableOperands>(&final_passes);
-  MaybeAddFinalPass<FuzzerPassToggleAccessChainInstruction>(&final_passes);
-  for (auto& pass : final_passes) {
-    if (!ApplyPassAndCheckValidity(pass.get())) {
-      return {Fuzzer::FuzzerResultStatus::kFuzzerPassLedToInvalidModule,
-              std::vector<uint32_t>(), protobufs::TransformationSequence()};
+  } while (ShouldContinueRepeatedPasses(num_of_transformations_to_apply == 0));
+
+  if (status != Status::kFuzzerPassLedToInvalidModule) {
+    // We apply this transformations despite the fact that we might exceed
+    // |num_of_transformations_to_apply|. This is not a problem for us since
+    // these fuzzer passes are relatively simple yet might trigger some bugs.
+    for (auto& pass : final_passes_) {
+      if (!ApplyPassAndCheckValidity(pass.get())) {
+        status = Status::kFuzzerPassLedToInvalidModule;
+        break;
+      }
     }
   }
-  // Encode the module as a binary.
-  std::vector<uint32_t> binary_out;
-  ir_context_->module()->ToBinary(&binary_out, false);
 
-  return {Fuzzer::FuzzerResultStatus::kComplete, std::move(binary_out),
-          std::move(transformation_sequence_out_)};
+  is_valid_ = status != Status::kFuzzerPassLedToInvalidModule;
+  return {status, static_cast<uint32_t>(
+                      transformation_sequence_out_.transformation_size()) !=
+                      initial_num_of_transformations};
 }
 
-bool Fuzzer::ShouldContinueFuzzing() {
-  // There's a risk that fuzzing could get stuck, if none of the enabled fuzzer
-  // passes are able to apply any transformations.  To guard against this we
-  // count the number of times some repeated pass has been applied and ensure
-  // that fuzzing stops if the number of repeated passes hits the limit on the
-  // number of transformations that can be applied.
-  assert(
-      num_repeated_passes_applied_ <=
-          fuzzer_context_->GetTransformationLimit() &&
-      "The number of repeated passes applied must not exceed its upper limit.");
-  if (ir_context_->module()->id_bound() >= fuzzer_context_->GetIdBoundLimit()) {
-    return false;
-  }
-  if (num_repeated_passes_applied_ ==
-      fuzzer_context_->GetTransformationLimit()) {
-    // Stop because fuzzing has got stuck.
-    return false;
-  }
-  auto transformations_applied_so_far =
-      static_cast<uint32_t>(transformation_sequence_out_.transformation_size());
-  if (transformations_applied_so_far >=
-      fuzzer_context_->GetTransformationLimit()) {
-    // Stop because we have reached the transformation limit.
-    return false;
-  }
-  // If we have applied T transformations so far, and the limit on the number of
-  // transformations to apply is L (where T < L), the chance that we will
-  // continue fuzzing is:
-  //
-  //     1 - T/(2*L)
-  //
-  // That is, the chance of continuing decreases as more transformations are
-  // applied.  Using 2*L instead of L increases the number of transformations
-  // that are applied on average.
-  auto chance_of_continuing = static_cast<uint32_t>(
-      100.0 * (1.0 - (static_cast<double>(transformations_applied_so_far) /
-                      (2.0 * static_cast<double>(
-                                 fuzzer_context_->GetTransformationLimit())))));
-  if (!fuzzer_context_->ChoosePercentage(chance_of_continuing)) {
-    // We have probabilistically decided to stop.
-    return false;
+bool Fuzzer::ShouldContinueRepeatedPasses(
+    bool continue_fuzzing_probabilistically) {
+  if (continue_fuzzing_probabilistically) {
+    // If we have applied T transformations so far, and the limit on the number
+    // of transformations to apply is L (where T < L), the chance that we will
+    // continue fuzzing is:
+    //
+    //     1 - T/(2*L)
+    //
+    // That is, the chance of continuing decreases as more transformations are
+    // applied.  Using 2*L instead of L increases the number of transformations
+    // that are applied on average.
+    auto transformations_applied_so_far = static_cast<uint32_t>(
+        transformation_sequence_out_.transformation_size());
+    auto chance_of_continuing = static_cast<uint32_t>(
+        100.0 *
+        (1.0 - (static_cast<double>(transformations_applied_so_far) /
+                (2.0 * static_cast<double>(
+                           fuzzer_context_->GetTransformationLimit())))));
+    if (!fuzzer_context_->ChoosePercentage(chance_of_continuing)) {
+      // We have probabilistically decided to stop.
+      return false;
+    }
   }
   // Continue fuzzing!
   num_repeated_passes_applied_++;

+ 72 - 57
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer.h

@@ -23,6 +23,7 @@
 #include "source/fuzz/fuzzer_pass.h"
 #include "source/fuzz/fuzzer_util.h"
 #include "source/fuzz/pass_management/repeated_pass_instances.h"
+#include "source/fuzz/pass_management/repeated_pass_manager.h"
 #include "source/fuzz/pass_management/repeated_pass_recommender.h"
 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
 #include "source/fuzz/random_generator.h"
@@ -37,36 +38,32 @@ namespace fuzz {
 class Fuzzer {
  public:
   // Possible statuses that can result from running the fuzzer.
-  enum class FuzzerResultStatus {
+  enum class Status {
     kComplete,
-    kFailedToCreateSpirvToolsInterface,
+    kModuleTooBig,
+    kTransformationLimitReached,
+    kFuzzerStuck,
     kFuzzerPassLedToInvalidModule,
-    kInitialBinaryInvalid,
   };
 
-  struct FuzzerResult {
-    FuzzerResultStatus status;
-    std::vector<uint32_t> transformed_binary;
-    protobufs::TransformationSequence applied_transformations;
-  };
+  struct Result {
+    // Status of the fuzzing session.
+    Status status;
 
-  // Each field of this enum corresponds to an available repeated pass
-  // strategy, and is used to decide which kind of RepeatedPassManager object
-  // to create.
-  enum class RepeatedPassStrategy {
-    kSimple,
-    kRandomWithRecommendations,
-    kLoopedWithRecommendations
+    // Equals to true if new transformations were applied during the previous
+    // fuzzing session.
+    bool is_changed;
   };
 
-  Fuzzer(spv_target_env target_env, MessageConsumer consumer,
-         const std::vector<uint32_t>& binary_in,
-         const protobufs::FactSequence& initial_facts,
+  Fuzzer(std::unique_ptr<opt::IRContext> ir_context,
+         std::unique_ptr<TransformationContext> transformation_context,
+         std::unique_ptr<FuzzerContext> fuzzer_context,
+         MessageConsumer consumer,
          const std::vector<fuzzerutil::ModuleSupplier>& donor_suppliers,
-         std::unique_ptr<RandomGenerator> random_generator,
          bool enable_all_passes, RepeatedPassStrategy repeated_pass_strategy,
          bool validate_after_each_fuzzer_pass,
-         spv_validator_options validator_options);
+         spv_validator_options validator_options,
+         bool ignore_inapplicable_transformations = true);
 
   // Disables copy/move constructor/assignment operations.
   Fuzzer(const Fuzzer&) = delete;
@@ -76,15 +73,23 @@ class Fuzzer {
 
   ~Fuzzer();
 
-  // Transforms |binary_in_| by running a number of randomized fuzzer passes.
-  // Initial facts about the input binary and the context in which it will
-  // execute are provided via |initial_facts_|.  A source of donor modules to be
-  // used by transformations is provided via |donor_suppliers_|.  On success,
-  // returns a successful result status together with the transformed binary and
-  // the sequence of transformations that were applied.  Otherwise, returns an
-  // appropriate result status together with an empty binary and empty
-  // transformation sequence.
-  FuzzerResult Run();
+  // Transforms |ir_context_| by running a number of randomized fuzzer passes.
+  // Initial facts about the input binary and the context in which it will be
+  // executed are provided with |transformation_context_|.
+  // |num_of_transformations| is equal to the maximum number of transformations
+  // applied in a single call to this method. This parameter is ignored if its
+  // value is equal to 0. Because fuzzing cannot stop mid way through a fuzzer
+  // pass, fuzzing will stop after the fuzzer pass that exceeds
+  // |num_of_transformations| has completed, so that the total number of
+  // transformations may be somewhat larger than this number.
+  Result Run(uint32_t num_of_transformations_to_apply);
+
+  // Returns the current IR context. It may be invalid if the Run method
+  // returned Status::kFuzzerPassLedToInvalidModule previously.
+  opt::IRContext* GetIRContext();
+
+  // Returns the sequence of applied transformations.
+  const protobufs::TransformationSequence& GetTransformationSequence() const;
 
  private:
   // A convenience method to add a repeated fuzzer pass to |pass_instances| with
@@ -119,7 +124,9 @@ class Fuzzer {
 
   // Decides whether to apply more repeated passes. The probability decreases as
   // the number of transformations that have been applied increases.
-  bool ShouldContinueFuzzing();
+  // The described probability is only applied if
+  // |continue_fuzzing_probabilistically| is true.
+  bool ShouldContinueRepeatedPasses(bool continue_fuzzing_probabilistically);
 
   // Applies |pass|, which must be a pass constructed with |ir_context|.
   // If |validate_after_each_fuzzer_pass_| is not set, true is always returned.
@@ -128,57 +135,65 @@ class Fuzzer {
   // instruction has a distinct unique id.
   bool ApplyPassAndCheckValidity(FuzzerPass* pass) const;
 
-  // Target environment.
-  const spv_target_env target_env_;
-
   // Message consumer that will be invoked once for each message communicated
   // from the library.
-  MessageConsumer consumer_;
-
-  // The initial binary to which fuzzing should be applied.
-  const std::vector<uint32_t>& binary_in_;
-
-  // Initial facts known to hold in advance of applying any transformations.
-  const protobufs::FactSequence& initial_facts_;
-
-  // A source of modules whose contents can be donated into the module being
-  // fuzzed.
-  const std::vector<fuzzerutil::ModuleSupplier>& donor_suppliers_;
-
-  // Random number generator to control decision making during fuzzing.
-  std::unique_ptr<RandomGenerator> random_generator_;
+  const MessageConsumer consumer_;
 
   // Determines whether all passes should be enabled, vs. having passes be
   // probabilistically enabled.
-  bool enable_all_passes_;
-
-  // Controls which type of RepeatedPassManager object to create.
-  RepeatedPassStrategy repeated_pass_strategy_;
+  const bool enable_all_passes_;
 
   // Determines whether the validator should be invoked after every fuzzer pass.
-  bool validate_after_each_fuzzer_pass_;
+  const bool validate_after_each_fuzzer_pass_;
 
   // Options to control validation.
-  spv_validator_options validator_options_;
+  const spv_validator_options validator_options_;
 
   // The number of repeated fuzzer passes that have been applied is kept track
   // of, in order to enforce a hard limit on the number of times such passes
   // can be applied.
   uint32_t num_repeated_passes_applied_;
 
+  // We use this to determine whether we can continue fuzzing incrementally
+  // since the previous call to the Run method could've returned
+  // kFuzzerPassLedToInvalidModule.
+  bool is_valid_;
+
   // Intermediate representation for the module being fuzzed, which gets
   // mutated as fuzzing proceeds.
   std::unique_ptr<opt::IRContext> ir_context_;
 
+  // Contextual information that is required in order to apply
+  // transformations.
+  std::unique_ptr<TransformationContext> transformation_context_;
+
   // Provides probabilities that control the fuzzing process.
   std::unique_ptr<FuzzerContext> fuzzer_context_;
 
-  // Contextual information that is required in order to apply transformations.
-  std::unique_ptr<TransformationContext> transformation_context_;
-
-  // The sequence of transformations that have been applied during fuzzing.  It
+  // The sequence of transformations that have been applied during fuzzing. It
   // is initially empty and grows as fuzzer passes are applied.
   protobufs::TransformationSequence transformation_sequence_out_;
+
+  // This object contains instances of all fuzzer passes that will participate
+  // in the fuzzing.
+  RepeatedPassInstances pass_instances_;
+
+  // This object defines the recommendation logic for fuzzer passes.
+  std::unique_ptr<RepeatedPassRecommender> repeated_pass_recommender_;
+
+  // This object manager a list of fuzzer pass and their available
+  // recommendations.
+  std::unique_ptr<RepeatedPassManager> repeated_pass_manager_;
+
+  // Some passes that it does not make sense to apply repeatedly, as they do not
+  // unlock other passes.
+  std::vector<std::unique_ptr<FuzzerPass>> final_passes_;
+
+  // When set, this flag causes inapplicable transformations that should be
+  // applicable by construction to be ignored. This is useful when the fuzzer
+  // is being deployed at scale to test a SPIR-V processing tool, and where it
+  // is desirable to ignore bugs in the fuzzer itself.
+  const bool ignore_inapplicable_transformations_;
 };
 
 }  // namespace fuzz

+ 34 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_context.cpp

@@ -21,6 +21,12 @@ namespace fuzz {
 
 namespace {
 
+// An offset between the module's id bound and the minimum fresh id.
+//
+// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/2541): consider
+//  the case where the maximum id bound is reached.
+const uint32_t kIdBoundGap = 100;
+
 // Limits to help control the overall fuzzing process and rein in individual
 // fuzzer passes.
 const uint32_t kIdBoundLimit = 50000;
@@ -36,6 +42,8 @@ const std::pair<uint32_t, uint32_t> kChanceOfAddingAnotherPassToPassLoop = {50,
 const std::pair<uint32_t, uint32_t> kChanceOfAddingAnotherStructField = {20,
                                                                          90};
 const std::pair<uint32_t, uint32_t> kChanceOfAddingArrayOrStructType = {20, 90};
+const std::pair<uint32_t, uint32_t> KChanceOfAddingAtomicLoad = {30, 90};
+const std::pair<uint32_t, uint32_t> KChanceOfAddingAtomicStore = {20, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfAddingBitInstructionSynonym = {5,
                                                                             20};
 const std::pair<uint32_t, uint32_t>
@@ -114,6 +122,8 @@ const std::pair<uint32_t, uint32_t> kChanceOfMovingBlockDown = {20, 50};
 const std::pair<uint32_t, uint32_t> kChanceOfMutatingPointer = {20, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfObfuscatingConstant = {10, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfOutliningFunction = {10, 90};
+const std::pair<uint32_t, uint32_t> kChanceOfPermutingFunctionVariables = {30,
+                                                                           90};
 const std::pair<uint32_t, uint32_t> kChanceOfPermutingInstructions = {20, 70};
 const std::pair<uint32_t, uint32_t> kChanceOfPermutingParameters = {30, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfPermutingPhiOperands = {30, 90};
@@ -145,12 +155,16 @@ const std::pair<uint32_t, uint32_t> kChanceOfReplacingParametersWithGlobals = {
 const std::pair<uint32_t, uint32_t> kChanceOfReplacingParametersWithStruct = {
     20, 40};
 const std::pair<uint32_t, uint32_t> kChanceOfSplittingBlock = {40, 95};
+const std::pair<uint32_t, uint32_t>
+    kChanceOfSwappingAnotherPairOfFunctionVariables = {30, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfSwappingConditionalBranchOperands =
     {10, 70};
+const std::pair<uint32_t, uint32_t> kChanceOfSwappingFunctions = {10, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfTogglingAccessChainInstruction = {
     20, 90};
 const std::pair<uint32_t, uint32_t> kChanceOfWrappingRegionInSelection = {70,
                                                                           90};
+const std::pair<uint32_t, uint32_t> kChanceOfWrappingVectorSynonym = {10, 90};
 
 // Default limits for various quantities that are chosen during fuzzing.
 // Keep them in alphabetical order.
@@ -177,10 +191,11 @@ const std::function<bool(uint32_t, RandomGenerator*)>
 
 }  // namespace
 
-FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
-                             uint32_t min_fresh_id)
-    : random_generator_(random_generator),
+FuzzerContext::FuzzerContext(std::unique_ptr<RandomGenerator> random_generator,
+                             uint32_t min_fresh_id, bool is_wgsl_compatible)
+    : random_generator_(std::move(random_generator)),
       next_fresh_id_(min_fresh_id),
+      is_wgsl_compatible_(is_wgsl_compatible),
       max_equivalence_class_size_for_data_synonym_fact_closure_(
           kDefaultMaxEquivalenceClassSizeForDataSynonymFactClosure),
       max_loop_control_partial_count_(kDefaultMaxLoopControlPartialCount),
@@ -203,6 +218,10 @@ FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
       ChooseBetweenMinAndMax(kChanceOfAddingAnotherStructField);
   chance_of_adding_array_or_struct_type_ =
       ChooseBetweenMinAndMax(kChanceOfAddingArrayOrStructType);
+  chance_of_adding_atomic_load_ =
+      ChooseBetweenMinAndMax(KChanceOfAddingAtomicLoad);
+  chance_of_adding_atomic_store_ =
+      ChooseBetweenMinAndMax(KChanceOfAddingAtomicStore);
   chance_of_adding_bit_instruction_synonym_ =
       ChooseBetweenMinAndMax(kChanceOfAddingBitInstructionSynonym);
   chance_of_adding_both_branches_when_replacing_opselect_ =
@@ -308,6 +327,8 @@ FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
       ChooseBetweenMinAndMax(kChanceOfObfuscatingConstant);
   chance_of_outlining_function_ =
       ChooseBetweenMinAndMax(kChanceOfOutliningFunction);
+  chance_of_permuting_function_variables_ =
+      ChooseBetweenMinAndMax(kChanceOfPermutingFunctionVariables);
   chance_of_permuting_instructions_ =
       ChooseBetweenMinAndMax(kChanceOfPermutingInstructions);
   chance_of_permuting_parameters_ =
@@ -345,12 +366,18 @@ FuzzerContext::FuzzerContext(RandomGenerator* random_generator,
   chance_of_replacing_parameters_with_struct_ =
       ChooseBetweenMinAndMax(kChanceOfReplacingParametersWithStruct);
   chance_of_splitting_block_ = ChooseBetweenMinAndMax(kChanceOfSplittingBlock);
+  chance_of_swapping_another_pair_of_function_variables_ =
+      ChooseBetweenMinAndMax(kChanceOfSwappingAnotherPairOfFunctionVariables);
   chance_of_swapping_conditional_branch_operands_ =
       ChooseBetweenMinAndMax(kChanceOfSwappingConditionalBranchOperands);
+  chance_of_swapping_functions_ =
+      ChooseBetweenMinAndMax(kChanceOfSwappingFunctions);
   chance_of_toggling_access_chain_instruction_ =
       ChooseBetweenMinAndMax(kChanceOfTogglingAccessChainInstruction);
   chance_of_wrapping_region_in_selection_ =
       ChooseBetweenMinAndMax(kChanceOfWrappingRegionInSelection);
+  chance_of_wrapping_vector_synonym_ =
+      ChooseBetweenMinAndMax(kChanceOfWrappingVectorSynonym);
 }
 
 FuzzerContext::~FuzzerContext() = default;
@@ -403,5 +430,9 @@ uint32_t FuzzerContext::GetTransformationLimit() const {
   return kTransformationLimit;
 }
 
+uint32_t FuzzerContext::GetMinFreshId(opt::IRContext* ir_context) {
+  return ir_context->module()->id_bound() + kIdBoundGap;
+}
+
 }  // namespace fuzz
 }  // namespace spvtools

+ 52 - 6
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_context.h

@@ -21,6 +21,7 @@
 #include "source/fuzz/protobufs/spirvfuzz_protobufs.h"
 #include "source/fuzz/random_generator.h"
 #include "source/opt/function.h"
+#include "source/opt/ir_context.h"
 
 namespace spvtools {
 namespace fuzz {
@@ -32,7 +33,8 @@ class FuzzerContext {
  public:
   // Constructs a fuzzer context with a given random generator and the minimum
   // value that can be used for fresh ids.
-  FuzzerContext(RandomGenerator* random_generator, uint32_t min_fresh_id);
+  FuzzerContext(std::unique_ptr<RandomGenerator> random_generator,
+                uint32_t min_fresh_id, bool is_wgsl_compatible);
 
   ~FuzzerContext();
 
@@ -64,7 +66,7 @@ class FuzzerContext {
   }
 
   // Randomly shuffles a |sequence| between |lo| and |hi| indices inclusively.
-  // |lo| and |hi| must be valid indices to the |sequence|
+  // |lo| and |hi| must be valid indices to the |sequence|.
   template <typename T>
   void Shuffle(std::vector<T>* sequence, size_t lo, size_t hi) const {
     auto& array = *sequence;
@@ -89,7 +91,7 @@ class FuzzerContext {
     }
   }
 
-  // Ramdomly shuffles a |sequence|
+  // Randomly shuffles a |sequence|.
   template <typename T>
   void Shuffle(std::vector<T>* sequence) const {
     if (!sequence->empty()) {
@@ -102,7 +104,7 @@ class FuzzerContext {
   uint32_t GetFreshId();
 
   // Returns a vector of |count| fresh ids.
-  std::vector<uint32_t> GetFreshIds(const uint32_t count);
+  std::vector<uint32_t> GetFreshIds(uint32_t count);
 
   // A suggested limit on the id bound for the module being fuzzed.  This is
   // useful for deciding when to stop the overall fuzzing process.  Furthermore,
@@ -115,6 +117,14 @@ class FuzzerContext {
   // fuzzer passes.
   uint32_t GetTransformationLimit() const;
 
+  // Returns the minimum fresh id that can be used given the |ir_context|.
+  static uint32_t GetMinFreshId(opt::IRContext* ir_context);
+
+  // Returns true if all transformations should be compatible with WGSL.
+  bool IsWgslCompatible() const {
+    return is_wgsl_compatible_;
+  }
+
   // Probabilities associated with applying various transformations.
   // Keep them in alphabetical order.
   uint32_t GetChanceOfAcceptingRepeatedPassRecommendation() const {
@@ -132,6 +142,12 @@ class FuzzerContext {
   uint32_t GetChanceOfAddingArrayOrStructType() const {
     return chance_of_adding_array_or_struct_type_;
   }
+  uint32_t GetChanceOfAddingAtomicLoad() const {
+    return chance_of_adding_atomic_load_;
+  }
+  uint32_t GetChanceOfAddingAtomicStore() const {
+    return chance_of_adding_atomic_store_;
+  }
   uint32_t GetChanceOfAddingBitInstructionSynonym() const {
     return chance_of_adding_bit_instruction_synonym_;
   }
@@ -293,6 +309,9 @@ class FuzzerContext {
   uint32_t GetChanceOfOutliningFunction() const {
     return chance_of_outlining_function_;
   }
+  uint32_t GetChanceOfPermutingFunctionVariables() const {
+    return chance_of_permuting_function_variables_;
+  }
   uint32_t GetChanceOfPermutingInstructions() const {
     return chance_of_permuting_instructions_;
   }
@@ -350,9 +369,17 @@ class FuzzerContext {
   uint32_t GetChanceOfSplittingBlock() const {
     return chance_of_splitting_block_;
   }
+  uint32_t GetChanceOfSwappingAnotherPairOfFunctionVariables() const {
+    return chance_of_swapping_another_pair_of_function_variables_;
+  }
   uint32_t GetChanceOfSwappingConditionalBranchOperands() const {
     return chance_of_swapping_conditional_branch_operands_;
   }
+
+  uint32_t GetChanceOfSwappingFunctions() const {
+    return chance_of_swapping_functions_;
+  }
+
   uint32_t GetChanceOfTogglingAccessChainInstruction() const {
     return chance_of_toggling_access_chain_instruction_;
   }
@@ -360,6 +387,10 @@ class FuzzerContext {
     return chance_of_wrapping_region_in_selection_;
   }
 
+  uint32_t GetChanceOfWrappingVectorSynonym() const {
+    return chance_of_wrapping_vector_synonym_;
+  }
+
   // Other functions to control transformations. Keep them in alphabetical
   // order.
   uint32_t GetMaximumEquivalenceClassSizeForDataSynonymFactClosure() const {
@@ -404,6 +435,9 @@ class FuzzerContext {
   uint32_t GetRandomIndexForCompositeInsert(uint32_t number_of_components) {
     return random_generator_->RandomUint32(number_of_components);
   }
+  uint32_t GetRandomIndexForWrappingVector(uint32_t vector_width) {
+    return random_generator_->RandomUint32(vector_width);
+  }
   int64_t GetRandomValueForStepConstantInLoop() {
     return random_generator_->RandomUint64(UINT64_MAX);
   }
@@ -441,16 +475,22 @@ class FuzzerContext {
     // Ensure that the number of unused components is non-zero.
     return random_generator_->RandomUint32(max_unused_component_count) + 1;
   }
+  uint32_t GetWidthOfWrappingVector() {
+    return 2 + random_generator_->RandomUint32(3);
+  }
   bool GoDeeperInConstantObfuscation(uint32_t depth) {
-    return go_deeper_in_constant_obfuscation_(depth, random_generator_);
+    return go_deeper_in_constant_obfuscation_(depth, random_generator_.get());
   }
 
  private:
   // The source of randomness.
-  RandomGenerator* random_generator_;
+  std::unique_ptr<RandomGenerator> random_generator_;
   // The next fresh id to be issued.
   uint32_t next_fresh_id_;
 
+  // True if all transformations should be compatible with WGSL spec.
+  bool is_wgsl_compatible_;
+
   // Probabilities associated with applying various transformations.
   // Keep them in alphabetical order.
   uint32_t chance_of_accepting_repeated_pass_recommendation_;
@@ -458,6 +498,8 @@ class FuzzerContext {
   uint32_t chance_of_adding_another_pass_to_pass_loop_;
   uint32_t chance_of_adding_another_struct_field_;
   uint32_t chance_of_adding_array_or_struct_type_;
+  uint32_t chance_of_adding_atomic_load_;
+  uint32_t chance_of_adding_atomic_store_;
   uint32_t chance_of_adding_bit_instruction_synonym_;
   uint32_t chance_of_adding_both_branches_when_replacing_opselect_;
   uint32_t chance_of_adding_composite_extract_;
@@ -513,6 +555,7 @@ class FuzzerContext {
   uint32_t chance_of_mutating_pointer_;
   uint32_t chance_of_obfuscating_constant_;
   uint32_t chance_of_outlining_function_;
+  uint32_t chance_of_permuting_function_variables_;
   uint32_t chance_of_permuting_instructions_;
   uint32_t chance_of_permuting_parameters_;
   uint32_t chance_of_permuting_phi_operands_;
@@ -532,9 +575,12 @@ class FuzzerContext {
   uint32_t chance_of_replacing_parameters_with_globals_;
   uint32_t chance_of_replacing_parameters_with_struct_;
   uint32_t chance_of_splitting_block_;
+  uint32_t chance_of_swapping_another_pair_of_function_variables_;
   uint32_t chance_of_swapping_conditional_branch_operands_;
+  uint32_t chance_of_swapping_functions_;
   uint32_t chance_of_toggling_access_chain_instruction_;
   uint32_t chance_of_wrapping_region_in_selection_;
+  uint32_t chance_of_wrapping_vector_synonym_;
 
   // Limits associated with various quantities for which random values are
   // chosen during fuzzing.

+ 50 - 6
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass.cpp

@@ -43,11 +43,14 @@ namespace fuzz {
 FuzzerPass::FuzzerPass(opt::IRContext* ir_context,
                        TransformationContext* transformation_context,
                        FuzzerContext* fuzzer_context,
-                       protobufs::TransformationSequence* transformations)
+                       protobufs::TransformationSequence* transformations,
+                       bool ignore_inapplicable_transformations)
     : ir_context_(ir_context),
       transformation_context_(transformation_context),
       fuzzer_context_(fuzzer_context),
-      transformations_(transformations) {}
+      transformations_(transformations),
+      ignore_inapplicable_transformations_(
+          ignore_inapplicable_transformations) {}
 
 FuzzerPass::~FuzzerPass() = default;
 
@@ -111,10 +114,8 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor(
   // module.
   std::vector<opt::BasicBlock*> reachable_blocks;
 
-  const auto* dominator_analysis =
-      GetIRContext()->GetDominatorAnalysis(function);
   for (auto& block : *function) {
-    if (dominator_analysis->IsReachable(&block)) {
+    if (GetIRContext()->IsReachable(block)) {
       reachable_blocks.push_back(&block);
     }
   }
@@ -184,6 +185,49 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor(
   }
 }
 
+void FuzzerPass::ApplyTransformation(const Transformation& transformation) {
+  if (ignore_inapplicable_transformations_) {
+    // If an applicable-by-construction transformation turns out to be
+    // inapplicable, this is a bug in the fuzzer. However, when deploying the
+    // fuzzer at scale for finding bugs in SPIR-V processing tools it is
+    // desirable to silently ignore such bugs. This code path caters for that
+    // scenario.
+    if (!transformation.IsApplicable(GetIRContext(),
+                                     *GetTransformationContext())) {
+      return;
+    }
+  } else {
+    // This code path caters for debugging bugs in the fuzzer, where an
+    // applicable-by-construction transformation turns out to be inapplicable.
+    assert(transformation.IsApplicable(GetIRContext(),
+                                       *GetTransformationContext()) &&
+           "Transformation should be applicable by construction.");
+  }
+  transformation.Apply(GetIRContext(), GetTransformationContext());
+  auto transformation_message = transformation.ToMessage();
+  assert(transformation_message.transformation_case() !=
+             protobufs::Transformation::TRANSFORMATION_NOT_SET &&
+         "Bad transformation.");
+  *GetTransformations()->add_transformation() =
+      std::move(transformation_message);
+}
+
+bool FuzzerPass::MaybeApplyTransformation(
+    const Transformation& transformation) {
+  if (transformation.IsApplicable(GetIRContext(),
+                                  *GetTransformationContext())) {
+    transformation.Apply(GetIRContext(), GetTransformationContext());
+    auto transformation_message = transformation.ToMessage();
+    assert(transformation_message.transformation_case() !=
+               protobufs::Transformation::TRANSFORMATION_NOT_SET &&
+           "Bad transformation.");
+    *GetTransformations()->add_transformation() =
+        std::move(transformation_message);
+    return true;
+  }
+  return false;
+}
+
 uint32_t FuzzerPass::FindOrCreateBoolType() {
   if (auto existing_id = fuzzerutil::MaybeGetBoolType(GetIRContext())) {
     return existing_id;
@@ -217,7 +261,7 @@ uint32_t FuzzerPass::FindOrCreateFloatType(uint32_t width) {
 
 uint32_t FuzzerPass::FindOrCreateFunctionType(
     uint32_t return_type_id, const std::vector<uint32_t>& argument_id) {
-  // FindFunctionType has a sigle argument for OpTypeFunction operands
+  // FindFunctionType has a single argument for OpTypeFunction operands
   // so we will have to copy them all in this vector
   std::vector<uint32_t> type_ids(argument_id.size() + 1);
   type_ids[0] = return_type_id;

+ 8 - 27
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass.h

@@ -33,7 +33,8 @@ class FuzzerPass {
   FuzzerPass(opt::IRContext* ir_context,
              TransformationContext* transformation_context,
              FuzzerContext* fuzzer_context,
-             protobufs::TransformationSequence* transformations);
+             protobufs::TransformationSequence* transformations,
+             bool ignore_inapplicable_transformations);
 
   virtual ~FuzzerPass();
 
@@ -106,37 +107,13 @@ class FuzzerPass {
 
   // A generic helper for applying a transformation that should be applicable
   // by construction, and adding it to the sequence of applied transformations.
-  void ApplyTransformation(const Transformation& transformation) {
-    assert(transformation.IsApplicable(GetIRContext(),
-                                       *GetTransformationContext()) &&
-           "Transformation should be applicable by construction.");
-    transformation.Apply(GetIRContext(), GetTransformationContext());
-    protobufs::Transformation transformation_message =
-        transformation.ToMessage();
-    assert(transformation_message.transformation_case() !=
-               protobufs::Transformation::TRANSFORMATION_NOT_SET &&
-           "Bad transformation.");
-    *GetTransformations()->add_transformation() = transformation_message;
-  }
+  void ApplyTransformation(const Transformation& transformation);
 
   // A generic helper for applying a transformation only if it is applicable.
   // If it is applicable, the transformation is applied and then added to the
   // sequence of applied transformations and the function returns true.
   // Otherwise, the function returns false.
-  bool MaybeApplyTransformation(const Transformation& transformation) {
-    if (transformation.IsApplicable(GetIRContext(),
-                                    *GetTransformationContext())) {
-      transformation.Apply(GetIRContext(), GetTransformationContext());
-      protobufs::Transformation transformation_message =
-          transformation.ToMessage();
-      assert(transformation_message.transformation_case() !=
-                 protobufs::Transformation::TRANSFORMATION_NOT_SET &&
-             "Bad transformation.");
-      *GetTransformations()->add_transformation() = transformation_message;
-      return true;
-    }
-    return false;
-  }
+  bool MaybeApplyTransformation(const Transformation& transformation);
 
   // Returns the id of an OpTypeBool instruction.  If such an instruction does
   // not exist, a transformation is applied to add it.
@@ -345,6 +322,10 @@ class FuzzerPass {
   TransformationContext* transformation_context_;
   FuzzerContext* fuzzer_context_;
   protobufs::TransformationSequence* transformations_;
+  // If set, then transformations that should be applicable by construction are
+  // still tested for applicability, and ignored if they turn out to be
+  // inapplicable. Otherwise, applicability by construction is asserted.
+  const bool ignore_inapplicable_transformations_;
 };
 
 }  // namespace fuzz

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp

@@ -23,11 +23,10 @@ namespace fuzz {
 FuzzerPassAddAccessChains::FuzzerPassAddAccessChains(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddAccessChains::~FuzzerPassAddAccessChains() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddAccessChains::Apply() {
   ForEachInstructionWithInstructionDescriptor(

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.h

@@ -28,9 +28,8 @@ class FuzzerPassAddAccessChains : public FuzzerPass {
   FuzzerPassAddAccessChains(opt::IRContext* ir_context,
                             TransformationContext* transformation_context,
                             FuzzerContext* fuzzer_context,
-                            protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddAccessChains();
+                            protobufs::TransformationSequence* transformations,
+                            bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 8 - 21
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.cpp

@@ -24,12 +24,10 @@ namespace fuzz {
 FuzzerPassAddBitInstructionSynonyms::FuzzerPassAddBitInstructionSynonyms(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddBitInstructionSynonyms::~FuzzerPassAddBitInstructionSynonyms() =
-    default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddBitInstructionSynonyms::Apply() {
   for (auto& function : *GetIRContext()->module()) {
@@ -48,22 +46,11 @@ void FuzzerPassAddBitInstructionSynonyms::Apply() {
           continue;
         }
 
-        // TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3557):
-        //  Right now we only support certain operations. When this issue is
-        //  addressed the following conditional can use the function
-        //  |spvOpcodeIsBit|.
-        if (instruction.opcode() != SpvOpBitwiseOr &&
-            instruction.opcode() != SpvOpBitwiseXor &&
-            instruction.opcode() != SpvOpBitwiseAnd &&
-            instruction.opcode() != SpvOpNot) {
-          continue;
-        }
-
-        // Right now, only integer operands are supported.
-        if (GetIRContext()
-                ->get_type_mgr()
-                ->GetType(instruction.type_id())
-                ->AsVector()) {
+        // Make sure fuzzer never applies a transformation to a bitwise
+        // instruction with differently signed operands, only integer operands
+        // are supported and bitwise operations are supported only.
+        if (!TransformationAddBitInstructionSynonym::IsInstructionSupported(
+                GetIRContext(), &instruction)) {
           continue;
         }
 

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_bit_instruction_synonyms.h

@@ -28,9 +28,8 @@ class FuzzerPassAddBitInstructionSynonyms : public FuzzerPass {
   FuzzerPassAddBitInstructionSynonyms(
       opt::IRContext* ir_context, TransformationContext* transformation_context,
       FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddBitInstructionSynonyms();
+      protobufs::TransformationSequence* transformations,
+      bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 22 - 29
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp

@@ -14,6 +14,7 @@
 
 #include "source/fuzz/fuzzer_pass_add_composite_extract.h"
 
+#include "source/fuzz/available_instructions.h"
 #include "source/fuzz/fuzzer_context.h"
 #include "source/fuzz/fuzzer_util.h"
 #include "source/fuzz/instruction_descriptor.h"
@@ -25,11 +26,10 @@ namespace fuzz {
 FuzzerPassAddCompositeExtract::FuzzerPassAddCompositeExtract(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddCompositeExtract::~FuzzerPassAddCompositeExtract() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddCompositeExtract::Apply() {
   std::vector<const protobufs::DataDescriptor*> composite_synonyms;
@@ -41,14 +41,16 @@ void FuzzerPassAddCompositeExtract::Apply() {
     }
   }
 
-  // We don't want to invalidate the module every time we apply this
-  // transformation since rebuilding DominatorAnalysis can be expensive, so we
-  // collect up the transformations we wish to apply and apply them all later.
-  std::vector<TransformationCompositeExtract> transformations;
+  AvailableInstructions available_composites(
+      GetIRContext(), [](opt::IRContext* ir_context, opt::Instruction* inst) {
+        return inst->type_id() && inst->result_id() &&
+               fuzzerutil::IsCompositeType(
+                   ir_context->get_type_mgr()->GetType(inst->type_id()));
+      });
 
   ForEachInstructionWithInstructionDescriptor(
-      [this, &composite_synonyms, &transformations](
-          opt::Function* function, opt::BasicBlock* block,
+      [this, &available_composites, &composite_synonyms](
+          opt::Function* /*unused*/, opt::BasicBlock* /*unused*/,
           opt::BasicBlock::iterator inst_it,
           const protobufs::InstructionDescriptor& instruction_descriptor) {
         if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCompositeExtract,
@@ -61,14 +63,6 @@ void FuzzerPassAddCompositeExtract::Apply() {
           return;
         }
 
-        auto available_composites = FindAvailableInstructions(
-            function, block, inst_it,
-            [](opt::IRContext* ir_context, opt::Instruction* inst) {
-              return inst->type_id() && inst->result_id() &&
-                     fuzzerutil::IsCompositeType(
-                         ir_context->get_type_mgr()->GetType(inst->type_id()));
-            });
-
         std::vector<const protobufs::DataDescriptor*> available_synonyms;
         for (const auto* dd : composite_synonyms) {
           if (fuzzerutil::IdIsAvailableBeforeInstruction(
@@ -77,18 +71,21 @@ void FuzzerPassAddCompositeExtract::Apply() {
           }
         }
 
-        if (available_synonyms.empty() && available_composites.empty()) {
+        auto candidate_composites =
+            available_composites.GetAvailableBeforeInstruction(&*inst_it);
+
+        if (available_synonyms.empty() && candidate_composites.empty()) {
           return;
         }
 
         uint32_t composite_id = 0;
         std::vector<uint32_t> indices;
 
-        if (available_synonyms.empty() || (!available_composites.empty() &&
+        if (available_synonyms.empty() || (!candidate_composites.empty() &&
                                            GetFuzzerContext()->ChooseEven())) {
           const auto* inst =
-              available_composites[GetFuzzerContext()->RandomIndex(
-                  available_composites)];
+              candidate_composites[GetFuzzerContext()->RandomIndex(
+                  candidate_composites)];
           composite_id = inst->result_id();
 
           auto type_id = inst->type_id();
@@ -153,14 +150,10 @@ void FuzzerPassAddCompositeExtract::Apply() {
         assert(composite_id != 0 && !indices.empty() &&
                "Composite object should have been chosen correctly");
 
-        transformations.emplace_back(instruction_descriptor,
-                                     GetFuzzerContext()->GetFreshId(),
-                                     composite_id, indices);
+        ApplyTransformation(TransformationCompositeExtract(
+            instruction_descriptor, GetFuzzerContext()->GetFreshId(),
+            composite_id, indices));
       });
-
-  for (const auto& transformation : transformations) {
-    ApplyTransformation(transformation);
-  }
 }
 
 }  // namespace fuzz

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.h

@@ -27,9 +27,8 @@ class FuzzerPassAddCompositeExtract : public FuzzerPass {
   FuzzerPassAddCompositeExtract(
       opt::IRContext* ir_context, TransformationContext* transformation_context,
       FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddCompositeExtract() override;
+      protobufs::TransformationSequence* transformations,
+      bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp

@@ -25,11 +25,10 @@ namespace fuzz {
 FuzzerPassAddCompositeInserts::FuzzerPassAddCompositeInserts(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddCompositeInserts::~FuzzerPassAddCompositeInserts() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddCompositeInserts::Apply() {
   ForEachInstructionWithInstructionDescriptor(

+ 2 - 2
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.h

@@ -27,9 +27,9 @@ class FuzzerPassAddCompositeInserts : public FuzzerPass {
   FuzzerPassAddCompositeInserts(
       opt::IRContext* ir_context, TransformationContext* transformation_context,
       FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
+      protobufs::TransformationSequence* transformations,
+      bool ignore_inapplicable_transformations);
 
-  ~FuzzerPassAddCompositeInserts();
   void Apply() override;
 
   // Checks if any component of a composite is a pointer.

+ 6 - 5
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp

@@ -24,11 +24,10 @@ namespace fuzz {
 FuzzerPassAddCompositeTypes::FuzzerPassAddCompositeTypes(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddCompositeTypes::~FuzzerPassAddCompositeTypes() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddCompositeTypes::Apply() {
   MaybeAddMissingVectorTypes();
@@ -125,7 +124,9 @@ uint32_t FuzzerPassAddCompositeTypes::ChooseScalarOrCompositeType() {
         break;
       case SpvOpTypeStruct: {
         if (!fuzzerutil::MembersHaveBuiltInDecoration(GetIRContext(),
-                                                      inst.result_id())) {
+                                                      inst.result_id()) &&
+            !fuzzerutil::HasBlockOrBufferBlockDecoration(GetIRContext(),
+                                                         inst.result_id())) {
           candidates.push_back(inst.result_id());
         }
       } break;

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.h

@@ -27,9 +27,8 @@ class FuzzerPassAddCompositeTypes : public FuzzerPass {
   FuzzerPassAddCompositeTypes(
       opt::IRContext* ir_context, TransformationContext* transformation_context,
       FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddCompositeTypes();
+      protobufs::TransformationSequence* transformations,
+      bool ignore_inapplicable_transformations);
 
   void Apply() override;
 

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp

@@ -25,11 +25,10 @@ namespace fuzz {
 FuzzerPassAddCopyMemory::FuzzerPassAddCopyMemory(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddCopyMemory::~FuzzerPassAddCopyMemory() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddCopyMemory::Apply() {
   ForEachInstructionWithInstructionDescriptor(

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.h

@@ -27,9 +27,8 @@ class FuzzerPassAddCopyMemory : public FuzzerPass {
   FuzzerPassAddCopyMemory(opt::IRContext* ir_context,
                           TransformationContext* transformation_context,
                           FuzzerContext* fuzzer_context,
-                          protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddCopyMemory() override;
+                          protobufs::TransformationSequence* transformations,
+                          bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 23 - 7
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_blocks.cpp

@@ -14,20 +14,27 @@
 
 #include "source/fuzz/fuzzer_pass_add_dead_blocks.h"
 
+#include <algorithm>
+
 #include "source/fuzz/fuzzer_util.h"
 #include "source/fuzz/transformation_add_dead_block.h"
 
 namespace spvtools {
 namespace fuzz {
 
+namespace {
+
+const size_t kMaxTransformationsInOnePass = 100U;
+
+}  // namespace
+
 FuzzerPassAddDeadBlocks::FuzzerPassAddDeadBlocks(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddDeadBlocks::~FuzzerPassAddDeadBlocks() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddDeadBlocks::Apply() {
   // We iterate over all blocks in the module collecting up those at which we
@@ -57,9 +64,18 @@ void FuzzerPassAddDeadBlocks::Apply() {
           GetFuzzerContext()->GetFreshId(), block.id(), condition_value));
     }
   }
-  // Apply all those transformations that are in fact applicable.
-  for (auto& transformation : candidate_transformations) {
-    MaybeApplyTransformation(transformation);
+  // Applying transformations can be expensive as each transformation requires
+  // dominator information and also invalidates dominator information. We thus
+  // limit the number of transformations that one application of this fuzzer
+  // pass can apply. We choose to do this after identifying all the
+  // transformations that we *might* want to apply, rather than breaking the
+  // above loops once the limit is reached, to avoid biasing towards
+  // transformations that target early parts of the module.
+  GetFuzzerContext()->Shuffle(&candidate_transformations);
+  for (size_t i = 0; i < std::min(kMaxTransformationsInOnePass,
+                                  candidate_transformations.size());
+       i++) {
+    MaybeApplyTransformation(candidate_transformations[i]);
   }
 }
 

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_blocks.h

@@ -27,9 +27,8 @@ class FuzzerPassAddDeadBlocks : public FuzzerPass {
   FuzzerPassAddDeadBlocks(opt::IRContext* ir_context,
                           TransformationContext* transformation_context,
                           FuzzerContext* fuzzer_context,
-                          protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddDeadBlocks();
+                          protobufs::TransformationSequence* transformations,
+                          bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_breaks.cpp

@@ -24,11 +24,10 @@ namespace fuzz {
 FuzzerPassAddDeadBreaks::FuzzerPassAddDeadBreaks(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddDeadBreaks::~FuzzerPassAddDeadBreaks() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddDeadBreaks::Apply() {
   // We first collect up lots of possibly-applicable transformations.

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_breaks.h

@@ -26,9 +26,8 @@ class FuzzerPassAddDeadBreaks : public FuzzerPass {
   FuzzerPassAddDeadBreaks(opt::IRContext* ir_context,
                           TransformationContext* transformation_context,
                           FuzzerContext* fuzzer_context,
-                          protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddDeadBreaks();
+                          protobufs::TransformationSequence* transformations,
+                          bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_continues.cpp

@@ -24,11 +24,10 @@ namespace fuzz {
 FuzzerPassAddDeadContinues::FuzzerPassAddDeadContinues(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddDeadContinues::~FuzzerPassAddDeadContinues() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddDeadContinues::Apply() {
   // Consider every block in every function.

+ 5 - 6
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_dead_continues.h

@@ -23,12 +23,11 @@ namespace fuzz {
 // A fuzzer pass for adding dead continue edges to the module.
 class FuzzerPassAddDeadContinues : public FuzzerPass {
  public:
-  FuzzerPassAddDeadContinues(
-      opt::IRContext* ir_context, TransformationContext* transformation_context,
-      FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddDeadContinues();
+  FuzzerPassAddDeadContinues(opt::IRContext* ir_context,
+                             TransformationContext* transformation_context,
+                             FuzzerContext* fuzzer_context,
+                             protobufs::TransformationSequence* transformations,
+                             bool ignore_inapplicable_transformations);
 
   void Apply() override;
 };

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

@@ -45,12 +45,10 @@ bool IsBitWidthSupported(opt::IRContext* ir_context, uint32_t bit_width) {
 FuzzerPassAddEquationInstructions::FuzzerPassAddEquationInstructions(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddEquationInstructions::~FuzzerPassAddEquationInstructions() =
-    default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddEquationInstructions::Apply() {
   ForEachInstructionWithInstructionDescriptor(

+ 2 - 3
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.h

@@ -29,9 +29,8 @@ class FuzzerPassAddEquationInstructions : public FuzzerPass {
   FuzzerPassAddEquationInstructions(
       opt::IRContext* ir_context, TransformationContext* transformation_context,
       FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddEquationInstructions();
+      protobufs::TransformationSequence* transformations,
+      bool ignore_inapplicable_transformations);
 
   void Apply() override;
 

+ 3 - 4
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp

@@ -26,11 +26,10 @@ namespace fuzz {
 FuzzerPassAddFunctionCalls::FuzzerPassAddFunctionCalls(
     opt::IRContext* ir_context, TransformationContext* transformation_context,
     FuzzerContext* fuzzer_context,
-    protobufs::TransformationSequence* transformations)
+    protobufs::TransformationSequence* transformations,
+    bool ignore_inapplicable_transformations)
     : FuzzerPass(ir_context, transformation_context, fuzzer_context,
-                 transformations) {}
-
-FuzzerPassAddFunctionCalls::~FuzzerPassAddFunctionCalls() = default;
+                 transformations, ignore_inapplicable_transformations) {}
 
 void FuzzerPassAddFunctionCalls::Apply() {
   ForEachInstructionWithInstructionDescriptor(

+ 5 - 6
ThirdParty/Glslang/External/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.h

@@ -24,12 +24,11 @@ namespace fuzz {
 // anywhere, and (b) any functions, from dead blocks.
 class FuzzerPassAddFunctionCalls : public FuzzerPass {
  public:
-  FuzzerPassAddFunctionCalls(
-      opt::IRContext* ir_context, TransformationContext* transformation_context,
-      FuzzerContext* fuzzer_context,
-      protobufs::TransformationSequence* transformations);
-
-  ~FuzzerPassAddFunctionCalls();
+  FuzzerPassAddFunctionCalls(opt::IRContext* ir_context,
+                             TransformationContext* transformation_context,
+                             FuzzerContext* fuzzer_context,
+                             protobufs::TransformationSequence* transformations,
+                             bool ignore_inapplicable_transformations);
 
   void Apply() override;
 

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.