diff --git a/third_party/spirv-tools/Android.mk b/third_party/spirv-tools/Android.mk
index 6dd18341da..a4e7615fad 100644
--- a/third_party/spirv-tools/Android.mk
+++ b/third_party/spirv-tools/Android.mk
@@ -61,6 +61,7 @@ SPVTOOLS_SRC_FILES := \
source/val/validate_instruction.cpp \
source/val/validate_memory.cpp \
source/val/validate_memory_semantics.cpp \
+ source/val/validate_mesh_shading.cpp \
source/val/validate_misc.cpp \
source/val/validate_mode_setting.cpp \
source/val/validate_layout.cpp \
@@ -68,6 +69,9 @@ SPVTOOLS_SRC_FILES := \
source/val/validate_logicals.cpp \
source/val/validate_non_uniform.cpp \
source/val/validate_primitives.cpp \
+ source/val/validate_ray_query.cpp \
+ source/val/validate_ray_tracing.cpp \
+ source/val/validate_ray_tracing_reorder.cpp \
source/val/validate_scopes.cpp \
source/val/validate_small_type_uses.cpp \
source/val/validate_type.cpp
@@ -75,6 +79,7 @@ SPVTOOLS_SRC_FILES := \
SPVTOOLS_OPT_SRC_FILES := \
source/opt/aggressive_dead_code_elim_pass.cpp \
source/opt/amd_ext_to_khr.cpp \
+ source/opt/analyze_live_input_pass.cpp \
source/opt/basic_block.cpp \
source/opt/block_merge_pass.cpp \
source/opt/block_merge_util.cpp \
@@ -106,8 +111,9 @@ SPVTOOLS_OPT_SRC_FILES := \
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_io_components_pass.cpp \
source/opt/eliminate_dead_members_pass.cpp \
+ source/opt/eliminate_dead_output_stores_pass.cpp \
source/opt/feature_manager.cpp \
source/opt/fix_func_call_arguments.cpp \
source/opt/fix_storage_class.cpp \
@@ -133,6 +139,7 @@ SPVTOOLS_OPT_SRC_FILES := \
source/opt/ir_context.cpp \
source/opt/ir_loader.cpp \
source/opt/licm_pass.cpp \
+ source/opt/liveness.cpp \
source/opt/local_access_chain_convert_pass.cpp \
source/opt/local_redundancy_elimination.cpp \
source/opt/local_single_block_elim_pass.cpp \
@@ -214,7 +221,8 @@ $(1)/opencl.std.insts.inc \
--core-insts-output=$(1)/core.insts-unified1.inc \
--glsl-insts-output=$(1)/glsl.std.450.insts.inc \
--opencl-insts-output=$(1)/opencl.std.insts.inc \
- --operand-kinds-output=$(1)/operand.kinds-unified1.inc
+ --operand-kinds-output=$(1)/operand.kinds-unified1.inc \
+ --output-language=c++
@echo "[$(TARGET_ARCH_ABI)] Grammar (from unified1) : instructions & operands <= grammar JSON files"
$(LOCAL_PATH)/source/opcode.cpp: $(1)/core.insts-unified1.inc
$(LOCAL_PATH)/source/operand.cpp: $(1)/operand.kinds-unified1.inc
@@ -288,7 +296,8 @@ $(1)/extension_enum.inc $(1)/enum_string_mapping.inc: \
--extinst-debuginfo-grammar=$(SPV_DEBUGINFO_GRAMMAR) \
--extinst-cldebuginfo100-grammar=$(SPV_CLDEBUGINFO100_GRAMMAR) \
--extension-enum-output=$(1)/extension_enum.inc \
- --enum-string-mapping-output=$(1)/enum_string_mapping.inc
+ --enum-string-mapping-output=$(1)/enum_string_mapping.inc \
+ --output-language=c++
@echo "[$(TARGET_ARCH_ABI)] Generate enum<->string mapping <= grammar JSON files"
# Generated header extension_enum.inc is transitively included by table.h, which is
# used pervasively. Capture the pervasive dependency.
diff --git a/third_party/spirv-tools/BUILD.bazel b/third_party/spirv-tools/BUILD.bazel
index 914619afed..0af7700515 100644
--- a/third_party/spirv-tools/BUILD.bazel
+++ b/third_party/spirv-tools/BUILD.bazel
@@ -82,7 +82,7 @@ genrule(
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"],
+ exec_tools = [":generate_registry_tables"],
)
py_binary(
@@ -96,7 +96,7 @@ genrule(
outs = ["build-version.inc"],
cmd = "SOURCE_DATE_EPOCH=0 $(location update_build_version) $(location CHANGES) $(location build-version.inc)",
cmd_bat = "set SOURCE_DATE_EPOCH=0 && $(location //:update_build_version) $(location CHANGES) $(location build-version.inc)",
- tools = [":update_build_version"],
+ exec_tools = [":update_build_version"],
)
# Libraries
@@ -137,7 +137,7 @@ cc_library(
copts = COMMON_COPTS,
includes = ["source"],
deps = [
- "@spirv_headers//:spirv_c_headers",
+ "@spirv_headers//:spirv_cpp11_headers",
],
)
@@ -162,7 +162,7 @@ cc_library(
deps = [
":generated_headers",
":spirv_tools_headers",
- "@spirv_headers//:spirv_c_headers",
+ "@spirv_headers//:spirv_cpp11_headers",
"@spirv_headers//:spirv_common_headers",
],
)
diff --git a/third_party/spirv-tools/BUILD.gn b/third_party/spirv-tools/BUILD.gn
index 9f96c24d05..a375e9df82 100644
--- a/third_party/spirv-tools/BUILD.gn
+++ b/third_party/spirv-tools/BUILD.gn
@@ -69,6 +69,8 @@ template("spvtools_core_tables") {
rebase_path(cldebuginfo100_insts_file, root_build_dir),
"--operand-kinds-output",
rebase_path(operand_kinds_file, root_build_dir),
+ "--output-language",
+ "c++"
]
}
}
@@ -101,6 +103,8 @@ template("spvtools_core_enums") {
rebase_path(extension_enum_file, root_build_dir),
"--enum-string-mapping-output",
rebase_path(extension_map_file, root_build_dir),
+ "--output-language",
+ "c++"
]
inputs = [
core_json_file,
@@ -142,6 +146,8 @@ template("spvtools_glsl_tables") {
rebase_path(glsl_json_file, root_build_dir),
"--glsl-insts-output",
rebase_path(glsl_insts_file, root_build_dir),
+ "--output-language",
+ "c++"
]
inputs = [
core_json_file,
@@ -466,7 +472,6 @@ static_library("spvtools") {
"source/util/make_unique.h",
"source/util/parse_number.cpp",
"source/util/parse_number.h",
- "source/util/pooled_linked_list.h",
"source/util/small_vector.h",
"source/util/string_utils.cpp",
"source/util/string_utils.h",
@@ -527,10 +532,14 @@ static_library("spvtools_val") {
"source/val/validate_memory.cpp",
"source/val/validate_memory_semantics.cpp",
"source/val/validate_memory_semantics.h",
+ "source/val/validate_mesh_shading.cpp",
"source/val/validate_misc.cpp",
"source/val/validate_mode_setting.cpp",
"source/val/validate_non_uniform.cpp",
"source/val/validate_primitives.cpp",
+ "source/val/validate_ray_query.cpp",
+ "source/val/validate_ray_tracing.cpp",
+ "source/val/validate_ray_tracing_reorder.cpp",
"source/val/validate_scopes.cpp",
"source/val/validate_scopes.h",
"source/val/validate_small_type_uses.cpp",
@@ -560,6 +569,8 @@ static_library("spvtools_opt") {
"source/opt/aggressive_dead_code_elim_pass.h",
"source/opt/amd_ext_to_khr.cpp",
"source/opt/amd_ext_to_khr.h",
+ "source/opt/analyze_live_input_pass.cpp",
+ "source/opt/analyze_live_input_pass.h",
"source/opt/basic_block.cpp",
"source/opt/basic_block.h",
"source/opt/block_merge_pass.cpp",
@@ -622,10 +633,12 @@ static_library("spvtools_opt") {
"source/opt/eliminate_dead_functions_pass.h",
"source/opt/eliminate_dead_functions_util.cpp",
"source/opt/eliminate_dead_functions_util.h",
- "source/opt/eliminate_dead_input_components_pass.cpp",
- "source/opt/eliminate_dead_input_components_pass.h",
+ "source/opt/eliminate_dead_io_components_pass.cpp",
+ "source/opt/eliminate_dead_io_components_pass.h",
"source/opt/eliminate_dead_members_pass.cpp",
"source/opt/eliminate_dead_members_pass.h",
+ "source/opt/eliminate_dead_output_stores_pass.cpp",
+ "source/opt/eliminate_dead_output_stores_pass.h",
"source/opt/empty_pass.h",
"source/opt/feature_manager.cpp",
"source/opt/feature_manager.h",
@@ -679,6 +692,8 @@ static_library("spvtools_opt") {
"source/opt/iterator.h",
"source/opt/licm_pass.cpp",
"source/opt/licm_pass.h",
+ "source/opt/liveness.cpp",
+ "source/opt/liveness.h",
"source/opt/local_access_chain_convert_pass.cpp",
"source/opt/local_access_chain_convert_pass.h",
"source/opt/local_redundancy_elimination.cpp",
diff --git a/third_party/spirv-tools/CHANGES b/third_party/spirv-tools/CHANGES
index 7984461b64..384805c32b 100644
--- a/third_party/spirv-tools/CHANGES
+++ b/third_party/spirv-tools/CHANGES
@@ -1,7 +1,57 @@
Revision history for SPIRV-Tools
-v2022.3-dev 2022-04-07
- - Start v2022.3-dev
+v2022.5-dev 2022-10-12
+ - Start v2022.5-dev
+
+v2022.4 2022-10-12
+ - General
+ - Support Narrow Types in BitCast Folding Rule (#4941)
+ - spirv-diff: Allow no SpecId (#4904)
+ - build: cmake: Add support for GNU/Hurd (#4895)
+ - Implement tool changes for SPV_EXT_mesh_shader. (#4915)
+ - Validator
+ - spirv-val: Add SPV_ARM_core_builtins validation (#4958)
+ - spirv-val: Add an option to use friendly names or not (#4951)
+ - spirv-val: Consistently quote ids in messages (#4950)
+ - spirv-val: Add initial SPV_EXT_mesh_shader validation (#4924)
+ - spirv-val: Make it legal to use arrays of ray queries (#4938)
+ - spirv-val: Better message for using OpTypeBool in input/output (#4901)
+ - spirv-val: Add SPV_KHR_ray_tracing storage class (#4868)
+ - Optimizer
+ - spirv-opt: Fix stacked CompositeExtract constant folds (#4932)
+ - Improve time to build dominators (#4916)
+ - Fix ADCE to mark scope and inlined_at of line instructions as live. (#4910)
+ - Improve algorithm to reorder blocks in a function (#4911)
+ - Add structs to eliminate dead input components (#4894)
+ - spirv-opt: fix copy-propagate-arrays index opti on structs. (#4891)
+ - Fix ADCE to not eliminate top level DebugInfo instructions (#4889)
+ - Fix array copy propagation (#4890)
+
+v2022.3 2022-08-08
+ - General
+ - Add SPV_KHR_fragment_shader_barycentric support (#4805)
+ - Add support for SPV_KHR_subgroup_rotate (#4786)
+ - use exec_tools instead of tools for better RBE compatibility (#4837)
+ - Write binary files to stdout in binary on windows. (#4834)
+ - Allow spirv-opt print-all to show pretty IDs (#4888)
+ - Validator
+ - spirv-val: Add PerVertexKHR (#4807)
+ - spirv-opt : Add FixFuncCallArgumentsPass (#4775)
+ - spirv-val: Add CullMaskKHR support (#4792)
+ - Require ColMajor or RowMajor for matrices (#4878)
+ - spirv-val: Add SPV_KHR_ray_query (#4848)
+ - spirv-val: Add SPV_KHR_ray_tracing instructions (#4871)
+ - Implement SPV_NV_bindless_texture related changes (#4847)
+ - spirv-val: Add OpConvertUToAccelerationStructureKHR (#4838)
+ - spirv-val: Add support for SPV_AMD_shader_early_and_late_fragment_tests (#4812)
+ - Optimizer
+ - Fold multiply and subtraction into FMA with negation (#4808)
+ - Add more folding for composite instructions (#4802)
+ - spirv-opt: add pass for interface variable scalar replacement (#4779)
+ - Don't try to unroll loop with step count 0. (#4769)
+ - spirv-opt: SPV_NV_bindless_texture related changes (#4870)
+ - Linker
+ - linker: Recalculate interface variables (#4784)
v2022.2 2022-04-07
- General
diff --git a/third_party/spirv-tools/CMakeLists.txt b/third_party/spirv-tools/CMakeLists.txt
index 53b3404d14..6e2de4f05b 100755
--- a/third_party/spirv-tools/CMakeLists.txt
+++ b/third_party/spirv-tools/CMakeLists.txt
@@ -37,7 +37,15 @@ set(SPIRV_TOOLS "SPIRV-Tools")
include(GNUInstallDirs)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(CMAKE_CXX_STANDARD 11)
+
+# Require at least C++11
+if(NOT CMAKE_CXX_STANDARD)
+ set(CMAKE_CXX_STANDARD 11)
+endif()
+if(${CMAKE_CXX_STANDARD} LESS 11)
+ message(FATAL_ERROR "SPIRV-Tools requires C++11 or later, but is configured for C++${CMAKE_CXX_STANDARD})")
+endif()
+
option(ENABLE_RTTI "Enables RTTI" OFF)
option(SPIRV_ALLOW_TIMERS "Allow timers via clock_gettime on supported platforms" ON)
@@ -62,8 +70,12 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS})
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
add_definitions(-DSPIRV_FREEBSD)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
+ add_definitions(-DSPIRV_OPENBSD)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
add_definitions(-DSPIRV_FUCHSIA)
+elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
+ add_definitions(-DSPIRV_GNU)
else()
message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!")
endif()
@@ -94,7 +106,6 @@ set(SPIRV_LIB_FUZZING_ENGINE_LINK_OPTIONS "" CACHE STRING "Used by OSS-Fuzz to c
option(SPIRV_BUILD_LIBFUZZER_TARGETS "Build libFuzzer targets" OFF)
set(SPIRV_WERROR OFF)
-
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)
endif()
@@ -202,7 +213,7 @@ function(spvtools_default_compile_options TARGET)
if(NOT "${SPIRV_PERF}" STREQUAL "")
target_compile_options(${TARGET} PRIVATE -fno-omit-frame-pointer)
endif()
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(SPIRV_USE_SANITIZER "" CACHE STRING
"Use the clang sanitizer [address|memory|thread|...]")
if(NOT "${SPIRV_USE_SANITIZER}" STREQUAL "")
@@ -297,11 +308,11 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
endif()
# Defaults to OFF if the user didn't set it.
- option(SPIRV_SKIP_EXECUTABLES
- "Skip building the executable and tests along with the library"
- ${SPIRV_SKIP_EXECUTABLES_OPTION})
- option(SPIRV_SKIP_TESTS
- "Skip building tests along with the library" ${SPIRV_SKIP_TESTS_OPTION})
+option(SPIRV_SKIP_EXECUTABLES
+ "Skip building the executable and tests along with the library"
+ ${SPIRV_SKIP_EXECUTABLES_OPTION})
+option(SPIRV_SKIP_TESTS
+ "Skip building tests along with the library" ${SPIRV_SKIP_TESTS_OPTION})
if ("${SPIRV_SKIP_EXECUTABLES}")
@@ -367,3 +378,4 @@ endif()
set(SPIRV_LIBRARIES "-lSPIRV-Tools-opt -lSPIRV-Tools -lSPIRV-Tools-link")
set(SPIRV_SHARED_LIBRARIES "-lSPIRV-Tools-shared")
+
diff --git a/third_party/spirv-tools/DEPS b/third_party/spirv-tools/DEPS
index abc3a76af2..d6242d815f 100644
--- a/third_party/spirv-tools/DEPS
+++ b/third_party/spirv-tools/DEPS
@@ -3,10 +3,10 @@ use_relative_paths = True
vars = {
'github': 'https://github.com',
- 'effcee_revision': 'ddf5e2bb92957dc8a12c5392f8495333d6844133',
- 'googletest_revision': '25dcdc7e8bfac8967f20fb2c0a628f5cf442188d',
- 're2_revision': '0c5616df9c0aaa44c9440d87422012423d91c7d1',
- 'spirv_headers_revision': 'b765c355f488837ca4c77980ba69484f3ff277f5',
+ 'effcee_revision': '35912e1b7778ec2ddcff7e7188177761539e59e0',
+ 'googletest_revision': 'd9bb8412d60b993365abb53f00b6dad9b2c01b62',
+ 're2_revision': 'd2836d1b1c34c4e330a85a1006201db474bf2c8a',
+ 'spirv_headers_revision': '34d04647d384e0aed037e7a2662a655fc39841bb',
}
deps = {
diff --git a/third_party/spirv-tools/PRESUBMIT.py b/third_party/spirv-tools/PRESUBMIT.py
index dd3117f229..847deb7638 100644
--- a/third_party/spirv-tools/PRESUBMIT.py
+++ b/third_party/spirv-tools/PRESUBMIT.py
@@ -18,6 +18,8 @@ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built into depot_tools.
"""
+USE_PYTHON3 = True
+
LINT_FILTERS = [
"-build/storage_class",
"-readability/casting",
diff --git a/third_party/spirv-tools/README.md b/third_party/spirv-tools/README.md
index e951e37f1a..96d59b9c7e 100644
--- a/third_party/spirv-tools/README.md
+++ b/third_party/spirv-tools/README.md
@@ -96,10 +96,10 @@ and in-progress work.
*Note*: The validator checks some Universal Limits, from section 2.17 of the SPIR-V spec.
The validator will fail on a module that exceeds those minimum upper bound limits.
-It is [future work](https://github.com/KhronosGroup/SPIRV-Tools/projects/1#card-1052403)
-to parameterize the validator to allow larger
-limits accepted by a more than minimally capable SPIR-V consumer.
+The validator has been parameterized to allow larger values, for use when targeting
+a more-than-minimally-capable SPIR-V consumer.
+See [`tools/val/val.cpp`](tools/val/val.cpp) or run `spirv-val --help` for the command-line help.
### Optimizer
diff --git a/third_party/spirv-tools/build_defs.bzl b/third_party/spirv-tools/build_defs.bzl
index ef9a829463..ed726aebee 100644
--- a/third_party/spirv-tools/build_defs.bzl
+++ b/third_party/spirv-tools/build_defs.bzl
@@ -66,7 +66,8 @@ def generate_core_tables(version = None):
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--core-insts-output=$(location {3}) " +
- "--operand-kinds-output=$(location {4})"
+ "--operand-kinds-output=$(location {4}) " +
+ "--output-language=c++"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
@@ -74,9 +75,10 @@ def generate_core_tables(version = None):
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--core-insts-output=$(location {3}) " +
- "--operand-kinds-output=$(location {4})"
+ "--operand-kinds-output=$(location {4}) " +
+ "--output-language=c++"
).format(*fmtargs),
- tools = [":generate_grammar_tables"],
+ exec_tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -103,7 +105,8 @@ def generate_enum_string_mapping(version = None):
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--extension-enum-output=$(location {3}) " +
- "--enum-string-mapping-output=$(location {4})"
+ "--enum-string-mapping-output=$(location {4}) " +
+ "--output-language=c++"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
@@ -111,9 +114,10 @@ def generate_enum_string_mapping(version = None):
"--extinst-debuginfo-grammar=$(location {1}) " +
"--extinst-cldebuginfo100-grammar=$(location {2}) " +
"--extension-enum-output=$(location {3}) " +
- "--enum-string-mapping-output=$(location {4})"
+ "--enum-string-mapping-output=$(location {4}) " +
+ "--output-language=c++"
).format(*fmtargs),
- tools = [":generate_grammar_tables"],
+ exec_tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -139,7 +143,7 @@ def generate_opencl_tables(version = None):
"--extinst-opencl-grammar=$(location {0}) " +
"--opencl-insts-output=$(location {1})"
).format(*fmtargs),
- tools = [":generate_grammar_tables"],
+ exec_tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -158,14 +162,16 @@ def generate_glsl_tables(version = None):
cmd = (
"$(location :generate_grammar_tables) " +
"--extinst-glsl-grammar=$(location {0}) " +
- "--glsl-insts-output=$(location {1})"
+ "--glsl-insts-output=$(location {1}) " +
+ "--output-language=c++"
).format(*fmtargs),
cmd_bat = (
"$(location :generate_grammar_tables) " +
"--extinst-glsl-grammar=$(location {0}) " +
- "--glsl-insts-output=$(location {1})"
+ "--glsl-insts-output=$(location {1}) " +
+ "--output-language=c++"
).format(*fmtargs),
- tools = [":generate_grammar_tables"],
+ exec_tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -193,7 +199,7 @@ def generate_vendor_tables(extension, operand_kind_prefix = ""):
"--vendor-insts-output=$(location {1}) " +
"--vendor-operand-kind-prefix={2}"
).format(*fmtargs),
- tools = [":generate_grammar_tables"],
+ exec_tools = [":generate_grammar_tables"],
visibility = ["//visibility:private"],
)
@@ -216,7 +222,7 @@ def generate_extinst_lang_headers(name, grammar = None):
"--extinst-grammar=$< " +
"--extinst-output-path=$(location {0})"
).format(*fmtargs),
- tools = [":generate_language_headers"],
+ exec_tools = [":generate_language_headers"],
visibility = ["//visibility:private"],
)
diff --git a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
index d8d1d7e35b..9c040849a3 100644
--- a/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
+++ b/third_party/spirv-tools/external/spirv-headers/CMakeLists.txt
@@ -44,11 +44,6 @@ project(SPIRV-Headers VERSION 1.5.5)
# 2. cmake ..
# 3. cmake --build . --target install
-# legacy
-add_custom_target(install-headers
- COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
- $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
-
option(SPIRV_HEADERS_SKIP_EXAMPLES "Skip building examples" ON)
option(SPIRV_HEADERS_SKIP_INSTALL "Skip install" ON)
@@ -59,6 +54,10 @@ endif()
if(NOT ${SPIRV_HEADERS_SKIP_INSTALL})
set(SPIRV_HEADERS_ENABLE_INSTALL ON)
+ # legacy
+ add_custom_target(install-headers
+ COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv
+ $ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/include/spirv)
endif()
if (SPIRV_HEADERS_ENABLE_EXAMPLES)
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml b/third_party/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml
index 7acaed34f0..642fdf3b67 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/spir-v.xml
@@ -62,7 +62,7 @@
-
+
@@ -85,7 +85,9 @@
-
+
+
+
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
index 380dc21b80..0cdf29d129 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
@@ -33,7 +33,7 @@ extern "C" {
#endif
enum {
- NonSemanticClspvReflectionRevision = 2,
+ NonSemanticClspvReflectionRevision = 4,
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
};
@@ -63,6 +63,16 @@ enum NonSemanticClspvReflectionInstructions {
NonSemanticClspvReflectionLiteralSampler = 23,
NonSemanticClspvReflectionPropertyRequiredWorkgroupSize = 24,
NonSemanticClspvReflectionSpecConstantSubgroupMaxSize = 25,
+ NonSemanticClspvReflectionArgumentPointerPushConstant = 26,
+ NonSemanticClspvReflectionArgumentPointerUniform = 27,
+ NonSemanticClspvReflectionProgramScopeVariablesStorageBuffer = 28,
+ NonSemanticClspvReflectionProgramScopeVariablePointerRelocation = 29,
+ NonSemanticClspvReflectionImageArgumentInfoChannelOrderPushConstant = 30,
+ NonSemanticClspvReflectionImageArgumentInfoChannelDataTypePushConstant = 31,
+ NonSemanticClspvReflectionImageArgumentInfoChannelOrderUniform = 32,
+ NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform = 33,
+ NonSemanticClspvReflectionArgumentStorageTexelBuffer = 34,
+ NonSemanticClspvReflectionArgumentUniformTexelBuffer = 35,
NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
};
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
index 3d153e58f0..b5a6637218 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
@@ -1,5 +1,5 @@
{
- "revision" : 2,
+ "revision" : 4,
"instructions" : [
{
"opname" : "Kernel",
@@ -239,6 +239,114 @@
"operands" : [
{ "kind" : "IdRef", "name" : "Size" }
]
+ },
+ {
+ "opname" : "ArgumentPointerPushConstant",
+ "opcode" : 26,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ArgumentPointerUniform",
+ "opcode" : 27,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ProgramScopeVariablesStorageBuffer",
+ "opcode" : 28,
+ "operands": [
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Data" }
+ ]
+ },
+ {
+ "opname" : "ProgramScopeVariablePointerRelocation",
+ "opcode" : 29,
+ "operands": [
+ { "kind" : "IdRef", "name" : "ObjectOffset" },
+ { "kind" : "IdRef", "name" : "PointerOffset" },
+ { "kind" : "IdRef", "name" : "PointerSize" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelOrderPushConstant",
+ "opcode" : 30,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelDataTypePushConstant",
+ "opcode" : 31,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelOrderUniform",
+ "opcode" : 32,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelDataTypeUniform",
+ "opcode" : 33,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ArgumentStorageTexelBuffer",
+ "opcode" : 34,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Decl" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ArgumentUniformTexelBuffer",
+ "opcode" : 35,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Decl" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
}
]
}
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.bf b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.bf
new file mode 100644
index 0000000000..15eafabe63
--- /dev/null
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.bf
@@ -0,0 +1,1957 @@
+// Copyright (c) 2014-2020 The Khronos Group Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and/or associated documentation files (the "Materials"),
+// to deal in the Materials without restriction, including without limitation
+// the rights to use, copy, modify, merge, publish, distribute, sublicense,
+// and/or sell copies of the Materials, and to permit persons to whom the
+// Materials are furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Materials.
+//
+// MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
+// STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
+// HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
+//
+// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS
+// IN THE MATERIALS.
+
+// This header is automatically generated by the same tool that creates
+// the Binary Section of the SPIR-V specification.
+
+// Enumeration tokens for SPIR-V, in various styles:
+// C, C++, C++11, JSON, Lua, Python, C#, D, Beef
+//
+// - C will have tokens with a "Spv" prefix, e.g.: SpvSourceLanguageGLSL
+// - C++ will have tokens in the "spv" name space, e.g.: spv::SourceLanguageGLSL
+// - C++11 will use enum classes in the spv namespace, e.g.: spv::SourceLanguage::GLSL
+// - Lua will use tables, e.g.: spv.SourceLanguage.GLSL
+// - Python will use dictionaries, e.g.: spv['SourceLanguage']['GLSL']
+// - C# will use enum classes in the Specification class located in the "Spv" namespace,
+// e.g.: Spv.Specification.SourceLanguage.GLSL
+// - D will have tokens under the "spv" module, e.g: spv.SourceLanguage.GLSL
+// - Beef will use enum classes in the Specification class located in the "Spv" namespace,
+// e.g.: Spv.Specification.SourceLanguage.GLSL
+//
+// Some tokens act like mask values, which can be OR'd together,
+// while others are mutually exclusive. The mask-like ones have
+// "Mask" in their name, and a parallel enum that has the shift
+// amount (1 << x) for each corresponding enumerant.
+
+namespace Spv
+{
+ using System;
+
+ public static class Specification
+ {
+ public const uint32 MagicNumber = 0x07230203;
+ public const uint32 Version = 0x00010600;
+ public const uint32 Revision = 1;
+ public const uint32 OpCodeMask = 0xffff;
+ public const uint32 WordCountShift = 16;
+
+ [AllowDuplicates, CRepr] public enum SourceLanguage
+ {
+ Unknown = 0,
+ ESSL = 1,
+ GLSL = 2,
+ OpenCL_C = 3,
+ OpenCL_CPP = 4,
+ HLSL = 5,
+ CPP_for_OpenCL = 6,
+ SYCL = 7,
+ }
+
+ [AllowDuplicates, CRepr] public enum ExecutionModel
+ {
+ Vertex = 0,
+ TessellationControl = 1,
+ TessellationEvaluation = 2,
+ Geometry = 3,
+ Fragment = 4,
+ GLCompute = 5,
+ Kernel = 6,
+ TaskNV = 5267,
+ MeshNV = 5268,
+ RayGenerationKHR = 5313,
+ RayGenerationNV = 5313,
+ IntersectionKHR = 5314,
+ IntersectionNV = 5314,
+ AnyHitKHR = 5315,
+ AnyHitNV = 5315,
+ ClosestHitKHR = 5316,
+ ClosestHitNV = 5316,
+ MissKHR = 5317,
+ MissNV = 5317,
+ CallableKHR = 5318,
+ CallableNV = 5318,
+ TaskEXT = 5364,
+ MeshEXT = 5365,
+ }
+
+ [AllowDuplicates, CRepr] public enum AddressingModel
+ {
+ Logical = 0,
+ Physical32 = 1,
+ Physical64 = 2,
+ PhysicalStorageBuffer64 = 5348,
+ PhysicalStorageBuffer64EXT = 5348,
+ }
+
+ [AllowDuplicates, CRepr] public enum MemoryModel
+ {
+ Simple = 0,
+ GLSL450 = 1,
+ OpenCL = 2,
+ Vulkan = 3,
+ VulkanKHR = 3,
+ }
+
+ [AllowDuplicates, CRepr] public enum ExecutionMode
+ {
+ Invocations = 0,
+ SpacingEqual = 1,
+ SpacingFractionalEven = 2,
+ SpacingFractionalOdd = 3,
+ VertexOrderCw = 4,
+ VertexOrderCcw = 5,
+ PixelCenterInteger = 6,
+ OriginUpperLeft = 7,
+ OriginLowerLeft = 8,
+ EarlyFragmentTests = 9,
+ PointMode = 10,
+ Xfb = 11,
+ DepthReplacing = 12,
+ DepthGreater = 14,
+ DepthLess = 15,
+ DepthUnchanged = 16,
+ LocalSize = 17,
+ LocalSizeHint = 18,
+ InputPoints = 19,
+ InputLines = 20,
+ InputLinesAdjacency = 21,
+ Triangles = 22,
+ InputTrianglesAdjacency = 23,
+ Quads = 24,
+ Isolines = 25,
+ OutputVertices = 26,
+ OutputPoints = 27,
+ OutputLineStrip = 28,
+ OutputTriangleStrip = 29,
+ VecTypeHint = 30,
+ ContractionOff = 31,
+ Initializer = 33,
+ Finalizer = 34,
+ SubgroupSize = 35,
+ SubgroupsPerWorkgroup = 36,
+ SubgroupsPerWorkgroupId = 37,
+ LocalSizeId = 38,
+ LocalSizeHintId = 39,
+ SubgroupUniformControlFlowKHR = 4421,
+ PostDepthCoverage = 4446,
+ DenormPreserve = 4459,
+ DenormFlushToZero = 4460,
+ SignedZeroInfNanPreserve = 4461,
+ RoundingModeRTE = 4462,
+ RoundingModeRTZ = 4463,
+ EarlyAndLateFragmentTestsAMD = 5017,
+ StencilRefReplacingEXT = 5027,
+ StencilRefUnchangedFrontAMD = 5079,
+ StencilRefGreaterFrontAMD = 5080,
+ StencilRefLessFrontAMD = 5081,
+ StencilRefUnchangedBackAMD = 5082,
+ StencilRefGreaterBackAMD = 5083,
+ StencilRefLessBackAMD = 5084,
+ OutputLinesEXT = 5269,
+ OutputLinesNV = 5269,
+ OutputPrimitivesEXT = 5270,
+ OutputPrimitivesNV = 5270,
+ DerivativeGroupQuadsNV = 5289,
+ DerivativeGroupLinearNV = 5290,
+ OutputTrianglesEXT = 5298,
+ OutputTrianglesNV = 5298,
+ PixelInterlockOrderedEXT = 5366,
+ PixelInterlockUnorderedEXT = 5367,
+ SampleInterlockOrderedEXT = 5368,
+ SampleInterlockUnorderedEXT = 5369,
+ ShadingRateInterlockOrderedEXT = 5370,
+ ShadingRateInterlockUnorderedEXT = 5371,
+ SharedLocalMemorySizeINTEL = 5618,
+ RoundingModeRTPINTEL = 5620,
+ RoundingModeRTNINTEL = 5621,
+ FloatingPointModeALTINTEL = 5622,
+ FloatingPointModeIEEEINTEL = 5623,
+ MaxWorkgroupSizeINTEL = 5893,
+ MaxWorkDimINTEL = 5894,
+ NoGlobalOffsetINTEL = 5895,
+ NumSIMDWorkitemsINTEL = 5896,
+ SchedulerTargetFmaxMhzINTEL = 5903,
+ StreamingInterfaceINTEL = 6154,
+ NamedBarrierCountINTEL = 6417,
+ }
+
+ [AllowDuplicates, CRepr] public enum StorageClass
+ {
+ UniformConstant = 0,
+ Input = 1,
+ Uniform = 2,
+ Output = 3,
+ Workgroup = 4,
+ CrossWorkgroup = 5,
+ Private = 6,
+ Function = 7,
+ Generic = 8,
+ PushConstant = 9,
+ AtomicCounter = 10,
+ Image = 11,
+ StorageBuffer = 12,
+ CallableDataKHR = 5328,
+ CallableDataNV = 5328,
+ IncomingCallableDataKHR = 5329,
+ IncomingCallableDataNV = 5329,
+ RayPayloadKHR = 5338,
+ RayPayloadNV = 5338,
+ HitAttributeKHR = 5339,
+ HitAttributeNV = 5339,
+ IncomingRayPayloadKHR = 5342,
+ IncomingRayPayloadNV = 5342,
+ ShaderRecordBufferKHR = 5343,
+ ShaderRecordBufferNV = 5343,
+ PhysicalStorageBuffer = 5349,
+ PhysicalStorageBufferEXT = 5349,
+ HitObjectAttributeNV = 5385,
+ TaskPayloadWorkgroupEXT = 5402,
+ CodeSectionINTEL = 5605,
+ DeviceOnlyINTEL = 5936,
+ HostOnlyINTEL = 5937,
+ }
+
+ [AllowDuplicates, CRepr] public enum Dim
+ {
+ Dim1D = 0,
+ Dim2D = 1,
+ Dim3D = 2,
+ Cube = 3,
+ Rect = 4,
+ Buffer = 5,
+ SubpassData = 6,
+ }
+
+ [AllowDuplicates, CRepr] public enum SamplerAddressingMode
+ {
+ None = 0,
+ ClampToEdge = 1,
+ Clamp = 2,
+ Repeat = 3,
+ RepeatMirrored = 4,
+ }
+
+ [AllowDuplicates, CRepr] public enum SamplerFilterMode
+ {
+ Nearest = 0,
+ Linear = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum ImageFormat
+ {
+ Unknown = 0,
+ Rgba32f = 1,
+ Rgba16f = 2,
+ R32f = 3,
+ Rgba8 = 4,
+ Rgba8Snorm = 5,
+ Rg32f = 6,
+ Rg16f = 7,
+ R11fG11fB10f = 8,
+ R16f = 9,
+ Rgba16 = 10,
+ Rgb10A2 = 11,
+ Rg16 = 12,
+ Rg8 = 13,
+ R16 = 14,
+ R8 = 15,
+ Rgba16Snorm = 16,
+ Rg16Snorm = 17,
+ Rg8Snorm = 18,
+ R16Snorm = 19,
+ R8Snorm = 20,
+ Rgba32i = 21,
+ Rgba16i = 22,
+ Rgba8i = 23,
+ R32i = 24,
+ Rg32i = 25,
+ Rg16i = 26,
+ Rg8i = 27,
+ R16i = 28,
+ R8i = 29,
+ Rgba32ui = 30,
+ Rgba16ui = 31,
+ Rgba8ui = 32,
+ R32ui = 33,
+ Rgb10a2ui = 34,
+ Rg32ui = 35,
+ Rg16ui = 36,
+ Rg8ui = 37,
+ R16ui = 38,
+ R8ui = 39,
+ R64ui = 40,
+ R64i = 41,
+ }
+
+ [AllowDuplicates, CRepr] public enum ImageChannelOrder
+ {
+ R = 0,
+ A = 1,
+ RG = 2,
+ RA = 3,
+ RGB = 4,
+ RGBA = 5,
+ BGRA = 6,
+ ARGB = 7,
+ Intensity = 8,
+ Luminance = 9,
+ Rx = 10,
+ RGx = 11,
+ RGBx = 12,
+ Depth = 13,
+ DepthStencil = 14,
+ sRGB = 15,
+ sRGBx = 16,
+ sRGBA = 17,
+ sBGRA = 18,
+ ABGR = 19,
+ }
+
+ [AllowDuplicates, CRepr] public enum ImageChannelDataType
+ {
+ SnormInt8 = 0,
+ SnormInt16 = 1,
+ UnormInt8 = 2,
+ UnormInt16 = 3,
+ UnormShort565 = 4,
+ UnormShort555 = 5,
+ UnormInt101010 = 6,
+ SignedInt8 = 7,
+ SignedInt16 = 8,
+ SignedInt32 = 9,
+ UnsignedInt8 = 10,
+ UnsignedInt16 = 11,
+ UnsignedInt32 = 12,
+ HalfFloat = 13,
+ Float = 14,
+ UnormInt24 = 15,
+ UnormInt101010_2 = 16,
+ }
+
+ [AllowDuplicates, CRepr] public enum ImageOperandsShift
+ {
+ Bias = 0,
+ Lod = 1,
+ Grad = 2,
+ ConstOffset = 3,
+ Offset = 4,
+ ConstOffsets = 5,
+ Sample = 6,
+ MinLod = 7,
+ MakeTexelAvailable = 8,
+ MakeTexelAvailableKHR = 8,
+ MakeTexelVisible = 9,
+ MakeTexelVisibleKHR = 9,
+ NonPrivateTexel = 10,
+ NonPrivateTexelKHR = 10,
+ VolatileTexel = 11,
+ VolatileTexelKHR = 11,
+ SignExtend = 12,
+ ZeroExtend = 13,
+ Nontemporal = 14,
+ Offsets = 16,
+ }
+
+ [AllowDuplicates, CRepr] public enum ImageOperandsMask
+ {
+ MaskNone = 0,
+ Bias = 0x00000001,
+ Lod = 0x00000002,
+ Grad = 0x00000004,
+ ConstOffset = 0x00000008,
+ Offset = 0x00000010,
+ ConstOffsets = 0x00000020,
+ Sample = 0x00000040,
+ MinLod = 0x00000080,
+ MakeTexelAvailable = 0x00000100,
+ MakeTexelAvailableKHR = 0x00000100,
+ MakeTexelVisible = 0x00000200,
+ MakeTexelVisibleKHR = 0x00000200,
+ NonPrivateTexel = 0x00000400,
+ NonPrivateTexelKHR = 0x00000400,
+ VolatileTexel = 0x00000800,
+ VolatileTexelKHR = 0x00000800,
+ SignExtend = 0x00001000,
+ ZeroExtend = 0x00002000,
+ Nontemporal = 0x00004000,
+ Offsets = 0x00010000,
+ }
+
+ [AllowDuplicates, CRepr] public enum FPFastMathModeShift
+ {
+ NotNaN = 0,
+ NotInf = 1,
+ NSZ = 2,
+ AllowRecip = 3,
+ Fast = 4,
+ AllowContractFastINTEL = 16,
+ AllowReassocINTEL = 17,
+ }
+
+ [AllowDuplicates, CRepr] public enum FPFastMathModeMask
+ {
+ MaskNone = 0,
+ NotNaN = 0x00000001,
+ NotInf = 0x00000002,
+ NSZ = 0x00000004,
+ AllowRecip = 0x00000008,
+ Fast = 0x00000010,
+ AllowContractFastINTEL = 0x00010000,
+ AllowReassocINTEL = 0x00020000,
+ }
+
+ [AllowDuplicates, CRepr] public enum FPRoundingMode
+ {
+ RTE = 0,
+ RTZ = 1,
+ RTP = 2,
+ RTN = 3,
+ }
+
+ [AllowDuplicates, CRepr] public enum LinkageType
+ {
+ Export = 0,
+ Import = 1,
+ LinkOnceODR = 2,
+ }
+
+ [AllowDuplicates, CRepr] public enum AccessQualifier
+ {
+ ReadOnly = 0,
+ WriteOnly = 1,
+ ReadWrite = 2,
+ }
+
+ [AllowDuplicates, CRepr] public enum FunctionParameterAttribute
+ {
+ Zext = 0,
+ Sext = 1,
+ ByVal = 2,
+ Sret = 3,
+ NoAlias = 4,
+ NoCapture = 5,
+ NoWrite = 6,
+ NoReadWrite = 7,
+ RuntimeAlignedINTEL = 5940,
+ }
+
+ [AllowDuplicates, CRepr] public enum Decoration
+ {
+ RelaxedPrecision = 0,
+ SpecId = 1,
+ Block = 2,
+ BufferBlock = 3,
+ RowMajor = 4,
+ ColMajor = 5,
+ ArrayStride = 6,
+ MatrixStride = 7,
+ GLSLShared = 8,
+ GLSLPacked = 9,
+ CPacked = 10,
+ BuiltIn = 11,
+ NoPerspective = 13,
+ Flat = 14,
+ Patch = 15,
+ Centroid = 16,
+ Sample = 17,
+ Invariant = 18,
+ Restrict = 19,
+ Aliased = 20,
+ Volatile = 21,
+ Constant = 22,
+ Coherent = 23,
+ NonWritable = 24,
+ NonReadable = 25,
+ Uniform = 26,
+ UniformId = 27,
+ SaturatedConversion = 28,
+ Stream = 29,
+ Location = 30,
+ Component = 31,
+ Index = 32,
+ Binding = 33,
+ DescriptorSet = 34,
+ Offset = 35,
+ XfbBuffer = 36,
+ XfbStride = 37,
+ FuncParamAttr = 38,
+ FPRoundingMode = 39,
+ FPFastMathMode = 40,
+ LinkageAttributes = 41,
+ NoContraction = 42,
+ InputAttachmentIndex = 43,
+ Alignment = 44,
+ MaxByteOffset = 45,
+ AlignmentId = 46,
+ MaxByteOffsetId = 47,
+ NoSignedWrap = 4469,
+ NoUnsignedWrap = 4470,
+ ExplicitInterpAMD = 4999,
+ OverrideCoverageNV = 5248,
+ PassthroughNV = 5250,
+ ViewportRelativeNV = 5252,
+ SecondaryViewportRelativeNV = 5256,
+ PerPrimitiveEXT = 5271,
+ PerPrimitiveNV = 5271,
+ PerViewNV = 5272,
+ PerTaskNV = 5273,
+ PerVertexKHR = 5285,
+ PerVertexNV = 5285,
+ NonUniform = 5300,
+ NonUniformEXT = 5300,
+ RestrictPointer = 5355,
+ RestrictPointerEXT = 5355,
+ AliasedPointer = 5356,
+ AliasedPointerEXT = 5356,
+ HitObjectShaderRecordBufferNV = 5386,
+ BindlessSamplerNV = 5398,
+ BindlessImageNV = 5399,
+ BoundSamplerNV = 5400,
+ BoundImageNV = 5401,
+ SIMTCallINTEL = 5599,
+ ReferencedIndirectlyINTEL = 5602,
+ ClobberINTEL = 5607,
+ SideEffectsINTEL = 5608,
+ VectorComputeVariableINTEL = 5624,
+ FuncParamIOKindINTEL = 5625,
+ VectorComputeFunctionINTEL = 5626,
+ StackCallINTEL = 5627,
+ GlobalVariableOffsetINTEL = 5628,
+ CounterBuffer = 5634,
+ HlslCounterBufferGOOGLE = 5634,
+ HlslSemanticGOOGLE = 5635,
+ UserSemantic = 5635,
+ UserTypeGOOGLE = 5636,
+ FunctionRoundingModeINTEL = 5822,
+ FunctionDenormModeINTEL = 5823,
+ RegisterINTEL = 5825,
+ MemoryINTEL = 5826,
+ NumbanksINTEL = 5827,
+ BankwidthINTEL = 5828,
+ MaxPrivateCopiesINTEL = 5829,
+ SinglepumpINTEL = 5830,
+ DoublepumpINTEL = 5831,
+ MaxReplicatesINTEL = 5832,
+ SimpleDualPortINTEL = 5833,
+ MergeINTEL = 5834,
+ BankBitsINTEL = 5835,
+ ForcePow2DepthINTEL = 5836,
+ BurstCoalesceINTEL = 5899,
+ CacheSizeINTEL = 5900,
+ DontStaticallyCoalesceINTEL = 5901,
+ PrefetchINTEL = 5902,
+ StallEnableINTEL = 5905,
+ FuseLoopsInFunctionINTEL = 5907,
+ MathOpDSPModeINTEL = 5909,
+ AliasScopeINTEL = 5914,
+ NoAliasINTEL = 5915,
+ InitiationIntervalINTEL = 5917,
+ MaxConcurrencyINTEL = 5918,
+ PipelineEnableINTEL = 5919,
+ BufferLocationINTEL = 5921,
+ IOPipeStorageINTEL = 5944,
+ FunctionFloatingPointModeINTEL = 6080,
+ SingleElementVectorINTEL = 6085,
+ VectorComputeCallableFunctionINTEL = 6087,
+ MediaBlockIOINTEL = 6140,
+ }
+
+ [AllowDuplicates, CRepr] public enum BuiltIn
+ {
+ Position = 0,
+ PointSize = 1,
+ ClipDistance = 3,
+ CullDistance = 4,
+ VertexId = 5,
+ InstanceId = 6,
+ PrimitiveId = 7,
+ InvocationId = 8,
+ Layer = 9,
+ ViewportIndex = 10,
+ TessLevelOuter = 11,
+ TessLevelInner = 12,
+ TessCoord = 13,
+ PatchVertices = 14,
+ FragCoord = 15,
+ PointCoord = 16,
+ FrontFacing = 17,
+ SampleId = 18,
+ SamplePosition = 19,
+ SampleMask = 20,
+ FragDepth = 22,
+ HelperInvocation = 23,
+ NumWorkgroups = 24,
+ WorkgroupSize = 25,
+ WorkgroupId = 26,
+ LocalInvocationId = 27,
+ GlobalInvocationId = 28,
+ LocalInvocationIndex = 29,
+ WorkDim = 30,
+ GlobalSize = 31,
+ EnqueuedWorkgroupSize = 32,
+ GlobalOffset = 33,
+ GlobalLinearId = 34,
+ SubgroupSize = 36,
+ SubgroupMaxSize = 37,
+ NumSubgroups = 38,
+ NumEnqueuedSubgroups = 39,
+ SubgroupId = 40,
+ SubgroupLocalInvocationId = 41,
+ VertexIndex = 42,
+ InstanceIndex = 43,
+ CoreIDARM = 4160,
+ CoreCountARM = 4161,
+ CoreMaxIDARM = 4162,
+ WarpIDARM = 4163,
+ WarpMaxIDARM = 4164,
+ SubgroupEqMask = 4416,
+ SubgroupEqMaskKHR = 4416,
+ SubgroupGeMask = 4417,
+ SubgroupGeMaskKHR = 4417,
+ SubgroupGtMask = 4418,
+ SubgroupGtMaskKHR = 4418,
+ SubgroupLeMask = 4419,
+ SubgroupLeMaskKHR = 4419,
+ SubgroupLtMask = 4420,
+ SubgroupLtMaskKHR = 4420,
+ BaseVertex = 4424,
+ BaseInstance = 4425,
+ DrawIndex = 4426,
+ PrimitiveShadingRateKHR = 4432,
+ DeviceIndex = 4438,
+ ViewIndex = 4440,
+ ShadingRateKHR = 4444,
+ BaryCoordNoPerspAMD = 4992,
+ BaryCoordNoPerspCentroidAMD = 4993,
+ BaryCoordNoPerspSampleAMD = 4994,
+ BaryCoordSmoothAMD = 4995,
+ BaryCoordSmoothCentroidAMD = 4996,
+ BaryCoordSmoothSampleAMD = 4997,
+ BaryCoordPullModelAMD = 4998,
+ FragStencilRefEXT = 5014,
+ ViewportMaskNV = 5253,
+ SecondaryPositionNV = 5257,
+ SecondaryViewportMaskNV = 5258,
+ PositionPerViewNV = 5261,
+ ViewportMaskPerViewNV = 5262,
+ FullyCoveredEXT = 5264,
+ TaskCountNV = 5274,
+ PrimitiveCountNV = 5275,
+ PrimitiveIndicesNV = 5276,
+ ClipDistancePerViewNV = 5277,
+ CullDistancePerViewNV = 5278,
+ LayerPerViewNV = 5279,
+ MeshViewCountNV = 5280,
+ MeshViewIndicesNV = 5281,
+ BaryCoordKHR = 5286,
+ BaryCoordNV = 5286,
+ BaryCoordNoPerspKHR = 5287,
+ BaryCoordNoPerspNV = 5287,
+ FragSizeEXT = 5292,
+ FragmentSizeNV = 5292,
+ FragInvocationCountEXT = 5293,
+ InvocationsPerPixelNV = 5293,
+ PrimitivePointIndicesEXT = 5294,
+ PrimitiveLineIndicesEXT = 5295,
+ PrimitiveTriangleIndicesEXT = 5296,
+ CullPrimitiveEXT = 5299,
+ LaunchIdKHR = 5319,
+ LaunchIdNV = 5319,
+ LaunchSizeKHR = 5320,
+ LaunchSizeNV = 5320,
+ WorldRayOriginKHR = 5321,
+ WorldRayOriginNV = 5321,
+ WorldRayDirectionKHR = 5322,
+ WorldRayDirectionNV = 5322,
+ ObjectRayOriginKHR = 5323,
+ ObjectRayOriginNV = 5323,
+ ObjectRayDirectionKHR = 5324,
+ ObjectRayDirectionNV = 5324,
+ RayTminKHR = 5325,
+ RayTminNV = 5325,
+ RayTmaxKHR = 5326,
+ RayTmaxNV = 5326,
+ InstanceCustomIndexKHR = 5327,
+ InstanceCustomIndexNV = 5327,
+ ObjectToWorldKHR = 5330,
+ ObjectToWorldNV = 5330,
+ WorldToObjectKHR = 5331,
+ WorldToObjectNV = 5331,
+ HitTNV = 5332,
+ HitKindKHR = 5333,
+ HitKindNV = 5333,
+ CurrentRayTimeNV = 5334,
+ IncomingRayFlagsKHR = 5351,
+ IncomingRayFlagsNV = 5351,
+ RayGeometryIndexKHR = 5352,
+ WarpsPerSMNV = 5374,
+ SMCountNV = 5375,
+ WarpIDNV = 5376,
+ SMIDNV = 5377,
+ CullMaskKHR = 6021,
+ }
+
+ [AllowDuplicates, CRepr] public enum SelectionControlShift
+ {
+ Flatten = 0,
+ DontFlatten = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum SelectionControlMask
+ {
+ MaskNone = 0,
+ Flatten = 0x00000001,
+ DontFlatten = 0x00000002,
+ }
+
+ [AllowDuplicates, CRepr] public enum LoopControlShift
+ {
+ Unroll = 0,
+ DontUnroll = 1,
+ DependencyInfinite = 2,
+ DependencyLength = 3,
+ MinIterations = 4,
+ MaxIterations = 5,
+ IterationMultiple = 6,
+ PeelCount = 7,
+ PartialCount = 8,
+ InitiationIntervalINTEL = 16,
+ MaxConcurrencyINTEL = 17,
+ DependencyArrayINTEL = 18,
+ PipelineEnableINTEL = 19,
+ LoopCoalesceINTEL = 20,
+ MaxInterleavingINTEL = 21,
+ SpeculatedIterationsINTEL = 22,
+ NoFusionINTEL = 23,
+ LoopCountINTEL = 24,
+ MaxReinvocationDelayINTEL = 25,
+ }
+
+ [AllowDuplicates, CRepr] public enum LoopControlMask
+ {
+ MaskNone = 0,
+ Unroll = 0x00000001,
+ DontUnroll = 0x00000002,
+ DependencyInfinite = 0x00000004,
+ DependencyLength = 0x00000008,
+ MinIterations = 0x00000010,
+ MaxIterations = 0x00000020,
+ IterationMultiple = 0x00000040,
+ PeelCount = 0x00000080,
+ PartialCount = 0x00000100,
+ InitiationIntervalINTEL = 0x00010000,
+ MaxConcurrencyINTEL = 0x00020000,
+ DependencyArrayINTEL = 0x00040000,
+ PipelineEnableINTEL = 0x00080000,
+ LoopCoalesceINTEL = 0x00100000,
+ MaxInterleavingINTEL = 0x00200000,
+ SpeculatedIterationsINTEL = 0x00400000,
+ NoFusionINTEL = 0x00800000,
+ LoopCountINTEL = 0x01000000,
+ MaxReinvocationDelayINTEL = 0x02000000,
+ }
+
+ [AllowDuplicates, CRepr] public enum FunctionControlShift
+ {
+ Inline = 0,
+ DontInline = 1,
+ Pure = 2,
+ Const = 3,
+ OptNoneINTEL = 16,
+ }
+
+ [AllowDuplicates, CRepr] public enum FunctionControlMask
+ {
+ MaskNone = 0,
+ Inline = 0x00000001,
+ DontInline = 0x00000002,
+ Pure = 0x00000004,
+ Const = 0x00000008,
+ OptNoneINTEL = 0x00010000,
+ }
+
+ [AllowDuplicates, CRepr] public enum MemorySemanticsShift
+ {
+ Acquire = 1,
+ Release = 2,
+ AcquireRelease = 3,
+ SequentiallyConsistent = 4,
+ UniformMemory = 6,
+ SubgroupMemory = 7,
+ WorkgroupMemory = 8,
+ CrossWorkgroupMemory = 9,
+ AtomicCounterMemory = 10,
+ ImageMemory = 11,
+ OutputMemory = 12,
+ OutputMemoryKHR = 12,
+ MakeAvailable = 13,
+ MakeAvailableKHR = 13,
+ MakeVisible = 14,
+ MakeVisibleKHR = 14,
+ Volatile = 15,
+ }
+
+ [AllowDuplicates, CRepr] public enum MemorySemanticsMask
+ {
+ MaskNone = 0,
+ Acquire = 0x00000002,
+ Release = 0x00000004,
+ AcquireRelease = 0x00000008,
+ SequentiallyConsistent = 0x00000010,
+ UniformMemory = 0x00000040,
+ SubgroupMemory = 0x00000080,
+ WorkgroupMemory = 0x00000100,
+ CrossWorkgroupMemory = 0x00000200,
+ AtomicCounterMemory = 0x00000400,
+ ImageMemory = 0x00000800,
+ OutputMemory = 0x00001000,
+ OutputMemoryKHR = 0x00001000,
+ MakeAvailable = 0x00002000,
+ MakeAvailableKHR = 0x00002000,
+ MakeVisible = 0x00004000,
+ MakeVisibleKHR = 0x00004000,
+ Volatile = 0x00008000,
+ }
+
+ [AllowDuplicates, CRepr] public enum MemoryAccessShift
+ {
+ Volatile = 0,
+ Aligned = 1,
+ Nontemporal = 2,
+ MakePointerAvailable = 3,
+ MakePointerAvailableKHR = 3,
+ MakePointerVisible = 4,
+ MakePointerVisibleKHR = 4,
+ NonPrivatePointer = 5,
+ NonPrivatePointerKHR = 5,
+ AliasScopeINTELMask = 16,
+ NoAliasINTELMask = 17,
+ }
+
+ [AllowDuplicates, CRepr] public enum MemoryAccessMask
+ {
+ MaskNone = 0,
+ Volatile = 0x00000001,
+ Aligned = 0x00000002,
+ Nontemporal = 0x00000004,
+ MakePointerAvailable = 0x00000008,
+ MakePointerAvailableKHR = 0x00000008,
+ MakePointerVisible = 0x00000010,
+ MakePointerVisibleKHR = 0x00000010,
+ NonPrivatePointer = 0x00000020,
+ NonPrivatePointerKHR = 0x00000020,
+ AliasScopeINTELMask = 0x00010000,
+ NoAliasINTELMask = 0x00020000,
+ }
+
+ [AllowDuplicates, CRepr] public enum Scope
+ {
+ CrossDevice = 0,
+ Device = 1,
+ Workgroup = 2,
+ Subgroup = 3,
+ Invocation = 4,
+ QueueFamily = 5,
+ QueueFamilyKHR = 5,
+ ShaderCallKHR = 6,
+ }
+
+ [AllowDuplicates, CRepr] public enum GroupOperation
+ {
+ Reduce = 0,
+ InclusiveScan = 1,
+ ExclusiveScan = 2,
+ ClusteredReduce = 3,
+ PartitionedReduceNV = 6,
+ PartitionedInclusiveScanNV = 7,
+ PartitionedExclusiveScanNV = 8,
+ }
+
+ [AllowDuplicates, CRepr] public enum KernelEnqueueFlags
+ {
+ NoWait = 0,
+ WaitKernel = 1,
+ WaitWorkGroup = 2,
+ }
+
+ [AllowDuplicates, CRepr] public enum KernelProfilingInfoShift
+ {
+ CmdExecTime = 0,
+ }
+
+ [AllowDuplicates, CRepr] public enum KernelProfilingInfoMask
+ {
+ MaskNone = 0,
+ CmdExecTime = 0x00000001,
+ }
+
+ [AllowDuplicates, CRepr] public enum Capability
+ {
+ Matrix = 0,
+ Shader = 1,
+ Geometry = 2,
+ Tessellation = 3,
+ Addresses = 4,
+ Linkage = 5,
+ Kernel = 6,
+ Vector16 = 7,
+ Float16Buffer = 8,
+ Float16 = 9,
+ Float64 = 10,
+ Int64 = 11,
+ Int64Atomics = 12,
+ ImageBasic = 13,
+ ImageReadWrite = 14,
+ ImageMipmap = 15,
+ Pipes = 17,
+ Groups = 18,
+ DeviceEnqueue = 19,
+ LiteralSampler = 20,
+ AtomicStorage = 21,
+ Int16 = 22,
+ TessellationPointSize = 23,
+ GeometryPointSize = 24,
+ ImageGatherExtended = 25,
+ StorageImageMultisample = 27,
+ UniformBufferArrayDynamicIndexing = 28,
+ SampledImageArrayDynamicIndexing = 29,
+ StorageBufferArrayDynamicIndexing = 30,
+ StorageImageArrayDynamicIndexing = 31,
+ ClipDistance = 32,
+ CullDistance = 33,
+ ImageCubeArray = 34,
+ SampleRateShading = 35,
+ ImageRect = 36,
+ SampledRect = 37,
+ GenericPointer = 38,
+ Int8 = 39,
+ InputAttachment = 40,
+ SparseResidency = 41,
+ MinLod = 42,
+ Sampled1D = 43,
+ Image1D = 44,
+ SampledCubeArray = 45,
+ SampledBuffer = 46,
+ ImageBuffer = 47,
+ ImageMSArray = 48,
+ StorageImageExtendedFormats = 49,
+ ImageQuery = 50,
+ DerivativeControl = 51,
+ InterpolationFunction = 52,
+ TransformFeedback = 53,
+ GeometryStreams = 54,
+ StorageImageReadWithoutFormat = 55,
+ StorageImageWriteWithoutFormat = 56,
+ MultiViewport = 57,
+ SubgroupDispatch = 58,
+ NamedBarrier = 59,
+ PipeStorage = 60,
+ GroupNonUniform = 61,
+ GroupNonUniformVote = 62,
+ GroupNonUniformArithmetic = 63,
+ GroupNonUniformBallot = 64,
+ GroupNonUniformShuffle = 65,
+ GroupNonUniformShuffleRelative = 66,
+ GroupNonUniformClustered = 67,
+ GroupNonUniformQuad = 68,
+ ShaderLayer = 69,
+ ShaderViewportIndex = 70,
+ UniformDecoration = 71,
+ CoreBuiltinsARM = 4165,
+ FragmentShadingRateKHR = 4422,
+ SubgroupBallotKHR = 4423,
+ DrawParameters = 4427,
+ WorkgroupMemoryExplicitLayoutKHR = 4428,
+ WorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
+ WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
+ SubgroupVoteKHR = 4431,
+ StorageBuffer16BitAccess = 4433,
+ StorageUniformBufferBlock16 = 4433,
+ StorageUniform16 = 4434,
+ UniformAndStorageBuffer16BitAccess = 4434,
+ StoragePushConstant16 = 4435,
+ StorageInputOutput16 = 4436,
+ DeviceGroup = 4437,
+ MultiView = 4439,
+ VariablePointersStorageBuffer = 4441,
+ VariablePointers = 4442,
+ AtomicStorageOps = 4445,
+ SampleMaskPostDepthCoverage = 4447,
+ StorageBuffer8BitAccess = 4448,
+ UniformAndStorageBuffer8BitAccess = 4449,
+ StoragePushConstant8 = 4450,
+ DenormPreserve = 4464,
+ DenormFlushToZero = 4465,
+ SignedZeroInfNanPreserve = 4466,
+ RoundingModeRTE = 4467,
+ RoundingModeRTZ = 4468,
+ RayQueryProvisionalKHR = 4471,
+ RayQueryKHR = 4472,
+ RayTraversalPrimitiveCullingKHR = 4478,
+ RayTracingKHR = 4479,
+ Float16ImageAMD = 5008,
+ ImageGatherBiasLodAMD = 5009,
+ FragmentMaskAMD = 5010,
+ StencilExportEXT = 5013,
+ ImageReadWriteLodAMD = 5015,
+ Int64ImageEXT = 5016,
+ ShaderClockKHR = 5055,
+ SampleMaskOverrideCoverageNV = 5249,
+ GeometryShaderPassthroughNV = 5251,
+ ShaderViewportIndexLayerEXT = 5254,
+ ShaderViewportIndexLayerNV = 5254,
+ ShaderViewportMaskNV = 5255,
+ ShaderStereoViewNV = 5259,
+ PerViewAttributesNV = 5260,
+ FragmentFullyCoveredEXT = 5265,
+ MeshShadingNV = 5266,
+ ImageFootprintNV = 5282,
+ MeshShadingEXT = 5283,
+ FragmentBarycentricKHR = 5284,
+ FragmentBarycentricNV = 5284,
+ ComputeDerivativeGroupQuadsNV = 5288,
+ FragmentDensityEXT = 5291,
+ ShadingRateNV = 5291,
+ GroupNonUniformPartitionedNV = 5297,
+ ShaderNonUniform = 5301,
+ ShaderNonUniformEXT = 5301,
+ RuntimeDescriptorArray = 5302,
+ RuntimeDescriptorArrayEXT = 5302,
+ InputAttachmentArrayDynamicIndexing = 5303,
+ InputAttachmentArrayDynamicIndexingEXT = 5303,
+ UniformTexelBufferArrayDynamicIndexing = 5304,
+ UniformTexelBufferArrayDynamicIndexingEXT = 5304,
+ StorageTexelBufferArrayDynamicIndexing = 5305,
+ StorageTexelBufferArrayDynamicIndexingEXT = 5305,
+ UniformBufferArrayNonUniformIndexing = 5306,
+ UniformBufferArrayNonUniformIndexingEXT = 5306,
+ SampledImageArrayNonUniformIndexing = 5307,
+ SampledImageArrayNonUniformIndexingEXT = 5307,
+ StorageBufferArrayNonUniformIndexing = 5308,
+ StorageBufferArrayNonUniformIndexingEXT = 5308,
+ StorageImageArrayNonUniformIndexing = 5309,
+ StorageImageArrayNonUniformIndexingEXT = 5309,
+ InputAttachmentArrayNonUniformIndexing = 5310,
+ InputAttachmentArrayNonUniformIndexingEXT = 5310,
+ UniformTexelBufferArrayNonUniformIndexing = 5311,
+ UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
+ StorageTexelBufferArrayNonUniformIndexing = 5312,
+ StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
+ RayTracingNV = 5340,
+ RayTracingMotionBlurNV = 5341,
+ VulkanMemoryModel = 5345,
+ VulkanMemoryModelKHR = 5345,
+ VulkanMemoryModelDeviceScope = 5346,
+ VulkanMemoryModelDeviceScopeKHR = 5346,
+ PhysicalStorageBufferAddresses = 5347,
+ PhysicalStorageBufferAddressesEXT = 5347,
+ ComputeDerivativeGroupLinearNV = 5350,
+ RayTracingProvisionalKHR = 5353,
+ CooperativeMatrixNV = 5357,
+ FragmentShaderSampleInterlockEXT = 5363,
+ FragmentShaderShadingRateInterlockEXT = 5372,
+ ShaderSMBuiltinsNV = 5373,
+ FragmentShaderPixelInterlockEXT = 5378,
+ DemoteToHelperInvocation = 5379,
+ DemoteToHelperInvocationEXT = 5379,
+ RayTracingOpacityMicromapEXT = 5381,
+ ShaderInvocationReorderNV = 5383,
+ BindlessTextureNV = 5390,
+ SubgroupShuffleINTEL = 5568,
+ SubgroupBufferBlockIOINTEL = 5569,
+ SubgroupImageBlockIOINTEL = 5570,
+ SubgroupImageMediaBlockIOINTEL = 5579,
+ RoundToInfinityINTEL = 5582,
+ FloatingPointModeINTEL = 5583,
+ IntegerFunctions2INTEL = 5584,
+ FunctionPointersINTEL = 5603,
+ IndirectReferencesINTEL = 5604,
+ AsmINTEL = 5606,
+ AtomicFloat32MinMaxEXT = 5612,
+ AtomicFloat64MinMaxEXT = 5613,
+ AtomicFloat16MinMaxEXT = 5616,
+ VectorComputeINTEL = 5617,
+ VectorAnyINTEL = 5619,
+ ExpectAssumeKHR = 5629,
+ SubgroupAvcMotionEstimationINTEL = 5696,
+ SubgroupAvcMotionEstimationIntraINTEL = 5697,
+ SubgroupAvcMotionEstimationChromaINTEL = 5698,
+ VariableLengthArrayINTEL = 5817,
+ FunctionFloatControlINTEL = 5821,
+ FPGAMemoryAttributesINTEL = 5824,
+ FPFastMathModeINTEL = 5837,
+ ArbitraryPrecisionIntegersINTEL = 5844,
+ ArbitraryPrecisionFloatingPointINTEL = 5845,
+ UnstructuredLoopControlsINTEL = 5886,
+ FPGALoopControlsINTEL = 5888,
+ KernelAttributesINTEL = 5892,
+ FPGAKernelAttributesINTEL = 5897,
+ FPGAMemoryAccessesINTEL = 5898,
+ FPGAClusterAttributesINTEL = 5904,
+ LoopFuseINTEL = 5906,
+ FPGADSPControlINTEL = 5908,
+ MemoryAccessAliasingINTEL = 5910,
+ FPGAInvocationPipeliningAttributesINTEL = 5916,
+ FPGABufferLocationINTEL = 5920,
+ ArbitraryPrecisionFixedPointINTEL = 5922,
+ USMStorageClassesINTEL = 5935,
+ RuntimeAlignedAttributeINTEL = 5939,
+ IOPipesINTEL = 5943,
+ BlockingPipesINTEL = 5945,
+ FPGARegINTEL = 5948,
+ DotProductInputAll = 6016,
+ DotProductInputAllKHR = 6016,
+ DotProductInput4x8Bit = 6017,
+ DotProductInput4x8BitKHR = 6017,
+ DotProductInput4x8BitPacked = 6018,
+ DotProductInput4x8BitPackedKHR = 6018,
+ DotProduct = 6019,
+ DotProductKHR = 6019,
+ RayCullMaskKHR = 6020,
+ BitInstructions = 6025,
+ GroupNonUniformRotateKHR = 6026,
+ AtomicFloat32AddEXT = 6033,
+ AtomicFloat64AddEXT = 6034,
+ LongConstantCompositeINTEL = 6089,
+ OptNoneINTEL = 6094,
+ AtomicFloat16AddEXT = 6095,
+ DebugInfoModuleINTEL = 6114,
+ SplitBarrierINTEL = 6141,
+ GroupUniformArithmeticKHR = 6400,
+ }
+
+ [AllowDuplicates, CRepr] public enum RayFlagsShift
+ {
+ OpaqueKHR = 0,
+ NoOpaqueKHR = 1,
+ TerminateOnFirstHitKHR = 2,
+ SkipClosestHitShaderKHR = 3,
+ CullBackFacingTrianglesKHR = 4,
+ CullFrontFacingTrianglesKHR = 5,
+ CullOpaqueKHR = 6,
+ CullNoOpaqueKHR = 7,
+ SkipTrianglesKHR = 8,
+ SkipAABBsKHR = 9,
+ ForceOpacityMicromap2StateEXT = 10,
+ }
+
+ [AllowDuplicates, CRepr] public enum RayFlagsMask
+ {
+ MaskNone = 0,
+ OpaqueKHR = 0x00000001,
+ NoOpaqueKHR = 0x00000002,
+ TerminateOnFirstHitKHR = 0x00000004,
+ SkipClosestHitShaderKHR = 0x00000008,
+ CullBackFacingTrianglesKHR = 0x00000010,
+ CullFrontFacingTrianglesKHR = 0x00000020,
+ CullOpaqueKHR = 0x00000040,
+ CullNoOpaqueKHR = 0x00000080,
+ SkipTrianglesKHR = 0x00000100,
+ SkipAABBsKHR = 0x00000200,
+ ForceOpacityMicromap2StateEXT = 0x00000400,
+ }
+
+ [AllowDuplicates, CRepr] public enum RayQueryIntersection
+ {
+ RayQueryCandidateIntersectionKHR = 0,
+ RayQueryCommittedIntersectionKHR = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum RayQueryCommittedIntersectionType
+ {
+ RayQueryCommittedIntersectionNoneKHR = 0,
+ RayQueryCommittedIntersectionTriangleKHR = 1,
+ RayQueryCommittedIntersectionGeneratedKHR = 2,
+ }
+
+ [AllowDuplicates, CRepr] public enum RayQueryCandidateIntersectionType
+ {
+ RayQueryCandidateIntersectionTriangleKHR = 0,
+ RayQueryCandidateIntersectionAABBKHR = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum FragmentShadingRateShift
+ {
+ Vertical2Pixels = 0,
+ Vertical4Pixels = 1,
+ Horizontal2Pixels = 2,
+ Horizontal4Pixels = 3,
+ }
+
+ [AllowDuplicates, CRepr] public enum FragmentShadingRateMask
+ {
+ MaskNone = 0,
+ Vertical2Pixels = 0x00000001,
+ Vertical4Pixels = 0x00000002,
+ Horizontal2Pixels = 0x00000004,
+ Horizontal4Pixels = 0x00000008,
+ }
+
+ [AllowDuplicates, CRepr] public enum FPDenormMode
+ {
+ Preserve = 0,
+ FlushToZero = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum FPOperationMode
+ {
+ IEEE = 0,
+ ALT = 1,
+ }
+
+ [AllowDuplicates, CRepr] public enum QuantizationModes
+ {
+ TRN = 0,
+ TRN_ZERO = 1,
+ RND = 2,
+ RND_ZERO = 3,
+ RND_INF = 4,
+ RND_MIN_INF = 5,
+ RND_CONV = 6,
+ RND_CONV_ODD = 7,
+ }
+
+ [AllowDuplicates, CRepr] public enum OverflowModes
+ {
+ WRAP = 0,
+ SAT = 1,
+ SAT_ZERO = 2,
+ SAT_SYM = 3,
+ }
+
+ [AllowDuplicates, CRepr] public enum PackedVectorFormat
+ {
+ PackedVectorFormat4x8Bit = 0,
+ PackedVectorFormat4x8BitKHR = 0,
+ }
+
+ [AllowDuplicates, CRepr] public enum Op
+ {
+ OpNop = 0,
+ OpUndef = 1,
+ OpSourceContinued = 2,
+ OpSource = 3,
+ OpSourceExtension = 4,
+ OpName = 5,
+ OpMemberName = 6,
+ OpString = 7,
+ OpLine = 8,
+ OpExtension = 10,
+ OpExtInstImport = 11,
+ OpExtInst = 12,
+ OpMemoryModel = 14,
+ OpEntryPoint = 15,
+ OpExecutionMode = 16,
+ OpCapability = 17,
+ OpTypeVoid = 19,
+ OpTypeBool = 20,
+ OpTypeInt = 21,
+ OpTypeFloat = 22,
+ OpTypeVector = 23,
+ OpTypeMatrix = 24,
+ OpTypeImage = 25,
+ OpTypeSampler = 26,
+ OpTypeSampledImage = 27,
+ OpTypeArray = 28,
+ OpTypeRuntimeArray = 29,
+ OpTypeStruct = 30,
+ OpTypeOpaque = 31,
+ OpTypePointer = 32,
+ OpTypeFunction = 33,
+ OpTypeEvent = 34,
+ OpTypeDeviceEvent = 35,
+ OpTypeReserveId = 36,
+ OpTypeQueue = 37,
+ OpTypePipe = 38,
+ OpTypeForwardPointer = 39,
+ OpConstantTrue = 41,
+ OpConstantFalse = 42,
+ OpConstant = 43,
+ OpConstantComposite = 44,
+ OpConstantSampler = 45,
+ OpConstantNull = 46,
+ OpSpecConstantTrue = 48,
+ OpSpecConstantFalse = 49,
+ OpSpecConstant = 50,
+ OpSpecConstantComposite = 51,
+ OpSpecConstantOp = 52,
+ OpFunction = 54,
+ OpFunctionParameter = 55,
+ OpFunctionEnd = 56,
+ OpFunctionCall = 57,
+ OpVariable = 59,
+ OpImageTexelPointer = 60,
+ OpLoad = 61,
+ OpStore = 62,
+ OpCopyMemory = 63,
+ OpCopyMemorySized = 64,
+ OpAccessChain = 65,
+ OpInBoundsAccessChain = 66,
+ OpPtrAccessChain = 67,
+ OpArrayLength = 68,
+ OpGenericPtrMemSemantics = 69,
+ OpInBoundsPtrAccessChain = 70,
+ OpDecorate = 71,
+ OpMemberDecorate = 72,
+ OpDecorationGroup = 73,
+ OpGroupDecorate = 74,
+ OpGroupMemberDecorate = 75,
+ OpVectorExtractDynamic = 77,
+ OpVectorInsertDynamic = 78,
+ OpVectorShuffle = 79,
+ OpCompositeConstruct = 80,
+ OpCompositeExtract = 81,
+ OpCompositeInsert = 82,
+ OpCopyObject = 83,
+ OpTranspose = 84,
+ OpSampledImage = 86,
+ OpImageSampleImplicitLod = 87,
+ OpImageSampleExplicitLod = 88,
+ OpImageSampleDrefImplicitLod = 89,
+ OpImageSampleDrefExplicitLod = 90,
+ OpImageSampleProjImplicitLod = 91,
+ OpImageSampleProjExplicitLod = 92,
+ OpImageSampleProjDrefImplicitLod = 93,
+ OpImageSampleProjDrefExplicitLod = 94,
+ OpImageFetch = 95,
+ OpImageGather = 96,
+ OpImageDrefGather = 97,
+ OpImageRead = 98,
+ OpImageWrite = 99,
+ OpImage = 100,
+ OpImageQueryFormat = 101,
+ OpImageQueryOrder = 102,
+ OpImageQuerySizeLod = 103,
+ OpImageQuerySize = 104,
+ OpImageQueryLod = 105,
+ OpImageQueryLevels = 106,
+ OpImageQuerySamples = 107,
+ OpConvertFToU = 109,
+ OpConvertFToS = 110,
+ OpConvertSToF = 111,
+ OpConvertUToF = 112,
+ OpUConvert = 113,
+ OpSConvert = 114,
+ OpFConvert = 115,
+ OpQuantizeToF16 = 116,
+ OpConvertPtrToU = 117,
+ OpSatConvertSToU = 118,
+ OpSatConvertUToS = 119,
+ OpConvertUToPtr = 120,
+ OpPtrCastToGeneric = 121,
+ OpGenericCastToPtr = 122,
+ OpGenericCastToPtrExplicit = 123,
+ OpBitcast = 124,
+ OpSNegate = 126,
+ OpFNegate = 127,
+ OpIAdd = 128,
+ OpFAdd = 129,
+ OpISub = 130,
+ OpFSub = 131,
+ OpIMul = 132,
+ OpFMul = 133,
+ OpUDiv = 134,
+ OpSDiv = 135,
+ OpFDiv = 136,
+ OpUMod = 137,
+ OpSRem = 138,
+ OpSMod = 139,
+ OpFRem = 140,
+ OpFMod = 141,
+ OpVectorTimesScalar = 142,
+ OpMatrixTimesScalar = 143,
+ OpVectorTimesMatrix = 144,
+ OpMatrixTimesVector = 145,
+ OpMatrixTimesMatrix = 146,
+ OpOuterProduct = 147,
+ OpDot = 148,
+ OpIAddCarry = 149,
+ OpISubBorrow = 150,
+ OpUMulExtended = 151,
+ OpSMulExtended = 152,
+ OpAny = 154,
+ OpAll = 155,
+ OpIsNan = 156,
+ OpIsInf = 157,
+ OpIsFinite = 158,
+ OpIsNormal = 159,
+ OpSignBitSet = 160,
+ OpLessOrGreater = 161,
+ OpOrdered = 162,
+ OpUnordered = 163,
+ OpLogicalEqual = 164,
+ OpLogicalNotEqual = 165,
+ OpLogicalOr = 166,
+ OpLogicalAnd = 167,
+ OpLogicalNot = 168,
+ OpSelect = 169,
+ OpIEqual = 170,
+ OpINotEqual = 171,
+ OpUGreaterThan = 172,
+ OpSGreaterThan = 173,
+ OpUGreaterThanEqual = 174,
+ OpSGreaterThanEqual = 175,
+ OpULessThan = 176,
+ OpSLessThan = 177,
+ OpULessThanEqual = 178,
+ OpSLessThanEqual = 179,
+ OpFOrdEqual = 180,
+ OpFUnordEqual = 181,
+ OpFOrdNotEqual = 182,
+ OpFUnordNotEqual = 183,
+ OpFOrdLessThan = 184,
+ OpFUnordLessThan = 185,
+ OpFOrdGreaterThan = 186,
+ OpFUnordGreaterThan = 187,
+ OpFOrdLessThanEqual = 188,
+ OpFUnordLessThanEqual = 189,
+ OpFOrdGreaterThanEqual = 190,
+ OpFUnordGreaterThanEqual = 191,
+ OpShiftRightLogical = 194,
+ OpShiftRightArithmetic = 195,
+ OpShiftLeftLogical = 196,
+ OpBitwiseOr = 197,
+ OpBitwiseXor = 198,
+ OpBitwiseAnd = 199,
+ OpNot = 200,
+ OpBitFieldInsert = 201,
+ OpBitFieldSExtract = 202,
+ OpBitFieldUExtract = 203,
+ OpBitReverse = 204,
+ OpBitCount = 205,
+ OpDPdx = 207,
+ OpDPdy = 208,
+ OpFwidth = 209,
+ OpDPdxFine = 210,
+ OpDPdyFine = 211,
+ OpFwidthFine = 212,
+ OpDPdxCoarse = 213,
+ OpDPdyCoarse = 214,
+ OpFwidthCoarse = 215,
+ OpEmitVertex = 218,
+ OpEndPrimitive = 219,
+ OpEmitStreamVertex = 220,
+ OpEndStreamPrimitive = 221,
+ OpControlBarrier = 224,
+ OpMemoryBarrier = 225,
+ OpAtomicLoad = 227,
+ OpAtomicStore = 228,
+ OpAtomicExchange = 229,
+ OpAtomicCompareExchange = 230,
+ OpAtomicCompareExchangeWeak = 231,
+ OpAtomicIIncrement = 232,
+ OpAtomicIDecrement = 233,
+ OpAtomicIAdd = 234,
+ OpAtomicISub = 235,
+ OpAtomicSMin = 236,
+ OpAtomicUMin = 237,
+ OpAtomicSMax = 238,
+ OpAtomicUMax = 239,
+ OpAtomicAnd = 240,
+ OpAtomicOr = 241,
+ OpAtomicXor = 242,
+ OpPhi = 245,
+ OpLoopMerge = 246,
+ OpSelectionMerge = 247,
+ OpLabel = 248,
+ OpBranch = 249,
+ OpBranchConditional = 250,
+ OpSwitch = 251,
+ OpKill = 252,
+ OpReturn = 253,
+ OpReturnValue = 254,
+ OpUnreachable = 255,
+ OpLifetimeStart = 256,
+ OpLifetimeStop = 257,
+ OpGroupAsyncCopy = 259,
+ OpGroupWaitEvents = 260,
+ OpGroupAll = 261,
+ OpGroupAny = 262,
+ OpGroupBroadcast = 263,
+ OpGroupIAdd = 264,
+ OpGroupFAdd = 265,
+ OpGroupFMin = 266,
+ OpGroupUMin = 267,
+ OpGroupSMin = 268,
+ OpGroupFMax = 269,
+ OpGroupUMax = 270,
+ OpGroupSMax = 271,
+ OpReadPipe = 274,
+ OpWritePipe = 275,
+ OpReservedReadPipe = 276,
+ OpReservedWritePipe = 277,
+ OpReserveReadPipePackets = 278,
+ OpReserveWritePipePackets = 279,
+ OpCommitReadPipe = 280,
+ OpCommitWritePipe = 281,
+ OpIsValidReserveId = 282,
+ OpGetNumPipePackets = 283,
+ OpGetMaxPipePackets = 284,
+ OpGroupReserveReadPipePackets = 285,
+ OpGroupReserveWritePipePackets = 286,
+ OpGroupCommitReadPipe = 287,
+ OpGroupCommitWritePipe = 288,
+ OpEnqueueMarker = 291,
+ OpEnqueueKernel = 292,
+ OpGetKernelNDrangeSubGroupCount = 293,
+ OpGetKernelNDrangeMaxSubGroupSize = 294,
+ OpGetKernelWorkGroupSize = 295,
+ OpGetKernelPreferredWorkGroupSizeMultiple = 296,
+ OpRetainEvent = 297,
+ OpReleaseEvent = 298,
+ OpCreateUserEvent = 299,
+ OpIsValidEvent = 300,
+ OpSetUserEventStatus = 301,
+ OpCaptureEventProfilingInfo = 302,
+ OpGetDefaultQueue = 303,
+ OpBuildNDRange = 304,
+ OpImageSparseSampleImplicitLod = 305,
+ OpImageSparseSampleExplicitLod = 306,
+ OpImageSparseSampleDrefImplicitLod = 307,
+ OpImageSparseSampleDrefExplicitLod = 308,
+ OpImageSparseSampleProjImplicitLod = 309,
+ OpImageSparseSampleProjExplicitLod = 310,
+ OpImageSparseSampleProjDrefImplicitLod = 311,
+ OpImageSparseSampleProjDrefExplicitLod = 312,
+ OpImageSparseFetch = 313,
+ OpImageSparseGather = 314,
+ OpImageSparseDrefGather = 315,
+ OpImageSparseTexelsResident = 316,
+ OpNoLine = 317,
+ OpAtomicFlagTestAndSet = 318,
+ OpAtomicFlagClear = 319,
+ OpImageSparseRead = 320,
+ OpSizeOf = 321,
+ OpTypePipeStorage = 322,
+ OpConstantPipeStorage = 323,
+ OpCreatePipeFromPipeStorage = 324,
+ OpGetKernelLocalSizeForSubgroupCount = 325,
+ OpGetKernelMaxNumSubgroups = 326,
+ OpTypeNamedBarrier = 327,
+ OpNamedBarrierInitialize = 328,
+ OpMemoryNamedBarrier = 329,
+ OpModuleProcessed = 330,
+ OpExecutionModeId = 331,
+ OpDecorateId = 332,
+ OpGroupNonUniformElect = 333,
+ OpGroupNonUniformAll = 334,
+ OpGroupNonUniformAny = 335,
+ OpGroupNonUniformAllEqual = 336,
+ OpGroupNonUniformBroadcast = 337,
+ OpGroupNonUniformBroadcastFirst = 338,
+ OpGroupNonUniformBallot = 339,
+ OpGroupNonUniformInverseBallot = 340,
+ OpGroupNonUniformBallotBitExtract = 341,
+ OpGroupNonUniformBallotBitCount = 342,
+ OpGroupNonUniformBallotFindLSB = 343,
+ OpGroupNonUniformBallotFindMSB = 344,
+ OpGroupNonUniformShuffle = 345,
+ OpGroupNonUniformShuffleXor = 346,
+ OpGroupNonUniformShuffleUp = 347,
+ OpGroupNonUniformShuffleDown = 348,
+ OpGroupNonUniformIAdd = 349,
+ OpGroupNonUniformFAdd = 350,
+ OpGroupNonUniformIMul = 351,
+ OpGroupNonUniformFMul = 352,
+ OpGroupNonUniformSMin = 353,
+ OpGroupNonUniformUMin = 354,
+ OpGroupNonUniformFMin = 355,
+ OpGroupNonUniformSMax = 356,
+ OpGroupNonUniformUMax = 357,
+ OpGroupNonUniformFMax = 358,
+ OpGroupNonUniformBitwiseAnd = 359,
+ OpGroupNonUniformBitwiseOr = 360,
+ OpGroupNonUniformBitwiseXor = 361,
+ OpGroupNonUniformLogicalAnd = 362,
+ OpGroupNonUniformLogicalOr = 363,
+ OpGroupNonUniformLogicalXor = 364,
+ OpGroupNonUniformQuadBroadcast = 365,
+ OpGroupNonUniformQuadSwap = 366,
+ OpCopyLogical = 400,
+ OpPtrEqual = 401,
+ OpPtrNotEqual = 402,
+ OpPtrDiff = 403,
+ OpTerminateInvocation = 4416,
+ OpSubgroupBallotKHR = 4421,
+ OpSubgroupFirstInvocationKHR = 4422,
+ OpSubgroupAllKHR = 4428,
+ OpSubgroupAnyKHR = 4429,
+ OpSubgroupAllEqualKHR = 4430,
+ OpGroupNonUniformRotateKHR = 4431,
+ OpSubgroupReadInvocationKHR = 4432,
+ OpTraceRayKHR = 4445,
+ OpExecuteCallableKHR = 4446,
+ OpConvertUToAccelerationStructureKHR = 4447,
+ OpIgnoreIntersectionKHR = 4448,
+ OpTerminateRayKHR = 4449,
+ OpSDot = 4450,
+ OpSDotKHR = 4450,
+ OpUDot = 4451,
+ OpUDotKHR = 4451,
+ OpSUDot = 4452,
+ OpSUDotKHR = 4452,
+ OpSDotAccSat = 4453,
+ OpSDotAccSatKHR = 4453,
+ OpUDotAccSat = 4454,
+ OpUDotAccSatKHR = 4454,
+ OpSUDotAccSat = 4455,
+ OpSUDotAccSatKHR = 4455,
+ OpTypeRayQueryKHR = 4472,
+ OpRayQueryInitializeKHR = 4473,
+ OpRayQueryTerminateKHR = 4474,
+ OpRayQueryGenerateIntersectionKHR = 4475,
+ OpRayQueryConfirmIntersectionKHR = 4476,
+ OpRayQueryProceedKHR = 4477,
+ OpRayQueryGetIntersectionTypeKHR = 4479,
+ OpGroupIAddNonUniformAMD = 5000,
+ OpGroupFAddNonUniformAMD = 5001,
+ OpGroupFMinNonUniformAMD = 5002,
+ OpGroupUMinNonUniformAMD = 5003,
+ OpGroupSMinNonUniformAMD = 5004,
+ OpGroupFMaxNonUniformAMD = 5005,
+ OpGroupUMaxNonUniformAMD = 5006,
+ OpGroupSMaxNonUniformAMD = 5007,
+ OpFragmentMaskFetchAMD = 5011,
+ OpFragmentFetchAMD = 5012,
+ OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
+ OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
+ OpGroupNonUniformPartitionNV = 5296,
+ OpWritePackedPrimitiveIndices4x8NV = 5299,
+ OpReportIntersectionKHR = 5334,
+ OpReportIntersectionNV = 5334,
+ OpIgnoreIntersectionNV = 5335,
+ OpTerminateRayNV = 5336,
+ OpTraceNV = 5337,
+ OpTraceMotionNV = 5338,
+ OpTraceRayMotionNV = 5339,
+ OpTypeAccelerationStructureKHR = 5341,
+ OpTypeAccelerationStructureNV = 5341,
+ OpExecuteCallableNV = 5344,
+ OpTypeCooperativeMatrixNV = 5358,
+ OpCooperativeMatrixLoadNV = 5359,
+ OpCooperativeMatrixStoreNV = 5360,
+ OpCooperativeMatrixMulAddNV = 5361,
+ OpCooperativeMatrixLengthNV = 5362,
+ OpBeginInvocationInterlockEXT = 5364,
+ OpEndInvocationInterlockEXT = 5365,
+ OpDemoteToHelperInvocation = 5380,
+ OpDemoteToHelperInvocationEXT = 5380,
+ OpIsHelperInvocationEXT = 5381,
+ OpConvertUToImageNV = 5391,
+ OpConvertUToSamplerNV = 5392,
+ OpConvertImageToUNV = 5393,
+ OpConvertSamplerToUNV = 5394,
+ OpConvertUToSampledImageNV = 5395,
+ OpConvertSampledImageToUNV = 5396,
+ OpSamplerImageAddressingModeNV = 5397,
+ OpSubgroupShuffleINTEL = 5571,
+ OpSubgroupShuffleDownINTEL = 5572,
+ OpSubgroupShuffleUpINTEL = 5573,
+ OpSubgroupShuffleXorINTEL = 5574,
+ OpSubgroupBlockReadINTEL = 5575,
+ OpSubgroupBlockWriteINTEL = 5576,
+ OpSubgroupImageBlockReadINTEL = 5577,
+ OpSubgroupImageBlockWriteINTEL = 5578,
+ OpSubgroupImageMediaBlockReadINTEL = 5580,
+ OpSubgroupImageMediaBlockWriteINTEL = 5581,
+ OpUCountLeadingZerosINTEL = 5585,
+ OpUCountTrailingZerosINTEL = 5586,
+ OpAbsISubINTEL = 5587,
+ OpAbsUSubINTEL = 5588,
+ OpIAddSatINTEL = 5589,
+ OpUAddSatINTEL = 5590,
+ OpIAverageINTEL = 5591,
+ OpUAverageINTEL = 5592,
+ OpIAverageRoundedINTEL = 5593,
+ OpUAverageRoundedINTEL = 5594,
+ OpISubSatINTEL = 5595,
+ OpUSubSatINTEL = 5596,
+ OpIMul32x16INTEL = 5597,
+ OpUMul32x16INTEL = 5598,
+ OpConstantFunctionPointerINTEL = 5600,
+ OpFunctionPointerCallINTEL = 5601,
+ OpAsmTargetINTEL = 5609,
+ OpAsmINTEL = 5610,
+ OpAsmCallINTEL = 5611,
+ OpAtomicFMinEXT = 5614,
+ OpAtomicFMaxEXT = 5615,
+ OpAssumeTrueKHR = 5630,
+ OpExpectKHR = 5631,
+ OpDecorateString = 5632,
+ OpDecorateStringGOOGLE = 5632,
+ OpMemberDecorateString = 5633,
+ OpMemberDecorateStringGOOGLE = 5633,
+ OpVmeImageINTEL = 5699,
+ OpTypeVmeImageINTEL = 5700,
+ OpTypeAvcImePayloadINTEL = 5701,
+ OpTypeAvcRefPayloadINTEL = 5702,
+ OpTypeAvcSicPayloadINTEL = 5703,
+ OpTypeAvcMcePayloadINTEL = 5704,
+ OpTypeAvcMceResultINTEL = 5705,
+ OpTypeAvcImeResultINTEL = 5706,
+ OpTypeAvcImeResultSingleReferenceStreamoutINTEL = 5707,
+ OpTypeAvcImeResultDualReferenceStreamoutINTEL = 5708,
+ OpTypeAvcImeSingleReferenceStreaminINTEL = 5709,
+ OpTypeAvcImeDualReferenceStreaminINTEL = 5710,
+ OpTypeAvcRefResultINTEL = 5711,
+ OpTypeAvcSicResultINTEL = 5712,
+ OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL = 5713,
+ OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL = 5714,
+ OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL = 5715,
+ OpSubgroupAvcMceSetInterShapePenaltyINTEL = 5716,
+ OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL = 5717,
+ OpSubgroupAvcMceSetInterDirectionPenaltyINTEL = 5718,
+ OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL = 5719,
+ OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL = 5720,
+ OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL = 5721,
+ OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL = 5722,
+ OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL = 5723,
+ OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL = 5724,
+ OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL = 5725,
+ OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL = 5726,
+ OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL = 5727,
+ OpSubgroupAvcMceSetAcOnlyHaarINTEL = 5728,
+ OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL = 5729,
+ OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL = 5730,
+ OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL = 5731,
+ OpSubgroupAvcMceConvertToImePayloadINTEL = 5732,
+ OpSubgroupAvcMceConvertToImeResultINTEL = 5733,
+ OpSubgroupAvcMceConvertToRefPayloadINTEL = 5734,
+ OpSubgroupAvcMceConvertToRefResultINTEL = 5735,
+ OpSubgroupAvcMceConvertToSicPayloadINTEL = 5736,
+ OpSubgroupAvcMceConvertToSicResultINTEL = 5737,
+ OpSubgroupAvcMceGetMotionVectorsINTEL = 5738,
+ OpSubgroupAvcMceGetInterDistortionsINTEL = 5739,
+ OpSubgroupAvcMceGetBestInterDistortionsINTEL = 5740,
+ OpSubgroupAvcMceGetInterMajorShapeINTEL = 5741,
+ OpSubgroupAvcMceGetInterMinorShapeINTEL = 5742,
+ OpSubgroupAvcMceGetInterDirectionsINTEL = 5743,
+ OpSubgroupAvcMceGetInterMotionVectorCountINTEL = 5744,
+ OpSubgroupAvcMceGetInterReferenceIdsINTEL = 5745,
+ OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL = 5746,
+ OpSubgroupAvcImeInitializeINTEL = 5747,
+ OpSubgroupAvcImeSetSingleReferenceINTEL = 5748,
+ OpSubgroupAvcImeSetDualReferenceINTEL = 5749,
+ OpSubgroupAvcImeRefWindowSizeINTEL = 5750,
+ OpSubgroupAvcImeAdjustRefOffsetINTEL = 5751,
+ OpSubgroupAvcImeConvertToMcePayloadINTEL = 5752,
+ OpSubgroupAvcImeSetMaxMotionVectorCountINTEL = 5753,
+ OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL = 5754,
+ OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL = 5755,
+ OpSubgroupAvcImeSetWeightedSadINTEL = 5756,
+ OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL = 5757,
+ OpSubgroupAvcImeEvaluateWithDualReferenceINTEL = 5758,
+ OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL = 5759,
+ OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL = 5760,
+ OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL = 5761,
+ OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL = 5762,
+ OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL = 5763,
+ OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL = 5764,
+ OpSubgroupAvcImeConvertToMceResultINTEL = 5765,
+ OpSubgroupAvcImeGetSingleReferenceStreaminINTEL = 5766,
+ OpSubgroupAvcImeGetDualReferenceStreaminINTEL = 5767,
+ OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL = 5768,
+ OpSubgroupAvcImeStripDualReferenceStreamoutINTEL = 5769,
+ OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL = 5770,
+ OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL = 5771,
+ OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL = 5772,
+ OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL = 5773,
+ OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL = 5774,
+ OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL = 5775,
+ OpSubgroupAvcImeGetBorderReachedINTEL = 5776,
+ OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777,
+ OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778,
+ OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779,
+ OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL = 5780,
+ OpSubgroupAvcFmeInitializeINTEL = 5781,
+ OpSubgroupAvcBmeInitializeINTEL = 5782,
+ OpSubgroupAvcRefConvertToMcePayloadINTEL = 5783,
+ OpSubgroupAvcRefSetBidirectionalMixDisableINTEL = 5784,
+ OpSubgroupAvcRefSetBilinearFilterEnableINTEL = 5785,
+ OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL = 5786,
+ OpSubgroupAvcRefEvaluateWithDualReferenceINTEL = 5787,
+ OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL = 5788,
+ OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL = 5789,
+ OpSubgroupAvcRefConvertToMceResultINTEL = 5790,
+ OpSubgroupAvcSicInitializeINTEL = 5791,
+ OpSubgroupAvcSicConfigureSkcINTEL = 5792,
+ OpSubgroupAvcSicConfigureIpeLumaINTEL = 5793,
+ OpSubgroupAvcSicConfigureIpeLumaChromaINTEL = 5794,
+ OpSubgroupAvcSicGetMotionVectorMaskINTEL = 5795,
+ OpSubgroupAvcSicConvertToMcePayloadINTEL = 5796,
+ OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL = 5797,
+ OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL = 5798,
+ OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL = 5799,
+ OpSubgroupAvcSicSetBilinearFilterEnableINTEL = 5800,
+ OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL = 5801,
+ OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL = 5802,
+ OpSubgroupAvcSicEvaluateIpeINTEL = 5803,
+ OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL = 5804,
+ OpSubgroupAvcSicEvaluateWithDualReferenceINTEL = 5805,
+ OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL = 5806,
+ OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL = 5807,
+ OpSubgroupAvcSicConvertToMceResultINTEL = 5808,
+ OpSubgroupAvcSicGetIpeLumaShapeINTEL = 5809,
+ OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL = 5810,
+ OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL = 5811,
+ OpSubgroupAvcSicGetPackedIpeLumaModesINTEL = 5812,
+ OpSubgroupAvcSicGetIpeChromaModeINTEL = 5813,
+ OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
+ OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
+ OpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
+ OpVariableLengthArrayINTEL = 5818,
+ OpSaveMemoryINTEL = 5819,
+ OpRestoreMemoryINTEL = 5820,
+ OpArbitraryFloatSinCosPiINTEL = 5840,
+ OpArbitraryFloatCastINTEL = 5841,
+ OpArbitraryFloatCastFromIntINTEL = 5842,
+ OpArbitraryFloatCastToIntINTEL = 5843,
+ OpArbitraryFloatAddINTEL = 5846,
+ OpArbitraryFloatSubINTEL = 5847,
+ OpArbitraryFloatMulINTEL = 5848,
+ OpArbitraryFloatDivINTEL = 5849,
+ OpArbitraryFloatGTINTEL = 5850,
+ OpArbitraryFloatGEINTEL = 5851,
+ OpArbitraryFloatLTINTEL = 5852,
+ OpArbitraryFloatLEINTEL = 5853,
+ OpArbitraryFloatEQINTEL = 5854,
+ OpArbitraryFloatRecipINTEL = 5855,
+ OpArbitraryFloatRSqrtINTEL = 5856,
+ OpArbitraryFloatCbrtINTEL = 5857,
+ OpArbitraryFloatHypotINTEL = 5858,
+ OpArbitraryFloatSqrtINTEL = 5859,
+ OpArbitraryFloatLogINTEL = 5860,
+ OpArbitraryFloatLog2INTEL = 5861,
+ OpArbitraryFloatLog10INTEL = 5862,
+ OpArbitraryFloatLog1pINTEL = 5863,
+ OpArbitraryFloatExpINTEL = 5864,
+ OpArbitraryFloatExp2INTEL = 5865,
+ OpArbitraryFloatExp10INTEL = 5866,
+ OpArbitraryFloatExpm1INTEL = 5867,
+ OpArbitraryFloatSinINTEL = 5868,
+ OpArbitraryFloatCosINTEL = 5869,
+ OpArbitraryFloatSinCosINTEL = 5870,
+ OpArbitraryFloatSinPiINTEL = 5871,
+ OpArbitraryFloatCosPiINTEL = 5872,
+ OpArbitraryFloatASinINTEL = 5873,
+ OpArbitraryFloatASinPiINTEL = 5874,
+ OpArbitraryFloatACosINTEL = 5875,
+ OpArbitraryFloatACosPiINTEL = 5876,
+ OpArbitraryFloatATanINTEL = 5877,
+ OpArbitraryFloatATanPiINTEL = 5878,
+ OpArbitraryFloatATan2INTEL = 5879,
+ OpArbitraryFloatPowINTEL = 5880,
+ OpArbitraryFloatPowRINTEL = 5881,
+ OpArbitraryFloatPowNINTEL = 5882,
+ OpLoopControlINTEL = 5887,
+ OpAliasDomainDeclINTEL = 5911,
+ OpAliasScopeDeclINTEL = 5912,
+ OpAliasScopeListDeclINTEL = 5913,
+ OpFixedSqrtINTEL = 5923,
+ OpFixedRecipINTEL = 5924,
+ OpFixedRsqrtINTEL = 5925,
+ OpFixedSinINTEL = 5926,
+ OpFixedCosINTEL = 5927,
+ OpFixedSinCosINTEL = 5928,
+ OpFixedSinPiINTEL = 5929,
+ OpFixedCosPiINTEL = 5930,
+ OpFixedSinCosPiINTEL = 5931,
+ OpFixedLogINTEL = 5932,
+ OpFixedExpINTEL = 5933,
+ OpPtrCastToCrossWorkgroupINTEL = 5934,
+ OpCrossWorkgroupCastToPtrINTEL = 5938,
+ OpReadPipeBlockingINTEL = 5946,
+ OpWritePipeBlockingINTEL = 5947,
+ OpFPGARegINTEL = 5949,
+ OpRayQueryGetRayTMinKHR = 6016,
+ OpRayQueryGetRayFlagsKHR = 6017,
+ OpRayQueryGetIntersectionTKHR = 6018,
+ OpRayQueryGetIntersectionInstanceCustomIndexKHR = 6019,
+ OpRayQueryGetIntersectionInstanceIdKHR = 6020,
+ OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR = 6021,
+ OpRayQueryGetIntersectionGeometryIndexKHR = 6022,
+ OpRayQueryGetIntersectionPrimitiveIndexKHR = 6023,
+ OpRayQueryGetIntersectionBarycentricsKHR = 6024,
+ OpRayQueryGetIntersectionFrontFaceKHR = 6025,
+ OpRayQueryGetIntersectionCandidateAABBOpaqueKHR = 6026,
+ OpRayQueryGetIntersectionObjectRayDirectionKHR = 6027,
+ OpRayQueryGetIntersectionObjectRayOriginKHR = 6028,
+ OpRayQueryGetWorldRayDirectionKHR = 6029,
+ OpRayQueryGetWorldRayOriginKHR = 6030,
+ OpRayQueryGetIntersectionObjectToWorldKHR = 6031,
+ OpRayQueryGetIntersectionWorldToObjectKHR = 6032,
+ OpAtomicFAddEXT = 6035,
+ OpTypeBufferSurfaceINTEL = 6086,
+ OpTypeStructContinuedINTEL = 6090,
+ OpConstantCompositeContinuedINTEL = 6091,
+ OpSpecConstantCompositeContinuedINTEL = 6092,
+ OpControlBarrierArriveINTEL = 6142,
+ OpControlBarrierWaitINTEL = 6143,
+ OpGroupIMulKHR = 6401,
+ OpGroupFMulKHR = 6402,
+ OpGroupBitwiseAndKHR = 6403,
+ OpGroupBitwiseOrKHR = 6404,
+ OpGroupBitwiseXorKHR = 6405,
+ OpGroupLogicalAndKHR = 6406,
+ OpGroupLogicalOrKHR = 6407,
+ OpGroupLogicalXorKHR = 6408,
+ }
+ }
+}
+
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
index 8b63c397b0..b23d8a86c3 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
@@ -4754,6 +4754,461 @@
"extensions" : [ "SPV_KHR_shader_clock" ],
"version" : "None"
},
+ {
+ "opname" : "OpHitObjectRecordHitMotionNV",
+ "class" : "Reserved",
+ "opcode" : 5249,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'" },
+ { "kind" : "IdRef", "name" : "'InstanceId'" },
+ { "kind" : "IdRef", "name" : "'PrimitiveId'" },
+ { "kind" : "IdRef", "name" : "'GeometryIndex'" },
+ { "kind" : "IdRef", "name" : "'Hit Kind'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Offset'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Stride'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" },
+ { "kind" : "IdRef", "name" : "'Current Time'" },
+ { "kind" : "IdRef", "name" : "'HitObject Attributes'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordHitWithIndexMotionNV",
+ "class" : "Reserved",
+ "opcode" : 5250,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'" },
+ { "kind" : "IdRef", "name" : "'InstanceId'" },
+ { "kind" : "IdRef", "name" : "'PrimitiveId'" },
+ { "kind" : "IdRef", "name" : "'GeometryIndex'" },
+ { "kind" : "IdRef", "name" : "'Hit Kind'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Index'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" },
+ { "kind" : "IdRef", "name" : "'Current Time'" },
+ { "kind" : "IdRef", "name" : "'HitObject Attributes'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordMissMotionNV",
+ "class" : "Reserved",
+ "opcode" : 5251,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'SBT Index'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" },
+ { "kind" : "IdRef", "name" : "'Current Time'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetWorldToObjectNV",
+ "class" : "Reserved",
+ "opcode" : 5252,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetObjectToWorldNV",
+ "class" : "Reserved",
+ "opcode" : 5253,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetObjectRayDirectionNV",
+ "class" : "Reserved",
+ "opcode" : 5254,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetObjectRayOriginNV",
+ "class" : "Reserved",
+ "opcode" : 5255,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectTraceRayMotionNV",
+ "class" : "Reserved",
+ "opcode" : 5256,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'"},
+ { "kind" : "IdRef", "name" : "'RayFlags'"},
+ { "kind" : "IdRef", "name" : "'Cullmask'"},
+ { "kind" : "IdRef", "name" : "'SBT Record Offset'"},
+ { "kind" : "IdRef", "name" : "'SBT Record Stride'"},
+ { "kind" : "IdRef", "name" : "'Miss Index'"},
+ { "kind" : "IdRef", "name" : "'Origin'"},
+ { "kind" : "IdRef", "name" : "'TMin'"},
+ { "kind" : "IdRef", "name" : "'Direction'"},
+ { "kind" : "IdRef", "name" : "'TMax'"},
+ { "kind" : "IdRef", "name" : "'Time'"},
+ { "kind" : "IdRef", "name" : "'Payload'"}
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV", "RayTracingMotionBlurNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetShaderRecordBufferHandleNV",
+ "class" : "Reserved",
+ "opcode" : 5257,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetShaderBindingTableRecordIndexNV",
+ "class" : "Reserved",
+ "opcode" : 5258,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordEmptyNV",
+ "class" : "Reserved",
+ "opcode" : 5259,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectTraceRayNV",
+ "class" : "Reserved",
+ "opcode" : 5260,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'"},
+ { "kind" : "IdRef", "name" : "'RayFlags'"},
+ { "kind" : "IdRef", "name" : "'Cullmask'"},
+ { "kind" : "IdRef", "name" : "'SBT Record Offset'"},
+ { "kind" : "IdRef", "name" : "'SBT Record Stride'"},
+ { "kind" : "IdRef", "name" : "'Miss Index'"},
+ { "kind" : "IdRef", "name" : "'Origin'"},
+ { "kind" : "IdRef", "name" : "'TMin'"},
+ { "kind" : "IdRef", "name" : "'Direction'"},
+ { "kind" : "IdRef", "name" : "'TMax'"},
+ { "kind" : "IdRef", "name" : "'Payload'"}
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordHitNV",
+ "class" : "Reserved",
+ "opcode" : 5261,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'" },
+ { "kind" : "IdRef", "name" : "'InstanceId'" },
+ { "kind" : "IdRef", "name" : "'PrimitiveId'" },
+ { "kind" : "IdRef", "name" : "'GeometryIndex'" },
+ { "kind" : "IdRef", "name" : "'Hit Kind'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Offset'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Stride'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" },
+ { "kind" : "IdRef", "name" : "'HitObject Attributes'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordHitWithIndexNV",
+ "class" : "Reserved",
+ "opcode" : 5262,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Acceleration Structure'" },
+ { "kind" : "IdRef", "name" : "'InstanceId'" },
+ { "kind" : "IdRef", "name" : "'PrimitiveId'" },
+ { "kind" : "IdRef", "name" : "'GeometryIndex'" },
+ { "kind" : "IdRef", "name" : "'Hit Kind'" },
+ { "kind" : "IdRef", "name" : "'SBT Record Index'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" },
+ { "kind" : "IdRef", "name" : "'HitObject Attributes'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectRecordMissNV",
+ "class" : "Reserved",
+ "opcode" : 5263,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'SBT Index'" },
+ { "kind" : "IdRef", "name" : "'Origin'" },
+ { "kind" : "IdRef", "name" : "'TMin'" },
+ { "kind" : "IdRef", "name" : "'Direction'" },
+ { "kind" : "IdRef", "name" : "'TMax'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectExecuteShaderNV",
+ "class" : "Reserved",
+ "opcode" : 5264,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Payload'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetCurrentTimeNV",
+ "class" : "Reserved",
+ "opcode" : 5265,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetAttributesNV",
+ "class" : "Reserved",
+ "opcode" : 5266,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "name" : "'Hit Object Attribute'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetHitKindNV",
+ "class" : "Reserved",
+ "opcode" : 5267,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetPrimitiveIndexNV",
+ "class" : "Reserved",
+ "opcode" : 5268,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetGeometryIndexNV",
+ "class" : "Reserved",
+ "opcode" : 5269,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetInstanceIdNV",
+ "class" : "Reserved",
+ "opcode" : 5270,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetInstanceCustomIndexNV",
+ "class" : "Reserved",
+ "opcode" : 5271,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetWorldRayDirectionNV",
+ "class" : "Reserved",
+ "opcode" : 5272,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetWorldRayOriginNV",
+ "class" : "Reserved",
+ "opcode" : 5273,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetRayTMaxNV",
+ "class" : "Reserved",
+ "opcode" : 5274,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectGetRayTMinNV",
+ "class" : "Reserved",
+ "opcode" : 5275,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectIsEmptyNV",
+ "class" : "Reserved",
+ "opcode" : 5276,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectIsHitNV",
+ "class" : "Reserved",
+ "opcode" : 5277,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpHitObjectIsMissNV",
+ "class" : "Reserved",
+ "opcode" : 5278,
+ "operands" : [
+ { "kind" : "IdResultType"},
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Hit Object'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpReorderThreadWithHitObjectNV",
+ "class" : "Reserved",
+ "opcode" : 5279,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hit Object'" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Hint'" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Bits'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpReorderThreadWithHintNV",
+ "class" : "Reserved",
+ "opcode" : 5280,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Hint'" },
+ { "kind" : "IdRef", "name" : "'Bits'" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpTypeHitObjectNV",
+ "class" : "Reserved",
+ "opcode" : 5281,
+ "operands" : [
+ { "kind" : "IdResult" }
+ ],
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
{
"opname" : "OpImageSampleFootprintNV",
"class" : "Image",
@@ -4771,6 +5226,30 @@
"extensions" : [ "SPV_NV_shader_image_footprint" ],
"version" : "None"
},
+ {
+ "opname" : "OpEmitMeshTasksEXT",
+ "class" : "Reserved",
+ "opcode" : 5294,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Group Count X'" },
+ { "kind" : "IdRef", "name" : "'Group Count Y'" },
+ { "kind" : "IdRef", "name" : "'Group Count Z'" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Payload'" }
+ ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSetMeshOutputsEXT",
+ "class" : "Reserved",
+ "opcode" : 5295,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Vertex Count'" },
+ { "kind" : "IdRef", "name" : "'Primitive Count'" }
+ ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
{
"opname" : "OpGroupNonUniformPartitionNV",
"class" : "Non-Uniform",
@@ -8996,7 +9475,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9006,7 +9484,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9016,7 +9493,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9026,7 +9502,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9036,7 +9511,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9046,7 +9520,6 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
@@ -9056,17 +9529,30 @@
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
},
{
"enumerant" : "NoFusionINTEL",
"value" : "0x800000",
+ "capabilities" : [ "FPGALoopControlsINTEL" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "LoopCountINTEL",
+ "value" : "0x1000000",
+ "parameters" : [
+ { "kind" : "LiteralInteger" }
+ ],
+ "capabilities" : [ "FPGALoopControlsINTEL" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MaxReinvocationDelayINTEL",
+ "value" : "0x2000000",
"parameters" : [
{ "kind" : "LiteralInteger" }
],
"capabilities" : [ "FPGALoopControlsINTEL" ],
- "extensions" : [ "SPV_INTEL_fpga_loop_controls" ],
"version" : "None"
}
]
@@ -9385,6 +9871,12 @@
"value" : "0x0200",
"capabilities" : [ "RayTraversalPrimitiveCullingKHR" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "ForceOpacityMicromap2StateEXT",
+ "value" : "0x0400",
+ "capabilities" : [ "RayTracingOpacityMicromapEXT" ],
+ "version" : "None"
}
]
},
@@ -9578,6 +10070,18 @@
"value" : 5318,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "TaskEXT",
+ "value" : 5364,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MeshEXT",
+ "value" : 5365,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
}
]
},
@@ -9793,7 +10297,7 @@
{
"enumerant" : "OutputVertices",
"value" : 26,
- "capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV" ],
+ "capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
{ "kind" : "LiteralInteger", "name" : "'Vertex count'" }
]
@@ -9801,7 +10305,7 @@
{
"enumerant" : "OutputPoints",
"value" : 27,
- "capabilities" : [ "Geometry", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "OutputLineStrip",
@@ -9950,6 +10454,13 @@
],
"version" : "1.4"
},
+ {
+ "enumerant": "EarlyAndLateFragmentTestsAMD",
+ "value": 5017,
+ "capabilities": [ "Shader" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests" ],
+ "version": "None"
+ },
{
"enumerant" : "StencilRefReplacingEXT",
"value" : 5027,
@@ -9957,21 +10468,80 @@
"extensions" : [ "SPV_EXT_shader_stencil_export" ],
"version" : "None"
},
+ {
+ "enumerant": "StencilRefUnchangedFrontAMD",
+ "value": 5079,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefGreaterFrontAMD",
+ "value": 5080,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefLessFrontAMD",
+ "value": 5081,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefUnchangedBackAMD",
+ "value": 5082,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefGreaterBackAMD",
+ "value": 5083,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefLessBackAMD",
+ "value": 5084,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
{
"enumerant" : "OutputLinesNV",
"value" : 5269,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputLinesEXT",
+ "value" : 5269,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
"enumerant" : "OutputPrimitivesNV",
"value" : 5270,
- "capabilities" : [ "MeshShadingNV" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
{ "kind" : "LiteralInteger", "name" : "'Primitive count'" }
],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputPrimitivesEXT",
+ "value" : 5270,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Primitive count'" }
+ ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -9991,8 +10561,15 @@
{
"enumerant" : "OutputTrianglesNV",
"value" : 5298,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputTrianglesEXT",
+ "value" : 5298,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -10130,6 +10707,15 @@
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"version" : "None"
},
+ {
+ "enumerant" : "StreamingInterfaceINTEL",
+ "value" : 6154,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'StallFreeReturn'" }
+ ],
+ "capabilities" : [ "FPGAKernelAttributesINTEL" ],
+ "version" : "None"
+ },
{
"enumerant" : "NamedBarrierCountINTEL",
"value" : 6417,
@@ -10307,6 +10893,19 @@
"capabilities" : [ "PhysicalStorageBufferAddresses" ],
"version" : "1.5"
},
+ {
+ "enumerant" : "HitObjectAttributeNV",
+ "value" : 5385,
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "TaskPayloadWorkgroupEXT",
+ "value" : 5402,
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "1.4"
+ },
{
"enumerant" : "CodeSectionINTEL",
"value" : 5605,
@@ -11062,6 +11661,11 @@
"enumerant" : "NoReadWrite",
"value" : 7,
"capabilities" : [ "Kernel" ]
+ },
+ {
+ "enumerant" : "RuntimeAlignedINTEL",
+ "value" : 5940,
+ "capabilities" : [ "RuntimeAlignedAttributeINTEL" ]
}
]
},
@@ -11422,8 +12026,15 @@
{
"enumerant" : "PerPrimitiveNV",
"value" : 5271,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PerPrimitiveEXT",
+ "value" : 5271,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -11436,8 +12047,8 @@
{
"enumerant" : "PerTaskNV",
"value" : 5273,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -11495,6 +12106,12 @@
"extensions" : [ "SPV_EXT_physical_storage_buffer" ],
"version" : "1.5"
},
+ {
+ "enumerant" : "HitObjectShaderRecordBufferNV",
+ "value" : 5386,
+ "capabilities" : [ "ShaderInvocationReorderNV" ],
+ "version" : "None"
+ },
{
"enumerant" : "BindlessSamplerNV",
"value" : 5398,
@@ -11800,6 +12417,16 @@
"capabilities" : [ "LoopFuseINTEL" ],
"version" : "None"
},
+ {
+ "enumerant" : "MathOpDSPModeINTEL",
+ "value" : 5909,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Mode'" },
+ { "kind" : "LiteralInteger", "name" : "'Propagate'" }
+ ],
+ "capabilities" : [ "FPGADSPControlINTEL" ],
+ "version" : "None"
+ },
{
"enumerant" : "AliasScopeINTEL",
"value" : 5914,
@@ -11818,6 +12445,33 @@
"capabilities" : [ "MemoryAccessAliasingINTEL" ],
"version" : "None"
},
+ {
+ "enumerant" : "InitiationIntervalINTEL",
+ "value" : 5917,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Cycles'" }
+ ],
+ "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MaxConcurrencyINTEL",
+ "value" : 5918,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Invocations'" }
+ ],
+ "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PipelineEnableINTEL",
+ "value" : 5919,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Enable'" }
+ ],
+ "capabilities" : [ "FPGAInvocationPipeliningAttributesINTEL" ],
+ "version" : "None"
+ },
{
"enumerant" : "BufferLocationINTEL",
"value" : 5921,
@@ -11903,7 +12557,7 @@
{
"enumerant" : "PrimitiveId",
"value" : 7,
- "capabilities" : [ "Geometry", "Tessellation", "RayTracingNV", "RayTracingKHR", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "Tessellation", "RayTracingNV", "RayTracingKHR", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "InvocationId",
@@ -11913,12 +12567,12 @@
{
"enumerant" : "Layer",
"value" : 9,
- "capabilities" : [ "Geometry", "ShaderLayer", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "ShaderLayer", "ShaderViewportIndexLayerEXT", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "ViewportIndex",
"value" : 10,
- "capabilities" : [ "MultiViewport", "ShaderViewportIndex", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ]
+ "capabilities" : [ "MultiViewport", "ShaderViewportIndex", "ShaderViewportIndexLayerEXT", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "TessLevelOuter",
@@ -12069,6 +12723,31 @@
"value" : 43,
"capabilities" : [ "Shader" ]
},
+ {
+ "enumerant" : "CoreIDARM",
+ "value" : 4160,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "CoreCountARM",
+ "value" : 4161,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "CoreMaxIDARM",
+ "value" : 4162,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "WarpIDARM",
+ "value" : 4163,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "WarpMaxIDARM",
+ "value" : 4164,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
{
"enumerant" : "SubgroupEqMask",
"value" : 4416,
@@ -12151,8 +12830,8 @@
{
"enumerant" : "DrawIndex",
"value" : 4426,
- "capabilities" : [ "DrawParameters", "MeshShadingNV" ],
- "extensions" : [ "SPV_KHR_shader_draw_parameters", "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "DrawParameters", "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_KHR_shader_draw_parameters", "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "1.3"
},
{
@@ -12386,6 +13065,34 @@
"extensions" : [ "SPV_NV_shading_rate", "SPV_EXT_fragment_invocation_density" ],
"version" : "None"
},
+ {
+ "enumerant" : "PrimitivePointIndicesEXT",
+ "value" : 5294,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PrimitiveLineIndicesEXT",
+ "value" : 5295,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PrimitiveTriangleIndicesEXT",
+ "value" : 5296,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CullPrimitiveEXT",
+ "value" : 5299,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
{
"enumerant" : "LaunchIdNV",
"value" : 5319,
@@ -13092,6 +13799,11 @@
"value" : 71,
"version" : "1.6"
},
+ {
+ "enumerant" : "CoreBuiltinsARM",
+ "value" : 4165,
+ "extensions" : [ "SPV_ARM_core_builtins" ]
+ },
{
"enumerant" : "FragmentShadingRateKHR",
"value" : 4422,
@@ -13417,6 +14129,13 @@
"extensions" : [ "SPV_NV_shader_image_footprint" ],
"version" : "None"
},
+ {
+ "enumerant" : "MeshShadingEXT",
+ "value" : 5283,
+ "capabilities" : [ "Shader" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
{
"enumerant" : "FragmentBarycentricKHR",
"value" : 5284,
@@ -13722,6 +14441,20 @@
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
"version" : "1.6"
},
+ {
+ "enumerant" : "RayTracingOpacityMicromapEXT",
+ "value" : 5381,
+ "capabilities" : [ "RayQueryKHR","RayTracingKHR" ],
+ "extensions" : [ "SPV_EXT_opacity_micromap" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "ShaderInvocationReorderNV",
+ "value" : 5383,
+ "capabilities" : [ "RayTracingKHR" ],
+ "extensions" : [ "SPV_NV_shader_invocation_reorder" ],
+ "version" : "None"
+ },
{
"enumerant" : "BindlessTextureNV",
"value" : 5390,
@@ -13923,12 +14656,24 @@
"extensions" : [ "SPV_INTEL_loop_fuse" ],
"version" : "None"
},
+ {
+ "enumerant" : "FPGADSPControlINTEL",
+ "value" : 5908,
+ "extensions" : [ "SPV_INTEL_fpga_dsp_control" ],
+ "version" : "None"
+ },
{
"enumerant" : "MemoryAccessAliasingINTEL",
"value" : 5910,
"extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
"version" : "None"
},
+ {
+ "enumerant" : "FPGAInvocationPipeliningAttributesINTEL",
+ "value" : 5916,
+ "extensions" : [ "SPV_INTEL_fpga_invocation_pipelining_attributes" ],
+ "version" : "None"
+ },
{
"enumerant" : "FPGABufferLocationINTEL",
"value" : 5920,
@@ -13947,6 +14692,12 @@
"extensions" : [ "SPV_INTEL_usm_storage_classes" ],
"version" : "None"
},
+ {
+ "enumerant" : "RuntimeAlignedAttributeINTEL",
+ "value" : 5939,
+ "extensions" : [ "SPV_INTEL_runtime_aligned" ],
+ "version" : "None"
+ },
{
"enumerant" : "IOPipesINTEL",
"value" : 5943,
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs
index 73701e0e1d..f836fc9092 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.cs
@@ -90,6 +90,8 @@ namespace Spv
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
+ TaskEXT = 5364,
+ MeshEXT = 5365,
}
public enum AddressingModel
@@ -157,11 +159,21 @@ namespace Spv
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
+ StencilRefUnchangedFrontAMD = 5079,
+ StencilRefGreaterFrontAMD = 5080,
+ StencilRefLessFrontAMD = 5081,
+ StencilRefUnchangedBackAMD = 5082,
+ StencilRefGreaterBackAMD = 5083,
+ StencilRefLessBackAMD = 5084,
+ OutputLinesEXT = 5269,
OutputLinesNV = 5269,
+ OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
+ OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
@@ -179,6 +191,7 @@ namespace Spv
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
+ StreamingInterfaceINTEL = 6154,
NamedBarrierCountINTEL = 6417,
}
@@ -211,6 +224,8 @@ namespace Spv
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
+ HitObjectAttributeNV = 5385,
+ TaskPayloadWorkgroupEXT = 5402,
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
@@ -437,6 +452,7 @@ namespace Spv
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
+ RuntimeAlignedINTEL = 5940,
}
public enum Decoration
@@ -495,6 +511,7 @@ namespace Spv
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
+ PerPrimitiveEXT = 5271,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
@@ -506,6 +523,7 @@ namespace Spv
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
+ HitObjectShaderRecordBufferNV = 5386,
BindlessSamplerNV = 5398,
BindlessImageNV = 5399,
BoundSamplerNV = 5400,
@@ -544,8 +562,12 @@ namespace Spv
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
+ MathOpDSPModeINTEL = 5909,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
+ InitiationIntervalINTEL = 5917,
+ MaxConcurrencyINTEL = 5918,
+ PipelineEnableINTEL = 5919,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
@@ -597,6 +619,11 @@ namespace Spv
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
+ CoreIDARM = 4160,
+ CoreCountARM = 4161,
+ CoreMaxIDARM = 4162,
+ WarpIDARM = 4163,
+ WarpMaxIDARM = 4164,
SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416,
SubgroupGeMask = 4417,
@@ -644,6 +671,10 @@ namespace Spv
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
+ PrimitivePointIndicesEXT = 5294,
+ PrimitiveLineIndicesEXT = 5295,
+ PrimitiveTriangleIndicesEXT = 5296,
+ CullPrimitiveEXT = 5299,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
@@ -712,6 +743,8 @@ namespace Spv
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
NoFusionINTEL = 23,
+ LoopCountINTEL = 24,
+ MaxReinvocationDelayINTEL = 25,
}
public enum LoopControlMask
@@ -734,6 +767,8 @@ namespace Spv
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
NoFusionINTEL = 0x00800000,
+ LoopCountINTEL = 0x01000000,
+ MaxReinvocationDelayINTEL = 0x02000000,
}
public enum FunctionControlShift
@@ -942,6 +977,7 @@ namespace Spv
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
+ CoreBuiltinsARM = 4165,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -990,6 +1026,7 @@ namespace Spv
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
+ MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
@@ -1037,6 +1074,8 @@ namespace Spv
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
+ RayTracingOpacityMicromapEXT = 5381,
+ ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
@@ -1070,10 +1109,13 @@ namespace Spv
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
+ FPGADSPControlINTEL = 5908,
MemoryAccessAliasingINTEL = 5910,
+ FPGAInvocationPipeliningAttributesINTEL = 5916,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
+ RuntimeAlignedAttributeINTEL = 5939,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
@@ -1110,6 +1152,7 @@ namespace Spv
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
+ ForceOpacityMicromap2StateEXT = 10,
}
public enum RayFlagsMask
@@ -1125,6 +1168,7 @@ namespace Spv
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
+ ForceOpacityMicromap2StateEXT = 0x00000400,
}
public enum RayQueryIntersection
@@ -1590,7 +1634,42 @@ namespace Spv
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h
index 38f558748c..366b55608e 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.h
@@ -98,6 +98,8 @@ typedef enum SpvExecutionModel_ {
SpvExecutionModelMissNV = 5317,
SpvExecutionModelCallableKHR = 5318,
SpvExecutionModelCallableNV = 5318,
+ SpvExecutionModelTaskEXT = 5364,
+ SpvExecutionModelMeshEXT = 5365,
SpvExecutionModelMax = 0x7fffffff,
} SpvExecutionModel;
@@ -165,11 +167,21 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeSignedZeroInfNanPreserve = 4461,
SpvExecutionModeRoundingModeRTE = 4462,
SpvExecutionModeRoundingModeRTZ = 4463,
+ SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
SpvExecutionModeStencilRefReplacingEXT = 5027,
+ SpvExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ SpvExecutionModeStencilRefGreaterFrontAMD = 5080,
+ SpvExecutionModeStencilRefLessFrontAMD = 5081,
+ SpvExecutionModeStencilRefUnchangedBackAMD = 5082,
+ SpvExecutionModeStencilRefGreaterBackAMD = 5083,
+ SpvExecutionModeStencilRefLessBackAMD = 5084,
+ SpvExecutionModeOutputLinesEXT = 5269,
SpvExecutionModeOutputLinesNV = 5269,
+ SpvExecutionModeOutputPrimitivesEXT = 5270,
SpvExecutionModeOutputPrimitivesNV = 5270,
SpvExecutionModeDerivativeGroupQuadsNV = 5289,
SpvExecutionModeDerivativeGroupLinearNV = 5290,
+ SpvExecutionModeOutputTrianglesEXT = 5298,
SpvExecutionModeOutputTrianglesNV = 5298,
SpvExecutionModePixelInterlockOrderedEXT = 5366,
SpvExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -187,6 +199,7 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeNoGlobalOffsetINTEL = 5895,
SpvExecutionModeNumSIMDWorkitemsINTEL = 5896,
SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+ SpvExecutionModeStreamingInterfaceINTEL = 6154,
SpvExecutionModeNamedBarrierCountINTEL = 6417,
SpvExecutionModeMax = 0x7fffffff,
} SpvExecutionMode;
@@ -219,6 +232,8 @@ typedef enum SpvStorageClass_ {
SpvStorageClassShaderRecordBufferNV = 5343,
SpvStorageClassPhysicalStorageBuffer = 5349,
SpvStorageClassPhysicalStorageBufferEXT = 5349,
+ SpvStorageClassHitObjectAttributeNV = 5385,
+ SpvStorageClassTaskPayloadWorkgroupEXT = 5402,
SpvStorageClassCodeSectionINTEL = 5605,
SpvStorageClassDeviceOnlyINTEL = 5936,
SpvStorageClassHostOnlyINTEL = 5937,
@@ -443,6 +458,7 @@ typedef enum SpvFunctionParameterAttribute_ {
SpvFunctionParameterAttributeNoCapture = 5,
SpvFunctionParameterAttributeNoWrite = 6,
SpvFunctionParameterAttributeNoReadWrite = 7,
+ SpvFunctionParameterAttributeRuntimeAlignedINTEL = 5940,
SpvFunctionParameterAttributeMax = 0x7fffffff,
} SpvFunctionParameterAttribute;
@@ -501,6 +517,7 @@ typedef enum SpvDecoration_ {
SpvDecorationPassthroughNV = 5250,
SpvDecorationViewportRelativeNV = 5252,
SpvDecorationSecondaryViewportRelativeNV = 5256,
+ SpvDecorationPerPrimitiveEXT = 5271,
SpvDecorationPerPrimitiveNV = 5271,
SpvDecorationPerViewNV = 5272,
SpvDecorationPerTaskNV = 5273,
@@ -512,6 +529,7 @@ typedef enum SpvDecoration_ {
SpvDecorationRestrictPointerEXT = 5355,
SpvDecorationAliasedPointer = 5356,
SpvDecorationAliasedPointerEXT = 5356,
+ SpvDecorationHitObjectShaderRecordBufferNV = 5386,
SpvDecorationBindlessSamplerNV = 5398,
SpvDecorationBindlessImageNV = 5399,
SpvDecorationBoundSamplerNV = 5400,
@@ -550,8 +568,12 @@ typedef enum SpvDecoration_ {
SpvDecorationPrefetchINTEL = 5902,
SpvDecorationStallEnableINTEL = 5905,
SpvDecorationFuseLoopsInFunctionINTEL = 5907,
+ SpvDecorationMathOpDSPModeINTEL = 5909,
SpvDecorationAliasScopeINTEL = 5914,
SpvDecorationNoAliasINTEL = 5915,
+ SpvDecorationInitiationIntervalINTEL = 5917,
+ SpvDecorationMaxConcurrencyINTEL = 5918,
+ SpvDecorationPipelineEnableINTEL = 5919,
SpvDecorationBufferLocationINTEL = 5921,
SpvDecorationIOPipeStorageINTEL = 5944,
SpvDecorationFunctionFloatingPointModeINTEL = 6080,
@@ -603,6 +625,11 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInSubgroupLocalInvocationId = 41,
SpvBuiltInVertexIndex = 42,
SpvBuiltInInstanceIndex = 43,
+ SpvBuiltInCoreIDARM = 4160,
+ SpvBuiltInCoreCountARM = 4161,
+ SpvBuiltInCoreMaxIDARM = 4162,
+ SpvBuiltInWarpIDARM = 4163,
+ SpvBuiltInWarpMaxIDARM = 4164,
SpvBuiltInSubgroupEqMask = 4416,
SpvBuiltInSubgroupEqMaskKHR = 4416,
SpvBuiltInSubgroupGeMask = 4417,
@@ -650,6 +677,10 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInFragmentSizeNV = 5292,
SpvBuiltInFragInvocationCountEXT = 5293,
SpvBuiltInInvocationsPerPixelNV = 5293,
+ SpvBuiltInPrimitivePointIndicesEXT = 5294,
+ SpvBuiltInPrimitiveLineIndicesEXT = 5295,
+ SpvBuiltInPrimitiveTriangleIndicesEXT = 5296,
+ SpvBuiltInCullPrimitiveEXT = 5299,
SpvBuiltInLaunchIdKHR = 5319,
SpvBuiltInLaunchIdNV = 5319,
SpvBuiltInLaunchSizeKHR = 5320,
@@ -717,6 +748,8 @@ typedef enum SpvLoopControlShift_ {
SpvLoopControlMaxInterleavingINTELShift = 21,
SpvLoopControlSpeculatedIterationsINTELShift = 22,
SpvLoopControlNoFusionINTELShift = 23,
+ SpvLoopControlLoopCountINTELShift = 24,
+ SpvLoopControlMaxReinvocationDelayINTELShift = 25,
SpvLoopControlMax = 0x7fffffff,
} SpvLoopControlShift;
@@ -739,6 +772,8 @@ typedef enum SpvLoopControlMask_ {
SpvLoopControlMaxInterleavingINTELMask = 0x00200000,
SpvLoopControlSpeculatedIterationsINTELMask = 0x00400000,
SpvLoopControlNoFusionINTELMask = 0x00800000,
+ SpvLoopControlLoopCountINTELMask = 0x01000000,
+ SpvLoopControlMaxReinvocationDelayINTELMask = 0x02000000,
} SpvLoopControlMask;
typedef enum SpvFunctionControlShift_ {
@@ -942,6 +977,7 @@ typedef enum SpvCapability_ {
SpvCapabilityShaderLayer = 69,
SpvCapabilityShaderViewportIndex = 70,
SpvCapabilityUniformDecoration = 71,
+ SpvCapabilityCoreBuiltinsARM = 4165,
SpvCapabilityFragmentShadingRateKHR = 4422,
SpvCapabilitySubgroupBallotKHR = 4423,
SpvCapabilityDrawParameters = 4427,
@@ -990,6 +1026,7 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentFullyCoveredEXT = 5265,
SpvCapabilityMeshShadingNV = 5266,
SpvCapabilityImageFootprintNV = 5282,
+ SpvCapabilityMeshShadingEXT = 5283,
SpvCapabilityFragmentBarycentricKHR = 5284,
SpvCapabilityFragmentBarycentricNV = 5284,
SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
@@ -1037,6 +1074,8 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentShaderPixelInterlockEXT = 5378,
SpvCapabilityDemoteToHelperInvocation = 5379,
SpvCapabilityDemoteToHelperInvocationEXT = 5379,
+ SpvCapabilityRayTracingOpacityMicromapEXT = 5381,
+ SpvCapabilityShaderInvocationReorderNV = 5383,
SpvCapabilityBindlessTextureNV = 5390,
SpvCapabilitySubgroupShuffleINTEL = 5568,
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
@@ -1070,10 +1109,13 @@ typedef enum SpvCapability_ {
SpvCapabilityFPGAMemoryAccessesINTEL = 5898,
SpvCapabilityFPGAClusterAttributesINTEL = 5904,
SpvCapabilityLoopFuseINTEL = 5906,
+ SpvCapabilityFPGADSPControlINTEL = 5908,
SpvCapabilityMemoryAccessAliasingINTEL = 5910,
+ SpvCapabilityFPGAInvocationPipeliningAttributesINTEL = 5916,
SpvCapabilityFPGABufferLocationINTEL = 5920,
SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922,
SpvCapabilityUSMStorageClassesINTEL = 5935,
+ SpvCapabilityRuntimeAlignedAttributeINTEL = 5939,
SpvCapabilityIOPipesINTEL = 5943,
SpvCapabilityBlockingPipesINTEL = 5945,
SpvCapabilityFPGARegINTEL = 5948,
@@ -1110,6 +1152,7 @@ typedef enum SpvRayFlagsShift_ {
SpvRayFlagsCullNoOpaqueKHRShift = 7,
SpvRayFlagsSkipTrianglesKHRShift = 8,
SpvRayFlagsSkipAABBsKHRShift = 9,
+ SpvRayFlagsForceOpacityMicromap2StateEXTShift = 10,
SpvRayFlagsMax = 0x7fffffff,
} SpvRayFlagsShift;
@@ -1125,6 +1168,7 @@ typedef enum SpvRayFlagsMask_ {
SpvRayFlagsCullNoOpaqueKHRMask = 0x00000080,
SpvRayFlagsSkipTrianglesKHRMask = 0x00000100,
SpvRayFlagsSkipAABBsKHRMask = 0x00000200,
+ SpvRayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
} SpvRayFlagsMask;
typedef enum SpvRayQueryIntersection_ {
@@ -1588,7 +1632,42 @@ typedef enum SpvOp_ {
SpvOpFragmentMaskFetchAMD = 5011,
SpvOpFragmentFetchAMD = 5012,
SpvOpReadClockKHR = 5056,
+ SpvOpHitObjectRecordHitMotionNV = 5249,
+ SpvOpHitObjectRecordHitWithIndexMotionNV = 5250,
+ SpvOpHitObjectRecordMissMotionNV = 5251,
+ SpvOpHitObjectGetWorldToObjectNV = 5252,
+ SpvOpHitObjectGetObjectToWorldNV = 5253,
+ SpvOpHitObjectGetObjectRayDirectionNV = 5254,
+ SpvOpHitObjectGetObjectRayOriginNV = 5255,
+ SpvOpHitObjectTraceRayMotionNV = 5256,
+ SpvOpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ SpvOpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ SpvOpHitObjectRecordEmptyNV = 5259,
+ SpvOpHitObjectTraceRayNV = 5260,
+ SpvOpHitObjectRecordHitNV = 5261,
+ SpvOpHitObjectRecordHitWithIndexNV = 5262,
+ SpvOpHitObjectRecordMissNV = 5263,
+ SpvOpHitObjectExecuteShaderNV = 5264,
+ SpvOpHitObjectGetCurrentTimeNV = 5265,
+ SpvOpHitObjectGetAttributesNV = 5266,
+ SpvOpHitObjectGetHitKindNV = 5267,
+ SpvOpHitObjectGetPrimitiveIndexNV = 5268,
+ SpvOpHitObjectGetGeometryIndexNV = 5269,
+ SpvOpHitObjectGetInstanceIdNV = 5270,
+ SpvOpHitObjectGetInstanceCustomIndexNV = 5271,
+ SpvOpHitObjectGetWorldRayDirectionNV = 5272,
+ SpvOpHitObjectGetWorldRayOriginNV = 5273,
+ SpvOpHitObjectGetRayTMaxNV = 5274,
+ SpvOpHitObjectGetRayTMinNV = 5275,
+ SpvOpHitObjectIsEmptyNV = 5276,
+ SpvOpHitObjectIsHitNV = 5277,
+ SpvOpHitObjectIsMissNV = 5278,
+ SpvOpReorderThreadWithHitObjectNV = 5279,
+ SpvOpReorderThreadWithHintNV = 5280,
+ SpvOpTypeHitObjectNV = 5281,
SpvOpImageSampleFootprintNV = 5283,
+ SpvOpEmitMeshTasksEXT = 5294,
+ SpvOpSetMeshOutputsEXT = 5295,
SpvOpGroupNonUniformPartitionNV = 5296,
SpvOpWritePackedPrimitiveIndices4x8NV = 5299,
SpvOpReportIntersectionKHR = 5334,
@@ -2261,7 +2340,42 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp
index 48d93d64c3..65d84e2abb 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp
@@ -94,6 +94,8 @@ enum ExecutionModel {
ExecutionModelMissNV = 5317,
ExecutionModelCallableKHR = 5318,
ExecutionModelCallableNV = 5318,
+ ExecutionModelTaskEXT = 5364,
+ ExecutionModelMeshEXT = 5365,
ExecutionModelMax = 0x7fffffff,
};
@@ -161,11 +163,21 @@ enum ExecutionMode {
ExecutionModeSignedZeroInfNanPreserve = 4461,
ExecutionModeRoundingModeRTE = 4462,
ExecutionModeRoundingModeRTZ = 4463,
+ ExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
ExecutionModeStencilRefReplacingEXT = 5027,
+ ExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ ExecutionModeStencilRefGreaterFrontAMD = 5080,
+ ExecutionModeStencilRefLessFrontAMD = 5081,
+ ExecutionModeStencilRefUnchangedBackAMD = 5082,
+ ExecutionModeStencilRefGreaterBackAMD = 5083,
+ ExecutionModeStencilRefLessBackAMD = 5084,
+ ExecutionModeOutputLinesEXT = 5269,
ExecutionModeOutputLinesNV = 5269,
+ ExecutionModeOutputPrimitivesEXT = 5270,
ExecutionModeOutputPrimitivesNV = 5270,
ExecutionModeDerivativeGroupQuadsNV = 5289,
ExecutionModeDerivativeGroupLinearNV = 5290,
+ ExecutionModeOutputTrianglesEXT = 5298,
ExecutionModeOutputTrianglesNV = 5298,
ExecutionModePixelInterlockOrderedEXT = 5366,
ExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -183,6 +195,7 @@ enum ExecutionMode {
ExecutionModeNoGlobalOffsetINTEL = 5895,
ExecutionModeNumSIMDWorkitemsINTEL = 5896,
ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+ ExecutionModeStreamingInterfaceINTEL = 6154,
ExecutionModeNamedBarrierCountINTEL = 6417,
ExecutionModeMax = 0x7fffffff,
};
@@ -215,6 +228,8 @@ enum StorageClass {
StorageClassShaderRecordBufferNV = 5343,
StorageClassPhysicalStorageBuffer = 5349,
StorageClassPhysicalStorageBufferEXT = 5349,
+ StorageClassHitObjectAttributeNV = 5385,
+ StorageClassTaskPayloadWorkgroupEXT = 5402,
StorageClassCodeSectionINTEL = 5605,
StorageClassDeviceOnlyINTEL = 5936,
StorageClassHostOnlyINTEL = 5937,
@@ -439,6 +454,7 @@ enum FunctionParameterAttribute {
FunctionParameterAttributeNoCapture = 5,
FunctionParameterAttributeNoWrite = 6,
FunctionParameterAttributeNoReadWrite = 7,
+ FunctionParameterAttributeRuntimeAlignedINTEL = 5940,
FunctionParameterAttributeMax = 0x7fffffff,
};
@@ -497,6 +513,7 @@ enum Decoration {
DecorationPassthroughNV = 5250,
DecorationViewportRelativeNV = 5252,
DecorationSecondaryViewportRelativeNV = 5256,
+ DecorationPerPrimitiveEXT = 5271,
DecorationPerPrimitiveNV = 5271,
DecorationPerViewNV = 5272,
DecorationPerTaskNV = 5273,
@@ -508,6 +525,7 @@ enum Decoration {
DecorationRestrictPointerEXT = 5355,
DecorationAliasedPointer = 5356,
DecorationAliasedPointerEXT = 5356,
+ DecorationHitObjectShaderRecordBufferNV = 5386,
DecorationBindlessSamplerNV = 5398,
DecorationBindlessImageNV = 5399,
DecorationBoundSamplerNV = 5400,
@@ -546,8 +564,12 @@ enum Decoration {
DecorationPrefetchINTEL = 5902,
DecorationStallEnableINTEL = 5905,
DecorationFuseLoopsInFunctionINTEL = 5907,
+ DecorationMathOpDSPModeINTEL = 5909,
DecorationAliasScopeINTEL = 5914,
DecorationNoAliasINTEL = 5915,
+ DecorationInitiationIntervalINTEL = 5917,
+ DecorationMaxConcurrencyINTEL = 5918,
+ DecorationPipelineEnableINTEL = 5919,
DecorationBufferLocationINTEL = 5921,
DecorationIOPipeStorageINTEL = 5944,
DecorationFunctionFloatingPointModeINTEL = 6080,
@@ -599,6 +621,11 @@ enum BuiltIn {
BuiltInSubgroupLocalInvocationId = 41,
BuiltInVertexIndex = 42,
BuiltInInstanceIndex = 43,
+ BuiltInCoreIDARM = 4160,
+ BuiltInCoreCountARM = 4161,
+ BuiltInCoreMaxIDARM = 4162,
+ BuiltInWarpIDARM = 4163,
+ BuiltInWarpMaxIDARM = 4164,
BuiltInSubgroupEqMask = 4416,
BuiltInSubgroupEqMaskKHR = 4416,
BuiltInSubgroupGeMask = 4417,
@@ -646,6 +673,10 @@ enum BuiltIn {
BuiltInFragmentSizeNV = 5292,
BuiltInFragInvocationCountEXT = 5293,
BuiltInInvocationsPerPixelNV = 5293,
+ BuiltInPrimitivePointIndicesEXT = 5294,
+ BuiltInPrimitiveLineIndicesEXT = 5295,
+ BuiltInPrimitiveTriangleIndicesEXT = 5296,
+ BuiltInCullPrimitiveEXT = 5299,
BuiltInLaunchIdKHR = 5319,
BuiltInLaunchIdNV = 5319,
BuiltInLaunchSizeKHR = 5320,
@@ -713,6 +744,8 @@ enum LoopControlShift {
LoopControlMaxInterleavingINTELShift = 21,
LoopControlSpeculatedIterationsINTELShift = 22,
LoopControlNoFusionINTELShift = 23,
+ LoopControlLoopCountINTELShift = 24,
+ LoopControlMaxReinvocationDelayINTELShift = 25,
LoopControlMax = 0x7fffffff,
};
@@ -735,6 +768,8 @@ enum LoopControlMask {
LoopControlMaxInterleavingINTELMask = 0x00200000,
LoopControlSpeculatedIterationsINTELMask = 0x00400000,
LoopControlNoFusionINTELMask = 0x00800000,
+ LoopControlLoopCountINTELMask = 0x01000000,
+ LoopControlMaxReinvocationDelayINTELMask = 0x02000000,
};
enum FunctionControlShift {
@@ -938,6 +973,7 @@ enum Capability {
CapabilityShaderLayer = 69,
CapabilityShaderViewportIndex = 70,
CapabilityUniformDecoration = 71,
+ CapabilityCoreBuiltinsARM = 4165,
CapabilityFragmentShadingRateKHR = 4422,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
@@ -986,6 +1022,7 @@ enum Capability {
CapabilityFragmentFullyCoveredEXT = 5265,
CapabilityMeshShadingNV = 5266,
CapabilityImageFootprintNV = 5282,
+ CapabilityMeshShadingEXT = 5283,
CapabilityFragmentBarycentricKHR = 5284,
CapabilityFragmentBarycentricNV = 5284,
CapabilityComputeDerivativeGroupQuadsNV = 5288,
@@ -1033,6 +1070,8 @@ enum Capability {
CapabilityFragmentShaderPixelInterlockEXT = 5378,
CapabilityDemoteToHelperInvocation = 5379,
CapabilityDemoteToHelperInvocationEXT = 5379,
+ CapabilityRayTracingOpacityMicromapEXT = 5381,
+ CapabilityShaderInvocationReorderNV = 5383,
CapabilityBindlessTextureNV = 5390,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
@@ -1066,10 +1105,13 @@ enum Capability {
CapabilityFPGAMemoryAccessesINTEL = 5898,
CapabilityFPGAClusterAttributesINTEL = 5904,
CapabilityLoopFuseINTEL = 5906,
+ CapabilityFPGADSPControlINTEL = 5908,
CapabilityMemoryAccessAliasingINTEL = 5910,
+ CapabilityFPGAInvocationPipeliningAttributesINTEL = 5916,
CapabilityFPGABufferLocationINTEL = 5920,
CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
CapabilityUSMStorageClassesINTEL = 5935,
+ CapabilityRuntimeAlignedAttributeINTEL = 5939,
CapabilityIOPipesINTEL = 5943,
CapabilityBlockingPipesINTEL = 5945,
CapabilityFPGARegINTEL = 5948,
@@ -1106,6 +1148,7 @@ enum RayFlagsShift {
RayFlagsCullNoOpaqueKHRShift = 7,
RayFlagsSkipTrianglesKHRShift = 8,
RayFlagsSkipAABBsKHRShift = 9,
+ RayFlagsForceOpacityMicromap2StateEXTShift = 10,
RayFlagsMax = 0x7fffffff,
};
@@ -1121,6 +1164,7 @@ enum RayFlagsMask {
RayFlagsCullNoOpaqueKHRMask = 0x00000080,
RayFlagsSkipTrianglesKHRMask = 0x00000100,
RayFlagsSkipAABBsKHRMask = 0x00000200,
+ RayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
};
enum RayQueryIntersection {
@@ -1584,7 +1628,42 @@ enum Op {
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
@@ -2257,7 +2336,42 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break;
+ case OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break;
+ case OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break;
+ case OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break;
+ case OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
+ case OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
+ case OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
case OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
case OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
@@ -2537,18 +2651,48 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
}
#endif /* SPV_ENABLE_UTILITY_CODE */
-// Overload operator| for mask bit combining
+// Overload bitwise operators for mask bit combining
inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
+inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); }
+inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); }
inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
+inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); }
+inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); }
+inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); }
inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
+inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); }
+inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); }
+inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); }
inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
+inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); }
+inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); }
+inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); }
inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
+inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); }
+inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); }
+inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); }
inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
+inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); }
+inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); }
+inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); }
inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
+inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); }
+inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); }
+inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); }
inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
+inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); }
+inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); }
+inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); }
inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
+inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); }
+inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); }
+inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); }
inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
+inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
+inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
+inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
} // end namespace spv
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11 b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11
index 4de79fdbd1..341d333dae 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.hpp11
@@ -94,6 +94,8 @@ enum class ExecutionModel : unsigned {
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
+ TaskEXT = 5364,
+ MeshEXT = 5365,
Max = 0x7fffffff,
};
@@ -161,11 +163,21 @@ enum class ExecutionMode : unsigned {
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
+ StencilRefUnchangedFrontAMD = 5079,
+ StencilRefGreaterFrontAMD = 5080,
+ StencilRefLessFrontAMD = 5081,
+ StencilRefUnchangedBackAMD = 5082,
+ StencilRefGreaterBackAMD = 5083,
+ StencilRefLessBackAMD = 5084,
+ OutputLinesEXT = 5269,
OutputLinesNV = 5269,
+ OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
+ OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
@@ -183,6 +195,7 @@ enum class ExecutionMode : unsigned {
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
+ StreamingInterfaceINTEL = 6154,
NamedBarrierCountINTEL = 6417,
Max = 0x7fffffff,
};
@@ -215,6 +228,8 @@ enum class StorageClass : unsigned {
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
+ HitObjectAttributeNV = 5385,
+ TaskPayloadWorkgroupEXT = 5402,
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
@@ -439,6 +454,7 @@ enum class FunctionParameterAttribute : unsigned {
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
+ RuntimeAlignedINTEL = 5940,
Max = 0x7fffffff,
};
@@ -497,6 +513,7 @@ enum class Decoration : unsigned {
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
+ PerPrimitiveEXT = 5271,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
@@ -508,6 +525,7 @@ enum class Decoration : unsigned {
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
+ HitObjectShaderRecordBufferNV = 5386,
BindlessSamplerNV = 5398,
BindlessImageNV = 5399,
BoundSamplerNV = 5400,
@@ -546,8 +564,12 @@ enum class Decoration : unsigned {
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
+ MathOpDSPModeINTEL = 5909,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
+ InitiationIntervalINTEL = 5917,
+ MaxConcurrencyINTEL = 5918,
+ PipelineEnableINTEL = 5919,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
@@ -599,6 +621,11 @@ enum class BuiltIn : unsigned {
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
+ CoreIDARM = 4160,
+ CoreCountARM = 4161,
+ CoreMaxIDARM = 4162,
+ WarpIDARM = 4163,
+ WarpMaxIDARM = 4164,
SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416,
SubgroupGeMask = 4417,
@@ -646,6 +673,10 @@ enum class BuiltIn : unsigned {
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
+ PrimitivePointIndicesEXT = 5294,
+ PrimitiveLineIndicesEXT = 5295,
+ PrimitiveTriangleIndicesEXT = 5296,
+ CullPrimitiveEXT = 5299,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
@@ -713,6 +744,8 @@ enum class LoopControlShift : unsigned {
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
NoFusionINTEL = 23,
+ LoopCountINTEL = 24,
+ MaxReinvocationDelayINTEL = 25,
Max = 0x7fffffff,
};
@@ -735,6 +768,8 @@ enum class LoopControlMask : unsigned {
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
NoFusionINTEL = 0x00800000,
+ LoopCountINTEL = 0x01000000,
+ MaxReinvocationDelayINTEL = 0x02000000,
};
enum class FunctionControlShift : unsigned {
@@ -938,6 +973,7 @@ enum class Capability : unsigned {
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
+ CoreBuiltinsARM = 4165,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -986,6 +1022,7 @@ enum class Capability : unsigned {
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
+ MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
@@ -1033,6 +1070,8 @@ enum class Capability : unsigned {
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
+ RayTracingOpacityMicromapEXT = 5381,
+ ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
@@ -1066,10 +1105,13 @@ enum class Capability : unsigned {
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
+ FPGADSPControlINTEL = 5908,
MemoryAccessAliasingINTEL = 5910,
+ FPGAInvocationPipeliningAttributesINTEL = 5916,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
+ RuntimeAlignedAttributeINTEL = 5939,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
@@ -1106,6 +1148,7 @@ enum class RayFlagsShift : unsigned {
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
+ ForceOpacityMicromap2StateEXT = 10,
Max = 0x7fffffff,
};
@@ -1121,6 +1164,7 @@ enum class RayFlagsMask : unsigned {
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
+ ForceOpacityMicromap2StateEXT = 0x00000400,
};
enum class RayQueryIntersection : unsigned {
@@ -1584,7 +1628,42 @@ enum class Op : unsigned {
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
@@ -2257,7 +2336,42 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case Op::OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
case Op::OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case Op::OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectRecordHitMotionNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectRecordHitWithIndexMotionNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectRecordMissMotionNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectGetWorldToObjectNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetObjectToWorldNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetObjectRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetObjectRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectGetShaderRecordBufferHandleNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetShaderBindingTableRecordIndexNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectRecordEmptyNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectTraceRayNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectRecordHitNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectRecordHitWithIndexNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectRecordMissNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectExecuteShaderNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectGetCurrentTimeNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetAttributesNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpHitObjectGetHitKindNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetPrimitiveIndexNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetGeometryIndexNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetInstanceIdNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetInstanceCustomIndexNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetWorldRayDirectionNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetWorldRayOriginNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetRayTMaxNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectGetRayTMinNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectIsEmptyNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectIsHitNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpHitObjectIsMissNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpReorderThreadWithHitObjectNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpReorderThreadWithHintNV: *hasResult = false; *hasResultType = false; break;
+ case Op::OpTypeHitObjectNV: *hasResult = true; *hasResultType = false; break;
case Op::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case Op::OpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
+ case Op::OpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
case Op::OpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
case Op::OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case Op::OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
@@ -2537,18 +2651,48 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
}
#endif /* SPV_ENABLE_UTILITY_CODE */
-// Overload operator| for mask bit combining
+// Overload bitwise operators for mask bit combining
inline ImageOperandsMask operator|(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) | unsigned(b)); }
+inline ImageOperandsMask operator&(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) & unsigned(b)); }
+inline ImageOperandsMask operator^(ImageOperandsMask a, ImageOperandsMask b) { return ImageOperandsMask(unsigned(a) ^ unsigned(b)); }
+inline ImageOperandsMask operator~(ImageOperandsMask a) { return ImageOperandsMask(~unsigned(a)); }
inline FPFastMathModeMask operator|(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) | unsigned(b)); }
+inline FPFastMathModeMask operator&(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) & unsigned(b)); }
+inline FPFastMathModeMask operator^(FPFastMathModeMask a, FPFastMathModeMask b) { return FPFastMathModeMask(unsigned(a) ^ unsigned(b)); }
+inline FPFastMathModeMask operator~(FPFastMathModeMask a) { return FPFastMathModeMask(~unsigned(a)); }
inline SelectionControlMask operator|(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) | unsigned(b)); }
+inline SelectionControlMask operator&(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) & unsigned(b)); }
+inline SelectionControlMask operator^(SelectionControlMask a, SelectionControlMask b) { return SelectionControlMask(unsigned(a) ^ unsigned(b)); }
+inline SelectionControlMask operator~(SelectionControlMask a) { return SelectionControlMask(~unsigned(a)); }
inline LoopControlMask operator|(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) | unsigned(b)); }
+inline LoopControlMask operator&(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) & unsigned(b)); }
+inline LoopControlMask operator^(LoopControlMask a, LoopControlMask b) { return LoopControlMask(unsigned(a) ^ unsigned(b)); }
+inline LoopControlMask operator~(LoopControlMask a) { return LoopControlMask(~unsigned(a)); }
inline FunctionControlMask operator|(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) | unsigned(b)); }
+inline FunctionControlMask operator&(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) & unsigned(b)); }
+inline FunctionControlMask operator^(FunctionControlMask a, FunctionControlMask b) { return FunctionControlMask(unsigned(a) ^ unsigned(b)); }
+inline FunctionControlMask operator~(FunctionControlMask a) { return FunctionControlMask(~unsigned(a)); }
inline MemorySemanticsMask operator|(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) | unsigned(b)); }
+inline MemorySemanticsMask operator&(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) & unsigned(b)); }
+inline MemorySemanticsMask operator^(MemorySemanticsMask a, MemorySemanticsMask b) { return MemorySemanticsMask(unsigned(a) ^ unsigned(b)); }
+inline MemorySemanticsMask operator~(MemorySemanticsMask a) { return MemorySemanticsMask(~unsigned(a)); }
inline MemoryAccessMask operator|(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) | unsigned(b)); }
+inline MemoryAccessMask operator&(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) & unsigned(b)); }
+inline MemoryAccessMask operator^(MemoryAccessMask a, MemoryAccessMask b) { return MemoryAccessMask(unsigned(a) ^ unsigned(b)); }
+inline MemoryAccessMask operator~(MemoryAccessMask a) { return MemoryAccessMask(~unsigned(a)); }
inline KernelProfilingInfoMask operator|(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) | unsigned(b)); }
+inline KernelProfilingInfoMask operator&(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) & unsigned(b)); }
+inline KernelProfilingInfoMask operator^(KernelProfilingInfoMask a, KernelProfilingInfoMask b) { return KernelProfilingInfoMask(unsigned(a) ^ unsigned(b)); }
+inline KernelProfilingInfoMask operator~(KernelProfilingInfoMask a) { return KernelProfilingInfoMask(~unsigned(a)); }
inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
+inline RayFlagsMask operator&(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) & unsigned(b)); }
+inline RayFlagsMask operator^(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) ^ unsigned(b)); }
+inline RayFlagsMask operator~(RayFlagsMask a) { return RayFlagsMask(~unsigned(a)); }
inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
+inline FragmentShadingRateMask operator&(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) & unsigned(b)); }
+inline FragmentShadingRateMask operator^(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) ^ unsigned(b)); }
+inline FragmentShadingRateMask operator~(FragmentShadingRateMask a) { return FragmentShadingRateMask(~unsigned(a)); }
} // end namespace spv
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json
index 85d18b6b30..4cd00db243 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.json
@@ -103,7 +103,9 @@
"MissKHR": 5317,
"MissNV": 5317,
"CallableKHR": 5318,
- "CallableNV": 5318
+ "CallableNV": 5318,
+ "TaskEXT": 5364,
+ "MeshEXT": 5365
}
},
{
@@ -180,11 +182,21 @@
"SignedZeroInfNanPreserve": 4461,
"RoundingModeRTE": 4462,
"RoundingModeRTZ": 4463,
+ "EarlyAndLateFragmentTestsAMD": 5017,
"StencilRefReplacingEXT": 5027,
+ "StencilRefUnchangedFrontAMD": 5079,
+ "StencilRefGreaterFrontAMD": 5080,
+ "StencilRefLessFrontAMD": 5081,
+ "StencilRefUnchangedBackAMD": 5082,
+ "StencilRefGreaterBackAMD": 5083,
+ "StencilRefLessBackAMD": 5084,
+ "OutputLinesEXT": 5269,
"OutputLinesNV": 5269,
+ "OutputPrimitivesEXT": 5270,
"OutputPrimitivesNV": 5270,
"DerivativeGroupQuadsNV": 5289,
"DerivativeGroupLinearNV": 5290,
+ "OutputTrianglesEXT": 5298,
"OutputTrianglesNV": 5298,
"PixelInterlockOrderedEXT": 5366,
"PixelInterlockUnorderedEXT": 5367,
@@ -202,6 +214,7 @@
"NoGlobalOffsetINTEL": 5895,
"NumSIMDWorkitemsINTEL": 5896,
"SchedulerTargetFmaxMhzINTEL": 5903,
+ "StreamingInterfaceINTEL": 6154,
"NamedBarrierCountINTEL": 6417
}
},
@@ -237,6 +250,8 @@
"ShaderRecordBufferNV": 5343,
"PhysicalStorageBuffer": 5349,
"PhysicalStorageBufferEXT": 5349,
+ "HitObjectAttributeNV": 5385,
+ "TaskPayloadWorkgroupEXT": 5402,
"CodeSectionINTEL": 5605,
"DeviceOnlyINTEL": 5936,
"HostOnlyINTEL": 5937
@@ -461,7 +476,8 @@
"NoAlias": 4,
"NoCapture": 5,
"NoWrite": 6,
- "NoReadWrite": 7
+ "NoReadWrite": 7,
+ "RuntimeAlignedINTEL": 5940
}
},
{
@@ -523,6 +539,7 @@
"PassthroughNV": 5250,
"ViewportRelativeNV": 5252,
"SecondaryViewportRelativeNV": 5256,
+ "PerPrimitiveEXT": 5271,
"PerPrimitiveNV": 5271,
"PerViewNV": 5272,
"PerTaskNV": 5273,
@@ -534,6 +551,7 @@
"RestrictPointerEXT": 5355,
"AliasedPointer": 5356,
"AliasedPointerEXT": 5356,
+ "HitObjectShaderRecordBufferNV": 5386,
"BindlessSamplerNV": 5398,
"BindlessImageNV": 5399,
"BoundSamplerNV": 5400,
@@ -572,8 +590,12 @@
"PrefetchINTEL": 5902,
"StallEnableINTEL": 5905,
"FuseLoopsInFunctionINTEL": 5907,
+ "MathOpDSPModeINTEL": 5909,
"AliasScopeINTEL": 5914,
"NoAliasINTEL": 5915,
+ "InitiationIntervalINTEL": 5917,
+ "MaxConcurrencyINTEL": 5918,
+ "PipelineEnableINTEL": 5919,
"BufferLocationINTEL": 5921,
"IOPipeStorageINTEL": 5944,
"FunctionFloatingPointModeINTEL": 6080,
@@ -628,6 +650,11 @@
"SubgroupLocalInvocationId": 41,
"VertexIndex": 42,
"InstanceIndex": 43,
+ "CoreIDARM": 4160,
+ "CoreCountARM": 4161,
+ "CoreMaxIDARM": 4162,
+ "WarpIDARM": 4163,
+ "WarpMaxIDARM": 4164,
"SubgroupEqMask": 4416,
"SubgroupEqMaskKHR": 4416,
"SubgroupGeMask": 4417,
@@ -675,6 +702,10 @@
"FragmentSizeNV": 5292,
"FragInvocationCountEXT": 5293,
"InvocationsPerPixelNV": 5293,
+ "PrimitivePointIndicesEXT": 5294,
+ "PrimitiveLineIndicesEXT": 5295,
+ "PrimitiveTriangleIndicesEXT": 5296,
+ "CullPrimitiveEXT": 5299,
"LaunchIdKHR": 5319,
"LaunchIdNV": 5319,
"LaunchSizeKHR": 5320,
@@ -741,7 +772,9 @@
"LoopCoalesceINTEL": 20,
"MaxInterleavingINTEL": 21,
"SpeculatedIterationsINTEL": 22,
- "NoFusionINTEL": 23
+ "NoFusionINTEL": 23,
+ "LoopCountINTEL": 24,
+ "MaxReinvocationDelayINTEL": 25
}
},
{
@@ -920,6 +953,7 @@
"ShaderLayer": 69,
"ShaderViewportIndex": 70,
"UniformDecoration": 71,
+ "CoreBuiltinsARM": 4165,
"FragmentShadingRateKHR": 4422,
"SubgroupBallotKHR": 4423,
"DrawParameters": 4427,
@@ -968,6 +1002,7 @@
"FragmentFullyCoveredEXT": 5265,
"MeshShadingNV": 5266,
"ImageFootprintNV": 5282,
+ "MeshShadingEXT": 5283,
"FragmentBarycentricKHR": 5284,
"FragmentBarycentricNV": 5284,
"ComputeDerivativeGroupQuadsNV": 5288,
@@ -1015,6 +1050,8 @@
"FragmentShaderPixelInterlockEXT": 5378,
"DemoteToHelperInvocation": 5379,
"DemoteToHelperInvocationEXT": 5379,
+ "RayTracingOpacityMicromapEXT": 5381,
+ "ShaderInvocationReorderNV": 5383,
"BindlessTextureNV": 5390,
"SubgroupShuffleINTEL": 5568,
"SubgroupBufferBlockIOINTEL": 5569,
@@ -1048,10 +1085,13 @@
"FPGAMemoryAccessesINTEL": 5898,
"FPGAClusterAttributesINTEL": 5904,
"LoopFuseINTEL": 5906,
+ "FPGADSPControlINTEL": 5908,
"MemoryAccessAliasingINTEL": 5910,
+ "FPGAInvocationPipeliningAttributesINTEL": 5916,
"FPGABufferLocationINTEL": 5920,
"ArbitraryPrecisionFixedPointINTEL": 5922,
"USMStorageClassesINTEL": 5935,
+ "RuntimeAlignedAttributeINTEL": 5939,
"IOPipesINTEL": 5943,
"BlockingPipesINTEL": 5945,
"FPGARegINTEL": 5948,
@@ -1090,7 +1130,8 @@
"CullOpaqueKHR": 6,
"CullNoOpaqueKHR": 7,
"SkipTrianglesKHR": 8,
- "SkipAABBsKHR": 9
+ "SkipAABBsKHR": 9,
+ "ForceOpacityMicromap2StateEXT": 10
}
},
{
@@ -1577,7 +1618,42 @@
"OpFragmentMaskFetchAMD": 5011,
"OpFragmentFetchAMD": 5012,
"OpReadClockKHR": 5056,
+ "OpHitObjectRecordHitMotionNV": 5249,
+ "OpHitObjectRecordHitWithIndexMotionNV": 5250,
+ "OpHitObjectRecordMissMotionNV": 5251,
+ "OpHitObjectGetWorldToObjectNV": 5252,
+ "OpHitObjectGetObjectToWorldNV": 5253,
+ "OpHitObjectGetObjectRayDirectionNV": 5254,
+ "OpHitObjectGetObjectRayOriginNV": 5255,
+ "OpHitObjectTraceRayMotionNV": 5256,
+ "OpHitObjectGetShaderRecordBufferHandleNV": 5257,
+ "OpHitObjectGetShaderBindingTableRecordIndexNV": 5258,
+ "OpHitObjectRecordEmptyNV": 5259,
+ "OpHitObjectTraceRayNV": 5260,
+ "OpHitObjectRecordHitNV": 5261,
+ "OpHitObjectRecordHitWithIndexNV": 5262,
+ "OpHitObjectRecordMissNV": 5263,
+ "OpHitObjectExecuteShaderNV": 5264,
+ "OpHitObjectGetCurrentTimeNV": 5265,
+ "OpHitObjectGetAttributesNV": 5266,
+ "OpHitObjectGetHitKindNV": 5267,
+ "OpHitObjectGetPrimitiveIndexNV": 5268,
+ "OpHitObjectGetGeometryIndexNV": 5269,
+ "OpHitObjectGetInstanceIdNV": 5270,
+ "OpHitObjectGetInstanceCustomIndexNV": 5271,
+ "OpHitObjectGetWorldRayDirectionNV": 5272,
+ "OpHitObjectGetWorldRayOriginNV": 5273,
+ "OpHitObjectGetRayTMaxNV": 5274,
+ "OpHitObjectGetRayTMinNV": 5275,
+ "OpHitObjectIsEmptyNV": 5276,
+ "OpHitObjectIsHitNV": 5277,
+ "OpHitObjectIsMissNV": 5278,
+ "OpReorderThreadWithHitObjectNV": 5279,
+ "OpReorderThreadWithHintNV": 5280,
+ "OpTypeHitObjectNV": 5281,
"OpImageSampleFootprintNV": 5283,
+ "OpEmitMeshTasksEXT": 5294,
+ "OpSetMeshOutputsEXT": 5295,
"OpGroupNonUniformPartitionNV": 5296,
"OpWritePackedPrimitiveIndices4x8NV": 5299,
"OpReportIntersectionKHR": 5334,
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua
index 58df6f312b..a755d04939 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.lua
@@ -84,6 +84,8 @@ spv = {
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
+ TaskEXT = 5364,
+ MeshEXT = 5365,
},
AddressingModel = {
@@ -148,11 +150,21 @@ spv = {
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
+ StencilRefUnchangedFrontAMD = 5079,
+ StencilRefGreaterFrontAMD = 5080,
+ StencilRefLessFrontAMD = 5081,
+ StencilRefUnchangedBackAMD = 5082,
+ StencilRefGreaterBackAMD = 5083,
+ StencilRefLessBackAMD = 5084,
+ OutputLinesEXT = 5269,
OutputLinesNV = 5269,
+ OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
+ OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
@@ -170,6 +182,7 @@ spv = {
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
+ StreamingInterfaceINTEL = 6154,
NamedBarrierCountINTEL = 6417,
},
@@ -201,6 +214,8 @@ spv = {
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
+ HitObjectAttributeNV = 5385,
+ TaskPayloadWorkgroupEXT = 5402,
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
@@ -413,6 +428,7 @@ spv = {
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
+ RuntimeAlignedINTEL = 5940,
},
Decoration = {
@@ -470,6 +486,7 @@ spv = {
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
+ PerPrimitiveEXT = 5271,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
@@ -481,6 +498,7 @@ spv = {
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
+ HitObjectShaderRecordBufferNV = 5386,
BindlessSamplerNV = 5398,
BindlessImageNV = 5399,
BoundSamplerNV = 5400,
@@ -519,8 +537,12 @@ spv = {
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
+ MathOpDSPModeINTEL = 5909,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
+ InitiationIntervalINTEL = 5917,
+ MaxConcurrencyINTEL = 5918,
+ PipelineEnableINTEL = 5919,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
@@ -571,6 +593,11 @@ spv = {
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
+ CoreIDARM = 4160,
+ CoreCountARM = 4161,
+ CoreMaxIDARM = 4162,
+ WarpIDARM = 4163,
+ WarpMaxIDARM = 4164,
SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416,
SubgroupGeMask = 4417,
@@ -618,6 +645,10 @@ spv = {
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
+ PrimitivePointIndicesEXT = 5294,
+ PrimitiveLineIndicesEXT = 5295,
+ PrimitiveTriangleIndicesEXT = 5296,
+ CullPrimitiveEXT = 5299,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
@@ -683,6 +714,8 @@ spv = {
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
NoFusionINTEL = 23,
+ LoopCountINTEL = 24,
+ MaxReinvocationDelayINTEL = 25,
},
LoopControlMask = {
@@ -704,6 +737,8 @@ spv = {
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
NoFusionINTEL = 0x00800000,
+ LoopCountINTEL = 0x01000000,
+ MaxReinvocationDelayINTEL = 0x02000000,
},
FunctionControlShift = {
@@ -900,6 +935,7 @@ spv = {
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
+ CoreBuiltinsARM = 4165,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -948,6 +984,7 @@ spv = {
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
+ MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
@@ -995,6 +1032,8 @@ spv = {
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
+ RayTracingOpacityMicromapEXT = 5381,
+ ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
@@ -1028,10 +1067,13 @@ spv = {
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
+ FPGADSPControlINTEL = 5908,
MemoryAccessAliasingINTEL = 5910,
+ FPGAInvocationPipeliningAttributesINTEL = 5916,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
+ RuntimeAlignedAttributeINTEL = 5939,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
@@ -1067,6 +1109,7 @@ spv = {
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
+ ForceOpacityMicromap2StateEXT = 10,
},
RayFlagsMask = {
@@ -1081,6 +1124,7 @@ spv = {
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
+ ForceOpacityMicromap2StateEXT = 0x00000400,
},
RayQueryIntersection = {
@@ -1535,7 +1579,42 @@ spv = {
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py
index 7a02a108d7..8a8b97930d 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spirv.py
@@ -84,6 +84,8 @@ spv = {
'MissNV' : 5317,
'CallableKHR' : 5318,
'CallableNV' : 5318,
+ 'TaskEXT' : 5364,
+ 'MeshEXT' : 5365,
},
'AddressingModel' : {
@@ -148,11 +150,21 @@ spv = {
'SignedZeroInfNanPreserve' : 4461,
'RoundingModeRTE' : 4462,
'RoundingModeRTZ' : 4463,
+ 'EarlyAndLateFragmentTestsAMD' : 5017,
'StencilRefReplacingEXT' : 5027,
+ 'StencilRefUnchangedFrontAMD' : 5079,
+ 'StencilRefGreaterFrontAMD' : 5080,
+ 'StencilRefLessFrontAMD' : 5081,
+ 'StencilRefUnchangedBackAMD' : 5082,
+ 'StencilRefGreaterBackAMD' : 5083,
+ 'StencilRefLessBackAMD' : 5084,
+ 'OutputLinesEXT' : 5269,
'OutputLinesNV' : 5269,
+ 'OutputPrimitivesEXT' : 5270,
'OutputPrimitivesNV' : 5270,
'DerivativeGroupQuadsNV' : 5289,
'DerivativeGroupLinearNV' : 5290,
+ 'OutputTrianglesEXT' : 5298,
'OutputTrianglesNV' : 5298,
'PixelInterlockOrderedEXT' : 5366,
'PixelInterlockUnorderedEXT' : 5367,
@@ -170,6 +182,7 @@ spv = {
'NoGlobalOffsetINTEL' : 5895,
'NumSIMDWorkitemsINTEL' : 5896,
'SchedulerTargetFmaxMhzINTEL' : 5903,
+ 'StreamingInterfaceINTEL' : 6154,
'NamedBarrierCountINTEL' : 6417,
},
@@ -201,6 +214,8 @@ spv = {
'ShaderRecordBufferNV' : 5343,
'PhysicalStorageBuffer' : 5349,
'PhysicalStorageBufferEXT' : 5349,
+ 'HitObjectAttributeNV' : 5385,
+ 'TaskPayloadWorkgroupEXT' : 5402,
'CodeSectionINTEL' : 5605,
'DeviceOnlyINTEL' : 5936,
'HostOnlyINTEL' : 5937,
@@ -413,6 +428,7 @@ spv = {
'NoCapture' : 5,
'NoWrite' : 6,
'NoReadWrite' : 7,
+ 'RuntimeAlignedINTEL' : 5940,
},
'Decoration' : {
@@ -470,6 +486,7 @@ spv = {
'PassthroughNV' : 5250,
'ViewportRelativeNV' : 5252,
'SecondaryViewportRelativeNV' : 5256,
+ 'PerPrimitiveEXT' : 5271,
'PerPrimitiveNV' : 5271,
'PerViewNV' : 5272,
'PerTaskNV' : 5273,
@@ -481,6 +498,7 @@ spv = {
'RestrictPointerEXT' : 5355,
'AliasedPointer' : 5356,
'AliasedPointerEXT' : 5356,
+ 'HitObjectShaderRecordBufferNV' : 5386,
'BindlessSamplerNV' : 5398,
'BindlessImageNV' : 5399,
'BoundSamplerNV' : 5400,
@@ -519,8 +537,12 @@ spv = {
'PrefetchINTEL' : 5902,
'StallEnableINTEL' : 5905,
'FuseLoopsInFunctionINTEL' : 5907,
+ 'MathOpDSPModeINTEL' : 5909,
'AliasScopeINTEL' : 5914,
'NoAliasINTEL' : 5915,
+ 'InitiationIntervalINTEL' : 5917,
+ 'MaxConcurrencyINTEL' : 5918,
+ 'PipelineEnableINTEL' : 5919,
'BufferLocationINTEL' : 5921,
'IOPipeStorageINTEL' : 5944,
'FunctionFloatingPointModeINTEL' : 6080,
@@ -571,6 +593,11 @@ spv = {
'SubgroupLocalInvocationId' : 41,
'VertexIndex' : 42,
'InstanceIndex' : 43,
+ 'CoreIDARM' : 4160,
+ 'CoreCountARM' : 4161,
+ 'CoreMaxIDARM' : 4162,
+ 'WarpIDARM' : 4163,
+ 'WarpMaxIDARM' : 4164,
'SubgroupEqMask' : 4416,
'SubgroupEqMaskKHR' : 4416,
'SubgroupGeMask' : 4417,
@@ -618,6 +645,10 @@ spv = {
'FragmentSizeNV' : 5292,
'FragInvocationCountEXT' : 5293,
'InvocationsPerPixelNV' : 5293,
+ 'PrimitivePointIndicesEXT' : 5294,
+ 'PrimitiveLineIndicesEXT' : 5295,
+ 'PrimitiveTriangleIndicesEXT' : 5296,
+ 'CullPrimitiveEXT' : 5299,
'LaunchIdKHR' : 5319,
'LaunchIdNV' : 5319,
'LaunchSizeKHR' : 5320,
@@ -683,6 +714,8 @@ spv = {
'MaxInterleavingINTEL' : 21,
'SpeculatedIterationsINTEL' : 22,
'NoFusionINTEL' : 23,
+ 'LoopCountINTEL' : 24,
+ 'MaxReinvocationDelayINTEL' : 25,
},
'LoopControlMask' : {
@@ -704,6 +737,8 @@ spv = {
'MaxInterleavingINTEL' : 0x00200000,
'SpeculatedIterationsINTEL' : 0x00400000,
'NoFusionINTEL' : 0x00800000,
+ 'LoopCountINTEL' : 0x01000000,
+ 'MaxReinvocationDelayINTEL' : 0x02000000,
},
'FunctionControlShift' : {
@@ -900,6 +935,7 @@ spv = {
'ShaderLayer' : 69,
'ShaderViewportIndex' : 70,
'UniformDecoration' : 71,
+ 'CoreBuiltinsARM' : 4165,
'FragmentShadingRateKHR' : 4422,
'SubgroupBallotKHR' : 4423,
'DrawParameters' : 4427,
@@ -948,6 +984,7 @@ spv = {
'FragmentFullyCoveredEXT' : 5265,
'MeshShadingNV' : 5266,
'ImageFootprintNV' : 5282,
+ 'MeshShadingEXT' : 5283,
'FragmentBarycentricKHR' : 5284,
'FragmentBarycentricNV' : 5284,
'ComputeDerivativeGroupQuadsNV' : 5288,
@@ -995,6 +1032,8 @@ spv = {
'FragmentShaderPixelInterlockEXT' : 5378,
'DemoteToHelperInvocation' : 5379,
'DemoteToHelperInvocationEXT' : 5379,
+ 'RayTracingOpacityMicromapEXT' : 5381,
+ 'ShaderInvocationReorderNV' : 5383,
'BindlessTextureNV' : 5390,
'SubgroupShuffleINTEL' : 5568,
'SubgroupBufferBlockIOINTEL' : 5569,
@@ -1028,10 +1067,13 @@ spv = {
'FPGAMemoryAccessesINTEL' : 5898,
'FPGAClusterAttributesINTEL' : 5904,
'LoopFuseINTEL' : 5906,
+ 'FPGADSPControlINTEL' : 5908,
'MemoryAccessAliasingINTEL' : 5910,
+ 'FPGAInvocationPipeliningAttributesINTEL' : 5916,
'FPGABufferLocationINTEL' : 5920,
'ArbitraryPrecisionFixedPointINTEL' : 5922,
'USMStorageClassesINTEL' : 5935,
+ 'RuntimeAlignedAttributeINTEL' : 5939,
'IOPipesINTEL' : 5943,
'BlockingPipesINTEL' : 5945,
'FPGARegINTEL' : 5948,
@@ -1067,6 +1109,7 @@ spv = {
'CullNoOpaqueKHR' : 7,
'SkipTrianglesKHR' : 8,
'SkipAABBsKHR' : 9,
+ 'ForceOpacityMicromap2StateEXT' : 10,
},
'RayFlagsMask' : {
@@ -1081,6 +1124,7 @@ spv = {
'CullNoOpaqueKHR' : 0x00000080,
'SkipTrianglesKHR' : 0x00000100,
'SkipAABBsKHR' : 0x00000200,
+ 'ForceOpacityMicromap2StateEXT' : 0x00000400,
},
'RayQueryIntersection' : {
@@ -1535,7 +1579,42 @@ spv = {
'OpFragmentMaskFetchAMD' : 5011,
'OpFragmentFetchAMD' : 5012,
'OpReadClockKHR' : 5056,
+ 'OpHitObjectRecordHitMotionNV' : 5249,
+ 'OpHitObjectRecordHitWithIndexMotionNV' : 5250,
+ 'OpHitObjectRecordMissMotionNV' : 5251,
+ 'OpHitObjectGetWorldToObjectNV' : 5252,
+ 'OpHitObjectGetObjectToWorldNV' : 5253,
+ 'OpHitObjectGetObjectRayDirectionNV' : 5254,
+ 'OpHitObjectGetObjectRayOriginNV' : 5255,
+ 'OpHitObjectTraceRayMotionNV' : 5256,
+ 'OpHitObjectGetShaderRecordBufferHandleNV' : 5257,
+ 'OpHitObjectGetShaderBindingTableRecordIndexNV' : 5258,
+ 'OpHitObjectRecordEmptyNV' : 5259,
+ 'OpHitObjectTraceRayNV' : 5260,
+ 'OpHitObjectRecordHitNV' : 5261,
+ 'OpHitObjectRecordHitWithIndexNV' : 5262,
+ 'OpHitObjectRecordMissNV' : 5263,
+ 'OpHitObjectExecuteShaderNV' : 5264,
+ 'OpHitObjectGetCurrentTimeNV' : 5265,
+ 'OpHitObjectGetAttributesNV' : 5266,
+ 'OpHitObjectGetHitKindNV' : 5267,
+ 'OpHitObjectGetPrimitiveIndexNV' : 5268,
+ 'OpHitObjectGetGeometryIndexNV' : 5269,
+ 'OpHitObjectGetInstanceIdNV' : 5270,
+ 'OpHitObjectGetInstanceCustomIndexNV' : 5271,
+ 'OpHitObjectGetWorldRayDirectionNV' : 5272,
+ 'OpHitObjectGetWorldRayOriginNV' : 5273,
+ 'OpHitObjectGetRayTMaxNV' : 5274,
+ 'OpHitObjectGetRayTMinNV' : 5275,
+ 'OpHitObjectIsEmptyNV' : 5276,
+ 'OpHitObjectIsHitNV' : 5277,
+ 'OpHitObjectIsMissNV' : 5278,
+ 'OpReorderThreadWithHitObjectNV' : 5279,
+ 'OpReorderThreadWithHintNV' : 5280,
+ 'OpTypeHitObjectNV' : 5281,
'OpImageSampleFootprintNV' : 5283,
+ 'OpEmitMeshTasksEXT' : 5294,
+ 'OpSetMeshOutputsEXT' : 5295,
'OpGroupNonUniformPartitionNV' : 5296,
'OpWritePackedPrimitiveIndices4x8NV' : 5299,
'OpReportIntersectionKHR' : 5334,
diff --git a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d
index db88b273f6..7b5f89ff09 100644
--- a/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d
+++ b/third_party/spirv-tools/external/spirv-headers/include/spirv/unified1/spv.d
@@ -93,6 +93,8 @@ enum ExecutionModel : uint
MissNV = 5317,
CallableKHR = 5318,
CallableNV = 5318,
+ TaskEXT = 5364,
+ MeshEXT = 5365,
}
enum AddressingModel : uint
@@ -160,11 +162,21 @@ enum ExecutionMode : uint
SignedZeroInfNanPreserve = 4461,
RoundingModeRTE = 4462,
RoundingModeRTZ = 4463,
+ EarlyAndLateFragmentTestsAMD = 5017,
StencilRefReplacingEXT = 5027,
+ StencilRefUnchangedFrontAMD = 5079,
+ StencilRefGreaterFrontAMD = 5080,
+ StencilRefLessFrontAMD = 5081,
+ StencilRefUnchangedBackAMD = 5082,
+ StencilRefGreaterBackAMD = 5083,
+ StencilRefLessBackAMD = 5084,
+ OutputLinesEXT = 5269,
OutputLinesNV = 5269,
+ OutputPrimitivesEXT = 5270,
OutputPrimitivesNV = 5270,
DerivativeGroupQuadsNV = 5289,
DerivativeGroupLinearNV = 5290,
+ OutputTrianglesEXT = 5298,
OutputTrianglesNV = 5298,
PixelInterlockOrderedEXT = 5366,
PixelInterlockUnorderedEXT = 5367,
@@ -182,6 +194,7 @@ enum ExecutionMode : uint
NoGlobalOffsetINTEL = 5895,
NumSIMDWorkitemsINTEL = 5896,
SchedulerTargetFmaxMhzINTEL = 5903,
+ StreamingInterfaceINTEL = 6154,
NamedBarrierCountINTEL = 6417,
}
@@ -214,6 +227,8 @@ enum StorageClass : uint
ShaderRecordBufferNV = 5343,
PhysicalStorageBuffer = 5349,
PhysicalStorageBufferEXT = 5349,
+ HitObjectAttributeNV = 5385,
+ TaskPayloadWorkgroupEXT = 5402,
CodeSectionINTEL = 5605,
DeviceOnlyINTEL = 5936,
HostOnlyINTEL = 5937,
@@ -440,6 +455,7 @@ enum FunctionParameterAttribute : uint
NoCapture = 5,
NoWrite = 6,
NoReadWrite = 7,
+ RuntimeAlignedINTEL = 5940,
}
enum Decoration : uint
@@ -498,6 +514,7 @@ enum Decoration : uint
PassthroughNV = 5250,
ViewportRelativeNV = 5252,
SecondaryViewportRelativeNV = 5256,
+ PerPrimitiveEXT = 5271,
PerPrimitiveNV = 5271,
PerViewNV = 5272,
PerTaskNV = 5273,
@@ -509,6 +526,7 @@ enum Decoration : uint
RestrictPointerEXT = 5355,
AliasedPointer = 5356,
AliasedPointerEXT = 5356,
+ HitObjectShaderRecordBufferNV = 5386,
BindlessSamplerNV = 5398,
BindlessImageNV = 5399,
BoundSamplerNV = 5400,
@@ -547,8 +565,12 @@ enum Decoration : uint
PrefetchINTEL = 5902,
StallEnableINTEL = 5905,
FuseLoopsInFunctionINTEL = 5907,
+ MathOpDSPModeINTEL = 5909,
AliasScopeINTEL = 5914,
NoAliasINTEL = 5915,
+ InitiationIntervalINTEL = 5917,
+ MaxConcurrencyINTEL = 5918,
+ PipelineEnableINTEL = 5919,
BufferLocationINTEL = 5921,
IOPipeStorageINTEL = 5944,
FunctionFloatingPointModeINTEL = 6080,
@@ -600,6 +622,11 @@ enum BuiltIn : uint
SubgroupLocalInvocationId = 41,
VertexIndex = 42,
InstanceIndex = 43,
+ CoreIDARM = 4160,
+ CoreCountARM = 4161,
+ CoreMaxIDARM = 4162,
+ WarpIDARM = 4163,
+ WarpMaxIDARM = 4164,
SubgroupEqMask = 4416,
SubgroupEqMaskKHR = 4416,
SubgroupGeMask = 4417,
@@ -647,6 +674,10 @@ enum BuiltIn : uint
FragmentSizeNV = 5292,
FragInvocationCountEXT = 5293,
InvocationsPerPixelNV = 5293,
+ PrimitivePointIndicesEXT = 5294,
+ PrimitiveLineIndicesEXT = 5295,
+ PrimitiveTriangleIndicesEXT = 5296,
+ CullPrimitiveEXT = 5299,
LaunchIdKHR = 5319,
LaunchIdNV = 5319,
LaunchSizeKHR = 5320,
@@ -715,6 +746,8 @@ enum LoopControlShift : uint
MaxInterleavingINTEL = 21,
SpeculatedIterationsINTEL = 22,
NoFusionINTEL = 23,
+ LoopCountINTEL = 24,
+ MaxReinvocationDelayINTEL = 25,
}
enum LoopControlMask : uint
@@ -737,6 +770,8 @@ enum LoopControlMask : uint
MaxInterleavingINTEL = 0x00200000,
SpeculatedIterationsINTEL = 0x00400000,
NoFusionINTEL = 0x00800000,
+ LoopCountINTEL = 0x01000000,
+ MaxReinvocationDelayINTEL = 0x02000000,
}
enum FunctionControlShift : uint
@@ -945,6 +980,7 @@ enum Capability : uint
ShaderLayer = 69,
ShaderViewportIndex = 70,
UniformDecoration = 71,
+ CoreBuiltinsARM = 4165,
FragmentShadingRateKHR = 4422,
SubgroupBallotKHR = 4423,
DrawParameters = 4427,
@@ -993,6 +1029,7 @@ enum Capability : uint
FragmentFullyCoveredEXT = 5265,
MeshShadingNV = 5266,
ImageFootprintNV = 5282,
+ MeshShadingEXT = 5283,
FragmentBarycentricKHR = 5284,
FragmentBarycentricNV = 5284,
ComputeDerivativeGroupQuadsNV = 5288,
@@ -1040,6 +1077,8 @@ enum Capability : uint
FragmentShaderPixelInterlockEXT = 5378,
DemoteToHelperInvocation = 5379,
DemoteToHelperInvocationEXT = 5379,
+ RayTracingOpacityMicromapEXT = 5381,
+ ShaderInvocationReorderNV = 5383,
BindlessTextureNV = 5390,
SubgroupShuffleINTEL = 5568,
SubgroupBufferBlockIOINTEL = 5569,
@@ -1073,10 +1112,13 @@ enum Capability : uint
FPGAMemoryAccessesINTEL = 5898,
FPGAClusterAttributesINTEL = 5904,
LoopFuseINTEL = 5906,
+ FPGADSPControlINTEL = 5908,
MemoryAccessAliasingINTEL = 5910,
+ FPGAInvocationPipeliningAttributesINTEL = 5916,
FPGABufferLocationINTEL = 5920,
ArbitraryPrecisionFixedPointINTEL = 5922,
USMStorageClassesINTEL = 5935,
+ RuntimeAlignedAttributeINTEL = 5939,
IOPipesINTEL = 5943,
BlockingPipesINTEL = 5945,
FPGARegINTEL = 5948,
@@ -1113,6 +1155,7 @@ enum RayFlagsShift : uint
CullNoOpaqueKHR = 7,
SkipTrianglesKHR = 8,
SkipAABBsKHR = 9,
+ ForceOpacityMicromap2StateEXT = 10,
}
enum RayFlagsMask : uint
@@ -1128,6 +1171,7 @@ enum RayFlagsMask : uint
CullNoOpaqueKHR = 0x00000080,
SkipTrianglesKHR = 0x00000100,
SkipAABBsKHR = 0x00000200,
+ ForceOpacityMicromap2StateEXT = 0x00000400,
}
enum RayQueryIntersection : uint
@@ -1593,7 +1637,42 @@ enum Op : uint
OpFragmentMaskFetchAMD = 5011,
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
+ OpHitObjectRecordHitMotionNV = 5249,
+ OpHitObjectRecordHitWithIndexMotionNV = 5250,
+ OpHitObjectRecordMissMotionNV = 5251,
+ OpHitObjectGetWorldToObjectNV = 5252,
+ OpHitObjectGetObjectToWorldNV = 5253,
+ OpHitObjectGetObjectRayDirectionNV = 5254,
+ OpHitObjectGetObjectRayOriginNV = 5255,
+ OpHitObjectTraceRayMotionNV = 5256,
+ OpHitObjectGetShaderRecordBufferHandleNV = 5257,
+ OpHitObjectGetShaderBindingTableRecordIndexNV = 5258,
+ OpHitObjectRecordEmptyNV = 5259,
+ OpHitObjectTraceRayNV = 5260,
+ OpHitObjectRecordHitNV = 5261,
+ OpHitObjectRecordHitWithIndexNV = 5262,
+ OpHitObjectRecordMissNV = 5263,
+ OpHitObjectExecuteShaderNV = 5264,
+ OpHitObjectGetCurrentTimeNV = 5265,
+ OpHitObjectGetAttributesNV = 5266,
+ OpHitObjectGetHitKindNV = 5267,
+ OpHitObjectGetPrimitiveIndexNV = 5268,
+ OpHitObjectGetGeometryIndexNV = 5269,
+ OpHitObjectGetInstanceIdNV = 5270,
+ OpHitObjectGetInstanceCustomIndexNV = 5271,
+ OpHitObjectGetWorldRayDirectionNV = 5272,
+ OpHitObjectGetWorldRayOriginNV = 5273,
+ OpHitObjectGetRayTMaxNV = 5274,
+ OpHitObjectGetRayTMinNV = 5275,
+ OpHitObjectIsEmptyNV = 5276,
+ OpHitObjectIsHitNV = 5277,
+ OpHitObjectIsMissNV = 5278,
+ OpReorderThreadWithHitObjectNV = 5279,
+ OpReorderThreadWithHintNV = 5280,
+ OpTypeHitObjectNV = 5281,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
diff --git a/third_party/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp b/third_party/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp
index f9e06fb5a8..fbae044514 100644
--- a/third_party/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp
+++ b/third_party/spirv-tools/external/spirv-headers/tools/buildHeaders/header.cpp
@@ -583,8 +583,7 @@ namespace {
void printEpilogue(std::ostream& out) const override {
const Json::Value& enums = spvRoot["spv"]["enum"];
- // Create overloaded operator| for mask types
- out << "// Overload operator| for mask bit combining\n\n";
+ out << "// Overload bitwise operators for mask bit combining\n\n";
for (auto opClass = enums.begin(); opClass != enums.end(); ++opClass) {
const bool isMask = (*opClass)["Type"].asString() == "Bit";
@@ -593,8 +592,18 @@ namespace {
if (isMask) {
const auto typeName = opName + styleStr(enumMask);
- out << "inline " + typeName + " operator|(" + typeName + " a, " + typeName + " b) { return " +
- typeName + "(unsigned(a) | unsigned(b)); }\n";
+ // Overload operator|
+ out << "inline " << typeName << " operator|(" << typeName << " a, " << typeName << " b) { return " <<
+ typeName << "(unsigned(a) | unsigned(b)); }\n";
+ // Overload operator&
+ out << "inline " << typeName << " operator&(" << typeName << " a, " << typeName << " b) { return " <<
+ typeName << "(unsigned(a) & unsigned(b)); }\n";
+ // Overload operator^
+ out << "inline " << typeName << " operator^(" << typeName << " a, " << typeName << " b) { return " <<
+ typeName << "(unsigned(a) ^ unsigned(b)); }\n";
+ // Overload operator~
+ out << "inline " << typeName << " operator~(" << typeName << " a) { return " <<
+ typeName << "(~unsigned(a)); }\n";
}
}
diff --git a/third_party/spirv-tools/include/spirv-tools/instrument.hpp b/third_party/spirv-tools/include/spirv-tools/instrument.hpp
index a19491fd3c..a75561b508 100644
--- a/third_party/spirv-tools/include/spirv-tools/instrument.hpp
+++ b/third_party/spirv-tools/include/spirv-tools/instrument.hpp
@@ -36,16 +36,25 @@ namespace spvtools {
// generated by InstrumentPass::GenDebugStreamWrite. This method is utilized
// by InstBindlessCheckPass, InstBuffAddrCheckPass, and InstDebugPrintfPass.
//
-// The first member of the debug output buffer contains the next available word
+// The 1st member of the debug output buffer contains a set of flags
+// controlling the behavior of instrumentation code.
+static const int kDebugOutputFlagsOffset = 0;
+
+// Values stored at kDebugOutputFlagsOffset
+enum kInstFlags : unsigned int {
+ kInstBufferOOBEnable = 0x1,
+};
+
+// The 2nd member of the debug output buffer contains the next available word
// in the data stream to be written. Shaders will atomically read and update
// this value so as not to overwrite each others records. This value must be
// initialized to zero
-static const int kDebugOutputSizeOffset = 0;
+static const int kDebugOutputSizeOffset = 1;
-// The second member of the output buffer is the start of the stream of records
+// The 3rd member of the output buffer is the start of the stream of records
// written by the instrumented shaders. Each record represents a validation
// error. The format of the records is documented below.
-static const int kDebugOutputDataOffset = 1;
+static const int kDebugOutputDataOffset = 2;
// Common Stream Record Offsets
//
diff --git a/third_party/spirv-tools/include/spirv-tools/libspirv.h b/third_party/spirv-tools/include/spirv-tools/libspirv.h
index e1b8890eb9..b549efbada 100644
--- a/third_party/spirv-tools/include/spirv-tools/libspirv.h
+++ b/third_party/spirv-tools/include/spirv-tools/libspirv.h
@@ -670,6 +670,10 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetSkipBlockLayout(
SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowLocalSizeId(
spv_validator_options options, bool val);
+// Whether friendly names should be used in validation error messages.
+SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetFriendlyNames(
+ 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|.
diff --git a/third_party/spirv-tools/include/spirv-tools/libspirv.hpp b/third_party/spirv-tools/include/spirv-tools/libspirv.hpp
index 25eb8a1dcf..408e3ebb23 100644
--- a/third_party/spirv-tools/include/spirv-tools/libspirv.hpp
+++ b/third_party/spirv-tools/include/spirv-tools/libspirv.hpp
@@ -148,6 +148,11 @@ class ValidatorOptions {
spvValidatorOptionsSetBeforeHlslLegalization(options_, val);
}
+ // Whether friendly names should be used in validation error messages.
+ void SetFriendlyNames(bool val) {
+ spvValidatorOptionsSetFriendlyNames(options_, val);
+ }
+
private:
spv_validator_options options_;
};
diff --git a/third_party/spirv-tools/include/spirv-tools/optimizer.hpp b/third_party/spirv-tools/include/spirv-tools/optimizer.hpp
index 949735608d..aa6a614ea6 100644
--- a/third_party/spirv-tools/include/spirv-tools/optimizer.hpp
+++ b/third_party/spirv-tools/include/spirv-tools/optimizer.hpp
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include
#include
@@ -520,8 +521,12 @@ Optimizer::PassToken CreateDeadInsertElimPass();
// 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);
+//
+// If |remove_outputs| is true, allow outputs to be removed from the interface.
+// This is only safe if the caller knows that there is no corresponding input
+// variable in the following shader. It is false by default.
+Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface = false,
+ bool remove_outputs = false);
// Creates a remove-unused-interface-variables pass.
// Removes variables referenced on the |OpEntryPoint| instruction that are not
@@ -887,12 +892,59 @@ Optimizer::PassToken CreateAmdExtToKhrPass();
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.
+// implementation just removes trailing unused components from input arrays
+// and structs. The pass performs best after maximizing dead code removal.
+// A subsequent dead code elimination pass would be beneficial in removing
+// newly unused component types.
+//
+// WARNING: This pass can only be safely applied standalone to vertex shaders
+// as it can otherwise cause interface incompatibilities with the preceding
+// shader in the pipeline. If applied to non-vertex shaders, the user should
+// follow by applying EliminateDeadOutputStores and
+// EliminateDeadOutputComponents to the preceding shader.
Optimizer::PassToken CreateEliminateDeadInputComponentsPass();
+// Removes unused components from composite output variables. Current
+// implementation just removes trailing unused components from output arrays
+// and structs. The pass performs best after eliminating dead output stores.
+// A subsequent dead code elimination pass would be beneficial in removing
+// newly unused component types. Currently only supports vertex and fragment
+// shaders.
+//
+// WARNING: This pass cannot be safely applied standalone as it can cause
+// interface incompatibility with the following shader in the pipeline. The
+// user should first apply EliminateDeadInputComponents to the following
+// shader, then apply EliminateDeadOutputStores to this shader.
+Optimizer::PassToken CreateEliminateDeadOutputComponentsPass();
+
+// Removes unused components from composite input variables. This safe
+// version will not cause interface incompatibilities since it only changes
+// vertex shaders. The current implementation just removes trailing unused
+// components from input structs and 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 CreateEliminateDeadInputComponentsSafePass();
+
+// Analyzes shader and populates |live_locs| and |live_builtins|. Best results
+// will be obtained if shader has all dead code eliminated first. |live_locs|
+// and |live_builtins| are subsequently used when calling
+// CreateEliminateDeadOutputStoresPass on the preceding shader. Currently only
+// supports tesc, tese, geom, and frag shaders.
+Optimizer::PassToken CreateAnalyzeLiveInputPass(
+ std::unordered_set* live_locs,
+ std::unordered_set* live_builtins);
+
+// Removes stores to output locations not listed in |live_locs| or
+// |live_builtins|. Best results are obtained if constant propagation is
+// performed first. A subsequent call to ADCE will eliminate any dead code
+// created by the removal of the stores. A subsequent call to
+// CreateEliminateDeadOutputComponentsPass will eliminate any dead output
+// components created by the elimination of the stores. Currently only supports
+// vert, tesc, tese, and geom shaders.
+Optimizer::PassToken CreateEliminateDeadOutputStoresPass(
+ std::unordered_set* live_locs,
+ std::unordered_set* live_builtins);
+
// 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
diff --git a/third_party/spirv-tools/kokoro/scripts/macos/build.sh b/third_party/spirv-tools/kokoro/scripts/macos/build.sh
index 46128238a6..3618e69053 100644
--- a/third_party/spirv-tools/kokoro/scripts/macos/build.sh
+++ b/third_party/spirv-tools/kokoro/scripts/macos/build.sh
@@ -43,11 +43,9 @@ mkdir build && cd $SRC/build
# Invoke the build.
BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT}
echo $(date): Starting build...
-# We need Python 3. At the moment python3.7 is the newest Python on Kokoro.
cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=$KOKORO_ARTIFACTS_DIR/install \
- -DPYTHON_EXECUTABLE:FILEPATH=/usr/local/bin/python3.7 \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
diff --git a/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/build.bat b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/build.bat
new file mode 100644
index 0000000000..c1945e25a3
--- /dev/null
+++ b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/build.bat
@@ -0,0 +1,57 @@
+:: Copyright (c) 2019 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.
+::
+:: Windows Build Script.
+
+@echo on
+
+set SRC=%cd%\github\SPIRV-Tools
+
+:: Force usage of python 3.6
+set PATH=C:\python36;%PATH%
+
+:: Get dependencies
+cd %SRC%
+git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers
+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
+
+:: REM Install Bazel.
+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\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
+set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC
+
+:: #########################################
+:: Start building.
+:: #########################################
+echo "Build everything... %DATE% %TIME%"
+bazel.exe build :all
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
+echo "Build Completed %DATE% %TIME%"
+
+:: ##############
+:: Run the tests
+:: ##############
+echo "Running Tests... %DATE% %TIME%"
+bazel.exe test :all
+if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
+echo "Tests Completed %DATE% %TIME%"
+
+exit /b 0
+
diff --git a/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/continuous.cfg b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/continuous.cfg
new file mode 100644
index 0000000000..f2387a6889
--- /dev/null
+++ b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/continuous.cfg
@@ -0,0 +1,16 @@
+# Copyright (c) 2019 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-2017-release-bazel/build.bat"
diff --git a/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/presubmit.cfg b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/presubmit.cfg
new file mode 100644
index 0000000000..13394b4100
--- /dev/null
+++ b/third_party/spirv-tools/kokoro/windows-msvc-2017-release-bazel/presubmit.cfg
@@ -0,0 +1,16 @@
+# Copyright (c) 2019 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.
+
+# Presubmit build configuration.
+build_file: "SPIRV-Tools/kokoro/windows-msvc-2017-release-bazel/build.bat"
diff --git a/third_party/spirv-tools/source/CMakeLists.txt b/third_party/spirv-tools/source/CMakeLists.txt
index 420fc38814..26d0583932 100644
--- a/third_party/spirv-tools/source/CMakeLists.txt
+++ b/third_party/spirv-tools/source/CMakeLists.txt
@@ -37,6 +37,7 @@ macro(spvtools_core_tables CONFIG_VERSION)
--extinst-cldebuginfo100-grammar=${CLDEBUGINFO100_GRAMMAR_JSON_FILE}
--core-insts-output=${GRAMMAR_INSTS_INC_FILE}
--operand-kinds-output=${GRAMMAR_KINDS_INC_FILE}
+ --output-language=c++
DEPENDS ${GRAMMAR_PROCESSING_SCRIPT}
${GRAMMAR_JSON_FILE}
${DEBUGINFO_GRAMMAR_JSON_FILE}
@@ -58,6 +59,7 @@ macro(spvtools_enum_string_mapping CONFIG_VERSION)
--extinst-cldebuginfo100-grammar=${CLDEBUGINFO100_GRAMMAR_JSON_FILE}
--extension-enum-output=${GRAMMAR_EXTENSION_ENUM_INC_FILE}
--enum-string-mapping-output=${GRAMMAR_ENUM_STRING_MAPPING_INC_FILE}
+ --output-language=c++
DEPENDS ${GRAMMAR_PROCESSING_SCRIPT}
${GRAMMAR_JSON_FILE}
${DEBUGINFO_GRAMMAR_JSON_FILE}
@@ -92,6 +94,7 @@ macro(spvtools_glsl_tables CONFIG_VERSION)
COMMAND ${PYTHON_EXECUTABLE} ${GRAMMAR_PROCESSING_SCRIPT}
--extinst-glsl-grammar=${GLSL_GRAMMAR_JSON_FILE}
--glsl-insts-output=${GRAMMAR_INC_FILE}
+ --output-language=c++
DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${CORE_GRAMMAR_JSON_FILE} ${GLSL_GRAMMAR_JSON_FILE}
COMMENT "Generate info tables for GLSL extended instructions and operands v${CONFIG_VERSION}.")
list(APPEND EXTINST_CPP_DEPENDS ${GRAMMAR_INC_FILE})
@@ -124,7 +127,7 @@ macro(spvtools_vendor_tables VENDOR_TABLE SHORT_NAME OPERAND_KIND_PREFIX)
DEPENDS ${GRAMMAR_PROCESSING_SCRIPT} ${GRAMMAR_FILE}
COMMENT "Generate extended instruction tables for ${VENDOR_TABLE}.")
add_custom_target(spv-tools-${SHORT_NAME} DEPENDS ${INSTS_FILE})
- set_property(TARGET spv-tools-${SHORT_NAME} PROPERTY FOLDER "ThirdParty/SPIRV-Tools build")
+ set_property(TARGET spv-tools-${SHORT_NAME} PROPERTY FOLDER "SPIRV-Tools build")
list(APPEND EXTINST_CPP_DEPENDS spv-tools-${SHORT_NAME})
endmacro(spvtools_vendor_tables)
@@ -137,7 +140,7 @@ macro(spvtools_extinst_lang_headers NAME GRAMMAR_FILE)
DEPENDS ${LANG_HEADER_PROCESSING_SCRIPT} ${GRAMMAR_FILE}
COMMENT "Generate language specific header for ${NAME}.")
add_custom_target(spirv-tools-header-${NAME} DEPENDS ${OUT_H})
- set_property(TARGET spirv-tools-header-${NAME} PROPERTY FOLDER "ThirdParty/SPIRV-Tools build")
+ set_property(TARGET spirv-tools-header-${NAME} PROPERTY FOLDER "SPIRV-Tools build")
list(APPEND EXTINST_CPP_DEPENDS spirv-tools-header-${NAME})
endmacro(spvtools_extinst_lang_headers)
@@ -159,7 +162,7 @@ spvtools_extinst_lang_headers("NonSemanticShaderDebugInfo100" ${VKDEBUGINFO100_G
spvtools_vimsyntax("unified1" "1.0")
add_custom_target(spirv-tools-vimsyntax DEPENDS ${VIMSYNTAX_FILE})
-set_property(TARGET spirv-tools-vimsyntax PROPERTY FOLDER "ThirdParty/SPIRV-Tools utilities")
+set_property(TARGET spirv-tools-vimsyntax PROPERTY FOLDER "SPIRV-Tools utilities")
# Extract the list of known generators from the SPIR-V XML registry file.
set(GENERATOR_INC_FILE ${spirv-tools_BINARY_DIR}/generators.inc)
@@ -184,13 +187,6 @@ add_custom_target(enum_string_mapping
add_custom_target(extinst_tables
DEPENDS ${EXTINST_CPP_DEPENDS})
-set_target_properties(core_tables PROPERTIES
- FOLDER "ThirdParty/SPIRV-Tools libraries")
-set_target_properties(enum_string_mapping PROPERTIES
- FOLDER "ThirdParty/SPIRV-Tools libraries")
-set_target_properties(extinst_tables PROPERTIES
- FOLDER "ThirdParty/SPIRV-Tools libraries")
-
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/extensions.h
PROPERTIES HEADER_FILE_ONLY TRUE)
@@ -212,7 +208,7 @@ add_custom_command(OUTPUT ${SPIRV_TOOLS_BUILD_VERSION_INC}
# This is not required for any dependence chain.
add_custom_target(spirv-tools-build-version
DEPENDS ${SPIRV_TOOLS_BUILD_VERSION_INC})
-set_property(TARGET spirv-tools-build-version PROPERTY FOLDER "ThirdParty/SPIRV-Tools build")
+set_property(TARGET spirv-tools-build-version PROPERTY FOLDER "SPIRV-Tools build")
list(APPEND PCH_DEPENDS ${ENUM_STRING_MAPPING_CPP_DEPENDS} ${OPCODE_CPP_DEPENDS} ${OPERAND_CPP_DEPENDS} ${EXTENSION_H_DEPENDS} ${EXTINST_CPP_DEPENDS} ${SPIRV_TOOLS_BUILD_VERSION_INC})
set_source_files_properties(
@@ -235,7 +231,6 @@ set(SPIRV_SOURCES
${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
@@ -326,10 +321,14 @@ set(SPIRV_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_logicals.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_memory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_memory_semantics.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_mesh_shading.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_misc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_mode_setting.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_non_uniform.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_primitives.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_ray_query.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_ray_tracing.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/val/validate_ray_tracing_reorder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_scopes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_small_type_uses.cpp
${CMAKE_CURRENT_SOURCE_DIR}/val/validate_type.cpp
@@ -374,7 +373,7 @@ function(spirv_tools_default_target_options target)
PRIVATE ${spirv-tools_BINARY_DIR}
PRIVATE ${SPIRV_HEADER_INCLUDE_DIR}
)
- set_property(TARGET ${target} PROPERTY FOLDER "ThirdParty/SPIRV-Tools libraries")
+ set_property(TARGET ${target} PROPERTY FOLDER "SPIRV-Tools libraries")
spvtools_check_symbol_exports(${target})
add_dependencies(${target} spirv-tools-build-version core_tables enum_string_mapping extinst_tables)
endfunction()
diff --git a/third_party/spirv-tools/source/assembly_grammar.cpp b/third_party/spirv-tools/source/assembly_grammar.cpp
index 4f5942ab4f..6df823e307 100644
--- a/third_party/spirv-tools/source/assembly_grammar.cpp
+++ b/third_party/spirv-tools/source/assembly_grammar.cpp
@@ -78,16 +78,16 @@ spv_result_t spvTextParseMaskOperand(spv_target_env env,
// Associates an opcode with its name.
struct SpecConstantOpcodeEntry {
- SpvOp opcode;
+ spv::Op opcode;
const char* name;
};
// All the opcodes allowed as the operation for OpSpecConstantOp.
-// The name does not have the usual "Op" prefix. For example opcode SpvOpIAdd
-// is associated with the name "IAdd".
+// The name does not have the usual "Op" prefix. For example opcode
+// spv::Op::IAdd is associated with the name "IAdd".
//
// clang-format off
-#define CASE(NAME) { SpvOp##NAME, #NAME }
+#define CASE(NAME) { spv::Op::Op##NAME, #NAME }
const SpecConstantOpcodeEntry kOpSpecConstantOpcodes[] = {
// Conversion
CASE(SConvert),
@@ -173,7 +173,7 @@ bool AssemblyGrammar::isValid() const {
}
CapabilitySet AssemblyGrammar::filterCapsAgainstTargetEnv(
- const SpvCapability* cap_array, uint32_t count) const {
+ const spv::Capability* cap_array, uint32_t count) const {
CapabilitySet cap_set;
for (uint32_t i = 0; i < count; ++i) {
spv_operand_desc cap_desc = {};
@@ -194,7 +194,7 @@ spv_result_t AssemblyGrammar::lookupOpcode(const char* name,
return spvOpcodeTableNameLookup(target_env_, opcodeTable_, name, desc);
}
-spv_result_t AssemblyGrammar::lookupOpcode(SpvOp opcode,
+spv_result_t AssemblyGrammar::lookupOpcode(spv::Op opcode,
spv_opcode_desc* desc) const {
return spvOpcodeTableValueLookup(target_env_, opcodeTable_, opcode, desc);
}
@@ -214,7 +214,7 @@ spv_result_t AssemblyGrammar::lookupOperand(spv_operand_type_t type,
}
spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name,
- SpvOp* opcode) const {
+ spv::Op* opcode) const {
const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes;
const auto* found =
std::find_if(kOpSpecConstantOpcodes, last,
@@ -226,7 +226,7 @@ spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(const char* name,
return SPV_SUCCESS;
}
-spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(SpvOp opcode) const {
+spv_result_t AssemblyGrammar::lookupSpecConstantOpcode(spv::Op opcode) const {
const auto* last = kOpSpecConstantOpcodes + kNumOpSpecConstantOpcodes;
const auto* found =
std::find_if(kOpSpecConstantOpcodes, last,
diff --git a/third_party/spirv-tools/source/assembly_grammar.h b/third_party/spirv-tools/source/assembly_grammar.h
index 17c2bd3bac..36fdd08a6d 100644
--- a/third_party/spirv-tools/source/assembly_grammar.h
+++ b/third_party/spirv-tools/source/assembly_grammar.h
@@ -41,7 +41,7 @@ class AssemblyGrammar {
// Removes capabilities not available in the current target environment and
// returns the rest.
- CapabilitySet filterCapsAgainstTargetEnv(const SpvCapability* cap_array,
+ CapabilitySet filterCapsAgainstTargetEnv(const spv::Capability* cap_array,
uint32_t count) const;
// Fills in the desc parameter with the information about the opcode
@@ -52,7 +52,7 @@ class AssemblyGrammar {
// Fills in the desc parameter with the information about the opcode
// of the valid. Returns SPV_SUCCESS if the opcode was found, and
// SPV_ERROR_INVALID_LOOKUP if the opcode does not exist.
- spv_result_t lookupOpcode(SpvOp opcode, spv_opcode_desc* desc) const;
+ spv_result_t lookupOpcode(spv::Op opcode, spv_opcode_desc* desc) const;
// Fills in the desc parameter with the information about the given
// operand. Returns SPV_SUCCESS if the operand was found, and
@@ -82,11 +82,12 @@ class AssemblyGrammar {
// the integer add opcode for OpSpecConstantOp. On success, returns
// SPV_SUCCESS and sends the discovered operation code through the opcode
// parameter. On failure, returns SPV_ERROR_INVALID_LOOKUP.
- spv_result_t lookupSpecConstantOpcode(const char* name, SpvOp* opcode) const;
+ spv_result_t lookupSpecConstantOpcode(const char* name,
+ spv::Op* opcode) const;
// Returns SPV_SUCCESS if the given opcode is valid as the opcode operand
// to OpSpecConstantOp.
- spv_result_t lookupSpecConstantOpcode(SpvOp opcode) const;
+ spv_result_t lookupSpecConstantOpcode(spv::Op opcode) const;
// Parses a mask expression string for the given operand type.
//
diff --git a/third_party/spirv-tools/source/binary.cpp b/third_party/spirv-tools/source/binary.cpp
index 24d32f8c4a..beb56be7b5 100644
--- a/third_party/spirv-tools/source/binary.cpp
+++ b/third_party/spirv-tools/source/binary.cpp
@@ -156,7 +156,7 @@ class Parser {
// Issues a diagnostic describing an exhaustion of input condition when
// trying to decode an instruction operand, and returns
// SPV_ERROR_INVALID_BINARY.
- spv_result_t exhaustedInputDiagnostic(size_t inst_offset, SpvOp opcode,
+ spv_result_t exhaustedInputDiagnostic(size_t inst_offset, spv::Op opcode,
spv_operand_type_t type) {
return diagnostic() << "End of input reached while decoding Op"
<< spvOpcodeString(opcode) << " starting at word "
@@ -318,7 +318,7 @@ spv_result_t Parser::parseInstruction() {
<< inst_word_count;
}
spv_opcode_desc opcode_desc;
- if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc))
+ if (grammar_.lookupOpcode(static_cast(inst.opcode), &opcode_desc))
return diagnostic() << "Invalid opcode: " << inst.opcode;
// Advance past the opcode word. But remember the of the start
@@ -418,7 +418,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
std::vector* words,
std::vector* operands,
spv_operand_pattern_t* expected_operands) {
- const SpvOp opcode = static_cast(inst->opcode);
+ const spv::Op opcode = static_cast(inst->opcode);
// We'll fill in this result as we go along.
spv_parsed_operand_t parsed_operand;
parsed_operand.offset = uint16_t(_.word_index - inst_offset);
@@ -473,7 +473,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
if (!word) return diagnostic(SPV_ERROR_INVALID_ID) << "Id is 0";
parsed_operand.type = SPV_OPERAND_TYPE_ID;
- if (opcode == SpvOpExtInst && parsed_operand.offset == 3) {
+ if (opcode == spv::Op::OpExtInst && parsed_operand.offset == 3) {
// The current word is the extended instruction set Id.
// Set the extended instruction set type for the current instruction.
auto ext_inst_type_iter = _.import_id_to_ext_inst_type.find(word);
@@ -494,7 +494,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
break;
case SPV_OPERAND_TYPE_EXTENSION_INSTRUCTION_NUMBER: {
- assert(SpvOpExtInst == opcode);
+ assert(spv::Op::OpExtInst == opcode);
assert(inst->ext_inst_type != SPV_EXT_INST_TYPE_NONE);
spv_ext_inst_desc ext_inst;
if (grammar_.lookupExtInst(inst->ext_inst_type, word, &ext_inst) ==
@@ -516,14 +516,14 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
} break;
case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: {
- assert(SpvOpSpecConstantOp == opcode);
- if (word > static_cast(SpvOp::SpvOpMax) ||
- grammar_.lookupSpecConstantOpcode(SpvOp(word))) {
+ assert(spv::Op::OpSpecConstantOp == opcode);
+ if (word > static_cast(spv::Op::Max) ||
+ grammar_.lookupSpecConstantOpcode(spv::Op(word))) {
return diagnostic()
<< "Invalid " << spvOperandTypeStr(type) << ": " << word;
}
spv_opcode_desc opcode_entry = nullptr;
- if (grammar_.lookupOpcode(SpvOp(word), &opcode_entry)) {
+ if (grammar_.lookupOpcode(spv::Op(word), &opcode_entry)) {
return diagnostic(SPV_ERROR_INTERNAL)
<< "OpSpecConstant opcode table out of sync";
}
@@ -549,7 +549,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
parsed_operand.type = SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER;
- if (opcode == SpvOpSwitch) {
+ if (opcode == spv::Op::OpSwitch) {
// The literal operands have the same type as the value
// referenced by the selector Id.
const uint32_t selector_id = peekAt(inst_offset + 1);
@@ -575,7 +575,8 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
<< " is not a scalar integer";
}
} else {
- assert(opcode == SpvOpConstant || opcode == SpvOpSpecConstant);
+ assert(opcode == spv::Op::OpConstant ||
+ opcode == spv::Op::OpSpecConstant);
// The literal number type is determined by the type Id for the
// constant.
assert(inst->type_id);
@@ -607,7 +608,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
parsed_operand.num_words = uint16_t(string_num_words);
parsed_operand.type = SPV_OPERAND_TYPE_LITERAL_STRING;
- if (SpvOpExtInstImport == opcode) {
+ if (spv::Op::OpExtInstImport == opcode) {
// Record the extended instruction type for the ID for this import.
// There is only one string literal argument to OpExtInstImport,
// so it's sufficient to guard this just on the opcode.
@@ -789,14 +790,14 @@ spv_result_t Parser::setNumericTypeInfoForType(
void Parser::recordNumberType(size_t inst_offset,
const spv_parsed_instruction_t* inst) {
- const SpvOp opcode = static_cast(inst->opcode);
+ const spv::Op opcode = static_cast(inst->opcode);
if (spvOpcodeGeneratesType(opcode)) {
NumberType info = {SPV_NUMBER_NONE, 0};
- if (SpvOpTypeInt == opcode) {
+ if (spv::Op::OpTypeInt == opcode) {
const bool is_signed = peekAt(inst_offset + 3) != 0;
info.type = is_signed ? SPV_NUMBER_SIGNED_INT : SPV_NUMBER_UNSIGNED_INT;
info.bit_width = peekAt(inst_offset + 2);
- } else if (SpvOpTypeFloat == opcode) {
+ } else if (spv::Op::OpTypeFloat == opcode) {
info.type = SPV_NUMBER_FLOATING;
info.bit_width = peekAt(inst_offset + 2);
}
diff --git a/third_party/spirv-tools/source/cfa.h b/third_party/spirv-tools/source/cfa.h
index 7cadf55f07..9ae3e39a19 100644
--- a/third_party/spirv-tools/source/cfa.h
+++ b/third_party/spirv-tools/source/cfa.h
@@ -52,12 +52,37 @@ class CFA {
uint32_t id);
public:
+ /// @brief Depth first traversal starting from the \p entry BasicBlock
+ ///
+ /// This function performs a depth first traversal from the \p entry
+ /// BasicBlock and calls the pre/postorder functions when it needs to process
+ /// the node in pre order, post order.
+ ///
+ /// @param[in] entry The root BasicBlock of a CFG
+ /// @param[in] successor_func A function which will return a pointer to the
+ /// successor nodes
+ /// @param[in] preorder A function that will be called for every block in a
+ /// CFG following preorder traversal semantics
+ /// @param[in] postorder A function that will be called for every block in a
+ /// CFG following postorder traversal semantics
+ /// @param[in] terminal A function that will be called to determine if the
+ /// search should stop at the given node.
+ /// NOTE: The @p successor_func and predecessor_func each return a pointer to
+ /// a collection such that iterators to that collection remain valid for the
+ /// lifetime of the algorithm.
+ static void DepthFirstTraversal(const BB* entry,
+ get_blocks_func successor_func,
+ std::function preorder,
+ std::function postorder,
+ std::function terminal);
+
/// @brief Depth first traversal starting from the \p entry BasicBlock
///
/// This function performs a depth first traversal from the \p entry
/// BasicBlock and calls the pre/postorder functions when it needs to process
/// the node in pre order, post order. It also calls the backedge function
- /// when a back edge is encountered.
+ /// when a back edge is encountered. The backedge function can be empty. The
+ /// runtime of the algorithm is improved if backedge is empty.
///
/// @param[in] entry The root BasicBlock of a CFG
/// @param[in] successor_func A function which will return a pointer to the
@@ -67,16 +92,18 @@ class CFA {
/// @param[in] postorder A function that will be called for every block in a
/// CFG following postorder traversal semantics
/// @param[in] backedge A function that will be called when a backedge is
- /// encountered during a traversal
+ /// encountered during a traversal.
+ /// @param[in] terminal A function that will be called to determine if the
+ /// search should stop at the given node.
/// NOTE: The @p successor_func and predecessor_func each return a pointer to
- /// a
- /// collection such that iterators to that collection remain valid for the
+ /// a collection such that iterators to that collection remain valid for the
/// lifetime of the algorithm.
static void DepthFirstTraversal(
const BB* entry, get_blocks_func successor_func,
std::function preorder,
std::function postorder,
- std::function backedge);
+ std::function backedge,
+ std::function terminal);
/// @brief Calculates dominator edges for a set of blocks
///
@@ -133,12 +160,28 @@ bool CFA::FindInWorkList(const std::vector& work_list,
return false;
}
+template
+void CFA::DepthFirstTraversal(const BB* entry,
+ get_blocks_func successor_func,
+ std::function preorder,
+ std::function postorder,
+ std::function terminal) {
+ DepthFirstTraversal(entry, successor_func, preorder, postorder,
+ /* backedge = */ {}, terminal);
+}
+
template
void CFA::DepthFirstTraversal(
const BB* entry, get_blocks_func successor_func,
std::function preorder,
std::function postorder,
- std::function backedge) {
+ std::function backedge,
+ std::function terminal) {
+ assert(successor_func && "The successor function cannot be empty.");
+ assert(preorder && "The preorder function cannot be empty.");
+ assert(postorder && "The postorder function cannot be empty.");
+ assert(terminal && "The terminal function cannot be empty.");
+
std::unordered_set processed;
/// NOTE: work_list is the sequence of nodes from the root node to the node
@@ -152,13 +195,13 @@ void CFA::DepthFirstTraversal(
while (!work_list.empty()) {
block_info& top = work_list.back();
- if (top.iter == end(*successor_func(top.block))) {
+ if (terminal(top.block) || top.iter == end(*successor_func(top.block))) {
postorder(top.block);
work_list.pop_back();
} else {
BB* child = *top.iter;
top.iter++;
- if (FindInWorkList(work_list, child->id())) {
+ if (backedge && FindInWorkList(work_list, child->id())) {
backedge(top.block, child);
}
if (processed.count(child->id()) == 0) {
@@ -232,10 +275,16 @@ std::vector> CFA::CalculateDominators(
std::vector> out;
for (auto idom : idoms) {
+ // At this point if there is no dominator for the node, just make it
+ // reflexive.
+ auto dominator = std::get<1>(idom).dominator;
+ if (dominator == undefined_dom) {
+ dominator = std::get<1>(idom).postorder_index;
+ }
// NOTE: performing a const cast for convenient usage with
// UpdateImmediateDominators
out.push_back({const_cast(std::get<0>(idom)),
- const_cast(postorder[std::get<1>(idom).dominator])});
+ const_cast(postorder[dominator])});
}
// Sort by postorder index to generate a deterministic ordering of edges.
@@ -265,12 +314,12 @@ std::vector CFA::TraversalRoots(const std::vector& blocks,
auto mark_visited = [&visited](const BB* b) { visited.insert(b); };
auto ignore_block = [](const BB*) {};
- auto ignore_blocks = [](const BB*, const BB*) {};
+ auto no_terminal_blocks = [](const BB*) { return false; };
auto traverse_from_root = [&mark_visited, &succ_func, &ignore_block,
- &ignore_blocks](const BB* entry) {
+ &no_terminal_blocks](const BB* entry) {
DepthFirstTraversal(entry, succ_func, mark_visited, ignore_block,
- ignore_blocks);
+ no_terminal_blocks);
};
std::vector result;
diff --git a/third_party/spirv-tools/source/diff/CMakeLists.txt b/third_party/spirv-tools/source/diff/CMakeLists.txt
index 33acda8281..1328699ab1 100644
--- a/third_party/spirv-tools/source/diff/CMakeLists.txt
+++ b/third_party/spirv-tools/source/diff/CMakeLists.txt
@@ -35,7 +35,7 @@ target_link_libraries(SPIRV-Tools-diff
target_link_libraries(SPIRV-Tools-diff
PUBLIC SPIRV-Tools-opt)
-set_property(TARGET SPIRV-Tools-diff PROPERTY FOLDER "ThirdParty/SPIRV-Tools libraries")
+set_property(TARGET SPIRV-Tools-diff PROPERTY FOLDER "SPIRV-Tools libraries")
spvtools_check_symbol_exports(SPIRV-Tools-diff)
if(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/third_party/spirv-tools/source/diff/diff.cpp b/third_party/spirv-tools/source/diff/diff.cpp
index bca31b061c..6daed321d1 100644
--- a/third_party/spirv-tools/source/diff/diff.cpp
+++ b/third_party/spirv-tools/source/diff/diff.cpp
@@ -44,8 +44,8 @@ using IdGroup = std::vector;
// different implementations produce identical results.
using IdGroupMapByName = std::map;
using IdGroupMapByTypeId = std::map;
-using IdGroupMapByOp = std::map;
-using IdGroupMapByStorageClass = std::map;
+using IdGroupMapByOp = std::map;
+using IdGroupMapByStorageClass = std::map;
// A set of potential id mappings that haven't been resolved yet. Any id in src
// may map in any id in dst. Note that ids are added in the same order as they
@@ -301,10 +301,10 @@ class Differ {
// Get various properties from an id. These Helper functions are passed to
// `GroupIds` and `GroupIdsAndMatch` below (as the `get_group` argument).
uint32_t GroupIdsHelperGetTypeId(const IdInstructions& id_to, uint32_t id);
- SpvStorageClass GroupIdsHelperGetTypePointerStorageClass(
+ spv::StorageClass GroupIdsHelperGetTypePointerStorageClass(
const IdInstructions& id_to, uint32_t id);
- SpvOp GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
- uint32_t id);
+ spv::Op GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
+ uint32_t id);
// Given a list of ids, groups them based on some value. The `get_group`
// function extracts a piece of information corresponding to each id, and the
@@ -414,8 +414,8 @@ class Differ {
// Helper functions to retrieve information pertaining to an id
const opt::Instruction* GetInst(const IdInstructions& id_to, uint32_t id);
uint32_t GetConstantUint(const IdInstructions& id_to, uint32_t constant_id);
- SpvExecutionModel GetExecutionModel(const opt::Module* module,
- uint32_t entry_point_id);
+ spv::ExecutionModel GetExecutionModel(const opt::Module* module,
+ uint32_t entry_point_id);
bool HasName(const IdInstructions& id_to, uint32_t id);
// Get the OpName associated with an id
std::string GetName(const IdInstructions& id_to, uint32_t id, bool* has_name);
@@ -424,20 +424,21 @@ class Differ {
// string, and this improves diff between SPIR-V from those tools and others.
std::string GetSanitizedName(const IdInstructions& id_to, uint32_t id);
uint32_t GetVarTypeId(const IdInstructions& id_to, uint32_t var_id,
- SpvStorageClass* storage_class);
+ spv::StorageClass* storage_class);
bool GetDecorationValue(const IdInstructions& id_to, uint32_t id,
- SpvDecoration decoration, uint32_t* decoration_value);
+ spv::Decoration decoration,
+ uint32_t* decoration_value);
const opt::Instruction* GetForwardPointerInst(const IdInstructions& id_to,
uint32_t id);
bool IsIntType(const IdInstructions& id_to, uint32_t type_id);
bool IsFloatType(const IdInstructions& id_to, uint32_t type_id);
bool IsConstantUint(const IdInstructions& id_to, uint32_t id);
bool IsVariable(const IdInstructions& id_to, uint32_t pointer_id);
- bool IsOp(const IdInstructions& id_to, uint32_t id, SpvOp opcode);
+ bool IsOp(const IdInstructions& id_to, uint32_t id, spv::Op opcode);
bool IsPerVertexType(const IdInstructions& id_to, uint32_t type_id);
bool IsPerVertexVariable(const IdInstructions& id_to, uint32_t type_id);
- SpvStorageClass GetPerVertexStorageClass(const opt::Module* module,
- uint32_t type_id);
+ spv::StorageClass GetPerVertexStorageClass(const opt::Module* module,
+ uint32_t type_id);
spv_ext_inst_type_t GetExtInstType(const IdInstructions& id_to,
uint32_t set_id);
spv_number_kind_t GetNumberKind(const IdInstructions& id_to,
@@ -561,19 +562,19 @@ void IdInstructions::MapIdsToInfos(
uint32_t id_operand = 0;
switch (inst.opcode()) {
- case SpvOpName:
+ case spv::Op::OpName:
info_map = &name_map_;
break;
- case SpvOpMemberName:
+ case spv::Op::OpMemberName:
info_map = &name_map_;
break;
- case SpvOpDecorate:
+ case spv::Op::OpDecorate:
info_map = &decoration_map_;
break;
- case SpvOpMemberDecorate:
+ case spv::Op::OpMemberDecorate:
info_map = &decoration_map_;
break;
- case SpvOpTypeForwardPointer: {
+ case spv::Op::OpTypeForwardPointer: {
uint32_t id = inst.GetSingleWordOperand(0);
assert(id != 0);
@@ -731,10 +732,10 @@ int Differ::ComparePreambleInstructions(const opt::Instruction* a,
// Instead of comparing OpExecutionMode entry point ids as ids, compare them
// through their corresponding execution model. This simplifies traversing
// the sorted list of instructions between src and dst modules.
- if (a->opcode() == SpvOpExecutionMode) {
- const SpvExecutionModel src_model =
+ if (a->opcode() == spv::Op::OpExecutionMode) {
+ const spv::ExecutionModel src_model =
GetExecutionModel(src_inst_module, a->GetSingleWordOperand(0));
- const SpvExecutionModel dst_model =
+ const spv::ExecutionModel dst_model =
GetExecutionModel(dst_inst_module, b->GetSingleWordOperand(0));
if (src_model < dst_model) {
@@ -758,9 +759,6 @@ int Differ::ComparePreambleInstructions(const opt::Instruction* a,
return 1;
}
- assert(a_operand.words.size() == 1);
- assert(b_operand.words.size() == 1);
-
switch (a_operand.type) {
case SPV_OPERAND_TYPE_ID:
// Don't compare ids, there can't be multiple instances of the
@@ -781,6 +779,9 @@ int Differ::ComparePreambleInstructions(const opt::Instruction* a,
}
default:
// Expect literal values to match.
+ assert(a_operand.words.size() == 1);
+ assert(b_operand.words.size() == 1);
+
if (a_operand.words[0] < b_operand.words[0]) {
return -1;
}
@@ -818,17 +819,17 @@ uint32_t Differ::GroupIdsHelperGetTypeId(const IdInstructions& id_to,
return GetInst(id_to, id)->type_id();
}
-SpvStorageClass Differ::GroupIdsHelperGetTypePointerStorageClass(
+spv::StorageClass Differ::GroupIdsHelperGetTypePointerStorageClass(
const IdInstructions& id_to, uint32_t id) {
const opt::Instruction* inst = GetInst(id_to, id);
- assert(inst && inst->opcode() == SpvOpTypePointer);
- return SpvStorageClass(inst->GetSingleWordInOperand(0));
+ assert(inst && inst->opcode() == spv::Op::OpTypePointer);
+ return spv::StorageClass(inst->GetSingleWordInOperand(0));
}
-SpvOp Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
- uint32_t id) {
+spv::Op Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
+ uint32_t id) {
const opt::Instruction* inst = GetInst(id_to, id);
- assert(inst && inst->opcode() == SpvOpTypePointer);
+ assert(inst && inst->opcode() == spv::Op::OpTypePointer);
const uint32_t type_id = inst->GetSingleWordInOperand(1);
const opt::Instruction* type_inst = GetInst(id_to, type_id);
@@ -1020,7 +1021,7 @@ bool Differ::DoInstructionsMatchFuzzy(const opt::Instruction* src_inst,
}
// For external instructions, make sure the set and opcode of the external
// instruction matches too.
- if (src_inst->opcode() == SpvOpExtInst) {
+ if (src_inst->opcode() == spv::Op::OpExtInst) {
if (!DoOperandsMatch(src_inst, dst_inst, 0, 2)) {
return false;
}
@@ -1064,26 +1065,26 @@ bool Differ::DoDebugAndAnnotationInstructionsMatch(
}
switch (src_inst->opcode()) {
- case SpvOpString:
- case SpvOpSourceExtension:
- case SpvOpModuleProcessed:
+ case spv::Op::OpString:
+ case spv::Op::OpSourceExtension:
+ case spv::Op::OpModuleProcessed:
return DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0));
- case SpvOpSource:
+ case spv::Op::OpSource:
return DoOperandsMatch(src_inst, dst_inst, 0, 2);
- case SpvOpSourceContinued:
+ case spv::Op::OpSourceContinued:
return true;
- case SpvOpName:
+ case spv::Op::OpName:
return DoOperandsMatch(src_inst, dst_inst, 0, 1);
- case SpvOpMemberName:
+ case spv::Op::OpMemberName:
return DoOperandsMatch(src_inst, dst_inst, 0, 2);
- case SpvOpDecorate:
+ case spv::Op::OpDecorate:
return DoOperandsMatch(src_inst, dst_inst, 0, 2);
- case SpvOpMemberDecorate:
+ case spv::Op::OpMemberDecorate:
return DoOperandsMatch(src_inst, dst_inst, 0, 3);
- case SpvOpExtInst:
- case SpvOpDecorationGroup:
- case SpvOpGroupDecorate:
- case SpvOpGroupMemberDecorate:
+ case spv::Op::OpExtInst:
+ case spv::Op::OpDecorationGroup:
+ case spv::Op::OpGroupDecorate:
+ case spv::Op::OpGroupMemberDecorate:
return false;
default:
return false;
@@ -1095,9 +1096,9 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id,
// Variables must match by their built-in decorations.
uint32_t src_built_in_decoration = 0, dst_built_in_decoration = 0;
const bool src_is_built_in = GetDecorationValue(
- src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration);
+ src_id_to_, src_id, spv::Decoration::BuiltIn, &src_built_in_decoration);
const bool dst_is_built_in = GetDecorationValue(
- dst_id_to_, dst_id, SpvDecorationBuiltIn, &dst_built_in_decoration);
+ dst_id_to_, dst_id, spv::Decoration::BuiltIn, &dst_built_in_decoration);
if (src_is_built_in != dst_is_built_in) {
return false;
@@ -1107,7 +1108,7 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id,
}
// Check their types and storage classes.
- SpvStorageClass src_storage_class, dst_storage_class;
+ spv::StorageClass src_storage_class, dst_storage_class;
const uint32_t src_type_id =
GetVarTypeId(src_id_to_, src_id, &src_storage_class);
const uint32_t dst_type_id =
@@ -1127,12 +1128,14 @@ bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id,
// Allow one of the two to be Private while the other is Input or
// Output, this allows matching in/out variables that have been turned
// global as part of linking two stages (as done in ANGLE).
- const bool src_is_io = src_storage_class == SpvStorageClassInput ||
- src_storage_class == SpvStorageClassOutput;
- const bool dst_is_io = dst_storage_class == SpvStorageClassInput ||
- dst_storage_class == SpvStorageClassOutput;
- const bool src_is_private = src_storage_class == SpvStorageClassPrivate;
- const bool dst_is_private = dst_storage_class == SpvStorageClassPrivate;
+ const bool src_is_io = src_storage_class == spv::StorageClass::Input ||
+ src_storage_class == spv::StorageClass::Output;
+ const bool dst_is_io = dst_storage_class == spv::StorageClass::Input ||
+ dst_storage_class == spv::StorageClass::Output;
+ const bool src_is_private =
+ src_storage_class == spv::StorageClass::Private;
+ const bool dst_is_private =
+ dst_storage_class == spv::StorageClass::Private;
if (!((src_is_io && dst_is_private) || (src_is_private && dst_is_io))) {
return false;
@@ -1277,15 +1280,22 @@ bool Differ::MatchOpSpecConstant(const opt::Instruction* src_inst,
// Otherwise, match them by SpecId.
uint32_t src_spec_id, dst_spec_id;
- if (GetDecorationValue(src_id_to_, src_id, SpvDecorationSpecId,
+ if (GetDecorationValue(src_id_to_, src_id, spv::Decoration::SpecId,
&src_spec_id) &&
- GetDecorationValue(dst_id_to_, dst_id, SpvDecorationSpecId,
+ GetDecorationValue(dst_id_to_, dst_id, spv::Decoration::SpecId,
&dst_spec_id)) {
return src_spec_id == dst_spec_id;
}
- // There is no spec id, this is not valid.
- assert(false && "Unreachable");
+ // There is no SpecId decoration, while not practical, still valid.
+ // SpecConstantOp don't have SpecId and can be matched by operands
+ if (src_inst->opcode() == spv::Op::OpSpecConstantOp) {
+ if (src_inst->NumInOperandWords() == dst_inst->NumInOperandWords()) {
+ return DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+ }
+ }
+
return false;
}
@@ -1320,13 +1330,13 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst,
// built-in decorations.
uint32_t src_built_in_decoration;
const bool src_is_built_in = GetDecorationValue(
- src_id_to_, src_id, SpvDecorationBuiltIn, &src_built_in_decoration);
+ src_id_to_, src_id, spv::Decoration::BuiltIn, &src_built_in_decoration);
if (src_is_built_in && AreVariablesMatchable(src_id, dst_id, flexibility)) {
return true;
}
- SpvStorageClass src_storage_class, dst_storage_class;
+ spv::StorageClass src_storage_class, dst_storage_class;
GetVarTypeId(src_id_to_, src_id, &src_storage_class);
GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class);
@@ -1341,13 +1351,13 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst,
uint32_t src_binding = 0, dst_binding = 0;
const bool src_has_set = GetDecorationValue(
- src_id_to_, src_id, SpvDecorationDescriptorSet, &src_set);
+ src_id_to_, src_id, spv::Decoration::DescriptorSet, &src_set);
const bool dst_has_set = GetDecorationValue(
- dst_id_to_, dst_id, SpvDecorationDescriptorSet, &dst_set);
- const bool src_has_binding =
- GetDecorationValue(src_id_to_, src_id, SpvDecorationBinding, &src_set);
- const bool dst_has_binding =
- GetDecorationValue(dst_id_to_, dst_id, SpvDecorationBinding, &dst_set);
+ dst_id_to_, dst_id, spv::Decoration::DescriptorSet, &dst_set);
+ const bool src_has_binding = GetDecorationValue(
+ src_id_to_, src_id, spv::Decoration::Binding, &src_set);
+ const bool dst_has_binding = GetDecorationValue(
+ dst_id_to_, dst_id, spv::Decoration::Binding, &dst_set);
if (src_has_set && dst_has_set && src_has_binding && dst_has_binding) {
return src_set == dst_set && src_binding == dst_binding;
@@ -1360,9 +1370,9 @@ bool Differ::MatchOpVariable(const opt::Instruction* src_inst,
uint32_t src_location, dst_location;
const bool src_has_location = GetDecorationValue(
- src_id_to_, src_id, SpvDecorationLocation, &src_location);
+ src_id_to_, src_id, spv::Decoration::Location, &src_location);
const bool dst_has_location = GetDecorationValue(
- dst_id_to_, dst_id, SpvDecorationLocation, &dst_location);
+ dst_id_to_, dst_id, spv::Decoration::Location, &dst_location);
if (src_has_location && dst_has_location) {
return src_location == dst_location;
@@ -1377,25 +1387,25 @@ bool Differ::MatchPerVertexType(uint32_t src_type_id, uint32_t dst_type_id) {
// For gl_PerVertex, find the type pointer of this type (array) and make sure
// the storage classes of src and dst match; geometry and tessellation shaders
// have two instances of gl_PerVertex.
- SpvStorageClass src_storage_class =
+ spv::StorageClass src_storage_class =
GetPerVertexStorageClass(src_, src_type_id);
- SpvStorageClass dst_storage_class =
+ spv::StorageClass dst_storage_class =
GetPerVertexStorageClass(dst_, dst_type_id);
- assert(src_storage_class == SpvStorageClassInput ||
- src_storage_class == SpvStorageClassOutput);
- assert(dst_storage_class == SpvStorageClassInput ||
- dst_storage_class == SpvStorageClassOutput);
+ assert(src_storage_class == spv::StorageClass::Input ||
+ src_storage_class == spv::StorageClass::Output);
+ assert(dst_storage_class == spv::StorageClass::Input ||
+ dst_storage_class == spv::StorageClass::Output);
return src_storage_class == dst_storage_class;
}
bool Differ::MatchPerVertexVariable(const opt::Instruction* src_inst,
const opt::Instruction* dst_inst) {
- SpvStorageClass src_storage_class =
- SpvStorageClass(src_inst->GetSingleWordInOperand(0));
- SpvStorageClass dst_storage_class =
- SpvStorageClass(dst_inst->GetSingleWordInOperand(0));
+ spv::StorageClass src_storage_class =
+ spv::StorageClass(src_inst->GetSingleWordInOperand(0));
+ spv::StorageClass dst_storage_class =
+ spv::StorageClass(dst_inst->GetSingleWordInOperand(0));
return src_storage_class == dst_storage_class;
}
@@ -1472,7 +1482,7 @@ InstructionList Differ::GetFunctionHeader(const opt::Function& function) {
InstructionList body;
function.WhileEachInst(
[&body](const opt::Instruction* inst) {
- if (inst->opcode() == SpvOpLabel) {
+ if (inst->opcode() == spv::Op::OpLabel) {
return false;
}
body.push_back(inst);
@@ -1687,12 +1697,12 @@ void Differ::MatchVariablesUsedByMatchedInstructions(
default:
// TODO: match functions based on OpFunctionCall?
break;
- case SpvOpAccessChain:
- case SpvOpInBoundsAccessChain:
- case SpvOpPtrAccessChain:
- case SpvOpInBoundsPtrAccessChain:
- case SpvOpLoad:
- case SpvOpStore:
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain:
+ case spv::Op::OpPtrAccessChain:
+ case spv::Op::OpInBoundsPtrAccessChain:
+ case spv::Op::OpLoad:
+ case spv::Op::OpStore:
const uint32_t src_pointer_id = src_inst->GetSingleWordInOperand(0);
const uint32_t dst_pointer_id = dst_inst->GetSingleWordInOperand(0);
if (IsVariable(src_id_to_, src_pointer_id) &&
@@ -1720,23 +1730,24 @@ const opt::Instruction* Differ::GetInst(const IdInstructions& id_to,
uint32_t Differ::GetConstantUint(const IdInstructions& id_to,
uint32_t constant_id) {
const opt::Instruction* constant_inst = GetInst(id_to, constant_id);
- assert(constant_inst->opcode() == SpvOpConstant);
- assert(GetInst(id_to, constant_inst->type_id())->opcode() == SpvOpTypeInt);
+ assert(constant_inst->opcode() == spv::Op::OpConstant);
+ assert(GetInst(id_to, constant_inst->type_id())->opcode() ==
+ spv::Op::OpTypeInt);
return constant_inst->GetSingleWordInOperand(0);
}
-SpvExecutionModel Differ::GetExecutionModel(const opt::Module* module,
- uint32_t entry_point_id) {
+spv::ExecutionModel Differ::GetExecutionModel(const opt::Module* module,
+ uint32_t entry_point_id) {
for (const opt::Instruction& inst : module->entry_points()) {
- assert(inst.opcode() == SpvOpEntryPoint);
+ assert(inst.opcode() == spv::Op::OpEntryPoint);
if (inst.GetSingleWordOperand(1) == entry_point_id) {
- return SpvExecutionModel(inst.GetSingleWordOperand(0));
+ return spv::ExecutionModel(inst.GetSingleWordOperand(0));
}
}
assert(false && "Unreachable");
- return SpvExecutionModel(0xFFF);
+ return spv::ExecutionModel(0xFFF);
}
bool Differ::HasName(const IdInstructions& id_to, uint32_t id) {
@@ -1744,7 +1755,7 @@ bool Differ::HasName(const IdInstructions& id_to, uint32_t id) {
assert(id < id_to.name_map_.size());
for (const opt::Instruction* inst : id_to.name_map_[id]) {
- if (inst->opcode() == SpvOpName) {
+ if (inst->opcode() == spv::Op::OpName) {
return true;
}
}
@@ -1758,7 +1769,7 @@ std::string Differ::GetName(const IdInstructions& id_to, uint32_t id,
assert(id < id_to.name_map_.size());
for (const opt::Instruction* inst : id_to.name_map_[id]) {
- if (inst->opcode() == SpvOpName) {
+ if (inst->opcode() == spv::Op::OpName) {
*has_name = true;
return inst->GetOperand(1).AsString();
}
@@ -1781,11 +1792,11 @@ std::string Differ::GetSanitizedName(const IdInstructions& id_to, uint32_t id) {
}
uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id,
- SpvStorageClass* storage_class) {
+ spv::StorageClass* storage_class) {
const opt::Instruction* var_inst = GetInst(id_to, var_id);
- assert(var_inst->opcode() == SpvOpVariable);
+ assert(var_inst->opcode() == spv::Op::OpVariable);
- *storage_class = SpvStorageClass(var_inst->GetSingleWordInOperand(0));
+ *storage_class = spv::StorageClass(var_inst->GetSingleWordInOperand(0));
// Get the type pointer from the variable.
const uint32_t type_pointer_id = var_inst->type_id();
@@ -1796,15 +1807,15 @@ uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id,
}
bool Differ::GetDecorationValue(const IdInstructions& id_to, uint32_t id,
- SpvDecoration decoration,
+ spv::Decoration decoration,
uint32_t* decoration_value) {
assert(id != 0);
assert(id < id_to.decoration_map_.size());
for (const opt::Instruction* inst : id_to.decoration_map_[id]) {
- if (inst->opcode() == SpvOpDecorate &&
+ if (inst->opcode() == spv::Op::OpDecorate &&
inst->GetSingleWordOperand(0) == id &&
- inst->GetSingleWordOperand(1) == decoration) {
+ spv::Decoration(inst->GetSingleWordOperand(1)) == decoration) {
*decoration_value = inst->GetSingleWordOperand(2);
return true;
}
@@ -1821,28 +1832,28 @@ const opt::Instruction* Differ::GetForwardPointerInst(
}
bool Differ::IsIntType(const IdInstructions& id_to, uint32_t type_id) {
- return IsOp(id_to, type_id, SpvOpTypeInt);
+ return IsOp(id_to, type_id, spv::Op::OpTypeInt);
}
bool Differ::IsFloatType(const IdInstructions& id_to, uint32_t type_id) {
- return IsOp(id_to, type_id, SpvOpTypeFloat);
+ return IsOp(id_to, type_id, spv::Op::OpTypeFloat);
}
bool Differ::IsConstantUint(const IdInstructions& id_to, uint32_t id) {
const opt::Instruction* constant_inst = GetInst(id_to, id);
- if (constant_inst->opcode() != SpvOpConstant) {
+ if (constant_inst->opcode() != spv::Op::OpConstant) {
return false;
}
const opt::Instruction* type_inst = GetInst(id_to, constant_inst->type_id());
- return type_inst->opcode() == SpvOpTypeInt;
+ return type_inst->opcode() == spv::Op::OpTypeInt;
}
bool Differ::IsVariable(const IdInstructions& id_to, uint32_t pointer_id) {
- return IsOp(id_to, pointer_id, SpvOpVariable);
+ return IsOp(id_to, pointer_id, spv::Op::OpVariable);
}
-bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, SpvOp op) {
+bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, spv::Op op) {
return GetInst(id_to, id)->opcode() == op;
}
@@ -1851,17 +1862,18 @@ bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) {
assert(type_id < id_to.decoration_map_.size());
for (const opt::Instruction* inst : id_to.decoration_map_[type_id]) {
- if (inst->opcode() == SpvOpMemberDecorate &&
+ if (inst->opcode() == spv::Op::OpMemberDecorate &&
inst->GetSingleWordOperand(0) == type_id &&
- inst->GetSingleWordOperand(2) == SpvDecorationBuiltIn) {
- SpvBuiltIn built_in = SpvBuiltIn(inst->GetSingleWordOperand(3));
+ spv::Decoration(inst->GetSingleWordOperand(2)) ==
+ spv::Decoration::BuiltIn) {
+ spv::BuiltIn built_in = spv::BuiltIn(inst->GetSingleWordOperand(3));
// Only gl_PerVertex can have, and it can only have, the following
// built-in decorations.
- return built_in == SpvBuiltInPosition ||
- built_in == SpvBuiltInPointSize ||
- built_in == SpvBuiltInClipDistance ||
- built_in == SpvBuiltInCullDistance;
+ return built_in == spv::BuiltIn::Position ||
+ built_in == spv::BuiltIn::PointSize ||
+ built_in == spv::BuiltIn::ClipDistance ||
+ built_in == spv::BuiltIn::CullDistance;
}
}
@@ -1870,12 +1882,12 @@ bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) {
bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) {
// Get the type from the type pointer.
- SpvStorageClass storage_class;
+ spv::StorageClass storage_class;
uint32_t type_id = GetVarTypeId(id_to, var_id, &storage_class);
const opt::Instruction* type_inst = GetInst(id_to, type_id);
// If array, get the element type.
- if (type_inst->opcode() == SpvOpTypeArray) {
+ if (type_inst->opcode() == spv::Op::OpTypeArray) {
type_id = type_inst->GetSingleWordInOperand(0);
}
@@ -1883,21 +1895,21 @@ bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) {
return IsPerVertexType(id_to, type_id);
}
-SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module,
- uint32_t type_id) {
+spv::StorageClass Differ::GetPerVertexStorageClass(const opt::Module* module,
+ uint32_t type_id) {
for (const opt::Instruction& inst : module->types_values()) {
switch (inst.opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
// The gl_PerVertex instance could be an array, look for a variable of
// the array type instead.
if (inst.GetSingleWordInOperand(0) == type_id) {
type_id = inst.result_id();
}
break;
- case SpvOpTypePointer:
+ case spv::Op::OpTypePointer:
// Find the storage class of the pointer to this type.
if (inst.GetSingleWordInOperand(1) == type_id) {
- return SpvStorageClass(inst.GetSingleWordInOperand(0));
+ return spv::StorageClass(inst.GetSingleWordInOperand(0));
}
break;
default:
@@ -1908,7 +1920,7 @@ SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module,
// gl_PerVertex is declared, but is unused. Return either of Input or Output
// classes just so it matches one in the other module. This should be highly
// unlikely, perhaps except for ancient GS-used-to-emulate-CS scenarios.
- return SpvStorageClassOutput;
+ return spv::StorageClass::Output;
}
spv_ext_inst_type_t Differ::GetExtInstType(const IdInstructions& id_to,
@@ -1934,9 +1946,9 @@ spv_number_kind_t Differ::GetNumberKind(const IdInstructions& id_to,
case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
switch (inst.opcode()) {
- case SpvOpSwitch:
- case SpvOpConstant:
- case SpvOpSpecConstant:
+ case spv::Op::OpSwitch:
+ case spv::Op::OpConstant:
+ case spv::Op::OpSpecConstant:
// Same kind of number as the selector (OpSwitch) or the type
// (Op*Constant).
return GetTypeNumberKind(id_to, inst.GetSingleWordOperand(0),
@@ -1962,12 +1974,12 @@ spv_number_kind_t Differ::GetTypeNumberKind(const IdInstructions& id_to,
}
switch (type_inst->opcode()) {
- case SpvOpTypeInt:
+ case spv::Op::OpTypeInt:
*number_bit_width = type_inst->GetSingleWordOperand(1);
return type_inst->GetSingleWordOperand(2) == 0 ? SPV_NUMBER_UNSIGNED_INT
: SPV_NUMBER_SIGNED_INT;
break;
- case SpvOpTypeFloat:
+ case spv::Op::OpTypeFloat:
*number_bit_width = type_inst->GetSingleWordOperand(1);
return SPV_NUMBER_FLOATING;
default:
@@ -2085,7 +2097,7 @@ void Differ::MatchTypeForwardPointers() {
return inst.GetSingleWordOperand(0);
};
auto accept_type_forward_pointer_ops = [](const opt::Instruction& inst) {
- return inst.opcode() == SpvOpTypeForwardPointer;
+ return inst.opcode() == spv::Op::OpTypeForwardPointer;
};
PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
@@ -2109,17 +2121,17 @@ void Differ::MatchTypeForwardPointers() {
// - If leftover is unique, match
// Group forwarded pointers by storage class first and loop over them.
- GroupIdsAndMatch(
- potential_id_map.src_ids, potential_id_map.dst_ids, SpvStorageClassMax,
- &Differ::GroupIdsHelperGetTypePointerStorageClass,
+ GroupIdsAndMatch(
+ potential_id_map.src_ids, potential_id_map.dst_ids,
+ spv::StorageClass::Max, &Differ::GroupIdsHelperGetTypePointerStorageClass,
[this](const IdGroup& src_group_by_storage_class,
const IdGroup& dst_group_by_storage_class) {
// Group them further by the type they are pointing to and loop over
// them.
- GroupIdsAndMatch(
- src_group_by_storage_class, dst_group_by_storage_class, SpvOpMax,
- &Differ::GroupIdsHelperGetTypePointerTypeOp,
+ GroupIdsAndMatch(
+ src_group_by_storage_class, dst_group_by_storage_class,
+ spv::Op::Max, &Differ::GroupIdsHelperGetTypePointerTypeOp,
[this](const IdGroup& src_group_by_type_op,
const IdGroup& dst_group_by_type_op) {
@@ -2175,8 +2187,8 @@ void Differ::MatchTypeIds() {
MatchIds(potential_id_map, [this, flexibility](
const opt::Instruction* src_inst,
const opt::Instruction* dst_inst) {
- const SpvOp src_op = src_inst->opcode();
- const SpvOp dst_op = dst_inst->opcode();
+ const spv::Op src_op = src_inst->opcode();
+ const spv::Op dst_op = dst_inst->opcode();
// Don't match if the opcode is not the same.
if (src_op != dst_op) {
@@ -2184,26 +2196,26 @@ void Differ::MatchTypeIds() {
}
switch (src_op) {
- case SpvOpTypeVoid:
- case SpvOpTypeBool:
- case SpvOpTypeSampler:
+ case spv::Op::OpTypeVoid:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeSampler:
// void, bool and sampler are unique, match them.
return true;
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
- case SpvOpTypeSampledImage:
- case SpvOpTypeRuntimeArray:
- case SpvOpTypePointer:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeSampledImage:
+ case spv::Op::OpTypeRuntimeArray:
+ case spv::Op::OpTypePointer:
// Match these instructions when all operands match.
assert(src_inst->NumInOperandWords() ==
dst_inst->NumInOperandWords());
return DoOperandsMatch(src_inst, dst_inst, 0,
src_inst->NumInOperandWords());
- case SpvOpTypeFunction:
- case SpvOpTypeImage:
+ case spv::Op::OpTypeFunction:
+ case spv::Op::OpTypeImage:
// Match function types only if they have the same number of operands,
// and they all match.
// Match image types similarly, expecting the optional final parameter
@@ -2214,7 +2226,7 @@ void Differ::MatchTypeIds() {
return DoOperandsMatch(src_inst, dst_inst, 0,
src_inst->NumInOperandWords());
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
// Match arrays only if the element type and length match. The length
// is an id of a constant, so the actual constant it's defining is
// compared instead.
@@ -2231,7 +2243,7 @@ void Differ::MatchTypeIds() {
// example if a spec contant is used).
return DoOperandsMatch(src_inst, dst_inst, 1, 1);
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
return MatchOpTypeStruct(src_inst, dst_inst, flexibility);
default:
@@ -2263,8 +2275,8 @@ void Differ::MatchConstants() {
MatchIds(potential_id_map, [this, flexibility](
const opt::Instruction* src_inst,
const opt::Instruction* dst_inst) {
- const SpvOp src_op = src_inst->opcode();
- const SpvOp dst_op = dst_inst->opcode();
+ const spv::Op src_op = src_inst->opcode();
+ const spv::Op dst_op = dst_inst->opcode();
// Don't match if the opcode is not the same.
if (src_op != dst_op) {
@@ -2272,14 +2284,14 @@ void Differ::MatchConstants() {
}
switch (src_op) {
- case SpvOpConstantTrue:
- case SpvOpConstantFalse:
+ case spv::Op::OpConstantTrue:
+ case spv::Op::OpConstantFalse:
// true and false are unique, match them.
return true;
- case SpvOpConstant:
+ case spv::Op::OpConstant:
return MatchOpConstant(src_inst, dst_inst, flexibility);
- case SpvOpConstantComposite:
- case SpvOpSpecConstantComposite:
+ case spv::Op::OpConstantComposite:
+ case spv::Op::OpSpecConstantComposite:
// Composite constants must match in type and value.
//
// TODO: match OpConstantNull with OpConstantComposite with all zeros
@@ -2292,7 +2304,7 @@ void Differ::MatchConstants() {
dst_inst->GetOperand(0)) &&
DoOperandsMatch(src_inst, dst_inst, 0,
src_inst->NumInOperandWords());
- case SpvOpConstantSampler:
+ case spv::Op::OpConstantSampler:
// Match sampler constants exactly.
// TODO: Allow flexibility in parameters to better diff shaders where
// the sampler param has changed.
@@ -2300,15 +2312,15 @@ void Differ::MatchConstants() {
dst_inst->NumInOperandWords());
return DoOperandsMatch(src_inst, dst_inst, 0,
src_inst->NumInOperandWords());
- case SpvOpConstantNull:
+ case spv::Op::OpConstantNull:
// Match null constants as long as the type matches.
return DoesOperandMatch(src_inst->GetOperand(0),
dst_inst->GetOperand(0));
- case SpvOpSpecConstantTrue:
- case SpvOpSpecConstantFalse:
- case SpvOpSpecConstant:
- case SpvOpSpecConstantOp:
+ case spv::Op::OpSpecConstantTrue:
+ case spv::Op::OpSpecConstantFalse:
+ case spv::Op::OpSpecConstant:
+ case spv::Op::OpSpecConstantOp:
// Match spec constants by name if available, then by the SpecId
// decoration.
return MatchOpSpecConstant(src_inst, dst_inst);
@@ -2327,7 +2339,7 @@ void Differ::MatchVariableIds() {
return inst.result_id();
};
auto accept_type_ops = [](const opt::Instruction& inst) {
- return inst.opcode() == SpvOpVariable;
+ return inst.opcode() == spv::Op::OpVariable;
};
PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
@@ -2343,8 +2355,8 @@ void Differ::MatchVariableIds() {
MatchIds(potential_id_map,
[this, flexibility](const opt::Instruction* src_inst,
const opt::Instruction* dst_inst) {
- assert(src_inst->opcode() == SpvOpVariable);
- assert(dst_inst->opcode() == SpvOpVariable);
+ assert(src_inst->opcode() == spv::Op::OpVariable);
+ assert(dst_inst->opcode() == spv::Op::OpVariable);
return MatchOpVariable(src_inst, dst_inst, flexibility);
});
@@ -2590,7 +2602,7 @@ void Differ::ToParsedInstruction(
parsed_inst->num_words = static_cast(inst_binary.size());
parsed_inst->opcode = static_cast(inst.opcode());
parsed_inst->ext_inst_type =
- inst.opcode() == SpvOpExtInst
+ inst.opcode() == spv::Op::OpExtInst
? GetExtInstType(id_to, original_inst.GetSingleWordInOperand(0))
: SPV_EXT_INST_TYPE_NONE;
parsed_inst->type_id =
diff --git a/third_party/spirv-tools/source/disassemble.cpp b/third_party/spirv-tools/source/disassemble.cpp
index 1d61b9f9ea..f862efd56b 100644
--- a/third_party/spirv-tools/source/disassemble.cpp
+++ b/third_party/spirv-tools/source/disassemble.cpp
@@ -244,7 +244,7 @@ void InstructionDisassembler::EmitHeaderSchema(uint32_t schema) {
void InstructionDisassembler::EmitInstruction(
const spv_parsed_instruction_t& inst, size_t inst_byte_offset) {
- auto opcode = static_cast(inst.opcode);
+ auto opcode = static_cast(inst.opcode);
if (inst.result_id) {
SetBlue();
@@ -268,7 +268,7 @@ void InstructionDisassembler::EmitInstruction(
EmitOperand(inst, i);
}
- if (comment_ && opcode == SpvOpName) {
+ if (comment_ && opcode == spv::Op::OpName) {
const spv_parsed_operand_t& operand = inst.operands[0];
const uint32_t word = inst.words[operand.offset];
stream_ << " ; id %" << word;
@@ -290,8 +290,8 @@ void InstructionDisassembler::EmitInstruction(
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(inst.opcode);
- if (comment_ && opcode == SpvOpFunction) {
+ auto opcode = static_cast(inst.opcode);
+ if (comment_ && opcode == spv::Op::OpFunction) {
stream_ << std::endl;
stream_ << std::string(indent_, ' ');
stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
@@ -351,7 +351,7 @@ void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst,
} break;
case SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER: {
spv_opcode_desc opcode_desc;
- if (grammar_.lookupOpcode(SpvOp(word), &opcode_desc))
+ if (grammar_.lookupOpcode(spv::Op(word), &opcode_desc))
assert(false && "should have caught this earlier");
SetRed();
stream_ << opcode_desc->name;
diff --git a/third_party/spirv-tools/source/disassemble.h b/third_party/spirv-tools/source/disassemble.h
index 8eacb10066..b520a1ea91 100644
--- a/third_party/spirv-tools/source/disassemble.h
+++ b/third_party/spirv-tools/source/disassemble.h
@@ -25,9 +25,10 @@ namespace spvtools {
// Decodes the given SPIR-V instruction binary representation to its assembly
// text. The context is inferred from the provided module binary. The options
-// parameter is a bit field of spv_binary_to_text_options_t. Decoded text will
-// be stored into *text. Any error will be written into *diagnostic if
-// diagnostic is non-null.
+// parameter is a bit field of spv_binary_to_text_options_t (note: the option
+// SPV_BINARY_TO_TEXT_OPTION_PRINT will be ignored). Decoded text will be
+// stored into *text. Any error will be written into *diagnostic if diagnostic
+// is non-null.
std::string spvInstructionBinaryToText(const spv_target_env env,
const uint32_t* inst_binary,
const size_t inst_word_count,
diff --git a/third_party/spirv-tools/source/enum_set.h b/third_party/spirv-tools/source/enum_set.h
index d4d31e3324..28ee5fee8d 100644
--- a/third_party/spirv-tools/source/enum_set.h
+++ b/third_party/spirv-tools/source/enum_set.h
@@ -200,8 +200,8 @@ class EnumSet {
std::unique_ptr overflow_ = {};
};
-// A set of SpvCapability, optimized for small capability values.
-using CapabilitySet = EnumSet;
+// A set of spv::Capability, optimized for small capability values.
+using CapabilitySet = EnumSet;
} // namespace spvtools
diff --git a/third_party/spirv-tools/source/enum_string_mapping.h b/third_party/spirv-tools/source/enum_string_mapping.h
index af8f56b82a..b136584063 100644
--- a/third_party/spirv-tools/source/enum_string_mapping.h
+++ b/third_party/spirv-tools/source/enum_string_mapping.h
@@ -29,7 +29,7 @@ bool GetExtensionFromString(const char* str, Extension* extension);
const char* ExtensionToString(Extension extension);
// Returns text string corresponding to |capability|.
-const char* CapabilityToString(SpvCapability capability);
+const char* CapabilityToString(spv::Capability capability);
} // namespace spvtools
diff --git a/third_party/spirv-tools/source/extensions.cpp b/third_party/spirv-tools/source/extensions.cpp
index 049a3ad10a..ebf6bec061 100644
--- a/third_party/spirv-tools/source/extensions.cpp
+++ b/third_party/spirv-tools/source/extensions.cpp
@@ -24,7 +24,9 @@
namespace spvtools {
std::string GetExtensionString(const spv_parsed_instruction_t* inst) {
- if (inst->opcode != SpvOpExtension) return "ERROR_not_op_extension";
+ if (inst->opcode != static_cast(spv::Op::OpExtension)) {
+ return "ERROR_not_op_extension";
+ }
assert(inst->num_operands == 1);
diff --git a/third_party/spirv-tools/source/fuzz/CMakeLists.txt b/third_party/spirv-tools/source/fuzz/CMakeLists.txt
index 7d9bf69106..dd674dd04c 100644
--- a/third_party/spirv-tools/source/fuzz/CMakeLists.txt
+++ b/third_party/spirv-tools/source/fuzz/CMakeLists.txt
@@ -466,7 +466,7 @@ if(SPIRV_BUILD_FUZZER)
PUBLIC SPIRV-Tools-reduce
PUBLIC protobuf::libprotobuf)
- set_property(TARGET SPIRV-Tools-fuzz PROPERTY FOLDER "ThirdParty/SPIRV-Tools libraries")
+ set_property(TARGET SPIRV-Tools-fuzz PROPERTY FOLDER "SPIRV-Tools libraries")
spvtools_check_symbol_exports(SPIRV-Tools-fuzz)
if(ENABLE_SPIRV_TOOLS_INSTALL)
diff --git a/third_party/spirv-tools/source/fuzz/added_function_reducer.cpp b/third_party/spirv-tools/source/fuzz/added_function_reducer.cpp
index e7cb027b9f..95cf9d6df5 100644
--- a/third_party/spirv-tools/source/fuzz/added_function_reducer.cpp
+++ b/third_party/spirv-tools/source/fuzz/added_function_reducer.cpp
@@ -130,7 +130,7 @@ bool AddedFunctionReducer::InterestingnessFunctionForReducingAddedFunction(
binary_under_reduction.size());
assert(ir_context != nullptr && "The binary should be parsable.");
for (auto& type_or_value : ir_context->module()->types_values()) {
- if (type_or_value.opcode() != SpvOpVariable) {
+ if (type_or_value.opcode() != spv::Op::OpVariable) {
continue;
}
if (irrelevant_pointee_global_variables.count(type_or_value.result_id())) {
@@ -202,7 +202,7 @@ void AddedFunctionReducer::ReplayPrefixAndAddFunction(
auto* ir_context = replay_result.transformed_module.get();
for (auto& type_or_value : ir_context->module()->types_values()) {
- if (type_or_value.opcode() != SpvOpVariable) {
+ if (type_or_value.opcode() != spv::Op::OpVariable) {
continue;
}
if (replay_result.transformation_context->GetFactManager()
diff --git a/third_party/spirv-tools/source/fuzz/call_graph.cpp b/third_party/spirv-tools/source/fuzz/call_graph.cpp
index c52bc3420e..d61a5f8403 100644
--- a/third_party/spirv-tools/source/fuzz/call_graph.cpp
+++ b/third_party/spirv-tools/source/fuzz/call_graph.cpp
@@ -54,7 +54,7 @@ void CallGraph::BuildGraphAndGetDepthOfFunctionCalls(
// Consider every function call instruction in every block.
for (auto& block : function) {
for (auto& instruction : block) {
- if (instruction.opcode() != SpvOpFunctionCall) {
+ if (instruction.opcode() != spv::Op::OpFunctionCall) {
continue;
}
// Get the id of the function being called.
diff --git a/third_party/spirv-tools/source/fuzz/fact_manager/constant_uniform_facts.cpp b/third_party/spirv-tools/source/fuzz/fact_manager/constant_uniform_facts.cpp
index a629c0d386..461859bdec 100644
--- a/third_party/spirv-tools/source/fuzz/fact_manager/constant_uniform_facts.cpp
+++ b/third_party/spirv-tools/source/fuzz/fact_manager/constant_uniform_facts.cpp
@@ -63,7 +63,7 @@ std::vector ConstantUniformFacts::GetConstantWords(
bool ConstantUniformFacts::DataMatches(
const opt::Instruction& constant_instruction,
const protobufs::FactConstantUniform& constant_uniform_fact) {
- assert(constant_instruction.opcode() == SpvOpConstant);
+ assert(constant_instruction.opcode() == spv::Op::OpConstant);
std::vector data_in_constant;
for (uint32_t i = 0; i < constant_instruction.NumInOperands(); i++) {
data_in_constant.push_back(constant_instruction.GetSingleWordInOperand(i));
@@ -95,7 +95,7 @@ ConstantUniformFacts::GetUniformDescriptorsForConstant(
uint32_t constant_id) const {
std::vector result;
auto constant_inst = ir_context_->get_def_use_mgr()->GetDef(constant_id);
- assert(constant_inst->opcode() == SpvOpConstant &&
+ assert(constant_inst->opcode() == spv::Op::OpConstant &&
"The given id must be that of a constant");
auto type_id = constant_inst->type_id();
for (auto& fact_and_type_id : facts_and_type_ids_) {
@@ -175,8 +175,9 @@ bool ConstantUniformFacts::MaybeAddFact(
return false;
}
- assert(SpvOpVariable == uniform_variable->opcode());
- assert(SpvStorageClassUniform == uniform_variable->GetSingleWordInOperand(0));
+ assert(spv::Op::OpVariable == uniform_variable->opcode());
+ assert(spv::StorageClass::Uniform ==
+ spv::StorageClass(uniform_variable->GetSingleWordInOperand(0)));
auto should_be_uniform_pointer_type =
ir_context_->get_type_mgr()->GetType(uniform_variable->type_id());
@@ -184,7 +185,7 @@ bool ConstantUniformFacts::MaybeAddFact(
return false;
}
if (should_be_uniform_pointer_type->AsPointer()->storage_class() !=
- SpvStorageClassUniform) {
+ spv::StorageClass::Uniform) {
return false;
}
auto should_be_uniform_pointer_instruction =
diff --git a/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.cpp b/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.cpp
index a2c1f2cabc..b43b8edf64 100644
--- a/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.cpp
+++ b/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.cpp
@@ -23,7 +23,7 @@ namespace fact_manager {
size_t DataSynonymAndIdEquationFacts::OperationHash::operator()(
const Operation& operation) const {
std::u32string hash;
- hash.push_back(operation.opcode);
+ hash.push_back(uint32_t(operation.opcode));
for (auto operand : operation.operands) {
hash.push_back(static_cast(DataDescriptorHash()(operand)));
}
@@ -104,7 +104,8 @@ bool DataSynonymAndIdEquationFacts::MaybeAddFact(
}
// Now add the fact.
- AddEquationFactRecursive(lhs_dd, static_cast(fact.opcode()), rhs_dds);
+ AddEquationFactRecursive(lhs_dd, static_cast(fact.opcode()),
+ rhs_dds);
return true;
}
@@ -119,7 +120,7 @@ DataSynonymAndIdEquationFacts::GetEquations(
}
void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
- const protobufs::DataDescriptor& lhs_dd, SpvOp opcode,
+ const protobufs::DataDescriptor& lhs_dd, spv::Op opcode,
const std::vector& rhs_dds) {
assert(synonymous_.Exists(lhs_dd) &&
"The LHS must be known to the equivalence relation.");
@@ -155,21 +156,21 @@ void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
// Now try to work out corollaries implied by the new equation and existing
// facts.
switch (opcode) {
- case SpvOpConvertSToF:
- case SpvOpConvertUToF:
+ case spv::Op::OpConvertSToF:
+ case spv::Op::OpConvertUToF:
ComputeConversionDataSynonymFacts(*rhs_dds[0]);
break;
- case SpvOpBitcast: {
+ case spv::Op::OpBitcast: {
assert(DataDescriptorsAreWellFormedAndComparable(lhs_dd, *rhs_dds[0]) &&
"Operands of OpBitcast equation fact must have compatible types");
if (!synonymous_.IsEquivalent(lhs_dd, *rhs_dds[0])) {
AddDataSynonymFactRecursive(lhs_dd, *rhs_dds[0]);
}
} break;
- case SpvOpIAdd: {
+ case spv::Op::OpIAdd: {
// Equation form: "a = b + c"
for (const auto& equation : GetEquations(rhs_dds[0])) {
- if (equation.opcode == SpvOpISub) {
+ if (equation.opcode == spv::Op::OpISub) {
// Equation form: "a = (d - e) + c"
if (synonymous_.IsEquivalent(*equation.operands[1], *rhs_dds[1])) {
// Equation form: "a = (d - c) + c"
@@ -179,7 +180,7 @@ void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
}
}
for (const auto& equation : GetEquations(rhs_dds[1])) {
- if (equation.opcode == SpvOpISub) {
+ if (equation.opcode == spv::Op::OpISub) {
// Equation form: "a = b + (d - e)"
if (synonymous_.IsEquivalent(*equation.operands[1], *rhs_dds[0])) {
// Equation form: "a = b + (d - b)"
@@ -190,10 +191,10 @@ void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
}
break;
}
- case SpvOpISub: {
+ case spv::Op::OpISub: {
// Equation form: "a = b - c"
for (const auto& equation : GetEquations(rhs_dds[0])) {
- if (equation.opcode == SpvOpIAdd) {
+ if (equation.opcode == spv::Op::OpIAdd) {
// Equation form: "a = (d + e) - c"
if (synonymous_.IsEquivalent(*equation.operands[0], *rhs_dds[1])) {
// Equation form: "a = (c + e) - c"
@@ -207,34 +208,34 @@ void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
}
}
- if (equation.opcode == SpvOpISub) {
+ if (equation.opcode == spv::Op::OpISub) {
// Equation form: "a = (d - e) - c"
if (synonymous_.IsEquivalent(*equation.operands[0], *rhs_dds[1])) {
// Equation form: "a = (c - e) - c"
// We can thus infer "a = -e"
- AddEquationFactRecursive(lhs_dd, SpvOpSNegate,
+ AddEquationFactRecursive(lhs_dd, spv::Op::OpSNegate,
{equation.operands[1]});
}
}
}
for (const auto& equation : GetEquations(rhs_dds[1])) {
- if (equation.opcode == SpvOpIAdd) {
+ if (equation.opcode == spv::Op::OpIAdd) {
// Equation form: "a = b - (d + e)"
if (synonymous_.IsEquivalent(*equation.operands[0], *rhs_dds[0])) {
// Equation form: "a = b - (b + e)"
// We can thus infer "a = -e"
- AddEquationFactRecursive(lhs_dd, SpvOpSNegate,
+ AddEquationFactRecursive(lhs_dd, spv::Op::OpSNegate,
{equation.operands[1]});
}
if (synonymous_.IsEquivalent(*equation.operands[1], *rhs_dds[0])) {
// Equation form: "a = b - (d + b)"
// We can thus infer "a = -d"
- AddEquationFactRecursive(lhs_dd, SpvOpSNegate,
+ AddEquationFactRecursive(lhs_dd, spv::Op::OpSNegate,
{equation.operands[0]});
}
}
- if (equation.opcode == SpvOpISub) {
+ if (equation.opcode == spv::Op::OpISub) {
// Equation form: "a = b - (d - e)"
if (synonymous_.IsEquivalent(*equation.operands[0], *rhs_dds[0])) {
// Equation form: "a = b - (b - e)"
@@ -245,8 +246,8 @@ void DataSynonymAndIdEquationFacts::AddEquationFactRecursive(
}
break;
}
- case SpvOpLogicalNot:
- case SpvOpSNegate: {
+ case spv::Op::OpLogicalNot:
+ case spv::Op::OpSNegate: {
// Equation form: "a = !b" or "a = -b"
for (const auto& equation : GetEquations(rhs_dds[0])) {
if (equation.opcode == opcode) {
@@ -321,9 +322,9 @@ void DataSynonymAndIdEquationFacts::ComputeConversionDataSynonymFacts(
for (const auto& equation : fact.second) {
if (synonymous_.IsEquivalent(*equation.operands[0], dd)) {
- if (equation.opcode == SpvOpConvertSToF) {
+ if (equation.opcode == spv::Op::OpConvertSToF) {
convert_s_to_f_lhs.push_back(*dd_it);
- } else if (equation.opcode == SpvOpConvertUToF) {
+ } else if (equation.opcode == spv::Op::OpConvertUToF) {
convert_u_to_f_lhs.push_back(*dd_it);
}
}
@@ -808,9 +809,9 @@ bool DataSynonymAndIdEquationFacts::DataDescriptorsAreWellFormedAndComparable(
}
// Neither end type is allowed to be void.
if (ir_context_->get_def_use_mgr()->GetDef(end_type_id_1)->opcode() ==
- SpvOpTypeVoid ||
+ spv::Op::OpTypeVoid ||
ir_context_->get_def_use_mgr()->GetDef(end_type_id_2)->opcode() ==
- SpvOpTypeVoid) {
+ spv::Op::OpTypeVoid) {
return false;
}
// If the end types are the same, the data descriptors are comparable.
diff --git a/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.h b/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.h
index 6652f30aa8..36d92ca7b4 100644
--- a/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.h
+++ b/third_party/spirv-tools/source/fuzz/fact_manager/data_synonym_and_id_equation_facts.h
@@ -79,7 +79,7 @@ class DataSynonymAndIdEquationFacts {
// This helper struct represents the right hand side of an equation as an
// operator applied to a number of data descriptor operands.
struct Operation {
- SpvOp opcode;
+ spv::Op opcode;
std::vector operands;
};
@@ -144,7 +144,7 @@ class DataSynonymAndIdEquationFacts {
// corollaries, in the form of data synonym or equation facts, that follow
// from this and other known facts.
void AddEquationFactRecursive(
- const protobufs::DataDescriptor& lhs_dd, SpvOp opcode,
+ const protobufs::DataDescriptor& lhs_dd, spv::Op opcode,
const std::vector& rhs_dds);
// Returns true if and only if |dd.object()| still exists in the module.
diff --git a/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.cpp b/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.cpp
index 40c0865f4d..c99f690d5b 100644
--- a/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.cpp
+++ b/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.cpp
@@ -64,7 +64,7 @@ std::string ToString(const protobufs::FactDataSynonym& fact) {
std::string ToString(const protobufs::FactIdEquation& fact) {
std::stringstream stream;
stream << fact.lhs_id();
- stream << " " << static_cast(fact.opcode());
+ stream << " " << fact.opcode();
for (auto rhs_id : fact.rhs_id()) {
stream << " " << rhs_id;
}
@@ -255,11 +255,11 @@ void FactManager::AddFactIdIsIrrelevant(uint32_t result_id) {
assert(success && "|result_id| is invalid");
}
-void FactManager::AddFactIdEquation(uint32_t lhs_id, SpvOp opcode,
+void FactManager::AddFactIdEquation(uint32_t lhs_id, spv::Op opcode,
const std::vector& rhs_id) {
protobufs::FactIdEquation fact;
fact.set_lhs_id(lhs_id);
- fact.set_opcode(opcode);
+ fact.set_opcode(uint32_t(opcode));
for (auto an_rhs_id : rhs_id) {
fact.add_rhs_id(an_rhs_id);
}
diff --git a/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.h b/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.h
index ce28ae4c92..4453e44527 100644
--- a/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.h
+++ b/third_party/spirv-tools/source/fuzz/fact_manager/fact_manager.h
@@ -83,7 +83,7 @@ class FactManager {
// |lhs_id| = |opcode| |rhs_id[0]| ... |rhs_id[N-1]|
//
// Neither |lhs_id| nor any of |rhs_id| may be irrelevant.
- void AddFactIdEquation(uint32_t lhs_id, SpvOp opcode,
+ void AddFactIdEquation(uint32_t lhs_id, spv::Op opcode,
const std::vector& rhs_id);
// Inspects all known facts and adds corollary facts; e.g. if we know that
diff --git a/third_party/spirv-tools/source/fuzz/force_render_red.cpp b/third_party/spirv-tools/source/fuzz/force_render_red.cpp
index 3267487ad6..191fd716b5 100644
--- a/third_party/spirv-tools/source/fuzz/force_render_red.cpp
+++ b/third_party/spirv-tools/source/fuzz/force_render_red.cpp
@@ -36,8 +36,9 @@ opt::Function* FindFragmentShaderEntryPoint(opt::IRContext* ir_context,
// Check that this is a fragment shader
bool found_capability_shader = false;
for (auto& capability : ir_context->capabilities()) {
- assert(capability.opcode() == SpvOpCapability);
- if (capability.GetSingleWordInOperand(0) == SpvCapabilityShader) {
+ assert(capability.opcode() == spv::Op::OpCapability);
+ if (spv::Capability(capability.GetSingleWordInOperand(0)) ==
+ spv::Capability::Shader) {
found_capability_shader = true;
break;
}
@@ -51,7 +52,8 @@ opt::Function* FindFragmentShaderEntryPoint(opt::IRContext* ir_context,
opt::Instruction* fragment_entry_point = nullptr;
for (auto& entry_point : ir_context->module()->entry_points()) {
- if (entry_point.GetSingleWordInOperand(0) == SpvExecutionModelFragment) {
+ if (spv::ExecutionModel(entry_point.GetSingleWordInOperand(0)) ==
+ spv::ExecutionModel::Fragment) {
fragment_entry_point = &entry_point;
break;
}
@@ -81,8 +83,9 @@ opt::Instruction* FindVec4OutputVariable(opt::IRContext* ir_context,
MessageConsumer message_consumer) {
opt::Instruction* output_variable = nullptr;
for (auto& inst : ir_context->types_values()) {
- if (inst.opcode() == SpvOpVariable &&
- inst.GetSingleWordInOperand(0) == SpvStorageClassOutput) {
+ if (inst.opcode() == spv::Op::OpVariable &&
+ spv::StorageClass(inst.GetSingleWordInOperand(0)) ==
+ spv::StorageClass::Output) {
if (output_variable != nullptr) {
message_consumer(SPV_MSG_ERROR, nullptr, {},
"Only one output variable can be handled at present; "
@@ -144,10 +147,11 @@ MakeConstantUniformReplacement(opt::IRContext* ir_context,
uint32_t greater_than_instruction,
uint32_t in_operand_index) {
return MakeUnique(
- MakeIdUseDescriptor(constant_id,
- MakeInstructionDescriptor(greater_than_instruction,
- SpvOpFOrdGreaterThan, 0),
- in_operand_index),
+ MakeIdUseDescriptor(
+ constant_id,
+ MakeInstructionDescriptor(greater_than_instruction,
+ spv::Op::OpFOrdGreaterThan, 0),
+ in_operand_index),
fact_manager.GetUniformDescriptorsForConstant(constant_id)[0],
ir_context->TakeNextId(), ir_context->TakeNextId());
}
@@ -204,20 +208,21 @@ bool ForceRenderRed(
// Make the new exit block
auto new_exit_block_id = ir_context->TakeNextId();
{
- auto label = MakeUnique(ir_context.get(), SpvOpLabel, 0,
- new_exit_block_id,
- opt::Instruction::OperandList());
+ auto label = MakeUnique(
+ ir_context.get(), spv::Op::OpLabel, 0, new_exit_block_id,
+ opt::Instruction::OperandList());
auto new_exit_block = MakeUnique(std::move(label));
- new_exit_block->AddInstruction(MakeUnique(
- ir_context.get(), SpvOpReturn, 0, 0, opt::Instruction::OperandList()));
+ new_exit_block->AddInstruction(
+ MakeUnique(ir_context.get(), spv::Op::OpReturn, 0, 0,
+ opt::Instruction::OperandList()));
entry_point_function->AddBasicBlock(std::move(new_exit_block));
}
// Make the new entry block
{
- auto label = MakeUnique(ir_context.get(), SpvOpLabel, 0,
- ir_context->TakeNextId(),
- opt::Instruction::OperandList());
+ auto label = MakeUnique(
+ ir_context.get(), spv::Op::OpLabel, 0, ir_context->TakeNextId(),
+ opt::Instruction::OperandList());
auto new_entry_block = MakeUnique(std::move(label));
// Make an instruction to construct vec4(1.0, 0.0, 0.0, 1.0), representing
@@ -229,7 +234,7 @@ bool ForceRenderRed(
auto temp_vec4 = opt::analysis::Vector(float_type, 4);
auto vec4_id = ir_context->get_type_mgr()->GetId(&temp_vec4);
auto red = MakeUnique(
- ir_context.get(), SpvOpCompositeConstruct, vec4_id,
+ ir_context.get(), spv::Op::OpCompositeConstruct, vec4_id,
ir_context->TakeNextId(), op_composite_construct_operands);
auto red_id = red->result_id();
new_entry_block->AddInstruction(std::move(red));
@@ -241,7 +246,7 @@ bool ForceRenderRed(
opt::Instruction::OperandList op_store_operands = {variable_to_store_into,
value_to_be_stored};
new_entry_block->AddInstruction(MakeUnique(
- ir_context.get(), SpvOpStore, 0, 0, op_store_operands));
+ ir_context.get(), spv::Op::OpStore, 0, 0, op_store_operands));
// We are going to attempt to construct 'false' as an expression of the form
// 'literal1 > literal2'. If we succeed, we will later replace each literal
@@ -313,7 +318,7 @@ bool ForceRenderRed(
{SPV_OPERAND_TYPE_ID, {smaller_constant}},
{SPV_OPERAND_TYPE_ID, {larger_constant}}};
new_entry_block->AddInstruction(MakeUnique(
- ir_context.get(), SpvOpFOrdGreaterThan,
+ ir_context.get(), spv::Op::OpFOrdGreaterThan,
ir_context->get_type_mgr()->GetId(registered_bool_type),
id_guaranteed_to_be_false, greater_than_operands));
@@ -344,9 +349,9 @@ bool ForceRenderRed(
opt::Operand else_block = {SPV_OPERAND_TYPE_ID, {new_exit_block_id}};
opt::Instruction::OperandList op_branch_conditional_operands = {
false_condition, then_block, else_block};
- new_entry_block->AddInstruction(
- MakeUnique(ir_context.get(), SpvOpBranchConditional,
- 0, 0, op_branch_conditional_operands));
+ new_entry_block->AddInstruction(MakeUnique(
+ ir_context.get(), spv::Op::OpBranchConditional, 0, 0,
+ op_branch_conditional_operands));
entry_point_function->InsertBasicBlockBefore(
std::move(new_entry_block), entry_point_function->entry().get());
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass.cpp
index 6a879851d0..02d8aa1b1e 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass.cpp
@@ -131,14 +131,15 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor(
// should skip when searching from 'base' for the desired instruction.
// (An instruction that has a result id is represented by its own opcode,
// itself as 'base', and a skip-count of 0.)
- std::vector> base_opcode_skip_triples;
+ std::vector>
+ base_opcode_skip_triples;
// The initial base instruction is the block label.
uint32_t base = block->id();
// Counts the number of times we have seen each opcode since we reset the
// base instruction.
- std::map skip_count;
+ std::map skip_count;
// Consider every instruction in the block. The label is excluded: it is
// only necessary to consider it as a base in case the first instruction
@@ -151,7 +152,7 @@ void FuzzerPass::ForEachInstructionWithInstructionDescriptor(
base = inst_it->result_id();
skip_count.clear();
}
- const SpvOp opcode = inst_it->opcode();
+ const spv::Op opcode = inst_it->opcode();
// Invoke the provided function, which might apply a transformation.
action(block, inst_it,
@@ -330,7 +331,7 @@ uint32_t FuzzerPass::FindOrCreateStructType(
}
uint32_t FuzzerPass::FindOrCreatePointerType(uint32_t base_type_id,
- SpvStorageClass storage_class) {
+ spv::StorageClass storage_class) {
// We do not use the type manager here, due to problems related to isomorphic
// but distinct structs not being regarded as different.
auto existing_id = fuzzerutil::MaybeGetPointerType(
@@ -345,7 +346,7 @@ uint32_t FuzzerPass::FindOrCreatePointerType(uint32_t base_type_id,
}
uint32_t FuzzerPass::FindOrCreatePointerToIntegerType(
- uint32_t width, bool is_signed, SpvStorageClass storage_class) {
+ uint32_t width, bool is_signed, spv::StorageClass storage_class) {
return FindOrCreatePointerType(FindOrCreateIntegerType(width, is_signed),
storage_class);
}
@@ -432,7 +433,7 @@ uint32_t FuzzerPass::FindOrCreateCompositeConstant(
uint32_t FuzzerPass::FindOrCreateGlobalUndef(uint32_t type_id) {
for (auto& inst : GetIRContext()->types_values()) {
- if (inst.opcode() == SpvOpUndef && inst.type_id() == type_id) {
+ if (inst.opcode() == spv::Op::OpUndef && inst.type_id() == type_id) {
return inst.result_id();
}
}
@@ -464,7 +465,7 @@ uint32_t FuzzerPass::FindOrCreateNullConstant(uint32_t type_id) {
std::pair, std::map>>
FuzzerPass::GetAvailableBasicTypesAndPointers(
- SpvStorageClass storage_class) const {
+ spv::StorageClass storage_class) const {
// Records all of the basic types available in the module.
std::set basic_types;
@@ -480,23 +481,23 @@ FuzzerPass::GetAvailableBasicTypesAndPointers(
// For pointer types with basic pointee types, associate the pointer type
// with the basic type.
switch (inst.opcode()) {
- case SpvOpTypeBool:
- case SpvOpTypeFloat:
- case SpvOpTypeInt:
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
// These are all basic types.
basic_types.insert(inst.result_id());
basic_type_to_pointers.insert({inst.result_id(), {}});
break;
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
// An array type is basic if its base type is basic.
if (basic_types.count(inst.GetSingleWordInOperand(0))) {
basic_types.insert(inst.result_id());
basic_type_to_pointers.insert({inst.result_id(), {}});
}
break;
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
// A struct type is basic if it does not have the Block/BufferBlock
// decoration, and if all of its members are basic.
if (!fuzzerutil::HasBlockOrBufferBlockDecoration(GetIRContext(),
@@ -515,11 +516,12 @@ FuzzerPass::GetAvailableBasicTypesAndPointers(
}
break;
}
- case SpvOpTypePointer: {
+ case spv::Op::OpTypePointer: {
// We are interested in the pointer if its pointee type is basic and it
// has the right storage class.
auto pointee_type = inst.GetSingleWordInOperand(1);
- if (inst.GetSingleWordInOperand(0) == storage_class &&
+ if (spv::StorageClass(inst.GetSingleWordInOperand(0)) ==
+ storage_class &&
basic_types.count(pointee_type)) {
// The pointer has the desired storage class, and its pointee type is
// a basic type, so we are interested in it. Associate it with its
@@ -541,22 +543,22 @@ uint32_t FuzzerPass::FindOrCreateZeroConstant(
GetIRContext()->get_def_use_mgr()->GetDef(scalar_or_composite_type_id);
assert(type_instruction && "The type instruction must exist.");
switch (type_instruction->opcode()) {
- case SpvOpTypeBool:
+ case spv::Op::OpTypeBool:
return FindOrCreateBoolConstant(false, is_irrelevant);
- case SpvOpTypeFloat: {
+ case spv::Op::OpTypeFloat: {
auto width = type_instruction->GetSingleWordInOperand(0);
auto num_words = (width + 32 - 1) / 32;
return FindOrCreateFloatConstant(std::vector(num_words, 0),
width, is_irrelevant);
}
- case SpvOpTypeInt: {
+ case spv::Op::OpTypeInt: {
auto width = type_instruction->GetSingleWordInOperand(0);
auto num_words = (width + 32 - 1) / 32;
return FindOrCreateIntegerConstant(
std::vector(num_words, 0), width,
type_instruction->GetSingleWordInOperand(1), is_irrelevant);
}
- case SpvOpTypeArray: {
+ case spv::Op::OpTypeArray: {
auto component_type_id = type_instruction->GetSingleWordInOperand(0);
auto num_components =
fuzzerutil::GetArraySize(*type_instruction, GetIRContext());
@@ -566,8 +568,8 @@ uint32_t FuzzerPass::FindOrCreateZeroConstant(
FindOrCreateZeroConstant(component_type_id, is_irrelevant)),
scalar_or_composite_type_id, is_irrelevant);
}
- case SpvOpTypeMatrix:
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector: {
auto component_type_id = type_instruction->GetSingleWordInOperand(0);
auto num_components = type_instruction->GetSingleWordInOperand(1);
return FindOrCreateCompositeConstant(
@@ -576,7 +578,7 @@ uint32_t FuzzerPass::FindOrCreateZeroConstant(
FindOrCreateZeroConstant(component_type_id, is_irrelevant)),
scalar_or_composite_type_id, is_irrelevant);
}
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
assert(!fuzzerutil::HasBlockOrBufferBlockDecoration(
GetIRContext(), scalar_or_composite_type_id) &&
"We do not construct constants of struct types decorated with "
@@ -646,7 +648,7 @@ opt::BasicBlock* FuzzerPass::GetOrCreateSimpleLoopPreheader(
// |maybe_preheader| is a preheader if it branches unconditionally to
// the header. We also require it not to be a loop header.
- if (maybe_preheader->terminator()->opcode() == SpvOpBranch &&
+ if (maybe_preheader->terminator()->opcode() == spv::Op::OpBranch &&
!maybe_preheader->IsLoopHeader()) {
return maybe_preheader;
}
@@ -683,8 +685,8 @@ opt::BasicBlock* FuzzerPass::SplitBlockAfterOpPhiOrOpVariable(
// Find the first non-OpPhi and non-OpVariable instruction.
auto non_phi_or_var_inst = &*block->begin();
- while (non_phi_or_var_inst->opcode() == SpvOpPhi ||
- non_phi_or_var_inst->opcode() == SpvOpVariable) {
+ while (non_phi_or_var_inst->opcode() == spv::Op::OpPhi ||
+ non_phi_or_var_inst->opcode() == spv::Op::OpVariable) {
non_phi_or_var_inst = non_phi_or_var_inst->NextNode();
}
@@ -706,7 +708,7 @@ uint32_t FuzzerPass::FindOrCreateLocalVariable(
(void)pointer_type;
assert(pointer_type && pointer_type->AsPointer() &&
pointer_type->AsPointer()->storage_class() ==
- SpvStorageClassFunction &&
+ spv::StorageClass::Function &&
"The pointer_type_id must refer to a defined pointer type with "
"storage class Function");
auto function = fuzzerutil::FindFunction(GetIRContext(), function_id);
@@ -715,7 +717,7 @@ uint32_t FuzzerPass::FindOrCreateLocalVariable(
// First we try to find a suitable existing variable.
// All of the local variable declarations are located in the first block.
for (auto& instruction : *function->begin()) {
- if (instruction.opcode() != SpvOpVariable) {
+ if (instruction.opcode() != spv::Op::OpVariable) {
continue;
}
// The existing OpVariable must have type |pointer_type_id|.
@@ -749,15 +751,16 @@ uint32_t FuzzerPass::FindOrCreateGlobalVariable(
(void)pointer_type;
assert(
pointer_type && pointer_type->AsPointer() &&
- (pointer_type->AsPointer()->storage_class() == SpvStorageClassPrivate ||
+ (pointer_type->AsPointer()->storage_class() ==
+ spv::StorageClass::Private ||
pointer_type->AsPointer()->storage_class() ==
- SpvStorageClassWorkgroup) &&
+ spv::StorageClass::Workgroup) &&
"The pointer_type_id must refer to a defined pointer type with storage "
"class Private or Workgroup");
// First we try to find a suitable existing variable.
for (auto& instruction : GetIRContext()->module()->types_values()) {
- if (instruction.opcode() != SpvOpVariable) {
+ if (instruction.opcode() != spv::Op::OpVariable) {
continue;
}
// The existing OpVariable must have type |pointer_type_id|.
@@ -781,13 +784,13 @@ uint32_t FuzzerPass::FindOrCreateGlobalVariable(
uint32_t result_id = GetFuzzerContext()->GetFreshId();
// A variable with storage class Workgroup shouldn't have an initializer.
- if (storage_class == SpvStorageClassWorkgroup) {
+ if (storage_class == spv::StorageClass::Workgroup) {
ApplyTransformation(TransformationAddGlobalVariable(
- result_id, pointer_type_id, SpvStorageClassWorkgroup, 0,
+ result_id, pointer_type_id, spv::StorageClass::Workgroup, 0,
pointee_value_is_irrelevant));
} else {
ApplyTransformation(TransformationAddGlobalVariable(
- result_id, pointer_type_id, SpvStorageClassPrivate,
+ result_id, pointer_type_id, spv::StorageClass::Private,
FindOrCreateZeroConstant(pointee_type_id, pointee_value_is_irrelevant),
pointee_value_is_irrelevant));
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass.h b/third_party/spirv-tools/source/fuzz/fuzzer_pass.h
index 2655b5406c..5c76be1b6e 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass.h
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass.h
@@ -159,14 +159,14 @@ class FuzzerPass {
// already exist) and storage class |storage_class|. A transformation is
// applied to add the pointer if it does not already exist.
uint32_t FindOrCreatePointerType(uint32_t base_type_id,
- SpvStorageClass storage_class);
+ spv::StorageClass storage_class);
// Returns the id of an OpTypePointer instruction, with a integer base
// type of width and signedness specified by |width| and |is_signed|,
// respectively. If the pointer type or required integer base type do not
// exist, transformations are applied to add them.
uint32_t FindOrCreatePointerToIntegerType(uint32_t width, bool is_signed,
- SpvStorageClass storage_class);
+ spv::StorageClass storage_class);
// Returns the id of an OpConstant instruction, with a integer type of
// width and signedness specified by |width| and |is_signed|, respectively,
@@ -239,7 +239,7 @@ class FuzzerPass {
// storage class, and the sequence will have multiple elements if there are
// repeated pointer declarations for the same basic type and storage class.
std::pair, std::map>>
- GetAvailableBasicTypesAndPointers(SpvStorageClass storage_class) const;
+ GetAvailableBasicTypesAndPointers(spv::StorageClass storage_class) const;
// Given a type id, |scalar_or_composite_type_id|, which must correspond to
// some scalar or composite type, returns the result id of an instruction
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp
index 39f193d940..85ca57dca5 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_access_chains.cpp
@@ -34,15 +34,16 @@ void FuzzerPassAddAccessChains::Apply() {
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(inst_it->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ inst_it->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Check whether it is legitimate to insert an access chain
// instruction before this instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpAccessChain,
- inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ spv::Op::OpAccessChain, inst_it)) {
return;
}
@@ -64,8 +65,8 @@ void FuzzerPassAddAccessChains::Apply() {
return false;
}
switch (instruction->opcode()) {
- case SpvOpConstantNull:
- case SpvOpUndef:
+ case spv::Op::OpConstantNull:
+ case spv::Op::OpUndef:
// Do not allow making an access chain from a null or
// undefined pointer. (We can eliminate these cases
// before actually checking that the instruction is a
@@ -78,7 +79,7 @@ void FuzzerPassAddAccessChains::Apply() {
// make an access chain from it.
return context->get_def_use_mgr()
->GetDef(instruction->type_id())
- ->opcode() == SpvOpTypePointer;
+ ->opcode() == spv::Op::OpTypePointer;
});
// At this point, |relevant_instructions| contains all the pointers
@@ -112,14 +113,14 @@ void FuzzerPassAddAccessChains::Apply() {
}
uint32_t bound;
switch (subobject_type->opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
bound = fuzzerutil::GetArraySize(*subobject_type, GetIRContext());
break;
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
bound = subobject_type->GetSingleWordInOperand(1);
break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
bound = fuzzerutil::GetNumberOfStructMembers(*subobject_type);
break;
default:
@@ -140,9 +141,9 @@ void FuzzerPassAddAccessChains::Apply() {
GetFuzzerContext()->GetRandomIndexForAccessChain(bound);
switch (subobject_type->opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeMatrix:
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector: {
// The index will be clamped
bool is_signed = GetFuzzerContext()->ChooseEven();
@@ -164,7 +165,7 @@ void FuzzerPassAddAccessChains::Apply() {
subobject_type_id = subobject_type->GetSingleWordInOperand(0);
} break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
index_ids.push_back(FindOrCreateIntegerConstant(
{index_value}, 32, GetFuzzerContext()->ChooseEven(), false));
subobject_type_id =
@@ -178,7 +179,7 @@ void FuzzerPassAddAccessChains::Apply() {
// pointer suitable for the access chain's result type exists, so we
// create one if it does not.
FindOrCreatePointerType(subobject_type_id,
- static_cast(
+ static_cast(
pointer_type->GetSingleWordInOperand(0)));
// Apply the transformation to add an access chain.
ApplyTransformation(TransformationAccessChain(
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp
index dbbec0ca0c..c33ae44c83 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_extract.cpp
@@ -53,8 +53,8 @@ void FuzzerPassAddCompositeExtract::Apply() {
opt::Function* /*unused*/, opt::BasicBlock* /*unused*/,
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor) {
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCompositeExtract,
- inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ spv::Op::OpCompositeExtract, inst_it)) {
return;
}
@@ -97,15 +97,15 @@ void FuzzerPassAddCompositeExtract::Apply() {
assert(type_inst && "Composite instruction has invalid type id");
switch (type_inst->opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
number_of_members =
fuzzerutil::GetArraySize(*type_inst, GetIRContext());
break;
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeMatrix:
number_of_members = type_inst->GetSingleWordInOperand(1);
break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
number_of_members = type_inst->NumInOperands();
break;
default:
@@ -122,12 +122,12 @@ void FuzzerPassAddCompositeExtract::Apply() {
number_of_members));
switch (type_inst->opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeMatrix:
type_id = type_inst->GetSingleWordInOperand(0);
break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
type_id = type_inst->GetSingleWordInOperand(indices.back());
break;
default:
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp
index 2ac12de42d..048cdfde94 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_inserts.cpp
@@ -36,10 +36,11 @@ void FuzzerPassAddCompositeInserts::Apply() {
opt::BasicBlock::iterator instruction_iterator,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(instruction_iterator->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ instruction_iterator->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Randomly decide whether to try adding an OpCompositeInsert
// instruction.
@@ -51,7 +52,7 @@ void FuzzerPassAddCompositeInserts::Apply() {
// It must be possible to insert an OpCompositeInsert instruction
// before |instruction_iterator|.
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpCompositeInsert, instruction_iterator)) {
+ spv::Op::OpCompositeInsert, instruction_iterator)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp
index af36ad06eb..bb90991386 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_composite_types.cpp
@@ -114,15 +114,15 @@ uint32_t FuzzerPassAddCompositeTypes::ChooseScalarOrCompositeType() {
std::vector candidates;
for (auto& inst : GetIRContext()->types_values()) {
switch (inst.opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeBool:
- case SpvOpTypeFloat:
- case SpvOpTypeInt:
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
candidates.push_back(inst.result_id());
break;
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
if (!fuzzerutil::MembersHaveBuiltInDecoration(GetIRContext(),
inst.result_id()) &&
!fuzzerutil::HasBlockOrBufferBlockDecoration(GetIRContext(),
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp
index 6551f49f38..d54d4ad84a 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_copy_memory.cpp
@@ -36,7 +36,7 @@ void FuzzerPassAddCopyMemory::Apply() {
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor) {
// Check that we can insert an OpCopyMemory before this instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCopyMemory,
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpCopyMemory,
inst_it)) {
return;
}
@@ -61,8 +61,8 @@ void FuzzerPassAddCopyMemory::Apply() {
// Decide whether to create global or local variable.
auto storage_class = GetFuzzerContext()->ChooseEven()
- ? SpvStorageClassPrivate
- : SpvStorageClassFunction;
+ ? spv::StorageClass::Private
+ : spv::StorageClass::Function;
auto pointee_type_id = fuzzerutil::GetPointeeTypeIdFromPointerType(
GetIRContext(), inst->type_id());
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.cpp
index 4bbded8e18..e720c4ec0d 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_equation_instructions.cpp
@@ -29,12 +29,14 @@ bool IsBitWidthSupported(opt::IRContext* ir_context, uint32_t bit_width) {
return true;
case 64:
return ir_context->get_feature_mgr()->HasCapability(
- SpvCapabilityFloat64) &&
- ir_context->get_feature_mgr()->HasCapability(SpvCapabilityInt64);
+ spv::Capability::Float64) &&
+ ir_context->get_feature_mgr()->HasCapability(
+ spv::Capability::Int64);
case 16:
return ir_context->get_feature_mgr()->HasCapability(
- SpvCapabilityFloat16) &&
- ir_context->get_feature_mgr()->HasCapability(SpvCapabilityInt16);
+ spv::Capability::Float16) &&
+ ir_context->get_feature_mgr()->HasCapability(
+ spv::Capability::Int16);
default:
return false;
}
@@ -66,7 +68,8 @@ void FuzzerPassAddEquationInstructions::Apply() {
// as an example opcode for this check, to be representative of *some*
// opcode that defines an equation, even though we may choose a
// different opcode below.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpIAdd, inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpIAdd,
+ inst_it)) {
return;
}
@@ -78,7 +81,7 @@ void FuzzerPassAddEquationInstructions::Apply() {
[this](opt::IRContext* /*unused*/,
opt::Instruction* instruction) -> bool {
return instruction->result_id() && instruction->type_id() &&
- instruction->opcode() != SpvOpUndef &&
+ instruction->opcode() != spv::Op::OpUndef &&
!GetTransformationContext()
->GetFactManager()
->IdIsIrrelevant(instruction->result_id());
@@ -86,15 +89,16 @@ void FuzzerPassAddEquationInstructions::Apply() {
// Try the opcodes for which we know how to make ids at random until
// something works.
- std::vector candidate_opcodes = {
- SpvOpIAdd, SpvOpISub, SpvOpLogicalNot, SpvOpSNegate,
- SpvOpConvertUToF, SpvOpConvertSToF, SpvOpBitcast};
+ std::vector candidate_opcodes = {
+ spv::Op::OpIAdd, spv::Op::OpISub, spv::Op::OpLogicalNot,
+ spv::Op::OpSNegate, spv::Op::OpConvertUToF, spv::Op::OpConvertSToF,
+ spv::Op::OpBitcast};
do {
auto opcode =
GetFuzzerContext()->RemoveAtRandomIndex(&candidate_opcodes);
switch (opcode) {
- case SpvOpConvertSToF:
- case SpvOpConvertUToF: {
+ case spv::Op::OpConvertSToF:
+ case spv::Op::OpConvertUToF: {
std::vector candidate_instructions;
for (const auto* inst :
GetIntegerInstructions(available_instructions)) {
@@ -144,7 +148,7 @@ void FuzzerPassAddEquationInstructions::Apply() {
{operand->result_id()}, instruction_descriptor));
return;
}
- case SpvOpBitcast: {
+ case spv::Op::OpBitcast: {
const auto candidate_instructions =
GetNumericalInstructions(available_instructions);
@@ -197,8 +201,8 @@ void FuzzerPassAddEquationInstructions::Apply() {
return;
}
} break;
- case SpvOpIAdd:
- case SpvOpISub: {
+ case spv::Op::OpIAdd:
+ case spv::Op::OpISub: {
// Instructions of integer (scalar or vector) result type are
// suitable for these opcodes.
auto integer_instructions =
@@ -251,7 +255,7 @@ void FuzzerPassAddEquationInstructions::Apply() {
}
break;
}
- case SpvOpLogicalNot: {
+ case spv::Op::OpLogicalNot: {
// Choose any available instruction of boolean scalar/vector
// result type and equate its negation with a fresh id.
auto boolean_instructions =
@@ -268,7 +272,7 @@ void FuzzerPassAddEquationInstructions::Apply() {
}
break;
}
- case SpvOpSNegate: {
+ case spv::Op::OpSNegate: {
// Similar to OpLogicalNot, but for signed integer negation.
auto integer_instructions =
GetIntegerInstructions(available_instructions);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp
index 033f4a276e..70b86573ef 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_function_calls.cpp
@@ -39,8 +39,8 @@ void FuzzerPassAddFunctionCalls::Apply() {
-> void {
// Check whether it is legitimate to insert a function call before the
// instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpFunctionCall,
- inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ spv::Op::OpFunctionCall, inst_it)) {
return;
}
@@ -112,8 +112,8 @@ std::vector FuzzerPassAddFunctionCalls::ChooseFunctionCallArguments(
auto available_pointers = FindAvailableInstructions(
caller_function, caller_block, caller_inst_it,
[this, caller_block](opt::IRContext* /*unused*/, opt::Instruction* inst) {
- if (inst->opcode() != SpvOpVariable ||
- inst->opcode() != SpvOpFunctionParameter) {
+ if (inst->opcode() != spv::Op::OpVariable ||
+ inst->opcode() != spv::Op::OpFunctionParameter) {
// Function parameters and variables are the only
// kinds of pointer that can be used as actual
// parameters.
@@ -172,15 +172,15 @@ std::vector FuzzerPassAddFunctionCalls::ChooseFunctionCallArguments(
auto storage_class = param_type->AsPointer()->storage_class();
auto pointee_type_id = fuzzerutil::GetPointeeTypeIdFromPointerType(
GetIRContext(), param->type_id());
- if (storage_class == SpvStorageClassFunction) {
+ if (storage_class == spv::StorageClass::Function) {
// Add a new zero-initialized local variable to the current
// function, noting that its pointee value is irrelevant.
ApplyTransformation(TransformationAddLocalVariable(
fresh_variable_id, param->type_id(), caller_function->result_id(),
FindOrCreateZeroConstant(pointee_type_id, false), true));
} else {
- assert((storage_class == SpvStorageClassPrivate ||
- storage_class == SpvStorageClassWorkgroup) &&
+ assert((storage_class == spv::StorageClass::Private ||
+ storage_class == spv::StorageClass::Workgroup) &&
"Only Function, Private and Workgroup storage classes are "
"supported at present.");
// Add a new global variable to the module, zero-initializing it if
@@ -188,7 +188,7 @@ std::vector FuzzerPassAddFunctionCalls::ChooseFunctionCallArguments(
// irrelevant.
ApplyTransformation(TransformationAddGlobalVariable(
fresh_variable_id, param->type_id(), storage_class,
- storage_class == SpvStorageClassPrivate
+ storage_class == spv::StorageClass::Private
? FindOrCreateZeroConstant(pointee_type_id, false)
: 0,
true));
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_global_variables.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_global_variables.cpp
index 061f44d069..4106856520 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_global_variables.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_global_variables.cpp
@@ -29,16 +29,17 @@ FuzzerPassAddGlobalVariables::FuzzerPassAddGlobalVariables(
transformations, ignore_inapplicable_transformations) {}
void FuzzerPassAddGlobalVariables::Apply() {
- SpvStorageClass variable_storage_class = SpvStorageClassPrivate;
+ spv::StorageClass variable_storage_class = spv::StorageClass::Private;
for (auto& entry_point : GetIRContext()->module()->entry_points()) {
// If the execution model of some entry point is GLCompute,
// then the variable storage class may be Workgroup.
- if (entry_point.GetSingleWordInOperand(0) == SpvExecutionModelGLCompute) {
+ if (spv::ExecutionModel(entry_point.GetSingleWordInOperand(0)) ==
+ spv::ExecutionModel::GLCompute) {
variable_storage_class =
GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfChoosingWorkgroupStorageClass())
- ? SpvStorageClassWorkgroup
- : SpvStorageClassPrivate;
+ ? spv::StorageClass::Workgroup
+ : spv::StorageClass::Private;
break;
}
}
@@ -87,7 +88,7 @@ void FuzzerPassAddGlobalVariables::Apply() {
ApplyTransformation(TransformationAddGlobalVariable(
GetFuzzerContext()->GetFreshId(), pointer_type_id,
variable_storage_class,
- variable_storage_class == SpvStorageClassPrivate
+ variable_storage_class == spv::StorageClass::Private
? FindOrCreateZeroConstant(basic_type, false)
: 0,
true));
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_loads.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_loads.cpp
index ab91543b09..36603284f7 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_loads.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_loads.cpp
@@ -34,10 +34,11 @@ void FuzzerPassAddLoads::Apply() {
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(inst_it->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ inst_it->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Randomly decide whether to try inserting a load here.
if (!GetFuzzerContext()->ChoosePercentage(
@@ -47,10 +48,11 @@ void FuzzerPassAddLoads::Apply() {
// Check whether it is legitimate to insert a load or atomic load before
// this instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpLoad,
+ inst_it)) {
return;
}
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpAtomicLoad,
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpAtomicLoad,
inst_it)) {
return;
}
@@ -64,8 +66,8 @@ void FuzzerPassAddLoads::Apply() {
return false;
}
switch (instruction->opcode()) {
- case SpvOpConstantNull:
- case SpvOpUndef:
+ case spv::Op::OpConstantNull:
+ case spv::Op::OpUndef:
// Do not allow loading from a null or undefined pointer;
// this might be OK if the block is dead, but for now we
// conservatively avoid it.
@@ -75,7 +77,7 @@ void FuzzerPassAddLoads::Apply() {
}
return context->get_def_use_mgr()
->GetDef(instruction->type_id())
- ->opcode() == SpvOpTypePointer;
+ ->opcode() == spv::Op::OpTypePointer;
});
// At this point, |relevant_instructions| contains all the pointers
@@ -92,25 +94,25 @@ void FuzzerPassAddLoads::Apply() {
uint32_t memory_scope_id = 0;
uint32_t memory_semantics_id = 0;
- auto storage_class = static_cast(
+ auto storage_class = static_cast(
GetIRContext()
->get_def_use_mgr()
->GetDef(chosen_instruction->type_id())
->GetSingleWordInOperand(0));
switch (storage_class) {
- case SpvStorageClassStorageBuffer:
- case SpvStorageClassPhysicalStorageBuffer:
- case SpvStorageClassWorkgroup:
- case SpvStorageClassCrossWorkgroup:
- case SpvStorageClassAtomicCounter:
- case SpvStorageClassImage:
+ case spv::StorageClass::StorageBuffer:
+ case spv::StorageClass::PhysicalStorageBuffer:
+ case spv::StorageClass::Workgroup:
+ case spv::StorageClass::CrossWorkgroup:
+ case spv::StorageClass::AtomicCounter:
+ case spv::StorageClass::Image:
if (GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfAddingAtomicLoad())) {
is_atomic_load = true;
memory_scope_id = FindOrCreateConstant(
- {SpvScopeInvocation},
+ {uint32_t(spv::Scope::Invocation)},
FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()),
false);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_local_variables.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_local_variables.cpp
index a4e739f8e0..f467f46b3e 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_local_variables.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_local_variables.cpp
@@ -31,7 +31,7 @@ FuzzerPassAddLocalVariables::FuzzerPassAddLocalVariables(
void FuzzerPassAddLocalVariables::Apply() {
auto basic_type_ids_and_pointers =
- GetAvailableBasicTypesAndPointers(SpvStorageClassFunction);
+ GetAvailableBasicTypesAndPointers(spv::StorageClass::Function);
// These are the basic types that are available to this fuzzer pass.
auto& basic_types = basic_type_ids_and_pointers.first;
@@ -64,7 +64,7 @@ void FuzzerPassAddLocalVariables::Apply() {
// use it.
pointer_type = GetFuzzerContext()->GetFreshId();
ApplyTransformation(TransformationAddTypePointer(
- pointer_type, SpvStorageClassFunction, basic_type));
+ pointer_type, spv::StorageClass::Function, basic_type));
available_pointers_to_basic_type.push_back(pointer_type);
} else {
// There is - grab one.
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp
index 73b6b0ac74..d0b1275bca 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_opphi_synonyms.cpp
@@ -176,8 +176,8 @@ FuzzerPassAddOpPhiSynonyms::GetIdEquivalenceClasses() {
// - OpFunction does not yield a value;
// - OpUndef yields an undefined value at each use, so it should never be a
// synonym of another id.
- if (pair.second->opcode() == SpvOpFunction ||
- pair.second->opcode() == SpvOpUndef) {
+ if (pair.second->opcode() == spv::Op::OpFunction ||
+ pair.second->opcode() == spv::Op::OpUndef) {
continue;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_parameters.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_parameters.cpp
index 1cb6a79d11..e663d89bae 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_parameters.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_parameters.cpp
@@ -79,7 +79,7 @@ void FuzzerPassAddParameters::Apply() {
auto storage_class = fuzzerutil::GetStorageClassFromPointerType(
GetIRContext(), current_type_id);
switch (storage_class) {
- case SpvStorageClassFunction: {
+ case spv::StorageClass::Function: {
// In every caller find or create a local variable that has the
// selected type.
for (auto* instr :
@@ -91,8 +91,8 @@ void FuzzerPassAddParameters::Apply() {
call_parameter_ids[instr->result_id()] = variable_id;
}
} break;
- case SpvStorageClassPrivate:
- case SpvStorageClassWorkgroup: {
+ case spv::StorageClass::Private:
+ case spv::StorageClass::Workgroup: {
// If there exists at least one caller, find or create a global
// variable that has the selected type.
std::vector callers =
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_stores.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_stores.cpp
index 606e4a634f..0de02a5b81 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_stores.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_stores.cpp
@@ -34,10 +34,11 @@ void FuzzerPassAddStores::Apply() {
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(inst_it->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ inst_it->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Randomly decide whether to try inserting a store here.
if (!GetFuzzerContext()->ChoosePercentage(
@@ -47,12 +48,12 @@ void FuzzerPassAddStores::Apply() {
// Check whether it is legitimate to insert a store before this
// instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpStore,
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpStore,
inst_it)) {
return;
}
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpAtomicStore,
- inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ spv::Op::OpAtomicStore, inst_it)) {
return;
}
@@ -67,7 +68,7 @@ void FuzzerPassAddStores::Apply() {
}
auto type_inst = context->get_def_use_mgr()->GetDef(
instruction->type_id());
- if (type_inst->opcode() != SpvOpTypePointer) {
+ if (type_inst->opcode() != spv::Op::OpTypePointer) {
// Not a pointer.
return false;
}
@@ -76,8 +77,8 @@ void FuzzerPassAddStores::Apply() {
return false;
}
switch (instruction->opcode()) {
- case SpvOpConstantNull:
- case SpvOpUndef:
+ case spv::Op::OpConstantNull:
+ case spv::Op::OpUndef:
// Do not allow storing to a null or undefined pointer;
// this might be OK if the block is dead, but for now we
// conservatively avoid it.
@@ -126,24 +127,24 @@ void FuzzerPassAddStores::Apply() {
uint32_t memory_semantics_id = 0;
auto storage_class =
- static_cast(GetIRContext()
- ->get_def_use_mgr()
- ->GetDef(pointer->type_id())
- ->GetSingleWordInOperand(0));
+ static_cast(GetIRContext()
+ ->get_def_use_mgr()
+ ->GetDef(pointer->type_id())
+ ->GetSingleWordInOperand(0));
switch (storage_class) {
- case SpvStorageClassStorageBuffer:
- case SpvStorageClassPhysicalStorageBuffer:
- case SpvStorageClassWorkgroup:
- case SpvStorageClassCrossWorkgroup:
- case SpvStorageClassAtomicCounter:
- case SpvStorageClassImage:
+ case spv::StorageClass::StorageBuffer:
+ case spv::StorageClass::PhysicalStorageBuffer:
+ case spv::StorageClass::Workgroup:
+ case spv::StorageClass::CrossWorkgroup:
+ case spv::StorageClass::AtomicCounter:
+ case spv::StorageClass::Image:
if (GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfAddingAtomicStore())) {
is_atomic_store = true;
memory_scope_id = FindOrCreateConstant(
- {SpvScopeInvocation},
+ {uint32_t(spv::Scope::Invocation)},
FindOrCreateIntegerType(32, GetFuzzerContext()->ChooseEven()),
false);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_synonyms.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_synonyms.cpp
index 1d188deb85..5782732cfd 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_synonyms.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_synonyms.cpp
@@ -44,7 +44,8 @@ void FuzzerPassAddSynonyms::Apply() {
// Skip |inst_it| if we can't insert anything above it. OpIAdd is just
// a representative of some instruction that might be produced by the
// transformation.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpIAdd, inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpIAdd,
+ inst_it)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp
index a29d1d34d2..4cddf55e46 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_add_vector_shuffle_instructions.cpp
@@ -35,10 +35,11 @@ void FuzzerPassAddVectorShuffleInstructions::Apply() {
opt::BasicBlock::iterator instruction_iterator,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(instruction_iterator->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ instruction_iterator->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Randomly decide whether to try adding an OpVectorShuffle instruction.
if (!GetFuzzerContext()->ChoosePercentage(
@@ -49,7 +50,7 @@ void FuzzerPassAddVectorShuffleInstructions::Apply() {
// It must be valid to insert an OpVectorShuffle instruction
// before |instruction_iterator|.
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpVectorShuffle, instruction_iterator)) {
+ spv::Op::OpVectorShuffle, instruction_iterator)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp
index 94428f72cc..6bf46e1b52 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_branch_weights.cpp
@@ -33,7 +33,7 @@ void FuzzerPassAdjustBranchWeights::Apply() {
// For all OpBranchConditional instructions,
// randomly applies the transformation.
GetIRContext()->module()->ForEachInst([this](opt::Instruction* instruction) {
- if (instruction->opcode() == SpvOpBranchConditional &&
+ if (instruction->opcode() == spv::Op::OpBranchConditional &&
GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfAdjustingBranchWeights())) {
ApplyTransformation(TransformationAdjustBranchWeights(
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp
index 1c2bc8cf76..363edc70c2 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_function_controls.cpp
@@ -40,21 +40,21 @@ void FuzzerPassAdjustFunctionControls::Apply() {
// For the new mask, we first randomly select one of three basic masks:
// None, Inline or DontInline. These are always valid (and are mutually
// exclusive).
- std::vector basic_function_control_masks = {
- SpvFunctionControlMaskNone, SpvFunctionControlInlineMask,
- SpvFunctionControlDontInlineMask};
+ std::vector basic_function_control_masks = {
+ spv::FunctionControlMask::MaskNone, spv::FunctionControlMask::Inline,
+ spv::FunctionControlMask::DontInline};
uint32_t new_function_control_mask =
- basic_function_control_masks[GetFuzzerContext()->RandomIndex(
- basic_function_control_masks)];
+ uint32_t(basic_function_control_masks[GetFuzzerContext()->RandomIndex(
+ basic_function_control_masks)]);
// We now consider the Pure and Const mask bits. If these are already
// set on the function then it's OK to keep them, but also interesting
// to consider dropping them, so we decide randomly in each case.
for (auto mask_bit :
- {SpvFunctionControlPureMask, SpvFunctionControlConstMask}) {
- if ((existing_function_control_mask & mask_bit) &&
+ {spv::FunctionControlMask::Pure, spv::FunctionControlMask::Const}) {
+ if ((existing_function_control_mask & uint32_t(mask_bit)) &&
GetFuzzerContext()->ChooseEven()) {
- new_function_control_mask |= mask_bit;
+ new_function_control_mask |= uint32_t(mask_bit);
}
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp
index fe855cade2..53dbe54067 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_loop_controls.cpp
@@ -34,7 +34,7 @@ void FuzzerPassAdjustLoopControls::Apply() {
for (auto& block : function) {
if (auto merge_inst = block.GetMergeInst()) {
// Ignore the instruction if it is not a loop merge.
- if (merge_inst->opcode() != SpvOpLoopMerge) {
+ if (merge_inst->opcode() != spv::Op::OpLoopMerge) {
continue;
}
@@ -48,9 +48,10 @@ void FuzzerPassAdjustLoopControls::Apply() {
TransformationSetLoopControl::kLoopControlMaskInOperandIndex);
// First, set the new mask to one of None, Unroll or DontUnroll.
- std::vector basic_masks = {SpvLoopControlMaskNone,
- SpvLoopControlUnrollMask,
- SpvLoopControlDontUnrollMask};
+ std::vector basic_masks = {
+ uint32_t(spv::LoopControlMask::MaskNone),
+ uint32_t(spv::LoopControlMask::Unroll),
+ uint32_t(spv::LoopControlMask::DontUnroll)};
uint32_t new_mask =
basic_masks[GetFuzzerContext()->RandomIndex(basic_masks)];
@@ -58,19 +59,20 @@ void FuzzerPassAdjustLoopControls::Apply() {
// does, check which of these were present in the existing mask and
// randomly decide whether to keep them. They are just hints, so
// removing them should not change the semantics of the module.
- for (auto mask_bit :
- {SpvLoopControlDependencyInfiniteMask,
- SpvLoopControlDependencyLengthMask,
- SpvLoopControlMinIterationsMask, SpvLoopControlMaxIterationsMask,
- SpvLoopControlIterationMultipleMask}) {
- if ((existing_mask & mask_bit) && GetFuzzerContext()->ChooseEven()) {
+ for (auto mask_bit : {spv::LoopControlMask::DependencyInfinite,
+ spv::LoopControlMask::DependencyLength,
+ spv::LoopControlMask::MinIterations,
+ spv::LoopControlMask::MaxIterations,
+ spv::LoopControlMask::IterationMultiple}) {
+ if ((existing_mask & uint32_t(mask_bit)) &&
+ GetFuzzerContext()->ChooseEven()) {
// The mask bits we are considering are not available in all SPIR-V
// versions. However, we only include a mask bit if it was present
// in the original loop control mask, and we work under the
// assumption that we are transforming a valid module, thus we don't
// need to actually check whether the SPIR-V version being used
// supports these loop control mask bits.
- new_mask |= mask_bit;
+ new_mask |= uint32_t(mask_bit);
}
}
@@ -81,14 +83,14 @@ void FuzzerPassAdjustLoopControls::Apply() {
// PeelCount and PartialCount are not compatible with DontUnroll, so
// we check whether DontUnroll is set.
- if (!(new_mask & SpvLoopControlDontUnrollMask)) {
+ if (!(new_mask & uint32_t(spv::LoopControlMask::DontUnroll))) {
// If PeelCount is supported by this SPIR-V version, randomly choose
// whether to set it. If it was set in the original mask and is not
// selected for setting here, that amounts to dropping it.
if (TransformationSetLoopControl::PeelCountIsSupported(
GetIRContext()) &&
GetFuzzerContext()->ChooseEven()) {
- new_mask |= SpvLoopControlPeelCountMask;
+ new_mask |= uint32_t(spv::LoopControlMask::PeelCount);
// The peel count is chosen randomly - if PeelCount was already set
// this will overwrite whatever peel count was previously used.
peel_count = GetFuzzerContext()->GetRandomLoopControlPeelCount();
@@ -97,7 +99,7 @@ void FuzzerPassAdjustLoopControls::Apply() {
if (TransformationSetLoopControl::PartialCountIsSupported(
GetIRContext()) &&
GetFuzzerContext()->ChooseEven()) {
- new_mask |= SpvLoopControlPartialCountMask;
+ new_mask |= uint32_t(spv::LoopControlMask::PartialCount);
partial_count =
GetFuzzerContext()->GetRandomLoopControlPartialCount();
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp
index d2ff40e6fc..efae7d6698 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_memory_operands_masks.cpp
@@ -47,8 +47,8 @@ void FuzzerPassAdjustMemoryOperandsMasks::Apply() {
// From SPIR-V 1.4 onwards, OpCopyMemory and OpCopyMemorySized have a
// second mask.
switch (inst_it->opcode()) {
- case SpvOpCopyMemory:
- case SpvOpCopyMemorySized:
+ case spv::Op::OpCopyMemory:
+ case spv::Op::OpCopyMemorySized:
if (TransformationSetMemoryOperandsMask::
MultipleMemoryOperandMasksAreSupported(GetIRContext())) {
indices_of_available_masks_to_adjust.push_back(1);
@@ -75,24 +75,26 @@ void FuzzerPassAdjustMemoryOperandsMasks::Apply() {
existing_mask_in_operand_index < inst_it->NumInOperands()
? inst_it->GetSingleWordInOperand(
existing_mask_in_operand_index)
- : static_cast(SpvMemoryAccessMaskNone);
+ : static_cast(spv::MemoryAccessMask::MaskNone);
// There are two things we can do to a mask:
// - add Volatile if not already present
// - toggle Nontemporal
// The following ensures that we do at least one of these
- bool add_volatile = !(existing_mask & SpvMemoryAccessVolatileMask) &&
- GetFuzzerContext()->ChooseEven();
+ bool add_volatile =
+ !(existing_mask & uint32_t(spv::MemoryAccessMask::Volatile)) &&
+ GetFuzzerContext()->ChooseEven();
bool toggle_nontemporal =
!add_volatile || GetFuzzerContext()->ChooseEven();
// These bitwise operations use '|' to add Volatile if desired, and
// '^' to toggle Nontemporal if desired.
uint32_t new_mask =
- (existing_mask | (add_volatile ? SpvMemoryAccessVolatileMask
- : SpvMemoryAccessMaskNone)) ^
- (toggle_nontemporal ? SpvMemoryAccessNontemporalMask
- : SpvMemoryAccessMaskNone);
+ (existing_mask |
+ (add_volatile ? uint32_t(spv::MemoryAccessMask::Volatile)
+ : uint32_t(spv::MemoryAccessMask::MaskNone))) ^
+ (toggle_nontemporal ? uint32_t(spv::MemoryAccessMask::Nontemporal)
+ : uint32_t(spv::MemoryAccessMask::MaskNone));
TransformationSetMemoryOperandsMask transformation(
MakeInstructionDescriptor(block, inst_it), new_mask, mask_index);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp
index 7d8e6b5782..fe0cf7afbc 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_adjust_selection_controls.cpp
@@ -34,7 +34,7 @@ void FuzzerPassAdjustSelectionControls::Apply() {
for (auto& block : function) {
if (auto merge_inst = block.GetMergeInst()) {
// Ignore the instruction if it is not a selection merge.
- if (merge_inst->opcode() != SpvOpSelectionMerge) {
+ if (merge_inst->opcode() != spv::Op::OpSelectionMerge) {
continue;
}
@@ -48,13 +48,14 @@ void FuzzerPassAdjustSelectionControls::Apply() {
// The choices to change the selection control to are the set of valid
// controls, minus the current control.
std::vector choices;
- for (auto control :
- {SpvSelectionControlMaskNone, SpvSelectionControlFlattenMask,
- SpvSelectionControlDontFlattenMask}) {
- if (control == merge_inst->GetSingleWordOperand(1)) {
+ for (auto control : {spv::SelectionControlMask::MaskNone,
+ spv::SelectionControlMask::Flatten,
+ spv::SelectionControlMask::DontFlatten}) {
+ if (control ==
+ spv::SelectionControlMask(merge_inst->GetSingleWordOperand(1))) {
continue;
}
- choices.push_back(control);
+ choices.push_back(uint32_t(control));
}
// Apply the transformation and add it to the output transformation
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
index 5c3b86b954..0367a26b3f 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.cpp
@@ -107,9 +107,9 @@ void FuzzerPassApplyIdSynonyms::Apply() {
// which case we need to be able to add an extract instruction to get
// that element out.
if (synonym_to_try->index_size() > 0 &&
- !fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCompositeExtract,
- use_inst) &&
- use_inst->opcode() != SpvOpPhi) {
+ !fuzzerutil::CanInsertOpcodeBeforeInstruction(
+ spv::Op::OpCompositeExtract, use_inst) &&
+ use_inst->opcode() != spv::Op::OpPhi) {
// We cannot insert an extract before this instruction, so this
// synonym is no good.
continue;
@@ -132,7 +132,7 @@ void FuzzerPassApplyIdSynonyms::Apply() {
id_with_which_to_replace_use = GetFuzzerContext()->GetFreshId();
opt::Instruction* instruction_to_insert_before = nullptr;
- if (use_inst->opcode() != SpvOpPhi) {
+ if (use_inst->opcode() != spv::Op::OpPhi) {
instruction_to_insert_before = use_inst;
} else {
auto parent_block_id =
@@ -182,7 +182,7 @@ void FuzzerPassApplyIdSynonyms::Apply() {
}
bool FuzzerPassApplyIdSynonyms::DataDescriptorsHaveCompatibleTypes(
- SpvOp opcode, uint32_t use_in_operand_index,
+ spv::Op opcode, uint32_t use_in_operand_index,
const protobufs::DataDescriptor& dd1,
const protobufs::DataDescriptor& dd2) {
auto base_object_type_id_1 =
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.h b/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.h
index 3da9c5d69a..d1a0e1aaf7 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.h
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_apply_id_synonyms.h
@@ -38,7 +38,7 @@ class FuzzerPassApplyIdSynonyms : public FuzzerPass {
// with respect to the type. Concretely, returns true if |dd1| and |dd2| have
// the same type or both |dd1| and |dd2| are either a numerical or a vector
// type of integral components with possibly different signedness.
- bool DataDescriptorsHaveCompatibleTypes(SpvOp opcode,
+ bool DataDescriptorsHaveCompatibleTypes(spv::Op opcode,
uint32_t use_in_operand_index,
const protobufs::DataDescriptor& dd1,
const protobufs::DataDescriptor& dd2);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp
index ff022fcca3..0ad630c167 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_construct_composites.cpp
@@ -81,7 +81,7 @@ void FuzzerPassConstructComposites::Apply() {
// Check whether it is legitimate to insert a composite construction
// before the instruction.
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpCompositeConstruct, inst_it)) {
+ spv::Op::OpCompositeConstruct, inst_it)) {
return;
}
@@ -121,19 +121,19 @@ void FuzzerPassConstructComposites::Apply() {
auto composite_type_inst =
GetIRContext()->get_def_use_mgr()->GetDef(chosen_composite_type);
switch (composite_type_inst->opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
constructor_arguments = FindComponentsToConstructArray(
*composite_type_inst, type_id_to_available_instructions);
break;
- case SpvOpTypeMatrix:
+ case spv::Op::OpTypeMatrix:
constructor_arguments = FindComponentsToConstructMatrix(
*composite_type_inst, type_id_to_available_instructions);
break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
constructor_arguments = FindComponentsToConstructStruct(
*composite_type_inst, type_id_to_available_instructions);
break;
- case SpvOpTypeVector:
+ case spv::Op::OpTypeVector:
constructor_arguments = FindComponentsToConstructVector(
*composite_type_inst, type_id_to_available_instructions);
break;
@@ -156,7 +156,7 @@ std::vector
FuzzerPassConstructComposites::FindComponentsToConstructArray(
const opt::Instruction& array_type_instruction,
const TypeIdToInstructions& type_id_to_available_instructions) {
- assert(array_type_instruction.opcode() == SpvOpTypeArray &&
+ assert(array_type_instruction.opcode() == spv::Op::OpTypeArray &&
"Precondition: instruction must be an array type.");
// Get the element type for the array.
@@ -191,7 +191,7 @@ std::vector
FuzzerPassConstructComposites::FindComponentsToConstructMatrix(
const opt::Instruction& matrix_type_instruction,
const TypeIdToInstructions& type_id_to_available_instructions) {
- assert(matrix_type_instruction.opcode() == SpvOpTypeMatrix &&
+ assert(matrix_type_instruction.opcode() == spv::Op::OpTypeMatrix &&
"Precondition: instruction must be a matrix type.");
// Get the element type for the matrix.
@@ -221,7 +221,7 @@ std::vector
FuzzerPassConstructComposites::FindComponentsToConstructStruct(
const opt::Instruction& struct_type_instruction,
const TypeIdToInstructions& type_id_to_available_instructions) {
- assert(struct_type_instruction.opcode() == SpvOpTypeStruct &&
+ assert(struct_type_instruction.opcode() == spv::Op::OpTypeStruct &&
"Precondition: instruction must be a struct type.");
std::vector result;
// Consider the type of each field of the struct.
@@ -251,7 +251,7 @@ std::vector
FuzzerPassConstructComposites::FindComponentsToConstructVector(
const opt::Instruction& vector_type_instruction,
const TypeIdToInstructions& type_id_to_available_instructions) {
- assert(vector_type_instruction.opcode() == SpvOpTypeVector &&
+ assert(vector_type_instruction.opcode() == spv::Op::OpTypeVector &&
"Precondition: instruction must be a vector type.");
// Get details of the type underlying the vector, and the width of the vector,
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
index 80cc2a5725..725c33e5ba 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_copy_objects.cpp
@@ -35,10 +35,11 @@ void FuzzerPassCopyObjects::Apply() {
opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(inst_it->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ inst_it->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
if (GetTransformationContext()->GetFactManager()->BlockIsDead(
block->id())) {
@@ -48,7 +49,7 @@ void FuzzerPassCopyObjects::Apply() {
// Check whether it is legitimate to insert a copy before this
// instruction.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCopyObject,
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpCopyObject,
inst_it)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.cpp
index 29ede58b5b..1696c74e20 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.cpp
@@ -88,7 +88,7 @@ void FuzzerPassDonateModules::DonateSingleModule(
// module.
for (const auto& capability_inst : donor_ir_context->capabilities()) {
auto capability =
- static_cast(capability_inst.GetSingleWordInOperand(0));
+ static_cast(capability_inst.GetSingleWordInOperand(0));
if (!GetIRContext()->get_feature_mgr()->HasCapability(capability)) {
return;
}
@@ -122,27 +122,27 @@ void FuzzerPassDonateModules::DonateSingleModule(
// kinds of decoration.
}
-SpvStorageClass FuzzerPassDonateModules::AdaptStorageClass(
- SpvStorageClass donor_storage_class) {
+spv::StorageClass FuzzerPassDonateModules::AdaptStorageClass(
+ spv::StorageClass donor_storage_class) {
switch (donor_storage_class) {
- case SpvStorageClassFunction:
- case SpvStorageClassPrivate:
- case SpvStorageClassWorkgroup:
+ case spv::StorageClass::Function:
+ case spv::StorageClass::Private:
+ case spv::StorageClass::Workgroup:
// We leave these alone
return donor_storage_class;
- case SpvStorageClassInput:
- case SpvStorageClassOutput:
- case SpvStorageClassUniform:
- case SpvStorageClassUniformConstant:
- case SpvStorageClassPushConstant:
- case SpvStorageClassImage:
- case SpvStorageClassStorageBuffer:
+ case spv::StorageClass::Input:
+ case spv::StorageClass::Output:
+ case spv::StorageClass::Uniform:
+ case spv::StorageClass::UniformConstant:
+ case spv::StorageClass::PushConstant:
+ case spv::StorageClass::Image:
+ case spv::StorageClass::StorageBuffer:
// We change these to Private
- return SpvStorageClassPrivate;
+ return spv::StorageClass::Private;
default:
// Handle other cases on demand.
assert(false && "Currently unsupported storage class.");
- return SpvStorageClassMax;
+ return spv::StorageClass::Max;
}
}
@@ -200,14 +200,14 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
// that its component types will have been considered previously, and that
// |original_id_to_donated_id| will already contain an entry for them.
switch (type_or_value.opcode()) {
- case SpvOpTypeImage:
- case SpvOpTypeSampledImage:
- case SpvOpTypeSampler:
+ case spv::Op::OpTypeImage:
+ case spv::Op::OpTypeSampledImage:
+ case spv::Op::OpTypeSampler:
// We do not donate types and variables that relate to images and
// samplers, so we skip these types and subsequently skip anything that
// depends on them.
return;
- case SpvOpTypeVoid: {
+ case spv::Op::OpTypeVoid: {
// Void has to exist already in order for us to have an entry point.
// Get the existing id of void.
opt::analysis::Void void_type;
@@ -216,7 +216,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
"The module being transformed will always have 'void' type "
"declared.");
} break;
- case SpvOpTypeBool: {
+ case spv::Op::OpTypeBool: {
// Bool cannot be declared multiple times, so use its existing id if
// present, or add a declaration of Bool with a fresh id if not.
opt::analysis::Bool bool_type;
@@ -228,7 +228,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
ApplyTransformation(TransformationAddTypeBoolean(new_result_id));
}
} break;
- case SpvOpTypeInt: {
+ case spv::Op::OpTypeInt: {
// Int cannot be declared multiple times with the same width and
// signedness, so check whether an existing identical Int type is
// present and use its id if so. Otherwise add a declaration of the
@@ -246,8 +246,8 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
TransformationAddTypeInt(new_result_id, width, is_signed));
}
} break;
- case SpvOpTypeFloat: {
- // Similar to SpvOpTypeInt.
+ case spv::Op::OpTypeFloat: {
+ // Similar to spv::Op::OpTypeInt.
const uint32_t width = type_or_value.GetSingleWordInOperand(0);
opt::analysis::Float float_type(width);
auto float_type_id = GetIRContext()->get_type_mgr()->GetId(&float_type);
@@ -258,7 +258,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
ApplyTransformation(TransformationAddTypeFloat(new_result_id, width));
}
} break;
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeVector: {
// It is not legal to have two Vector type declarations with identical
// element types and element counts, so check whether an existing
// identical Vector type is present and use its id if so. Otherwise add
@@ -282,8 +282,8 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
new_result_id, component_type_id, component_count));
}
} break;
- case SpvOpTypeMatrix: {
- // Similar to SpvOpTypeVector.
+ case spv::Op::OpTypeMatrix: {
+ // Similar to spv::Op::OpTypeVector.
uint32_t column_type_id = original_id_to_donated_id->at(
type_or_value.GetSingleWordInOperand(0));
auto column_type =
@@ -302,7 +302,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
}
} break;
- case SpvOpTypeArray: {
+ case spv::Op::OpTypeArray: {
// It is OK to have multiple structurally identical array types, so
// we go ahead and add a remapped version of the type declared by the
// donor.
@@ -318,7 +318,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
original_id_to_donated_id->at(
type_or_value.GetSingleWordInOperand(1))));
} break;
- case SpvOpTypeRuntimeArray: {
+ case spv::Op::OpTypeRuntimeArray: {
// A runtime array is allowed as the final member of an SSBO. During
// donation we turn runtime arrays into fixed-size arrays. For dead
// code donations this is OK because the array is never indexed into at
@@ -341,8 +341,8 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
{GetFuzzerContext()->GetRandomSizeForNewArray()}, 32, false,
false)));
} break;
- case SpvOpTypeStruct: {
- // Similar to SpvOpTypeArray.
+ case spv::Op::OpTypeStruct: {
+ // Similar to spv::Op::OpTypeArray.
std::vector member_type_ids;
for (uint32_t i = 0; i < type_or_value.NumInOperands(); i++) {
auto component_type_id = type_or_value.GetSingleWordInOperand(i);
@@ -358,8 +358,8 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
ApplyTransformation(
TransformationAddTypeStruct(new_result_id, member_type_ids));
} break;
- case SpvOpTypePointer: {
- // Similar to SpvOpTypeArray.
+ case spv::Op::OpTypePointer: {
+ // Similar to spv::Op::OpTypeArray.
uint32_t pointee_type_id = type_or_value.GetSingleWordInOperand(1);
if (!original_id_to_donated_id->count(pointee_type_id)) {
// We did not donate the pointee type for this pointer type, so we
@@ -369,11 +369,11 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
new_result_id = GetFuzzerContext()->GetFreshId();
ApplyTransformation(TransformationAddTypePointer(
new_result_id,
- AdaptStorageClass(static_cast(
+ AdaptStorageClass(static_cast(
type_or_value.GetSingleWordInOperand(0))),
original_id_to_donated_id->at(pointee_type_id)));
} break;
- case SpvOpTypeFunction: {
+ case spv::Op::OpTypeFunction: {
// It is not OK to have multiple function types that use identical ids
// for their return and parameter types. We thus go through all
// existing function types to look for a match. We do not use the
@@ -425,10 +425,11 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
argument_type_ids));
}
} break;
- case SpvOpSpecConstantOp: {
+ case spv::Op::OpSpecConstantOp: {
new_result_id = GetFuzzerContext()->GetFreshId();
auto type_id = original_id_to_donated_id->at(type_or_value.type_id());
- auto opcode = static_cast(type_or_value.GetSingleWordInOperand(0));
+ auto opcode =
+ static_cast(type_or_value.GetSingleWordInOperand(0));
// Make sure we take into account |original_id_to_donated_id| when
// computing operands for OpSpecConstantOp.
@@ -447,20 +448,20 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
ApplyTransformation(TransformationAddSpecConstantOp(
new_result_id, type_id, opcode, std::move(operands)));
} break;
- case SpvOpSpecConstantTrue:
- case SpvOpSpecConstantFalse:
- case SpvOpConstantTrue:
- case SpvOpConstantFalse: {
+ case spv::Op::OpSpecConstantTrue:
+ case spv::Op::OpSpecConstantFalse:
+ case spv::Op::OpConstantTrue:
+ case spv::Op::OpConstantFalse: {
// It is OK to have duplicate definitions of True and False, so add
// these to the module, using a remapped Bool type.
new_result_id = GetFuzzerContext()->GetFreshId();
- auto value = type_or_value.opcode() == SpvOpConstantTrue ||
- type_or_value.opcode() == SpvOpSpecConstantTrue;
+ auto value = type_or_value.opcode() == spv::Op::OpConstantTrue ||
+ type_or_value.opcode() == spv::Op::OpSpecConstantTrue;
ApplyTransformation(
TransformationAddConstantBoolean(new_result_id, value, false));
} break;
- case SpvOpSpecConstant:
- case SpvOpConstant: {
+ case spv::Op::OpSpecConstant:
+ case spv::Op::OpConstant: {
// It is OK to have duplicate constant definitions, so add this to the
// module using a remapped result type.
new_result_id = GetFuzzerContext()->GetFreshId();
@@ -472,8 +473,8 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
new_result_id, original_id_to_donated_id->at(type_or_value.type_id()),
data_words, false));
} break;
- case SpvOpSpecConstantComposite:
- case SpvOpConstantComposite: {
+ case spv::Op::OpSpecConstantComposite:
+ case spv::Op::OpConstantComposite: {
assert(original_id_to_donated_id->count(type_or_value.type_id()) &&
"Composite types for which it is possible to create a constant "
"should have been donated.");
@@ -495,7 +496,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
new_result_id, original_id_to_donated_id->at(type_or_value.type_id()),
constituent_ids, false));
} break;
- case SpvOpConstantNull: {
+ case spv::Op::OpConstantNull: {
if (!original_id_to_donated_id->count(type_or_value.type_id())) {
// We did not donate the type associated with this null constant, so
// we cannot donate the null constant.
@@ -509,7 +510,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
new_result_id,
original_id_to_donated_id->at(type_or_value.type_id())));
} break;
- case SpvOpVariable: {
+ case spv::Op::OpVariable: {
if (!original_id_to_donated_id->count(type_or_value.type_id())) {
// We did not donate the pointer type associated with this variable,
// so we cannot donate the variable.
@@ -536,11 +537,11 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
uint32_t remapped_pointer_type =
original_id_to_donated_id->at(type_or_value.type_id());
uint32_t initializer_id;
- SpvStorageClass storage_class =
- static_cast(type_or_value.GetSingleWordInOperand(
- 0)) == SpvStorageClassWorkgroup
- ? SpvStorageClassWorkgroup
- : SpvStorageClassPrivate;
+ spv::StorageClass storage_class =
+ static_cast(type_or_value.GetSingleWordInOperand(
+ 0)) == spv::StorageClass::Workgroup
+ ? spv::StorageClass::Workgroup
+ : spv::StorageClass::Private;
if (type_or_value.NumInOperands() == 1) {
// The variable did not have an initializer. Initialize it to zero
// if it has Private storage class (to limit problems associated with
@@ -551,7 +552,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
// could initialize Workgroup variables at the start of an entry
// point, and should do so if their uninitialized nature proves
// problematic.
- initializer_id = storage_class == SpvStorageClassWorkgroup
+ initializer_id = storage_class == spv::StorageClass::Workgroup
? 0
: FindOrCreateZeroConstant(
fuzzerutil::GetPointeeTypeIdFromPointerType(
@@ -566,7 +567,7 @@ void FuzzerPassDonateModules::HandleTypeOrValue(
TransformationAddGlobalVariable(new_result_id, remapped_pointer_type,
storage_class, initializer_id, true));
} break;
- case SpvOpUndef: {
+ case spv::Op::OpUndef: {
if (!original_id_to_donated_id->count(type_or_value.type_id())) {
// We did not donate the type associated with this undef, so we cannot
// donate the undef.
@@ -638,7 +639,7 @@ void FuzzerPassDonateModules::HandleFunctions(
[this, &donated_instructions, donor_ir_context,
&original_id_to_donated_id,
&skipped_instructions](const opt::Instruction* instruction) {
- if (instruction->opcode() == SpvOpArrayLength) {
+ if (instruction->opcode() == spv::Op::OpArrayLength) {
// We treat OpArrayLength specially.
HandleOpArrayLength(*instruction, original_id_to_donated_id,
&donated_instructions);
@@ -682,70 +683,70 @@ bool FuzzerPassDonateModules::CanDonateInstruction(
// Now consider instructions we specifically want to skip because we do not
// yet support them.
switch (instruction.opcode()) {
- case SpvOpAtomicLoad:
- case SpvOpAtomicStore:
- case SpvOpAtomicExchange:
- case SpvOpAtomicCompareExchange:
- case SpvOpAtomicCompareExchangeWeak:
- case SpvOpAtomicIIncrement:
- case SpvOpAtomicIDecrement:
- case SpvOpAtomicIAdd:
- case SpvOpAtomicISub:
- case SpvOpAtomicSMin:
- case SpvOpAtomicUMin:
- case SpvOpAtomicSMax:
- case SpvOpAtomicUMax:
- case SpvOpAtomicAnd:
- case SpvOpAtomicOr:
- case SpvOpAtomicXor:
+ case spv::Op::OpAtomicLoad:
+ case spv::Op::OpAtomicStore:
+ case spv::Op::OpAtomicExchange:
+ case spv::Op::OpAtomicCompareExchange:
+ case spv::Op::OpAtomicCompareExchangeWeak:
+ case spv::Op::OpAtomicIIncrement:
+ case spv::Op::OpAtomicIDecrement:
+ case spv::Op::OpAtomicIAdd:
+ case spv::Op::OpAtomicISub:
+ case spv::Op::OpAtomicSMin:
+ case spv::Op::OpAtomicUMin:
+ case spv::Op::OpAtomicSMax:
+ case spv::Op::OpAtomicUMax:
+ case spv::Op::OpAtomicAnd:
+ case spv::Op::OpAtomicOr:
+ case spv::Op::OpAtomicXor:
// We conservatively ignore all atomic instructions at present.
// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3276): Consider
// being less conservative here.
- case SpvOpImageSampleImplicitLod:
- case SpvOpImageSampleExplicitLod:
- case SpvOpImageSampleDrefImplicitLod:
- case SpvOpImageSampleDrefExplicitLod:
- case SpvOpImageSampleProjImplicitLod:
- case SpvOpImageSampleProjExplicitLod:
- case SpvOpImageSampleProjDrefImplicitLod:
- case SpvOpImageSampleProjDrefExplicitLod:
- case SpvOpImageFetch:
- case SpvOpImageGather:
- case SpvOpImageDrefGather:
- case SpvOpImageRead:
- case SpvOpImageWrite:
- case SpvOpImageSparseSampleImplicitLod:
- case SpvOpImageSparseSampleExplicitLod:
- case SpvOpImageSparseSampleDrefImplicitLod:
- case SpvOpImageSparseSampleDrefExplicitLod:
- case SpvOpImageSparseSampleProjImplicitLod:
- case SpvOpImageSparseSampleProjExplicitLod:
- case SpvOpImageSparseSampleProjDrefImplicitLod:
- case SpvOpImageSparseSampleProjDrefExplicitLod:
- case SpvOpImageSparseFetch:
- case SpvOpImageSparseGather:
- case SpvOpImageSparseDrefGather:
- case SpvOpImageSparseRead:
- case SpvOpImageSampleFootprintNV:
- case SpvOpImage:
- case SpvOpImageQueryFormat:
- case SpvOpImageQueryLevels:
- case SpvOpImageQueryLod:
- case SpvOpImageQueryOrder:
- case SpvOpImageQuerySamples:
- case SpvOpImageQuerySize:
- case SpvOpImageQuerySizeLod:
- case SpvOpSampledImage:
+ case spv::Op::OpImageSampleImplicitLod:
+ case spv::Op::OpImageSampleExplicitLod:
+ case spv::Op::OpImageSampleDrefImplicitLod:
+ case spv::Op::OpImageSampleDrefExplicitLod:
+ case spv::Op::OpImageSampleProjImplicitLod:
+ case spv::Op::OpImageSampleProjExplicitLod:
+ case spv::Op::OpImageSampleProjDrefImplicitLod:
+ case spv::Op::OpImageSampleProjDrefExplicitLod:
+ case spv::Op::OpImageFetch:
+ case spv::Op::OpImageGather:
+ case spv::Op::OpImageDrefGather:
+ case spv::Op::OpImageRead:
+ case spv::Op::OpImageWrite:
+ case spv::Op::OpImageSparseSampleImplicitLod:
+ case spv::Op::OpImageSparseSampleExplicitLod:
+ case spv::Op::OpImageSparseSampleDrefImplicitLod:
+ case spv::Op::OpImageSparseSampleDrefExplicitLod:
+ case spv::Op::OpImageSparseSampleProjImplicitLod:
+ case spv::Op::OpImageSparseSampleProjExplicitLod:
+ case spv::Op::OpImageSparseSampleProjDrefImplicitLod:
+ case spv::Op::OpImageSparseSampleProjDrefExplicitLod:
+ case spv::Op::OpImageSparseFetch:
+ case spv::Op::OpImageSparseGather:
+ case spv::Op::OpImageSparseDrefGather:
+ case spv::Op::OpImageSparseRead:
+ case spv::Op::OpImageSampleFootprintNV:
+ case spv::Op::OpImage:
+ case spv::Op::OpImageQueryFormat:
+ case spv::Op::OpImageQueryLevels:
+ case spv::Op::OpImageQueryLod:
+ case spv::Op::OpImageQueryOrder:
+ case spv::Op::OpImageQuerySamples:
+ case spv::Op::OpImageQuerySize:
+ case spv::Op::OpImageQuerySizeLod:
+ case spv::Op::OpSampledImage:
// We ignore all instructions related to accessing images, since we do not
// donate images.
return false;
- case SpvOpLoad:
+ case spv::Op::OpLoad:
switch (donor_ir_context->get_def_use_mgr()
->GetDef(instruction.type_id())
->opcode()) {
- case SpvOpTypeImage:
- case SpvOpTypeSampledImage:
- case SpvOpTypeSampler:
+ case spv::Op::OpTypeImage:
+ case spv::Op::OpTypeSampledImage:
+ case spv::Op::OpTypeSampler:
// Again, we ignore instructions that relate to accessing images.
return false;
default:
@@ -783,13 +784,13 @@ bool FuzzerPassDonateModules::CanDonateInstruction(
bool FuzzerPassDonateModules::IsBasicType(
const opt::Instruction& instruction) const {
switch (instruction.opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeBool:
- case SpvOpTypeFloat:
- case SpvOpTypeInt:
- case SpvOpTypeMatrix:
- case SpvOpTypeStruct:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeStruct:
+ case spv::Op::OpTypeVector:
return true;
default:
return false;
@@ -800,7 +801,7 @@ void FuzzerPassDonateModules::HandleOpArrayLength(
const opt::Instruction& instruction,
std::map* original_id_to_donated_id,
std::vector* donated_instructions) const {
- assert(instruction.opcode() == SpvOpArrayLength &&
+ assert(instruction.opcode() == spv::Op::OpArrayLength &&
"Precondition: instruction must be OpArrayLength.");
uint32_t donated_variable_id =
original_id_to_donated_id->at(instruction.GetSingleWordInOperand(0));
@@ -809,12 +810,12 @@ void FuzzerPassDonateModules::HandleOpArrayLength(
auto pointer_to_struct_instruction =
GetIRContext()->get_def_use_mgr()->GetDef(
donated_variable_instruction->type_id());
- assert(pointer_to_struct_instruction->opcode() == SpvOpTypePointer &&
+ assert(pointer_to_struct_instruction->opcode() == spv::Op::OpTypePointer &&
"Type of variable must be pointer.");
auto donated_struct_type_instruction =
GetIRContext()->get_def_use_mgr()->GetDef(
pointer_to_struct_instruction->GetSingleWordInOperand(1));
- assert(donated_struct_type_instruction->opcode() == SpvOpTypeStruct &&
+ assert(donated_struct_type_instruction->opcode() == spv::Op::OpTypeStruct &&
"Pointee type of pointer used by OpArrayLength must be struct.");
assert(donated_struct_type_instruction->NumInOperands() ==
instruction.GetSingleWordInOperand(1) + 1 &&
@@ -825,7 +826,7 @@ void FuzzerPassDonateModules::HandleOpArrayLength(
donated_struct_type_instruction->NumInOperands() - 1);
auto fixed_size_array_type_instruction =
GetIRContext()->get_def_use_mgr()->GetDef(fixed_size_array_type_id);
- assert(fixed_size_array_type_instruction->opcode() == SpvOpTypeArray &&
+ assert(fixed_size_array_type_instruction->opcode() == spv::Op::OpTypeArray &&
"The donated array type must be fixed-size.");
auto array_size_id =
fixed_size_array_type_instruction->GetSingleWordInOperand(1);
@@ -837,7 +838,8 @@ void FuzzerPassDonateModules::HandleOpArrayLength(
}
donated_instructions->push_back(MakeInstructionMessage(
- SpvOpCopyObject, original_id_to_donated_id->at(instruction.type_id()),
+ spv::Op::OpCopyObject,
+ original_id_to_donated_id->at(instruction.type_id()),
original_id_to_donated_id->at(instruction.result_id()),
opt::Instruction::OperandList({{SPV_OPERAND_TYPE_ID, {array_size_id}}})));
}
@@ -892,7 +894,7 @@ void FuzzerPassDonateModules::HandleDifficultInstruction(
// more interesting value later.
auto zero_constant = FindOrCreateZeroConstant(remapped_type_id, true);
donated_instructions->push_back(MakeInstructionMessage(
- SpvOpCopyObject, remapped_type_id,
+ spv::Op::OpCopyObject, remapped_type_id,
original_id_to_donated_id->at(instruction.result_id()),
opt::Instruction::OperandList({{SPV_OPERAND_TYPE_ID, {zero_constant}}})));
}
@@ -926,8 +928,8 @@ void FuzzerPassDonateModules::PrepareInstructionForDonation(
(void)(donor_ir_context);
assert((donor_ir_context->get_def_use_mgr()
->GetDef(operand_id)
- ->opcode() == SpvOpLabel ||
- instruction.opcode() == SpvOpPhi) &&
+ ->opcode() == spv::Op::OpLabel ||
+ instruction.opcode() == spv::Op::OpPhi) &&
"Unsupported forward reference.");
original_id_to_donated_id->insert(
{operand_id, GetFuzzerContext()->GetFreshId()});
@@ -942,7 +944,7 @@ void FuzzerPassDonateModules::PrepareInstructionForDonation(
input_operands.push_back({in_operand.type, operand_data});
}
- if (instruction.opcode() == SpvOpVariable &&
+ if (instruction.opcode() == spv::Op::OpVariable &&
instruction.NumInOperands() == 1) {
// This is an uninitialized local variable. Initialize it to zero.
input_operands.push_back(
@@ -1017,7 +1019,7 @@ bool FuzzerPassDonateModules::CreateLoopLimiterInfo(
// Adjust OpPhi instructions in the |merge_block|.
for (const auto& inst : *merge_block) {
- if (inst.opcode() != SpvOpPhi) {
+ if (inst.opcode() != spv::Op::OpPhi) {
break;
}
@@ -1070,7 +1072,8 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
// live-safe. Add them if not already present.
FindOrCreateBoolType(); // Needed for comparisons
FindOrCreatePointerToIntegerType(
- 32, false, SpvStorageClassFunction); // Needed for adding loop limiters
+ 32, false,
+ spv::StorageClass::Function); // Needed for adding loop limiters
FindOrCreateIntegerConstant({0}, 32, false,
false); // Needed for initializing loop limiters
FindOrCreateIntegerConstant({1}, 32, false,
@@ -1107,8 +1110,8 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
for (auto& block : function_to_donate) {
for (auto& inst : block) {
switch (inst.opcode()) {
- case SpvOpAccessChain:
- case SpvOpInBoundsAccessChain: {
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain: {
protobufs::AccessChainClampingInfo clamping_info;
clamping_info.set_access_chain_id(
original_id_to_donated_id.at(inst.result_id()));
@@ -1118,7 +1121,8 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
assert(base_object && "The base object must exist.");
auto pointer_type = donor_ir_context->get_def_use_mgr()->GetDef(
base_object->type_id());
- assert(pointer_type && pointer_type->opcode() == SpvOpTypePointer &&
+ assert(pointer_type &&
+ pointer_type->opcode() == spv::Op::OpTypePointer &&
"The base object must have pointer type.");
auto should_be_composite_type =
@@ -1138,7 +1142,8 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
// Get the bound for the component being indexed into.
uint32_t bound;
- if (should_be_composite_type->opcode() == SpvOpTypeRuntimeArray) {
+ if (should_be_composite_type->opcode() ==
+ spv::Op::OpTypeRuntimeArray) {
// The donor is indexing into a runtime array. We do not
// donate runtime arrays. Instead, we donate a corresponding
// fixed-size array for every runtime array. We should thus
@@ -1148,7 +1153,7 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
GetIRContext()->get_def_use_mgr()->GetDef(
original_id_to_donated_id.at(
should_be_composite_type->result_id()));
- assert(fixed_size_array_type->opcode() == SpvOpTypeArray &&
+ assert(fixed_size_array_type->opcode() == spv::Op::OpTypeArray &&
"A runtime array type in the donor should have been "
"replaced by a fixed-sized array in the recipient.");
// The size of this fixed-size array is a suitable bound.
@@ -1163,12 +1168,12 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
donor_ir_context->get_def_use_mgr()->GetDef(index_id);
auto index_type_inst = donor_ir_context->get_def_use_mgr()->GetDef(
index_inst->type_id());
- assert(index_type_inst->opcode() == SpvOpTypeInt);
+ assert(index_type_inst->opcode() == spv::Op::OpTypeInt);
opt::analysis::Integer* index_int_type =
donor_ir_context->get_type_mgr()
->GetType(index_type_inst->result_id())
->AsInteger();
- if (index_inst->opcode() != SpvOpConstant) {
+ if (index_inst->opcode() != spv::Op::OpConstant) {
// We will have to clamp this index, so we need a constant
// whose value is one less than the bound, to compare
// against and to use as the clamped value.
@@ -1194,7 +1199,7 @@ bool FuzzerPassDonateModules::MaybeAddLivesafeFunction(
uint32_t kill_unreachable_return_value_id = 0;
auto function_return_type_inst =
donor_ir_context->get_def_use_mgr()->GetDef(function_to_donate.type_id());
- if (function_return_type_inst->opcode() != SpvOpTypeVoid &&
+ if (function_return_type_inst->opcode() != spv::Op::OpTypeVoid &&
fuzzerutil::FunctionContainsOpKillOrUnreachable(function_to_donate)) {
kill_unreachable_return_value_id = FindOrCreateZeroConstant(
original_id_to_donated_id.at(function_return_type_inst->result_id()),
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.h b/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.h
index 924dd358cd..004f15875c 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.h
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_donate_modules.h
@@ -45,7 +45,8 @@ class FuzzerPassDonateModules : public FuzzerPass {
private:
// Adapts a storage class coming from a donor module so that it will work
// in a recipient module, e.g. by changing Uniform to Private.
- static SpvStorageClass AdaptStorageClass(SpvStorageClass donor_storage_class);
+ static spv::StorageClass AdaptStorageClass(
+ spv::StorageClass donor_storage_class);
// Identifies all external instruction set imports in |donor_ir_context| and
// populates |original_id_to_donated_id| with a mapping from the donor's id
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp
index 5bf0461d31..fecd82e488 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_expand_vector_reductions.cpp
@@ -40,8 +40,8 @@ void FuzzerPassExpandVectorReductions::Apply() {
}
// |instruction| must be OpAny or OpAll.
- if (instruction.opcode() != SpvOpAny &&
- instruction.opcode() != SpvOpAll) {
+ if (instruction.opcode() != spv::Op::OpAny &&
+ instruction.opcode() != spv::Op::OpAll) {
continue;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp
index 70fa6a12ca..86ffff45a3 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_flatten_conditional_branches.cpp
@@ -48,8 +48,8 @@ void FuzzerPassFlattenConditionalBranches::Apply() {
// Only consider this block if it is the header of a conditional, with a
// non-irrelevant condition.
if (block.GetMergeInst() &&
- block.GetMergeInst()->opcode() == SpvOpSelectionMerge &&
- block.terminator()->opcode() == SpvOpBranchConditional &&
+ block.GetMergeInst()->opcode() == spv::Op::OpSelectionMerge &&
+ block.terminator()->opcode() == spv::Op::OpBranchConditional &&
!GetTransformationContext()->GetFactManager()->IdIsIrrelevant(
block.terminator()->GetSingleWordInOperand(0))) {
selection_headers.emplace_back(&block);
@@ -94,11 +94,11 @@ void FuzzerPassFlattenConditionalBranches::Apply() {
->get_def_use_mgr()
->GetDef(phi_instruction->type_id())
->opcode()) {
- case SpvOpTypeBool:
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypePointer:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypePointer:
+ case spv::Op::OpTypeVector:
return true;
default:
return false;
@@ -143,7 +143,7 @@ void FuzzerPassFlattenConditionalBranches::Apply() {
GetIRContext()->get_def_use_mgr()->GetDef(
phi_instruction->type_id());
switch (type_instruction->opcode()) {
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeVector: {
uint32_t dimension =
type_instruction->GetSingleWordInOperand(1);
switch (dimension) {
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_inline_functions.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_inline_functions.cpp
index 4024096f46..6839bbe2cc 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_inline_functions.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_inline_functions.cpp
@@ -64,7 +64,7 @@ void FuzzerPassInlineFunctions::Apply() {
auto* function_call_block =
GetIRContext()->get_instr_block(function_call_instruction);
if ((function_call_instruction != &*--function_call_block->tail() ||
- function_call_block->terminator()->opcode() != SpvOpBranch) &&
+ function_call_block->terminator()->opcode() != spv::Op::OpBranch) &&
!MaybeApplyTransformation(TransformationSplitBlock(
MakeInstructionDescriptor(GetIRContext(),
function_call_instruction->NextNode()),
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp
index b755d2357e..ec5fc4b7b4 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_make_vector_operations_dynamic.cpp
@@ -47,18 +47,20 @@ void FuzzerPassMakeVectorOperationsDynamic::Apply() {
}
// Make sure |instruction| has only one indexing operand.
- assert(instruction.NumInOperands() ==
- (instruction.opcode() == SpvOpCompositeExtract ? 2 : 3) &&
- "FuzzerPassMakeVectorOperationsDynamic: the composite "
- "instruction must have "
- "only one indexing operand.");
+ assert(
+ instruction.NumInOperands() ==
+ (instruction.opcode() == spv::Op::OpCompositeExtract ? 2 : 3) &&
+ "FuzzerPassMakeVectorOperationsDynamic: the composite "
+ "instruction must have "
+ "only one indexing operand.");
// Applies the make vector operation dynamic transformation.
ApplyTransformation(TransformationMakeVectorOperationDynamic(
instruction.result_id(),
FindOrCreateIntegerConstant(
{instruction.GetSingleWordInOperand(
- instruction.opcode() == SpvOpCompositeExtract ? 1 : 2)},
+ instruction.opcode() == spv::Op::OpCompositeExtract ? 1
+ : 2)},
32, GetFuzzerContext()->ChooseEven(), false)));
}
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_merge_function_returns.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_merge_function_returns.cpp
index 220f707b5c..48c1861837 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_merge_function_returns.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_merge_function_returns.cpp
@@ -64,11 +64,11 @@ void FuzzerPassMergeFunctionReturns::Apply() {
[this, function](
opt::BasicBlock* /*unused*/, opt::BasicBlock::iterator inst_it,
const protobufs::InstructionDescriptor& instruction_descriptor) {
- const SpvOp opcode = inst_it->opcode();
+ const spv::Op opcode = inst_it->opcode();
switch (opcode) {
- case SpvOpKill:
- case SpvOpUnreachable:
- case SpvOpTerminateInvocation: {
+ case spv::Op::OpKill:
+ case spv::Op::OpUnreachable:
+ case spv::Op::OpTerminateInvocation: {
// This is an early termination instruction - we need to wrap it
// so that it becomes a return.
if (TransformationWrapEarlyTerminatorInFunction::
@@ -85,7 +85,7 @@ void FuzzerPassMergeFunctionReturns::Apply() {
GetIRContext()->get_def_use_mgr()->GetDef(
function->type_id());
uint32_t returned_value_id;
- if (function_return_type->opcode() == SpvOpTypeVoid) {
+ if (function_return_type->opcode() == spv::Op::OpTypeVoid) {
// No value is needed.
returned_value_id = 0;
} else if (fuzzerutil::CanCreateConstant(
@@ -130,7 +130,7 @@ void FuzzerPassMergeFunctionReturns::Apply() {
// If the entry block does not branch unconditionally to another block,
// split it.
- if (function->entry()->terminator()->opcode() != SpvOpBranch) {
+ if (function->entry()->terminator()->opcode() != spv::Op::OpBranch) {
SplitBlockAfterOpPhiOrOpVariable(function->entry()->id());
}
@@ -149,9 +149,9 @@ void FuzzerPassMergeFunctionReturns::Apply() {
if (GetIRContext()
->get_instr_block(merge_block)
->WhileEachInst([](opt::Instruction* inst) {
- return inst->opcode() == SpvOpLabel ||
- inst->opcode() == SpvOpPhi ||
- inst->opcode() == SpvOpBranch;
+ return inst->opcode() == spv::Op::OpLabel ||
+ inst->opcode() == spv::Op::OpPhi ||
+ inst->opcode() == spv::Op::OpBranch;
})) {
actual_merge_blocks.emplace_back(merge_block);
continue;
@@ -324,7 +324,8 @@ FuzzerPassMergeFunctionReturns::GetInfoNeededForMergeBlocks(
bool FuzzerPassMergeFunctionReturns::IsEarlyTerminatorWrapper(
const opt::Function& function) const {
- for (SpvOp opcode : {SpvOpKill, SpvOpUnreachable, SpvOpTerminateInvocation}) {
+ for (spv::Op opcode : {spv::Op::OpKill, spv::Op::OpUnreachable,
+ spv::Op::OpTerminateInvocation}) {
if (TransformationWrapEarlyTerminatorInFunction::MaybeGetWrapperFunction(
GetIRContext(), opcode) == &function) {
return true;
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_mutate_pointers.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_mutate_pointers.cpp
index bbe05409b0..a7e9fdc35f 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_mutate_pointers.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_mutate_pointers.cpp
@@ -39,7 +39,8 @@ void FuzzerPassMutatePointers::Apply() {
return;
}
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, inst_it)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpLoad,
+ inst_it)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
index f60c1b4cdf..48ac589ec8 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.cpp
@@ -37,21 +37,21 @@ FuzzerPassObfuscateConstants::FuzzerPassObfuscateConstants(
void FuzzerPassObfuscateConstants::ObfuscateBoolConstantViaConstantPair(
uint32_t depth, const protobufs::IdUseDescriptor& bool_constant_use,
- const std::vector& greater_than_opcodes,
- const std::vector& less_than_opcodes, uint32_t constant_id_1,
+ const std::vector& greater_than_opcodes,
+ const std::vector& less_than_opcodes, uint32_t constant_id_1,
uint32_t constant_id_2, bool first_constant_is_larger) {
auto bool_constant_opcode = GetIRContext()
->get_def_use_mgr()
->GetDef(bool_constant_use.id_of_interest())
->opcode();
- assert((bool_constant_opcode == SpvOpConstantFalse ||
- bool_constant_opcode == SpvOpConstantTrue) &&
+ assert((bool_constant_opcode == spv::Op::OpConstantFalse ||
+ bool_constant_opcode == spv::Op::OpConstantTrue) &&
"Precondition: this must be a usage of a boolean constant.");
// Pick an opcode at random. First randomly decide whether to generate
// a 'greater than' or 'less than' kind of opcode, and then select a
// random opcode from the resulting subset.
- SpvOp comparison_opcode;
+ spv::Op comparison_opcode;
if (GetFuzzerContext()->ChooseEven()) {
comparison_opcode = greater_than_opcodes[GetFuzzerContext()->RandomIndex(
greater_than_opcodes)];
@@ -68,9 +68,9 @@ void FuzzerPassObfuscateConstants::ObfuscateBoolConstantViaConstantPair(
comparison_opcode) != greater_than_opcodes.end();
uint32_t lhs_id;
uint32_t rhs_id;
- if ((bool_constant_opcode == SpvOpConstantTrue &&
+ if ((bool_constant_opcode == spv::Op::OpConstantTrue &&
first_constant_is_larger == is_greater_than_opcode) ||
- (bool_constant_opcode == SpvOpConstantFalse &&
+ (bool_constant_opcode == spv::Op::OpConstantFalse &&
first_constant_is_larger != is_greater_than_opcode)) {
lhs_id = constant_id_1;
rhs_id = constant_id_2;
@@ -147,12 +147,12 @@ void FuzzerPassObfuscateConstants::ObfuscateBoolConstantViaFloatConstantPair(
first_constant_is_larger =
float_constant_1->GetDouble() > float_constant_2->GetDouble();
}
- std::vector greater_than_opcodes{
- SpvOpFOrdGreaterThan, SpvOpFOrdGreaterThanEqual, SpvOpFUnordGreaterThan,
- SpvOpFUnordGreaterThanEqual};
- std::vector less_than_opcodes{
- SpvOpFOrdGreaterThan, SpvOpFOrdGreaterThanEqual, SpvOpFUnordGreaterThan,
- SpvOpFUnordGreaterThanEqual};
+ std::vector greater_than_opcodes{
+ spv::Op::OpFOrdGreaterThan, spv::Op::OpFOrdGreaterThanEqual,
+ spv::Op::OpFUnordGreaterThan, spv::Op::OpFUnordGreaterThanEqual};
+ std::vector less_than_opcodes{
+ spv::Op::OpFOrdGreaterThan, spv::Op::OpFOrdGreaterThanEqual,
+ spv::Op::OpFUnordGreaterThan, spv::Op::OpFUnordGreaterThanEqual};
ObfuscateBoolConstantViaConstantPair(
depth, bool_constant_use, greater_than_opcodes, less_than_opcodes,
@@ -190,9 +190,10 @@ void FuzzerPassObfuscateConstants::
first_constant_is_larger =
signed_int_constant_1->GetS64() > signed_int_constant_2->GetS64();
}
- std::vector greater_than_opcodes{SpvOpSGreaterThan,
- SpvOpSGreaterThanEqual};
- std::vector less_than_opcodes{SpvOpSLessThan, SpvOpSLessThanEqual};
+ std::vector greater_than_opcodes{spv::Op::OpSGreaterThan,
+ spv::Op::OpSGreaterThanEqual};
+ std::vector less_than_opcodes{spv::Op::OpSLessThan,
+ spv::Op::OpSLessThanEqual};
ObfuscateBoolConstantViaConstantPair(
depth, bool_constant_use, greater_than_opcodes, less_than_opcodes,
@@ -232,9 +233,10 @@ void FuzzerPassObfuscateConstants::
first_constant_is_larger =
unsigned_int_constant_1->GetU64() > unsigned_int_constant_2->GetU64();
}
- std::vector greater_than_opcodes{SpvOpUGreaterThan,
- SpvOpUGreaterThanEqual};
- std::vector less_than_opcodes{SpvOpULessThan, SpvOpULessThanEqual};
+ std::vector greater_than_opcodes{spv::Op::OpUGreaterThan,
+ spv::Op::OpUGreaterThanEqual};
+ std::vector less_than_opcodes{spv::Op::OpULessThan,
+ spv::Op::OpULessThanEqual};
ObfuscateBoolConstantViaConstantPair(
depth, bool_constant_use, greater_than_opcodes, less_than_opcodes,
@@ -379,7 +381,7 @@ void FuzzerPassObfuscateConstants::ObfuscateScalarConstant(
uniform_descriptor.index());
assert(element_type_id && "Type of uniform variable is invalid");
- FindOrCreatePointerType(element_type_id, SpvStorageClassUniform);
+ FindOrCreatePointerType(element_type_id, spv::StorageClass::Uniform);
// Create, apply and record a transformation to replace the constant use with
// the result of a load from the chosen uniform.
@@ -394,11 +396,11 @@ void FuzzerPassObfuscateConstants::ObfuscateConstant(
->get_def_use_mgr()
->GetDef(constant_use.id_of_interest())
->opcode()) {
- case SpvOpConstantTrue:
- case SpvOpConstantFalse:
+ case spv::Op::OpConstantTrue:
+ case spv::Op::OpConstantFalse:
ObfuscateBoolConstant(depth, constant_use);
break;
- case SpvOpConstant:
+ case spv::Op::OpConstant:
ObfuscateScalarConstant(depth, constant_use);
break;
default:
@@ -410,7 +412,7 @@ void FuzzerPassObfuscateConstants::ObfuscateConstant(
void FuzzerPassObfuscateConstants::MaybeAddConstantIdUse(
const opt::Instruction& inst, uint32_t in_operand_index,
uint32_t base_instruction_result_id,
- const std::map& skipped_opcode_count,
+ const std::map& skipped_opcode_count,
std::vector* constant_uses) {
if (inst.GetInOperand(in_operand_index).type != SPV_OPERAND_TYPE_ID) {
// The operand is not an id, so it cannot be a constant id.
@@ -420,15 +422,15 @@ void FuzzerPassObfuscateConstants::MaybeAddConstantIdUse(
auto operand_definition =
GetIRContext()->get_def_use_mgr()->GetDef(operand_id);
switch (operand_definition->opcode()) {
- case SpvOpConstantFalse:
- case SpvOpConstantTrue:
- case SpvOpConstant: {
+ case spv::Op::OpConstantFalse:
+ case spv::Op::OpConstantTrue:
+ case spv::Op::OpConstant: {
// The operand is a constant id, so make an id use descriptor and record
// it.
protobufs::IdUseDescriptor id_use_descriptor;
id_use_descriptor.set_id_of_interest(operand_id);
id_use_descriptor.mutable_enclosing_instruction()
- ->set_target_instruction_opcode(inst.opcode());
+ ->set_target_instruction_opcode(uint32_t(inst.opcode()));
id_use_descriptor.mutable_enclosing_instruction()
->set_base_instruction_result_id(base_instruction_result_id);
id_use_descriptor.mutable_enclosing_instruction()
@@ -461,7 +463,7 @@ void FuzzerPassObfuscateConstants::Apply() {
// opcode need to be skipped in order to find the instruction of interest
// from the base instruction. We maintain a mapping that records a skip
// count for each relevant opcode.
- std::map skipped_opcode_count;
+ std::map skipped_opcode_count;
// Go through each instruction in the block.
for (auto& inst : block) {
@@ -478,7 +480,7 @@ void FuzzerPassObfuscateConstants::Apply() {
// The instruction must not be an OpVariable, the only id that an
// OpVariable uses is an initializer id, which has to remain
// constant.
- if (inst.opcode() != SpvOpVariable) {
+ if (inst.opcode() != spv::Op::OpVariable) {
// Consider each operand of the instruction, and add a constant id
// use for the operand if relevant.
for (uint32_t in_operand_index = 0;
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.h b/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.h
index 30e64d28cb..bfef597ca2 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.h
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_obfuscate_constants.h
@@ -85,8 +85,8 @@ class FuzzerPassObfuscateConstants : public FuzzerPass {
// (similar for |less_than_opcodes|).
void ObfuscateBoolConstantViaConstantPair(
uint32_t depth, const protobufs::IdUseDescriptor& bool_constant_use,
- const std::vector& greater_than_opcodes,
- const std::vector& less_than_opcodes, uint32_t constant_id_1,
+ const std::vector& greater_than_opcodes,
+ const std::vector& less_than_opcodes, uint32_t constant_id_1,
uint32_t constant_id_2, bool first_constant_is_larger);
// A helper method to determine whether input operand |in_operand_index| of
@@ -96,7 +96,7 @@ class FuzzerPassObfuscateConstants : public FuzzerPass {
void MaybeAddConstantIdUse(
const opt::Instruction& inst, uint32_t in_operand_index,
uint32_t base_instruction_result_id,
- const std::map& skipped_opcode_count,
+ const std::map& skipped_opcode_count,
std::vector* constant_uses);
// Returns a vector of unique words that denote constants. Every such constant
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_outline_functions.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_outline_functions.cpp
index b90c12dc34..e64373a4fb 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_outline_functions.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_outline_functions.cpp
@@ -137,12 +137,12 @@ FuzzerPassOutlineFunctions::MaybeGetEntryBlockSuitableForOutlining(
"The entry block cannot be a loop header at this point.");
// If the entry block starts with OpPhi or OpVariable, try to split it.
- if (entry_block->begin()->opcode() == SpvOpPhi ||
- entry_block->begin()->opcode() == SpvOpVariable) {
+ if (entry_block->begin()->opcode() == spv::Op::OpPhi ||
+ entry_block->begin()->opcode() == spv::Op::OpVariable) {
// Find the first non-OpPhi and non-OpVariable instruction.
auto non_phi_or_var_inst = &*entry_block->begin();
- while (non_phi_or_var_inst->opcode() == SpvOpPhi ||
- non_phi_or_var_inst->opcode() == SpvOpVariable) {
+ while (non_phi_or_var_inst->opcode() == spv::Op::OpPhi ||
+ non_phi_or_var_inst->opcode() == spv::Op::OpVariable) {
non_phi_or_var_inst = non_phi_or_var_inst->NextNode();
}
@@ -175,7 +175,7 @@ FuzzerPassOutlineFunctions::MaybeGetExitBlockSuitableForOutlining(
// Find the first non-OpPhi instruction, after which to split.
auto split_before = &*exit_block->begin();
- while (split_before->opcode() == SpvOpPhi) {
+ while (split_before->opcode() == spv::Op::OpPhi) {
split_before = split_before->NextNode();
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_function_variables.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_function_variables.cpp
index f8b9b45034..2313f4204e 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_function_variables.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_function_variables.cpp
@@ -47,7 +47,7 @@ void FuzzerPassPermuteFunctionVariables::Apply() {
std::vector variables;
for (auto& instruction : *first_block) {
- if (instruction.opcode() == SpvOpVariable) {
+ if (instruction.opcode() == spv::Op::OpVariable) {
variables.push_back(&instruction);
}
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_phi_operands.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_phi_operands.cpp
index 5fac98161b..7fbdd3b2b8 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_phi_operands.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_permute_phi_operands.cpp
@@ -40,7 +40,7 @@ void FuzzerPassPermutePhiOperands::Apply() {
const protobufs::InstructionDescriptor& /*unused*/) {
const auto& inst = *inst_it;
- if (inst.opcode() != SpvOpPhi) {
+ if (inst.opcode() != spv::Op::OpPhi) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp
index a6c07b4b34..c0397e18cb 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_push_ids_through_variables.cpp
@@ -35,10 +35,11 @@ void FuzzerPassPushIdsThroughVariables::Apply() {
opt::BasicBlock::iterator instruction_iterator,
const protobufs::InstructionDescriptor& instruction_descriptor)
-> void {
- assert(instruction_iterator->opcode() ==
- instruction_descriptor.target_instruction_opcode() &&
- "The opcode of the instruction we might insert before must be "
- "the same as the opcode in the descriptor for the instruction");
+ assert(
+ instruction_iterator->opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode()) &&
+ "The opcode of the instruction we might insert before must be "
+ "the same as the opcode in the descriptor for the instruction");
// Randomly decide whether to try pushing an id through a variable.
if (!GetFuzzerContext()->ChoosePercentage(
@@ -55,16 +56,16 @@ void FuzzerPassPushIdsThroughVariables::Apply() {
// It must be valid to insert OpStore and OpLoad instructions
// before the instruction to insert before.
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpStore, instruction_iterator) ||
+ spv::Op::OpStore, instruction_iterator) ||
!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpLoad, instruction_iterator)) {
+ spv::Op::OpLoad, instruction_iterator)) {
return;
}
// Randomly decides whether a global or local variable will be added.
auto variable_storage_class = GetFuzzerContext()->ChooseEven()
- ? SpvStorageClassPrivate
- : SpvStorageClassFunction;
+ ? spv::StorageClass::Private
+ : spv::StorageClass::Function;
// Gets the available basic and pointer types.
auto basic_type_ids_and_pointers =
@@ -127,13 +128,13 @@ void FuzzerPassPushIdsThroughVariables::Apply() {
GetIRContext()->get_def_use_mgr()->GetDef(basic_type_id);
assert(type_inst);
switch (type_inst->opcode()) {
- case SpvOpTypeBool:
- case SpvOpTypeFloat:
- case SpvOpTypeInt:
- case SpvOpTypeArray:
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeStruct:
break;
default:
return;
@@ -150,7 +151,8 @@ void FuzzerPassPushIdsThroughVariables::Apply() {
value_instructions)]
->result_id(),
GetFuzzerContext()->GetFreshId(), GetFuzzerContext()->GetFreshId(),
- variable_storage_class, initializer_id, instruction_descriptor));
+ uint32_t(variable_storage_class), initializer_id,
+ instruction_descriptor));
});
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp
index 995657cc13..52c0381864 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_branches_from_dead_blocks_with_exits.cpp
@@ -38,13 +38,13 @@ void FuzzerPassReplaceBranchesFromDeadBlocksWithExits::Apply() {
// to be executed with the Fragment execution model. We conservatively only
// allow OpKill if every entry point in the module has the Fragment execution
// model.
- auto fragment_execution_model_guaranteed =
- std::all_of(GetIRContext()->module()->entry_points().begin(),
- GetIRContext()->module()->entry_points().end(),
- [](const opt::Instruction& entry_point) -> bool {
- return entry_point.GetSingleWordInOperand(0) ==
- SpvExecutionModelFragment;
- });
+ auto fragment_execution_model_guaranteed = std::all_of(
+ GetIRContext()->module()->entry_points().begin(),
+ GetIRContext()->module()->entry_points().end(),
+ [](const opt::Instruction& entry_point) -> bool {
+ return spv::ExecutionModel(entry_point.GetSingleWordInOperand(0)) ==
+ spv::ExecutionModel::Fragment;
+ });
// Transformations of this type can disable one another. To avoid ordering
// bias, we therefore build a set of candidate transformations to apply, and
@@ -71,20 +71,20 @@ void FuzzerPassReplaceBranchesFromDeadBlocksWithExits::Apply() {
// Whether we can use OpKill depends on the execution model, and which of
// OpReturn and OpReturnValue we can use depends on the return type of the
// enclosing function.
- std::vector opcodes = {SpvOpUnreachable};
+ std::vector opcodes = {spv::Op::OpUnreachable};
if (fragment_execution_model_guaranteed) {
- opcodes.emplace_back(SpvOpKill);
+ opcodes.emplace_back(spv::Op::OpKill);
}
auto function_return_type =
GetIRContext()->get_type_mgr()->GetType(function.type_id());
if (function_return_type->AsVoid()) {
- opcodes.emplace_back(SpvOpReturn);
+ opcodes.emplace_back(spv::Op::OpReturn);
} else if (fuzzerutil::CanCreateConstant(GetIRContext(),
function.type_id())) {
// For simplicity we only allow OpReturnValue if the function return
// type is a type for which we can create a constant. This allows us a
// zero of the given type as a default return value.
- opcodes.emplace_back(SpvOpReturnValue);
+ opcodes.emplace_back(spv::Op::OpReturnValue);
}
// Choose one of the available terminator opcodes at random and create a
// candidate transformation.
@@ -92,7 +92,7 @@ void FuzzerPassReplaceBranchesFromDeadBlocksWithExits::Apply() {
candidate_transformations.emplace_back(
TransformationReplaceBranchFromDeadBlockWithExit(
block.id(), opcode,
- opcode == SpvOpReturnValue
+ opcode == spv::Op::OpReturnValue
? FindOrCreateZeroConstant(function.type_id(), true)
: 0));
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp
index af1aacee34..aabc6bc3b9 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_memories_with_loads_stores.cpp
@@ -41,7 +41,7 @@ void FuzzerPassReplaceCopyMemoriesWithLoadsStores::Apply() {
}
// The instruction must be OpCopyMemory.
- if (instruction->opcode() != SpvOpCopyMemory) {
+ if (instruction->opcode() != spv::Op::OpCopyMemory) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp
index d0992a3ffb..c1892be1ef 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_copy_objects_with_stores_loads.cpp
@@ -40,7 +40,7 @@ void FuzzerPassReplaceCopyObjectsWithStoresLoads::Apply() {
return;
}
// The instruction must be OpCopyObject.
- if (instruction->opcode() != SpvOpCopyObject) {
+ if (instruction->opcode() != spv::Op::OpCopyObject) {
return;
}
// The opcode of the type_id instruction cannot be a OpTypePointer,
@@ -48,21 +48,22 @@ void FuzzerPassReplaceCopyObjectsWithStoresLoads::Apply() {
if (GetIRContext()
->get_def_use_mgr()
->GetDef(instruction->type_id())
- ->opcode() == SpvOpTypePointer) {
+ ->opcode() == spv::Op::OpTypePointer) {
return;
}
// It must be valid to insert OpStore and OpLoad instructions
// before the instruction OpCopyObject.
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpStore,
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpStore,
instruction) ||
- !fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpLoad, instruction)) {
+ !fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpLoad,
+ instruction)) {
return;
}
// Randomly decides whether a global or local variable will be added.
auto variable_storage_class = GetFuzzerContext()->ChooseEven()
- ? SpvStorageClassPrivate
- : SpvStorageClassFunction;
+ ? spv::StorageClass::Private
+ : spv::StorageClass::Function;
// Find or create a constant to initialize the variable from. The type of
// |instruction| must be such that the function FindOrCreateConstant can be
@@ -79,7 +80,7 @@ void FuzzerPassReplaceCopyObjectsWithStoresLoads::Apply() {
// Apply the transformation replacing OpCopyObject with Store and Load.
ApplyTransformation(TransformationReplaceCopyObjectWithStoreLoad(
instruction->result_id(), GetFuzzerContext()->GetFreshId(),
- variable_storage_class, variable_initializer_id));
+ uint32_t(variable_storage_class), variable_initializer_id));
});
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp
index 4d55ae840d..4c0bd8595a 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_irrelevant_ids.cpp
@@ -73,7 +73,7 @@ void FuzzerPassReplaceIrrelevantIds::Apply() {
// we cannot use these as replacements.
for (const auto& pair : GetIRContext()->get_def_use_mgr()->id_to_defs()) {
uint32_t type_id = pair.second->type_id();
- if (pair.second->opcode() != SpvOpFunction && type_id &&
+ if (pair.second->opcode() != spv::Op::OpFunction && type_id &&
types_to_ids.count(type_id)) {
types_to_ids[type_id].push_back(pair.first);
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp
index 38ac048bf3..8d292ac384 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_loads_stores_with_copy_memories.cpp
@@ -50,9 +50,9 @@ void FuzzerPassReplaceLoadsStoresWithCopyMemories::Apply() {
std::unordered_map current_op_loads;
for (auto& instruction : block) {
// Add a potential OpLoad instruction.
- if (instruction.opcode() == SpvOpLoad) {
+ if (instruction.opcode() == spv::Op::OpLoad) {
current_op_loads[instruction.result_id()] = &instruction;
- } else if (instruction.opcode() == SpvOpStore) {
+ } else if (instruction.opcode() == spv::Op::OpStore) {
if (current_op_loads.find(instruction.GetSingleWordOperand(1)) !=
current_op_loads.end()) {
// We have found the matching OpLoad instruction to the current
@@ -73,7 +73,7 @@ void FuzzerPassReplaceLoadsStoresWithCopyMemories::Apply() {
opt::Instruction* source_id =
GetIRContext()->get_def_use_mgr()->GetDef(
it->second->GetSingleWordOperand(2));
- SpvStorageClass storage_class =
+ spv::StorageClass storage_class =
fuzzerutil::GetStorageClassFromPointerType(
GetIRContext(), source_id->type_id());
if (!TransformationReplaceLoadStoreWithCopyMemory::
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp
index ea90a7ac73..26475ab20c 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opphi_ids_from_dead_predecessors.cpp
@@ -50,7 +50,7 @@ void FuzzerPassReplaceOpPhiIdsFromDeadPredecessors::Apply() {
block->id(), [this, &function, block, &transformations](
opt::Instruction* instruction, uint32_t) {
// Only consider OpPhi instructions.
- if (instruction->opcode() != SpvOpPhi) {
+ if (instruction->opcode() != spv::Op::OpPhi) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp
index 72ed0936a5..4691e0a85f 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_opselects_with_conditional_branches.cpp
@@ -52,7 +52,7 @@ void FuzzerPassReplaceOpSelectsWithConditionalBranches::Apply() {
for (auto& instruction : block) {
// We only care about OpSelect instructions.
- if (instruction.opcode() != SpvOpSelect) {
+ if (instruction.opcode() != spv::Op::OpSelect) {
continue;
}
@@ -69,7 +69,7 @@ void FuzzerPassReplaceOpSelectsWithConditionalBranches::Apply() {
->get_def_use_mgr()
->GetDef(fuzzerutil::GetTypeId(
GetIRContext(), instruction.GetSingleWordInOperand(0)))
- ->opcode() != SpvOpTypeBool) {
+ ->opcode() != spv::Op::OpTypeBool) {
continue;
}
@@ -136,7 +136,7 @@ void FuzzerPassReplaceOpSelectsWithConditionalBranches::Apply() {
bool FuzzerPassReplaceOpSelectsWithConditionalBranches::
InstructionNeedsSplitBefore(opt::Instruction* instruction) {
- assert(instruction && instruction->opcode() == SpvOpSelect &&
+ assert(instruction && instruction->opcode() == spv::Op::OpSelect &&
"The instruction must be OpSelect.");
auto block = GetIRContext()->get_instr_block(instruction);
@@ -163,7 +163,7 @@ bool FuzzerPassReplaceOpSelectsWithConditionalBranches::
auto predecessor = GetIRContext()->get_instr_block(
GetIRContext()->cfg()->preds(block->id())[0]);
return predecessor->MergeBlockIdIfAny() ||
- predecessor->terminator()->opcode() != SpvOpBranch;
+ predecessor->terminator()->opcode() != spv::Op::OpBranch;
}
} // namespace fuzz
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp
index 7fb7b0d27f..d7eddca10e 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_replace_parameter_with_global.cpp
@@ -72,7 +72,8 @@ void FuzzerPassReplaceParameterWithGlobal::Apply() {
assert(replaced_param && "Unable to find a parameter to replace");
// Make sure type id for the global variable exists in the module.
- FindOrCreatePointerType(replaced_param->type_id(), SpvStorageClassPrivate);
+ FindOrCreatePointerType(replaced_param->type_id(),
+ spv::StorageClass::Private);
// Make sure initializer for the global variable exists in the module.
FindOrCreateZeroConstant(replaced_param->type_id(), false);
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
index 40a4151d32..5b4afcc5d9 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_split_blocks.cpp
@@ -65,7 +65,7 @@ void FuzzerPassSplitBlocks::Apply() {
// Counts the number of times we have seen each opcode since we reset the
// base instruction.
- std::map skip_count;
+ std::map skip_count;
// Consider every instruction in the block. The label is excluded: it is
// only necessary to consider it as a base in case the first instruction
@@ -78,7 +78,7 @@ void FuzzerPassSplitBlocks::Apply() {
base = inst.result_id();
skip_count.clear();
}
- const SpvOp opcode = inst.opcode();
+ const spv::Op opcode = inst.opcode();
instruction_descriptors.emplace_back(MakeInstructionDescriptor(
base, opcode, skip_count.count(opcode) ? skip_count.at(opcode) : 0));
if (!inst.HasResultId()) {
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp
index f8bf111dcf..72c8358ab3 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_swap_conditional_branch_operands.cpp
@@ -39,7 +39,7 @@ void FuzzerPassSwapBranchConditionalOperands::Apply() {
const protobufs::InstructionDescriptor& instruction_descriptor) {
const auto& inst = *inst_it;
- if (inst.opcode() != SpvOpBranchConditional) {
+ if (inst.opcode() != spv::Op::OpBranchConditional) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp
index ac2b1565dc..2a1ad6e5d3 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_toggle_access_chain_instruction.cpp
@@ -36,8 +36,9 @@ void FuzzerPassToggleAccessChainInstruction::Apply() {
// probabilistically applied.
context->module()->ForEachInst([this,
context](opt::Instruction* instruction) {
- SpvOp opcode = instruction->opcode();
- if ((opcode == SpvOpAccessChain || opcode == SpvOpInBoundsAccessChain) &&
+ spv::Op opcode = instruction->opcode();
+ if ((opcode == spv::Op::OpAccessChain ||
+ opcode == spv::Op::OpInBoundsAccessChain) &&
GetFuzzerContext()->ChoosePercentage(
GetFuzzerContext()->GetChanceOfTogglingAccessChainInstruction())) {
auto instructionDescriptor =
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp
index 35adcfec00..55fbe2c228 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_pass_wrap_vector_synonym.cpp
@@ -52,7 +52,7 @@ void FuzzerPassWrapVectorSynonym::Apply() {
// It must be valid to insert an OpCompositeConstruct instruction
// before |instruction_iterator|.
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpCompositeConstruct, instruction_iterator)) {
+ spv::Op::OpCompositeConstruct, instruction_iterator)) {
return;
}
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_util.cpp b/third_party/spirv-tools/source/fuzz/fuzzer_util.cpp
index 1d368a9fa6..e85ff2fbb1 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_util.cpp
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_util.cpp
@@ -49,7 +49,7 @@ uint32_t MaybeGetOpConstant(opt::IRContext* ir_context,
const std::vector& words,
uint32_t type_id, bool is_irrelevant) {
for (const auto& inst : ir_context->types_values()) {
- if (inst.opcode() == SpvOpConstant && inst.type_id() == type_id &&
+ if (inst.opcode() == spv::Op::OpConstant && inst.type_id() == type_id &&
inst.GetInOperand(0).words == words &&
transformation_context.GetFactManager()->IdIsIrrelevant(
inst.result_id()) == is_irrelevant) {
@@ -112,7 +112,7 @@ opt::BasicBlock* MaybeFindBlock(opt::IRContext* context,
// No instruction defining this id was found.
return nullptr;
}
- if (inst->opcode() != SpvOpLabel) {
+ if (inst->opcode() != spv::Op::OpLabel) {
// The instruction defining the id is not a label, so it cannot be a block
// id.
return nullptr;
@@ -138,7 +138,7 @@ bool PhiIdsOkForNewEdge(
// makes sense here because we need to increment |phi_index| for each OpPhi
// instruction.
for (auto& inst : *bb_to) {
- if (inst.opcode() != SpvOpPhi) {
+ if (inst.opcode() != spv::Op::OpPhi) {
// The OpPhi instructions all occur at the start of the block; if we find
// a non-OpPhi then we have seen them all.
break;
@@ -189,24 +189,24 @@ opt::Instruction CreateUnreachableEdgeInstruction(opt::IRContext* ir_context,
const auto* bb_from = MaybeFindBlock(ir_context, bb_from_id);
assert(bb_from && "|bb_from_id| is invalid");
assert(MaybeFindBlock(ir_context, bb_to_id) && "|bb_to_id| is invalid");
- assert(bb_from->terminator()->opcode() == SpvOpBranch &&
+ assert(bb_from->terminator()->opcode() == spv::Op::OpBranch &&
"Precondition on terminator of bb_from is not satisfied");
// Get the id of the boolean constant to be used as the condition.
auto condition_inst = ir_context->get_def_use_mgr()->GetDef(bool_id);
assert(condition_inst &&
- (condition_inst->opcode() == SpvOpConstantTrue ||
- condition_inst->opcode() == SpvOpConstantFalse) &&
+ (condition_inst->opcode() == spv::Op::OpConstantTrue ||
+ condition_inst->opcode() == spv::Op::OpConstantFalse) &&
"|bool_id| is invalid");
- auto condition_value = condition_inst->opcode() == SpvOpConstantTrue;
+ auto condition_value = condition_inst->opcode() == spv::Op::OpConstantTrue;
auto successor_id = bb_from->terminator()->GetSingleWordInOperand(0);
// Add the dead branch, by turning OpBranch into OpBranchConditional, and
// ordering the targets depending on whether the given boolean corresponds to
// true or false.
return opt::Instruction(
- ir_context, SpvOpBranchConditional, 0, 0,
+ ir_context, spv::Op::OpBranchConditional, 0, 0,
{{SPV_OPERAND_TYPE_ID, {bool_id}},
{SPV_OPERAND_TYPE_ID, {condition_value ? successor_id : bb_to_id}},
{SPV_OPERAND_TYPE_ID, {condition_value ? bb_to_id : successor_id}}});
@@ -228,7 +228,7 @@ void AddUnreachableEdgeAndUpdateOpPhis(
if (!from_to_edge_already_exists) {
uint32_t phi_index = 0;
for (auto& inst : *bb_to) {
- if (inst.opcode() != SpvOpPhi) {
+ if (inst.opcode() != spv::Op::OpPhi) {
break;
}
assert(phi_index < static_cast(phi_ids.size()) &&
@@ -285,28 +285,30 @@ opt::BasicBlock::iterator GetIteratorForInstruction(
}
bool CanInsertOpcodeBeforeInstruction(
- SpvOp opcode, const opt::BasicBlock::iterator& instruction_in_block) {
+ spv::Op opcode, const opt::BasicBlock::iterator& instruction_in_block) {
if (instruction_in_block->PreviousNode() &&
- (instruction_in_block->PreviousNode()->opcode() == SpvOpLoopMerge ||
- instruction_in_block->PreviousNode()->opcode() == SpvOpSelectionMerge)) {
+ (instruction_in_block->PreviousNode()->opcode() == spv::Op::OpLoopMerge ||
+ instruction_in_block->PreviousNode()->opcode() ==
+ spv::Op::OpSelectionMerge)) {
// We cannot insert directly after a merge instruction.
return false;
}
- if (opcode != SpvOpVariable &&
- instruction_in_block->opcode() == SpvOpVariable) {
+ if (opcode != spv::Op::OpVariable &&
+ instruction_in_block->opcode() == spv::Op::OpVariable) {
// We cannot insert a non-OpVariable instruction directly before a
// variable; variables in a function must be contiguous in the entry block.
return false;
}
// We cannot insert a non-OpPhi instruction directly before an OpPhi, because
// OpPhi instructions need to be contiguous at the start of a block.
- return opcode == SpvOpPhi || instruction_in_block->opcode() != SpvOpPhi;
+ return opcode == spv::Op::OpPhi ||
+ instruction_in_block->opcode() != spv::Op::OpPhi;
}
bool CanMakeSynonymOf(opt::IRContext* ir_context,
const TransformationContext& transformation_context,
const opt::Instruction& inst) {
- if (inst.opcode() == SpvOpSampledImage) {
+ if (inst.opcode() == spv::Op::OpSampledImage) {
// The SPIR-V data rules say that only very specific instructions may
// may consume the result id of an OpSampledImage, and this excludes the
// instructions that are used for making synonyms.
@@ -326,15 +328,15 @@ bool CanMakeSynonymOf(opt::IRContext* ir_context,
return false;
}
auto type_inst = ir_context->get_def_use_mgr()->GetDef(inst.type_id());
- if (type_inst->opcode() == SpvOpTypeVoid) {
+ if (type_inst->opcode() == spv::Op::OpTypeVoid) {
// We only make synonyms of instructions that define objects, and an object
// cannot have void type.
return false;
}
- if (type_inst->opcode() == SpvOpTypePointer) {
+ if (type_inst->opcode() == spv::Op::OpTypePointer) {
switch (inst.opcode()) {
- case SpvOpConstantNull:
- case SpvOpUndef:
+ case spv::Op::OpConstantNull:
+ case spv::Op::OpUndef:
// We disallow making synonyms of null or undefined pointers. This is
// to provide the property that if the original shader exhibited no bad
// pointer accesses, the transformed shader will not either.
@@ -373,22 +375,22 @@ uint32_t WalkOneCompositeTypeIndex(opt::IRContext* context,
context->get_def_use_mgr()->GetDef(base_object_type_id);
assert(should_be_composite_type && "The type should exist.");
switch (should_be_composite_type->opcode()) {
- case SpvOpTypeArray: {
+ case spv::Op::OpTypeArray: {
auto array_length = GetArraySize(*should_be_composite_type, context);
if (array_length == 0 || index >= array_length) {
return 0;
}
return should_be_composite_type->GetSingleWordInOperand(0);
}
- case SpvOpTypeMatrix:
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector: {
auto count = should_be_composite_type->GetSingleWordInOperand(1);
if (index >= count) {
return 0;
}
return should_be_composite_type->GetSingleWordInOperand(0);
}
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
if (index >= GetNumberOfStructMembers(*should_be_composite_type)) {
return 0;
}
@@ -415,7 +417,7 @@ uint32_t WalkCompositeTypeIndices(
uint32_t GetNumberOfStructMembers(
const opt::Instruction& struct_type_instruction) {
- assert(struct_type_instruction.opcode() == SpvOpTypeStruct &&
+ assert(struct_type_instruction.opcode() == spv::Op::OpTypeStruct &&
"An OpTypeStruct instruction is required here.");
return struct_type_instruction.NumInOperands();
}
@@ -436,15 +438,15 @@ uint32_t GetArraySize(const opt::Instruction& array_type_instruction,
uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst,
opt::IRContext* ir_context) {
switch (composite_type_inst.opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
return fuzzerutil::GetArraySize(composite_type_inst, ir_context);
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
return composite_type_inst.GetSingleWordInOperand(1);
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
return fuzzerutil::GetNumberOfStructMembers(composite_type_inst);
}
- case SpvOpTypeRuntimeArray:
+ case spv::Op::OpTypeRuntimeArray:
assert(false &&
"GetBoundForCompositeIndex should not be invoked with an "
"OpTypeRuntimeArray, which does not have a static bound.");
@@ -455,27 +457,27 @@ uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst,
}
}
-SpvMemorySemanticsMask GetMemorySemanticsForStorageClass(
- SpvStorageClass storage_class) {
+spv::MemorySemanticsMask GetMemorySemanticsForStorageClass(
+ spv::StorageClass storage_class) {
switch (storage_class) {
- case SpvStorageClassWorkgroup:
- return SpvMemorySemanticsWorkgroupMemoryMask;
+ case spv::StorageClass::Workgroup:
+ return spv::MemorySemanticsMask::WorkgroupMemory;
- case SpvStorageClassStorageBuffer:
- case SpvStorageClassPhysicalStorageBuffer:
- return SpvMemorySemanticsUniformMemoryMask;
+ case spv::StorageClass::StorageBuffer:
+ case spv::StorageClass::PhysicalStorageBuffer:
+ return spv::MemorySemanticsMask::UniformMemory;
- case SpvStorageClassCrossWorkgroup:
- return SpvMemorySemanticsCrossWorkgroupMemoryMask;
+ case spv::StorageClass::CrossWorkgroup:
+ return spv::MemorySemanticsMask::CrossWorkgroupMemory;
- case SpvStorageClassAtomicCounter:
- return SpvMemorySemanticsAtomicCounterMemoryMask;
+ case spv::StorageClass::AtomicCounter:
+ return spv::MemorySemanticsMask::AtomicCounterMemory;
- case SpvStorageClassImage:
- return SpvMemorySemanticsImageMemoryMask;
+ case spv::StorageClass::Image:
+ return spv::MemorySemanticsMask::ImageMemory;
default:
- return SpvMemorySemanticsMaskNone;
+ return spv::MemorySemanticsMask::MaskNone;
}
}
@@ -562,8 +564,8 @@ bool IsMergeOrContinue(opt::IRContext* ir_context, uint32_t block_id) {
[&result](const opt::Instruction* use_instruction,
uint32_t /*unused*/) -> bool {
switch (use_instruction->opcode()) {
- case SpvOpLoopMerge:
- case SpvOpSelectionMerge:
+ case spv::Op::OpLoopMerge:
+ case spv::Op::OpSelectionMerge:
result = true;
return false;
default:
@@ -581,7 +583,7 @@ uint32_t GetLoopFromMergeBlock(opt::IRContext* ir_context,
[ir_context, &result](opt::Instruction* use_instruction,
uint32_t use_index) -> bool {
switch (use_instruction->opcode()) {
- case SpvOpLoopMerge:
+ case spv::Op::OpLoopMerge:
// The merge block operand is the first operand in OpLoopMerge.
if (use_index == 0) {
result = ir_context->get_instr_block(use_instruction)->id();
@@ -599,7 +601,7 @@ uint32_t FindFunctionType(opt::IRContext* ir_context,
const std::vector& type_ids) {
// Look through the existing types for a match.
for (auto& type_or_value : ir_context->types_values()) {
- if (type_or_value.opcode() != SpvOpTypeFunction) {
+ if (type_or_value.opcode() != spv::Op::OpTypeFunction) {
// We are only interested in function types.
continue;
}
@@ -641,8 +643,8 @@ opt::Function* FindFunction(opt::IRContext* ir_context, uint32_t function_id) {
bool FunctionContainsOpKillOrUnreachable(const opt::Function& function) {
for (auto& block : function) {
- if (block.terminator()->opcode() == SpvOpKill ||
- block.terminator()->opcode() == SpvOpUnreachable) {
+ if (block.terminator()->opcode() == spv::Op::OpKill ||
+ block.terminator()->opcode() == spv::Op::OpUnreachable) {
return true;
}
}
@@ -669,7 +671,7 @@ bool IdIsAvailableAtUse(opt::IRContext* context,
context->get_instr_block(use_instruction)->GetParent();
// If the id a function parameter, it needs to be associated with the
// function containing the use.
- if (defining_instruction->opcode() == SpvOpFunctionParameter) {
+ if (defining_instruction->opcode() == spv::Op::OpFunctionParameter) {
return InstructionIsFunctionParameter(defining_instruction,
enclosing_function);
}
@@ -687,7 +689,7 @@ bool IdIsAvailableAtUse(opt::IRContext* context,
return false;
}
auto dominator_analysis = context->GetDominatorAnalysis(enclosing_function);
- if (use_instruction->opcode() == SpvOpPhi) {
+ if (use_instruction->opcode() == spv::Op::OpPhi) {
// In the case where the use is an operand to OpPhi, it is actually the
// *parent* block associated with the operand that must be dominated by
// the synonym.
@@ -710,7 +712,7 @@ bool IdIsAvailableBeforeInstruction(opt::IRContext* context,
context->get_instr_block(instruction)->GetParent();
// If the id a function parameter, it needs to be associated with the
// function containing the instruction.
- if (id_definition->opcode() == SpvOpFunctionParameter) {
+ if (id_definition->opcode() == spv::Op::OpFunctionParameter) {
return InstructionIsFunctionParameter(id_definition,
function_enclosing_instruction);
}
@@ -732,7 +734,7 @@ bool IdIsAvailableBeforeInstruction(opt::IRContext* context,
// the instruction.
return true;
}
- if (id_definition->opcode() == SpvOpVariable &&
+ if (id_definition->opcode() == spv::Op::OpVariable &&
function_enclosing_instruction ==
context->get_instr_block(id)->GetParent()) {
assert(!context->IsReachable(*context->get_instr_block(instruction)) &&
@@ -747,7 +749,7 @@ bool IdIsAvailableBeforeInstruction(opt::IRContext* context,
bool InstructionIsFunctionParameter(opt::Instruction* instruction,
opt::Function* function) {
- if (instruction->opcode() != SpvOpFunctionParameter) {
+ if (instruction->opcode() != spv::Op::OpFunctionParameter) {
return false;
}
bool found_parameter = false;
@@ -767,7 +769,8 @@ uint32_t GetTypeId(opt::IRContext* context, uint32_t result_id) {
}
uint32_t GetPointeeTypeIdFromPointerType(opt::Instruction* pointer_type_inst) {
- assert(pointer_type_inst && pointer_type_inst->opcode() == SpvOpTypePointer &&
+ assert(pointer_type_inst &&
+ pointer_type_inst->opcode() == spv::Op::OpTypePointer &&
"Precondition: |pointer_type_inst| must be OpTypePointer.");
return pointer_type_inst->GetSingleWordInOperand(1);
}
@@ -778,26 +781,28 @@ uint32_t GetPointeeTypeIdFromPointerType(opt::IRContext* context,
context->get_def_use_mgr()->GetDef(pointer_type_id));
}
-SpvStorageClass GetStorageClassFromPointerType(
+spv::StorageClass GetStorageClassFromPointerType(
opt::Instruction* pointer_type_inst) {
- assert(pointer_type_inst && pointer_type_inst->opcode() == SpvOpTypePointer &&
+ assert(pointer_type_inst &&
+ pointer_type_inst->opcode() == spv::Op::OpTypePointer &&
"Precondition: |pointer_type_inst| must be OpTypePointer.");
- return static_cast(
+ return static_cast(
pointer_type_inst->GetSingleWordInOperand(0));
}
-SpvStorageClass GetStorageClassFromPointerType(opt::IRContext* context,
- uint32_t pointer_type_id) {
+spv::StorageClass GetStorageClassFromPointerType(opt::IRContext* context,
+ uint32_t pointer_type_id) {
return GetStorageClassFromPointerType(
context->get_def_use_mgr()->GetDef(pointer_type_id));
}
uint32_t MaybeGetPointerType(opt::IRContext* context, uint32_t pointee_type_id,
- SpvStorageClass storage_class) {
+ spv::StorageClass storage_class) {
for (auto& inst : context->types_values()) {
switch (inst.opcode()) {
- case SpvOpTypePointer:
- if (inst.GetSingleWordInOperand(0) == storage_class &&
+ case spv::Op::OpTypePointer:
+ if (spv::StorageClass(inst.GetSingleWordInOperand(0)) ==
+ storage_class &&
inst.GetSingleWordInOperand(1) == pointee_type_id) {
return inst.result_id();
}
@@ -818,30 +823,30 @@ uint32_t InOperandIndexFromOperandIndex(const opt::Instruction& inst,
bool IsNullConstantSupported(opt::IRContext* ir_context,
const opt::Instruction& type_inst) {
switch (type_inst.opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeBool:
- case SpvOpTypeDeviceEvent:
- case SpvOpTypeEvent:
- case SpvOpTypeFloat:
- case SpvOpTypeInt:
- case SpvOpTypeMatrix:
- case SpvOpTypeQueue:
- case SpvOpTypeReserveId:
- case SpvOpTypeVector:
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeDeviceEvent:
+ case spv::Op::OpTypeEvent:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeQueue:
+ case spv::Op::OpTypeReserveId:
+ case spv::Op::OpTypeVector:
+ case spv::Op::OpTypeStruct:
return true;
- case SpvOpTypePointer:
+ case spv::Op::OpTypePointer:
// Null pointers are allowed if the VariablePointers capability is
// enabled, or if the VariablePointersStorageBuffer capability is enabled
// and the pointer type has StorageBuffer as its storage class.
if (ir_context->get_feature_mgr()->HasCapability(
- SpvCapabilityVariablePointers)) {
+ spv::Capability::VariablePointers)) {
return true;
}
if (ir_context->get_feature_mgr()->HasCapability(
- SpvCapabilityVariablePointersStorageBuffer)) {
- return type_inst.GetSingleWordInOperand(0) ==
- SpvStorageClassStorageBuffer;
+ spv::Capability::VariablePointersStorageBuffer)) {
+ return spv::StorageClass(type_inst.GetSingleWordInOperand(0)) ==
+ spv::StorageClass::StorageBuffer;
}
return false;
default:
@@ -885,22 +890,22 @@ void AddVariableIdToEntryPointInterfaces(opt::IRContext* context, uint32_t id) {
opt::Instruction* AddGlobalVariable(opt::IRContext* context, uint32_t result_id,
uint32_t type_id,
- SpvStorageClass storage_class,
+ spv::StorageClass storage_class,
uint32_t initializer_id) {
// Check various preconditions.
assert(result_id != 0 && "Result id can't be 0");
- assert((storage_class == SpvStorageClassPrivate ||
- storage_class == SpvStorageClassWorkgroup) &&
+ assert((storage_class == spv::StorageClass::Private ||
+ storage_class == spv::StorageClass::Workgroup) &&
"Variable's storage class must be either Private or Workgroup");
auto* type_inst = context->get_def_use_mgr()->GetDef(type_id);
(void)type_inst; // Variable becomes unused in release mode.
- assert(type_inst && type_inst->opcode() == SpvOpTypePointer &&
+ assert(type_inst && type_inst->opcode() == spv::Op::OpTypePointer &&
GetStorageClassFromPointerType(type_inst) == storage_class &&
"Variable's type is invalid");
- if (storage_class == SpvStorageClassWorkgroup) {
+ if (storage_class == spv::StorageClass::Workgroup) {
assert(initializer_id == 0);
}
@@ -922,7 +927,7 @@ opt::Instruction* AddGlobalVariable(opt::IRContext* context, uint32_t result_id,
}
auto new_instruction = MakeUnique(
- context, SpvOpVariable, type_id, result_id, std::move(operands));
+ context, spv::Op::OpVariable, type_id, result_id, std::move(operands));
auto result = new_instruction.get();
context->module()->AddGlobalValue(std::move(new_instruction));
@@ -940,8 +945,9 @@ opt::Instruction* AddLocalVariable(opt::IRContext* context, uint32_t result_id,
auto* type_inst = context->get_def_use_mgr()->GetDef(type_id);
(void)type_inst; // Variable becomes unused in release mode.
- assert(type_inst && type_inst->opcode() == SpvOpTypePointer &&
- GetStorageClassFromPointerType(type_inst) == SpvStorageClassFunction &&
+ assert(type_inst && type_inst->opcode() == spv::Op::OpTypePointer &&
+ GetStorageClassFromPointerType(type_inst) ==
+ spv::StorageClass::Function &&
"Variable's type is invalid");
const auto* constant_inst =
@@ -956,10 +962,10 @@ opt::Instruction* AddLocalVariable(opt::IRContext* context, uint32_t result_id,
assert(function && "Function id is invalid");
auto new_instruction = MakeUnique(
- context, SpvOpVariable, type_id, result_id,
- opt::Instruction::OperandList{
- {SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}},
- {SPV_OPERAND_TYPE_ID, {initializer_id}}});
+ context, spv::Op::OpVariable, type_id, result_id,
+ opt::Instruction::OperandList{{SPV_OPERAND_TYPE_STORAGE_CLASS,
+ {uint32_t(spv::StorageClass::Function)}},
+ {SPV_OPERAND_TYPE_ID, {initializer_id}}});
auto result = new_instruction.get();
function->begin()->begin()->InsertBefore(std::move(new_instruction));
@@ -1022,7 +1028,7 @@ std::vector GetCallers(opt::IRContext* ir_context,
std::vector result;
ir_context->get_def_use_mgr()->ForEachUser(
function_id, [&result, function_id](opt::Instruction* inst) {
- if (inst->opcode() == SpvOpFunctionCall &&
+ if (inst->opcode() == spv::Op::OpFunctionCall &&
inst->GetSingleWordInOperand(0) == function_id) {
result.push_back(inst);
}
@@ -1137,7 +1143,7 @@ void AddFunctionType(opt::IRContext* ir_context, uint32_t result_id,
}
ir_context->AddType(MakeUnique(
- ir_context, SpvOpTypeFunction, 0, result_id, std::move(operands)));
+ ir_context, spv::Op::OpTypeFunction, 0, result_id, std::move(operands)));
UpdateModuleIdBound(ir_context, result_id);
}
@@ -1186,7 +1192,7 @@ uint32_t MaybeGetVectorType(opt::IRContext* ir_context,
uint32_t MaybeGetStructType(opt::IRContext* ir_context,
const std::vector& component_type_ids) {
for (auto& type_or_value : ir_context->types_values()) {
- if (type_or_value.opcode() != SpvOpTypeStruct ||
+ if (type_or_value.opcode() != spv::Op::OpTypeStruct ||
type_or_value.NumInOperands() !=
static_cast(component_type_ids.size())) {
continue;
@@ -1219,11 +1225,11 @@ uint32_t MaybeGetZeroConstant(
assert(type_inst && "|scalar_or_composite_type_id| is invalid");
switch (type_inst->opcode()) {
- case SpvOpTypeBool:
+ case spv::Op::OpTypeBool:
return MaybeGetBoolConstant(ir_context, transformation_context, false,
is_irrelevant);
- case SpvOpTypeFloat:
- case SpvOpTypeInt: {
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeInt: {
const auto width = type_inst->GetSingleWordInOperand(0);
std::vector words = {0};
if (width > 32) {
@@ -1233,7 +1239,7 @@ uint32_t MaybeGetZeroConstant(
return MaybeGetScalarConstant(ir_context, transformation_context, words,
scalar_or_composite_type_id, is_irrelevant);
}
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
std::vector component_ids;
for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) {
const auto component_type_id = type_inst->GetSingleWordInOperand(i);
@@ -1260,8 +1266,8 @@ uint32_t MaybeGetZeroConstant(
ir_context, transformation_context, component_ids,
scalar_or_composite_type_id, is_irrelevant);
}
- case SpvOpTypeMatrix:
- case SpvOpTypeVector: {
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector: {
const auto component_type_id = type_inst->GetSingleWordInOperand(0);
auto component_id = MaybeGetZeroConstant(
@@ -1284,7 +1290,7 @@ uint32_t MaybeGetZeroConstant(
std::vector(component_count, component_id),
scalar_or_composite_type_id, is_irrelevant);
}
- case SpvOpTypeArray: {
+ case spv::Op::OpTypeArray: {
const auto component_type_id = type_inst->GetSingleWordInOperand(0);
auto component_id = MaybeGetZeroConstant(
@@ -1319,16 +1325,16 @@ bool CanCreateConstant(opt::IRContext* ir_context, uint32_t type_id) {
assert(spvOpcodeGeneratesType(type_instr->opcode()) &&
"A type-generating opcode was expected.");
switch (type_instr->opcode()) {
- case SpvOpTypeBool:
- case SpvOpTypeInt:
- case SpvOpTypeFloat:
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeBool:
+ case spv::Op::OpTypeInt:
+ case spv::Op::OpTypeFloat:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
return true;
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
return CanCreateConstant(ir_context,
type_instr->GetSingleWordInOperand(0));
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
if (HasBlockOrBufferBlockDecoration(ir_context, type_id)) {
return false;
}
@@ -1377,7 +1383,7 @@ uint32_t MaybeGetCompositeConstant(
assert(IsCompositeType(type) && "|composite_type_id| is invalid");
for (const auto& inst : ir_context->types_values()) {
- if (inst.opcode() == SpvOpConstantComposite &&
+ if (inst.opcode() == spv::Op::OpConstantComposite &&
inst.type_id() == composite_type_id &&
transformation_context.GetFactManager()->IdIsIrrelevant(
inst.result_id()) == is_irrelevant &&
@@ -1457,7 +1463,8 @@ uint32_t MaybeGetBoolConstant(
bool is_irrelevant) {
if (auto type_id = MaybeGetBoolType(ir_context)) {
for (const auto& inst : ir_context->types_values()) {
- if (inst.opcode() == (value ? SpvOpConstantTrue : SpvOpConstantFalse) &&
+ if (inst.opcode() ==
+ (value ? spv::Op::OpConstantTrue : spv::Op::OpConstantFalse) &&
inst.type_id() == type_id &&
transformation_context.GetFactManager()->IdIsIrrelevant(
inst.result_id()) == is_irrelevant) {
@@ -1552,13 +1559,13 @@ MapToRepeatedUInt32Pair(const std::map& data) {
opt::Instruction* GetLastInsertBeforeInstruction(opt::IRContext* ir_context,
uint32_t block_id,
- SpvOp opcode) {
+ spv::Op opcode) {
// CFG::block uses std::map::at which throws an exception when |block_id| is
// invalid. The error message is unhelpful, though. Thus, we test that
// |block_id| is valid here.
const auto* label_inst = ir_context->get_def_use_mgr()->GetDef(block_id);
(void)label_inst; // Make compilers happy in release mode.
- assert(label_inst && label_inst->opcode() == SpvOpLabel &&
+ assert(label_inst && label_inst->opcode() == spv::Op::OpLabel &&
"|block_id| is invalid");
auto* block = ir_context->cfg()->block(block_id);
@@ -1624,7 +1631,7 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context,
assert(composite_type_being_accessed->AsStruct());
auto constant_index_instruction = ir_context->get_def_use_mgr()->GetDef(
use_instruction->GetSingleWordInOperand(index_in_operand));
- assert(constant_index_instruction->opcode() == SpvOpConstant);
+ assert(constant_index_instruction->opcode() == spv::Op::OpConstant);
uint32_t member_index =
constant_index_instruction->GetSingleWordInOperand(0);
composite_type_being_accessed =
@@ -1641,7 +1648,7 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context,
}
}
- if (use_instruction->opcode() == SpvOpFunctionCall &&
+ if (use_instruction->opcode() == spv::Op::OpFunctionCall &&
use_in_operand_index > 0) {
// This is a function call argument. It is not allowed to have pointer
// type.
@@ -1663,7 +1670,7 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context,
}
}
- if (use_instruction->opcode() == SpvOpImageTexelPointer &&
+ if (use_instruction->opcode() == spv::Op::OpImageTexelPointer &&
use_in_operand_index == 2) {
// The OpImageTexelPointer instruction has a Sample parameter that in some
// situations must be an id for the value 0. To guard against disrupting
@@ -1671,38 +1678,38 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context,
return false;
}
- if (ir_context->get_feature_mgr()->HasCapability(SpvCapabilityShader)) {
+ if (ir_context->get_feature_mgr()->HasCapability(spv::Capability::Shader)) {
// With the Shader capability, memory scope and memory semantics operands
// are required to be constants, so they cannot be replaced arbitrarily.
switch (use_instruction->opcode()) {
- case SpvOpAtomicLoad:
- case SpvOpAtomicStore:
- case SpvOpAtomicExchange:
- case SpvOpAtomicIIncrement:
- case SpvOpAtomicIDecrement:
- case SpvOpAtomicIAdd:
- case SpvOpAtomicISub:
- case SpvOpAtomicSMin:
- case SpvOpAtomicUMin:
- case SpvOpAtomicSMax:
- case SpvOpAtomicUMax:
- case SpvOpAtomicAnd:
- case SpvOpAtomicOr:
- case SpvOpAtomicXor:
+ case spv::Op::OpAtomicLoad:
+ case spv::Op::OpAtomicStore:
+ case spv::Op::OpAtomicExchange:
+ case spv::Op::OpAtomicIIncrement:
+ case spv::Op::OpAtomicIDecrement:
+ case spv::Op::OpAtomicIAdd:
+ case spv::Op::OpAtomicISub:
+ case spv::Op::OpAtomicSMin:
+ case spv::Op::OpAtomicUMin:
+ case spv::Op::OpAtomicSMax:
+ case spv::Op::OpAtomicUMax:
+ case spv::Op::OpAtomicAnd:
+ case spv::Op::OpAtomicOr:
+ case spv::Op::OpAtomicXor:
if (use_in_operand_index == 1 || use_in_operand_index == 2) {
return false;
}
break;
- case SpvOpAtomicCompareExchange:
+ case spv::Op::OpAtomicCompareExchange:
if (use_in_operand_index == 1 || use_in_operand_index == 2 ||
use_in_operand_index == 3) {
return false;
}
break;
- case SpvOpAtomicCompareExchangeWeak:
- case SpvOpAtomicFlagTestAndSet:
- case SpvOpAtomicFlagClear:
- case SpvOpAtomicFAddEXT:
+ case spv::Op::OpAtomicCompareExchangeWeak:
+ case spv::Op::OpAtomicFlagTestAndSet:
+ case spv::Op::OpAtomicFlagClear:
+ case spv::Op::OpAtomicFAddEXT:
assert(false && "Not allowed with the Shader capability.");
default:
break;
@@ -1715,17 +1722,17 @@ bool IdUseCanBeReplaced(opt::IRContext* ir_context,
bool MembersHaveBuiltInDecoration(opt::IRContext* ir_context,
uint32_t struct_type_id) {
const auto* type_inst = ir_context->get_def_use_mgr()->GetDef(struct_type_id);
- assert(type_inst && type_inst->opcode() == SpvOpTypeStruct &&
+ assert(type_inst && type_inst->opcode() == spv::Op::OpTypeStruct &&
"|struct_type_id| is not a result id of an OpTypeStruct");
uint32_t builtin_count = 0;
ir_context->get_def_use_mgr()->ForEachUser(
type_inst,
[struct_type_id, &builtin_count](const opt::Instruction* user) {
- if (user->opcode() == SpvOpMemberDecorate &&
+ if (user->opcode() == spv::Op::OpMemberDecorate &&
user->GetSingleWordInOperand(0) == struct_type_id &&
- static_cast(user->GetSingleWordInOperand(2)) ==
- SpvDecorationBuiltIn) {
+ static_cast(user->GetSingleWordInOperand(2)) ==
+ spv::Decoration::BuiltIn) {
++builtin_count;
}
});
@@ -1738,9 +1745,11 @@ bool MembersHaveBuiltInDecoration(opt::IRContext* ir_context,
}
bool HasBlockOrBufferBlockDecoration(opt::IRContext* ir_context, uint32_t id) {
- for (auto decoration : {SpvDecorationBlock, SpvDecorationBufferBlock}) {
+ for (auto decoration :
+ {spv::Decoration::Block, spv::Decoration::BufferBlock}) {
if (!ir_context->get_decoration_mgr()->WhileEachDecoration(
- id, decoration, [](const opt::Instruction & /*unused*/) -> bool {
+ id, uint32_t(decoration),
+ [](const opt::Instruction & /*unused*/) -> bool {
return false;
})) {
return true;
@@ -1762,7 +1771,7 @@ bool SplittingBeforeInstructionSeparatesOpSampledImageDefinitionFromUse(
if (before_split) {
// If the instruction comes before the split and its opcode is
// OpSampledImage, record its result id.
- if (instruction.opcode() == SpvOpSampledImage) {
+ if (instruction.opcode() == spv::Op::OpSampledImage) {
sampled_image_result_ids.insert(instruction.result_id());
}
} else {
@@ -1784,110 +1793,110 @@ bool SplittingBeforeInstructionSeparatesOpSampledImageDefinitionFromUse(
bool InstructionHasNoSideEffects(const opt::Instruction& instruction) {
switch (instruction.opcode()) {
- case SpvOpUndef:
- case SpvOpAccessChain:
- case SpvOpInBoundsAccessChain:
- case SpvOpArrayLength:
- case SpvOpVectorExtractDynamic:
- case SpvOpVectorInsertDynamic:
- case SpvOpVectorShuffle:
- case SpvOpCompositeConstruct:
- case SpvOpCompositeExtract:
- case SpvOpCompositeInsert:
- case SpvOpCopyObject:
- case SpvOpTranspose:
- case SpvOpConvertFToU:
- case SpvOpConvertFToS:
- case SpvOpConvertSToF:
- case SpvOpConvertUToF:
- case SpvOpUConvert:
- case SpvOpSConvert:
- case SpvOpFConvert:
- case SpvOpQuantizeToF16:
- case SpvOpSatConvertSToU:
- case SpvOpSatConvertUToS:
- case SpvOpBitcast:
- case SpvOpSNegate:
- case SpvOpFNegate:
- case SpvOpIAdd:
- case SpvOpFAdd:
- case SpvOpISub:
- case SpvOpFSub:
- case SpvOpIMul:
- case SpvOpFMul:
- case SpvOpUDiv:
- case SpvOpSDiv:
- case SpvOpFDiv:
- case SpvOpUMod:
- case SpvOpSRem:
- case SpvOpSMod:
- case SpvOpFRem:
- case SpvOpFMod:
- case SpvOpVectorTimesScalar:
- case SpvOpMatrixTimesScalar:
- case SpvOpVectorTimesMatrix:
- case SpvOpMatrixTimesVector:
- case SpvOpMatrixTimesMatrix:
- case SpvOpOuterProduct:
- case SpvOpDot:
- case SpvOpIAddCarry:
- case SpvOpISubBorrow:
- case SpvOpUMulExtended:
- case SpvOpSMulExtended:
- case SpvOpAny:
- case SpvOpAll:
- case SpvOpIsNan:
- case SpvOpIsInf:
- case SpvOpIsFinite:
- case SpvOpIsNormal:
- case SpvOpSignBitSet:
- case SpvOpLessOrGreater:
- case SpvOpOrdered:
- case SpvOpUnordered:
- case SpvOpLogicalEqual:
- case SpvOpLogicalNotEqual:
- case SpvOpLogicalOr:
- case SpvOpLogicalAnd:
- case SpvOpLogicalNot:
- case SpvOpSelect:
- case SpvOpIEqual:
- case SpvOpINotEqual:
- case SpvOpUGreaterThan:
- case SpvOpSGreaterThan:
- case SpvOpUGreaterThanEqual:
- case SpvOpSGreaterThanEqual:
- case SpvOpULessThan:
- case SpvOpSLessThan:
- case SpvOpULessThanEqual:
- case SpvOpSLessThanEqual:
- case SpvOpFOrdEqual:
- case SpvOpFUnordEqual:
- case SpvOpFOrdNotEqual:
- case SpvOpFUnordNotEqual:
- case SpvOpFOrdLessThan:
- case SpvOpFUnordLessThan:
- case SpvOpFOrdGreaterThan:
- case SpvOpFUnordGreaterThan:
- case SpvOpFOrdLessThanEqual:
- case SpvOpFUnordLessThanEqual:
- case SpvOpFOrdGreaterThanEqual:
- case SpvOpFUnordGreaterThanEqual:
- case SpvOpShiftRightLogical:
- case SpvOpShiftRightArithmetic:
- case SpvOpShiftLeftLogical:
- case SpvOpBitwiseOr:
- case SpvOpBitwiseXor:
- case SpvOpBitwiseAnd:
- case SpvOpNot:
- case SpvOpBitFieldInsert:
- case SpvOpBitFieldSExtract:
- case SpvOpBitFieldUExtract:
- case SpvOpBitReverse:
- case SpvOpBitCount:
- case SpvOpCopyLogical:
- case SpvOpPhi:
- case SpvOpPtrEqual:
- case SpvOpPtrNotEqual:
+ case spv::Op::OpUndef:
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain:
+ case spv::Op::OpArrayLength:
+ case spv::Op::OpVectorExtractDynamic:
+ case spv::Op::OpVectorInsertDynamic:
+ case spv::Op::OpVectorShuffle:
+ case spv::Op::OpCompositeConstruct:
+ case spv::Op::OpCompositeExtract:
+ case spv::Op::OpCompositeInsert:
+ case spv::Op::OpCopyObject:
+ case spv::Op::OpTranspose:
+ case spv::Op::OpConvertFToU:
+ case spv::Op::OpConvertFToS:
+ case spv::Op::OpConvertSToF:
+ case spv::Op::OpConvertUToF:
+ case spv::Op::OpUConvert:
+ case spv::Op::OpSConvert:
+ case spv::Op::OpFConvert:
+ case spv::Op::OpQuantizeToF16:
+ case spv::Op::OpSatConvertSToU:
+ case spv::Op::OpSatConvertUToS:
+ case spv::Op::OpBitcast:
+ case spv::Op::OpSNegate:
+ case spv::Op::OpFNegate:
+ case spv::Op::OpIAdd:
+ case spv::Op::OpFAdd:
+ case spv::Op::OpISub:
+ case spv::Op::OpFSub:
+ case spv::Op::OpIMul:
+ case spv::Op::OpFMul:
+ case spv::Op::OpUDiv:
+ case spv::Op::OpSDiv:
+ case spv::Op::OpFDiv:
+ case spv::Op::OpUMod:
+ case spv::Op::OpSRem:
+ case spv::Op::OpSMod:
+ case spv::Op::OpFRem:
+ case spv::Op::OpFMod:
+ case spv::Op::OpVectorTimesScalar:
+ case spv::Op::OpMatrixTimesScalar:
+ case spv::Op::OpVectorTimesMatrix:
+ case spv::Op::OpMatrixTimesVector:
+ case spv::Op::OpMatrixTimesMatrix:
+ case spv::Op::OpOuterProduct:
+ case spv::Op::OpDot:
+ case spv::Op::OpIAddCarry:
+ case spv::Op::OpISubBorrow:
+ case spv::Op::OpUMulExtended:
+ case spv::Op::OpSMulExtended:
+ case spv::Op::OpAny:
+ case spv::Op::OpAll:
+ case spv::Op::OpIsNan:
+ case spv::Op::OpIsInf:
+ case spv::Op::OpIsFinite:
+ case spv::Op::OpIsNormal:
+ case spv::Op::OpSignBitSet:
+ case spv::Op::OpLessOrGreater:
+ case spv::Op::OpOrdered:
+ case spv::Op::OpUnordered:
+ case spv::Op::OpLogicalEqual:
+ case spv::Op::OpLogicalNotEqual:
+ case spv::Op::OpLogicalOr:
+ case spv::Op::OpLogicalAnd:
+ case spv::Op::OpLogicalNot:
+ case spv::Op::OpSelect:
+ case spv::Op::OpIEqual:
+ case spv::Op::OpINotEqual:
+ case spv::Op::OpUGreaterThan:
+ case spv::Op::OpSGreaterThan:
+ case spv::Op::OpUGreaterThanEqual:
+ case spv::Op::OpSGreaterThanEqual:
+ case spv::Op::OpULessThan:
+ case spv::Op::OpSLessThan:
+ case spv::Op::OpULessThanEqual:
+ case spv::Op::OpSLessThanEqual:
+ case spv::Op::OpFOrdEqual:
+ case spv::Op::OpFUnordEqual:
+ case spv::Op::OpFOrdNotEqual:
+ case spv::Op::OpFUnordNotEqual:
+ case spv::Op::OpFOrdLessThan:
+ case spv::Op::OpFUnordLessThan:
+ case spv::Op::OpFOrdGreaterThan:
+ case spv::Op::OpFUnordGreaterThan:
+ case spv::Op::OpFOrdLessThanEqual:
+ case spv::Op::OpFUnordLessThanEqual:
+ case spv::Op::OpFOrdGreaterThanEqual:
+ case spv::Op::OpFUnordGreaterThanEqual:
+ case spv::Op::OpShiftRightLogical:
+ case spv::Op::OpShiftRightArithmetic:
+ case spv::Op::OpShiftLeftLogical:
+ case spv::Op::OpBitwiseOr:
+ case spv::Op::OpBitwiseXor:
+ case spv::Op::OpBitwiseAnd:
+ case spv::Op::OpNot:
+ case spv::Op::OpBitFieldInsert:
+ case spv::Op::OpBitFieldSExtract:
+ case spv::Op::OpBitFieldUExtract:
+ case spv::Op::OpBitReverse:
+ case spv::Op::OpBitCount:
+ case spv::Op::OpCopyLogical:
+ case spv::Op::OpPhi:
+ case spv::Op::OpPtrEqual:
+ case spv::Op::OpPtrNotEqual:
return true;
default:
return false;
@@ -1975,7 +1984,7 @@ bool NewTerminatorPreservesDominationRules(opt::IRContext* ir_context,
for (const auto& inst : block) {
for (uint32_t i = 0; i < inst.NumInOperands();
- i += inst.opcode() == SpvOpPhi ? 2 : 1) {
+ i += inst.opcode() == spv::Op::OpPhi ? 2 : 1) {
const auto& operand = inst.GetInOperand(i);
if (!spvIsInIdType(operand.type)) {
continue;
@@ -1994,7 +2003,7 @@ bool NewTerminatorPreservesDominationRules(opt::IRContext* ir_context,
continue;
}
- auto domination_target_id = inst.opcode() == SpvOpPhi
+ auto domination_target_id = inst.opcode() == spv::Op::OpPhi
? inst.GetSingleWordInOperand(i + 1)
: block.id();
@@ -2021,68 +2030,68 @@ opt::Module::iterator GetFunctionIterator(opt::IRContext* ir_context,
// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3582): Add all
// opcodes that are agnostic to signedness of operands to function.
// This is not exhaustive yet.
-bool IsAgnosticToSignednessOfOperand(SpvOp opcode,
+bool IsAgnosticToSignednessOfOperand(spv::Op opcode,
uint32_t use_in_operand_index) {
switch (opcode) {
- case SpvOpSNegate:
- case SpvOpNot:
- case SpvOpIAdd:
- case SpvOpISub:
- case SpvOpIMul:
- case SpvOpSDiv:
- case SpvOpSRem:
- case SpvOpSMod:
- case SpvOpShiftRightLogical:
- case SpvOpShiftRightArithmetic:
- case SpvOpShiftLeftLogical:
- case SpvOpBitwiseOr:
- case SpvOpBitwiseXor:
- case SpvOpBitwiseAnd:
- case SpvOpIEqual:
- case SpvOpINotEqual:
- case SpvOpULessThan:
- case SpvOpSLessThan:
- case SpvOpUGreaterThan:
- case SpvOpSGreaterThan:
- case SpvOpULessThanEqual:
- case SpvOpSLessThanEqual:
- case SpvOpUGreaterThanEqual:
- case SpvOpSGreaterThanEqual:
+ case spv::Op::OpSNegate:
+ case spv::Op::OpNot:
+ case spv::Op::OpIAdd:
+ case spv::Op::OpISub:
+ case spv::Op::OpIMul:
+ case spv::Op::OpSDiv:
+ case spv::Op::OpSRem:
+ case spv::Op::OpSMod:
+ case spv::Op::OpShiftRightLogical:
+ case spv::Op::OpShiftRightArithmetic:
+ case spv::Op::OpShiftLeftLogical:
+ case spv::Op::OpBitwiseOr:
+ case spv::Op::OpBitwiseXor:
+ case spv::Op::OpBitwiseAnd:
+ case spv::Op::OpIEqual:
+ case spv::Op::OpINotEqual:
+ case spv::Op::OpULessThan:
+ case spv::Op::OpSLessThan:
+ case spv::Op::OpUGreaterThan:
+ case spv::Op::OpSGreaterThan:
+ case spv::Op::OpULessThanEqual:
+ case spv::Op::OpSLessThanEqual:
+ case spv::Op::OpUGreaterThanEqual:
+ case spv::Op::OpSGreaterThanEqual:
return true;
- case SpvOpAtomicStore:
- case SpvOpAtomicExchange:
- case SpvOpAtomicIAdd:
- case SpvOpAtomicISub:
- case SpvOpAtomicSMin:
- case SpvOpAtomicUMin:
- case SpvOpAtomicSMax:
- case SpvOpAtomicUMax:
- case SpvOpAtomicAnd:
- case SpvOpAtomicOr:
- case SpvOpAtomicXor:
- case SpvOpAtomicFAddEXT: // Capability AtomicFloat32AddEXT,
+ case spv::Op::OpAtomicStore:
+ case spv::Op::OpAtomicExchange:
+ case spv::Op::OpAtomicIAdd:
+ case spv::Op::OpAtomicISub:
+ case spv::Op::OpAtomicSMin:
+ case spv::Op::OpAtomicUMin:
+ case spv::Op::OpAtomicSMax:
+ case spv::Op::OpAtomicUMax:
+ case spv::Op::OpAtomicAnd:
+ case spv::Op::OpAtomicOr:
+ case spv::Op::OpAtomicXor:
+ case spv::Op::OpAtomicFAddEXT: // Capability AtomicFloat32AddEXT,
// AtomicFloat64AddEXT.
assert(use_in_operand_index != 0 &&
"Signedness check should not occur on a pointer operand.");
return use_in_operand_index == 1 || use_in_operand_index == 2;
- case SpvOpAtomicCompareExchange:
- case SpvOpAtomicCompareExchangeWeak: // Capability Kernel.
+ case spv::Op::OpAtomicCompareExchange:
+ case spv::Op::OpAtomicCompareExchangeWeak: // Capability Kernel.
assert(use_in_operand_index != 0 &&
"Signedness check should not occur on a pointer operand.");
return use_in_operand_index >= 1 && use_in_operand_index <= 3;
- case SpvOpAtomicLoad:
- case SpvOpAtomicIIncrement:
- case SpvOpAtomicIDecrement:
- case SpvOpAtomicFlagTestAndSet: // Capability Kernel.
- case SpvOpAtomicFlagClear: // Capability Kernel.
+ case spv::Op::OpAtomicLoad:
+ case spv::Op::OpAtomicIIncrement:
+ case spv::Op::OpAtomicIDecrement:
+ case spv::Op::OpAtomicFlagTestAndSet: // Capability Kernel.
+ case spv::Op::OpAtomicFlagClear: // Capability Kernel.
assert(use_in_operand_index != 0 &&
"Signedness check should not occur on a pointer operand.");
return use_in_operand_index >= 1;
- case SpvOpAccessChain:
+ case spv::Op::OpAccessChain:
// The signedness of indices does not matter.
return use_in_operand_index > 0;
@@ -2093,7 +2102,7 @@ bool IsAgnosticToSignednessOfOperand(SpvOp opcode,
}
}
-bool TypesAreCompatible(opt::IRContext* ir_context, SpvOp opcode,
+bool TypesAreCompatible(opt::IRContext* ir_context, spv::Op opcode,
uint32_t use_in_operand_index, uint32_t type_id_1,
uint32_t type_id_2) {
assert(ir_context->get_type_mgr()->GetType(type_id_1) &&
diff --git a/third_party/spirv-tools/source/fuzz/fuzzer_util.h b/third_party/spirv-tools/source/fuzz/fuzzer_util.h
index 54aa14a2fb..374e32e11c 100644
--- a/third_party/spirv-tools/source/fuzz/fuzzer_util.h
+++ b/third_party/spirv-tools/source/fuzz/fuzzer_util.h
@@ -111,7 +111,7 @@ opt::BasicBlock::iterator GetIteratorForInstruction(
// Determines whether it is OK to insert an instruction with opcode |opcode|
// before |instruction_in_block|.
bool CanInsertOpcodeBeforeInstruction(
- SpvOp opcode, const opt::BasicBlock::iterator& instruction_in_block);
+ spv::Op opcode, const opt::BasicBlock::iterator& instruction_in_block);
// Determines whether it is OK to make a synonym of |inst|.
// |transformation_context| is used to verify that the result id of |inst|
@@ -170,8 +170,8 @@ uint32_t GetBoundForCompositeIndex(const opt::Instruction& composite_type_inst,
opt::IRContext* ir_context);
// Returns memory semantics mask for specific storage class.
-SpvMemorySemanticsMask GetMemorySemanticsForStorageClass(
- SpvStorageClass storage_class);
+spv::MemorySemanticsMask GetMemorySemanticsForStorageClass(
+ spv::StorageClass storage_class);
// Returns true if and only if |context| is valid, according to the validator
// instantiated with |validator_options|. |consumer| is used for error
@@ -258,18 +258,18 @@ uint32_t GetPointeeTypeIdFromPointerType(opt::IRContext* context,
// Given |pointer_type_inst|, which must be an OpTypePointer instruction,
// returns the associated storage class.
-SpvStorageClass GetStorageClassFromPointerType(
+spv::StorageClass GetStorageClassFromPointerType(
opt::Instruction* pointer_type_inst);
// Given |pointer_type_id|, which must be the id of a pointer type, returns the
// associated storage class.
-SpvStorageClass GetStorageClassFromPointerType(opt::IRContext* context,
- uint32_t pointer_type_id);
+spv::StorageClass GetStorageClassFromPointerType(opt::IRContext* context,
+ uint32_t pointer_type_id);
// Returns the id of a pointer with pointee type |pointee_type_id| and storage
// class |storage_class|, if it exists, and 0 otherwise.
uint32_t MaybeGetPointerType(opt::IRContext* context, uint32_t pointee_type_id,
- SpvStorageClass storage_class);
+ spv::StorageClass storage_class);
// Given an instruction |inst| and an operand absolute index |absolute_index|,
// returns the index of the operand restricted to the input operands.
@@ -309,7 +309,7 @@ void AddVariableIdToEntryPointInterfaces(opt::IRContext* context, uint32_t id);
// Returns a pointer to the new global variable instruction.
opt::Instruction* AddGlobalVariable(opt::IRContext* context, uint32_t result_id,
uint32_t type_id,
- SpvStorageClass storage_class,
+ spv::StorageClass storage_class,
uint32_t initializer_id);
// Adds an instruction to the start of |function_id|, of the form:
@@ -541,7 +541,7 @@ MapToRepeatedUInt32Pair(const std::map& data);
// opcode |opcode| can be inserted, or nullptr if there is no such instruction.
opt::Instruction* GetLastInsertBeforeInstruction(opt::IRContext* ir_context,
uint32_t block_id,
- SpvOp opcode);
+ spv::Op opcode);
// Checks whether various conditions hold related to the acceptability of
// replacing the id use at |use_in_operand_index| of |use_instruction| with a
@@ -608,14 +608,14 @@ opt::Module::iterator GetFunctionIterator(opt::IRContext* ir_context,
// behaviour depending on the signedness of the operand at
// |use_in_operand_index|.
// Assumes that the operand must be the id of an integer scalar or vector.
-bool IsAgnosticToSignednessOfOperand(SpvOp opcode,
+bool IsAgnosticToSignednessOfOperand(spv::Op opcode,
uint32_t use_in_operand_index);
// Returns true if |type_id_1| and |type_id_2| represent compatible types
// given the context of the instruction with |opcode| (i.e. we can replace
// an operand of |opcode| of the first type with an id of the second type
// and vice-versa).
-bool TypesAreCompatible(opt::IRContext* ir_context, SpvOp opcode,
+bool TypesAreCompatible(opt::IRContext* ir_context, spv::Op opcode,
uint32_t use_in_operand_index, uint32_t type_id_1,
uint32_t type_id_2);
diff --git a/third_party/spirv-tools/source/fuzz/instruction_descriptor.cpp b/third_party/spirv-tools/source/fuzz/instruction_descriptor.cpp
index fb1ff765a5..120d8f8795 100644
--- a/third_party/spirv-tools/source/fuzz/instruction_descriptor.cpp
+++ b/third_party/spirv-tools/source/fuzz/instruction_descriptor.cpp
@@ -40,8 +40,9 @@ opt::Instruction* FindInstruction(
"The skipped instruction count should only be incremented "
"after the instruction base has been found.");
}
- if (found_base && instruction.opcode() ==
- instruction_descriptor.target_instruction_opcode()) {
+ if (found_base &&
+ instruction.opcode() ==
+ spv::Op(instruction_descriptor.target_instruction_opcode())) {
if (num_ignored == instruction_descriptor.num_opcodes_to_ignore()) {
return &instruction;
}
@@ -52,11 +53,11 @@ opt::Instruction* FindInstruction(
}
protobufs::InstructionDescriptor MakeInstructionDescriptor(
- uint32_t base_instruction_result_id, SpvOp target_instruction_opcode,
+ uint32_t base_instruction_result_id, spv::Op target_instruction_opcode,
uint32_t num_opcodes_to_ignore) {
protobufs::InstructionDescriptor result;
result.set_base_instruction_result_id(base_instruction_result_id);
- result.set_target_instruction_opcode(target_instruction_opcode);
+ result.set_target_instruction_opcode(uint32_t(target_instruction_opcode));
result.set_num_opcodes_to_ignore(num_opcodes_to_ignore);
return result;
}
@@ -64,7 +65,7 @@ protobufs::InstructionDescriptor MakeInstructionDescriptor(
protobufs::InstructionDescriptor MakeInstructionDescriptor(
const opt::BasicBlock& block,
const opt::BasicBlock::const_iterator& inst_it) {
- const SpvOp opcode =
+ const spv::Op opcode =
inst_it->opcode(); // The opcode of the instruction being described.
uint32_t skip_count = 0; // The number of these opcodes we have skipped when
// searching backwards.
diff --git a/third_party/spirv-tools/source/fuzz/instruction_descriptor.h b/third_party/spirv-tools/source/fuzz/instruction_descriptor.h
index 2ccd15a232..063cad47cd 100644
--- a/third_party/spirv-tools/source/fuzz/instruction_descriptor.h
+++ b/third_party/spirv-tools/source/fuzz/instruction_descriptor.h
@@ -32,7 +32,7 @@ opt::Instruction* FindInstruction(
// components. See the protobuf definition for details of what these
// components mean.
protobufs::InstructionDescriptor MakeInstructionDescriptor(
- uint32_t base_instruction_result_id, SpvOp target_instruction_opcode,
+ uint32_t base_instruction_result_id, spv::Op target_instruction_opcode,
uint32_t num_opcodes_to_ignore);
// Returns an instruction descriptor that describing the instruction at
diff --git a/third_party/spirv-tools/source/fuzz/instruction_message.cpp b/third_party/spirv-tools/source/fuzz/instruction_message.cpp
index 95039327be..7e8ac71b2f 100644
--- a/third_party/spirv-tools/source/fuzz/instruction_message.cpp
+++ b/third_party/spirv-tools/source/fuzz/instruction_message.cpp
@@ -20,10 +20,10 @@ namespace spvtools {
namespace fuzz {
protobufs::Instruction MakeInstructionMessage(
- SpvOp opcode, uint32_t result_type_id, uint32_t result_id,
+ spv::Op opcode, uint32_t result_type_id, uint32_t result_id,
const opt::Instruction::OperandList& input_operands) {
protobufs::Instruction result;
- result.set_opcode(opcode);
+ result.set_opcode(uint32_t(opcode));
result.set_result_type_id(result_type_id);
result.set_result_id(result_id);
for (auto& operand : input_operands) {
@@ -71,7 +71,7 @@ std::unique_ptr InstructionFromMessage(
}
// Create and return the instruction.
return MakeUnique(
- ir_context, static_cast(instruction_message.opcode()),
+ ir_context, static_cast(instruction_message.opcode()),
instruction_message.result_type_id(), instruction_message.result_id(),
in_operands);
}
diff --git a/third_party/spirv-tools/source/fuzz/instruction_message.h b/third_party/spirv-tools/source/fuzz/instruction_message.h
index fcbb4c7671..e1312f452f 100644
--- a/third_party/spirv-tools/source/fuzz/instruction_message.h
+++ b/third_party/spirv-tools/source/fuzz/instruction_message.h
@@ -26,7 +26,7 @@ namespace fuzz {
// Creates an Instruction protobuf message from its component parts.
protobufs::Instruction MakeInstructionMessage(
- SpvOp opcode, uint32_t result_type_id, uint32_t result_id,
+ spv::Op opcode, uint32_t result_type_id, uint32_t result_id,
const opt::Instruction::OperandList& input_operands);
// Creates an Instruction protobuf message from a parsed instruction.
diff --git a/third_party/spirv-tools/source/fuzz/transformation_access_chain.cpp b/third_party/spirv-tools/source/fuzz/transformation_access_chain.cpp
index 3fe9e656b5..1e7f87bd96 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_access_chain.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_access_chain.cpp
@@ -63,7 +63,7 @@ bool TransformationAccessChain::IsApplicable(
}
// The type must indeed be a pointer.
auto pointer_type = ir_context->get_def_use_mgr()->GetDef(pointer->type_id());
- if (pointer_type->opcode() != SpvOpTypePointer) {
+ if (pointer_type->opcode() != spv::Op::OpTypePointer) {
return false;
}
@@ -75,7 +75,7 @@ bool TransformationAccessChain::IsApplicable(
return false;
}
if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(
- SpvOpAccessChain, instruction_to_insert_before)) {
+ spv::Op::OpAccessChain, instruction_to_insert_before)) {
return false;
}
@@ -83,8 +83,8 @@ bool TransformationAccessChain::IsApplicable(
// we do not want to allow accessing such pointers. This might be acceptable
// in dead blocks, but we conservatively avoid it.
switch (pointer->opcode()) {
- case SpvOpConstantNull:
- case SpvOpUndef:
+ case spv::Op::OpConstantNull:
+ case spv::Op::OpUndef:
assert(
false &&
"Access chains should not be created from null/undefined pointers");
@@ -117,7 +117,7 @@ bool TransformationAccessChain::IsApplicable(
// Check whether the object is a struct.
if (ir_context->get_def_use_mgr()->GetDef(subobject_type_id)->opcode() ==
- SpvOpTypeStruct) {
+ spv::Op::OpTypeStruct) {
// It is a struct: we need to retrieve the integer value.
bool successful;
@@ -202,7 +202,7 @@ bool TransformationAccessChain::IsApplicable(
// associated with pointers to isomorphic structs being regarded as the same.
return fuzzerutil::MaybeGetPointerType(
ir_context, subobject_type_id,
- static_cast(
+ static_cast(
pointer_type->GetSingleWordInOperand(0))) != 0;
}
@@ -243,7 +243,7 @@ void TransformationAccessChain::Apply(
// Check whether the object is a struct.
if (ir_context->get_def_use_mgr()->GetDef(subobject_type_id)->opcode() ==
- SpvOpTypeStruct) {
+ spv::Op::OpTypeStruct) {
// It is a struct: we need to retrieve the integer value.
index_value =
@@ -290,7 +290,8 @@ void TransformationAccessChain::Apply(
// %fresh_ids.first = OpULessThanEqual %bool %int_id %bound_minus_one.
fuzzerutil::UpdateModuleIdBound(ir_context, fresh_ids.first());
auto comparison_instruction = MakeUnique(
- ir_context, SpvOpULessThanEqual, bool_type_id, fresh_ids.first(),
+ ir_context, spv::Op::OpULessThanEqual, bool_type_id,
+ fresh_ids.first(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {index_instruction->result_id()}},
{SPV_OPERAND_TYPE_ID, {bound_minus_one_id}}}));
@@ -306,7 +307,7 @@ void TransformationAccessChain::Apply(
// %bound_minus_one
fuzzerutil::UpdateModuleIdBound(ir_context, fresh_ids.second());
auto select_instruction = MakeUnique(
- ir_context, SpvOpSelect, int_type_inst->result_id(),
+ ir_context, spv::Op::OpSelect, int_type_inst->result_id(),
fresh_ids.second(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {fresh_ids.first()}},
@@ -334,13 +335,14 @@ void TransformationAccessChain::Apply(
// of the original pointer.
uint32_t result_type = fuzzerutil::MaybeGetPointerType(
ir_context, subobject_type_id,
- static_cast(pointer_type->GetSingleWordInOperand(0)));
+ static_cast(pointer_type->GetSingleWordInOperand(0)));
// Add the access chain instruction to the module, and update the module's
// id bound.
fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id());
- auto access_chain_instruction = MakeUnique(
- ir_context, SpvOpAccessChain, result_type, message_.fresh_id(), operands);
+ auto access_chain_instruction =
+ MakeUnique(ir_context, spv::Op::OpAccessChain,
+ result_type, message_.fresh_id(), operands);
auto access_chain_instruction_ptr = access_chain_instruction.get();
instruction_to_insert_before->InsertBefore(
std::move(access_chain_instruction));
@@ -367,7 +369,7 @@ std::pair TransformationAccessChain::GetStructIndexValue(
opt::IRContext* ir_context, uint32_t index_id,
uint32_t object_type_id) const {
assert(ir_context->get_def_use_mgr()->GetDef(object_type_id)->opcode() ==
- SpvOpTypeStruct &&
+ spv::Op::OpTypeStruct &&
"Precondition: the type must be a struct type.");
if (!ValidIndexToComposite(ir_context, index_id, object_type_id)) {
return {false, 0};
@@ -408,14 +410,14 @@ bool TransformationAccessChain::ValidIndexToComposite(
// The index type must be 32-bit integer.
auto index_type =
ir_context->get_def_use_mgr()->GetDef(index_instruction->type_id());
- if (index_type->opcode() != SpvOpTypeInt ||
+ if (index_type->opcode() != spv::Op::OpTypeInt ||
index_type->GetSingleWordInOperand(0) != 32) {
return false;
}
// If the object being traversed is a struct, the id must correspond to an
// in-bound constant.
- if (object_type_def->opcode() == SpvOpTypeStruct) {
+ if (object_type_def->opcode() == spv::Op::OpTypeStruct) {
if (!spvOpcodeIsConstant(index_instruction->opcode())) {
return false;
}
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_bit_instruction_synonym.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_bit_instruction_synonym.cpp
index 636c0a3855..4b26c2b565 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_bit_instruction_synonym.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_bit_instruction_synonym.cpp
@@ -87,10 +87,10 @@ void TransformationAddBitInstructionSynonym::Apply(
// synonym fact. The helper function should take care of invalidating
// analyses before adding facts.
switch (bit_instruction->opcode()) {
- case SpvOpBitwiseOr:
- case SpvOpBitwiseXor:
- case SpvOpBitwiseAnd:
- case SpvOpNot:
+ case spv::Op::OpBitwiseOr:
+ case spv::Op::OpBitwiseXor:
+ case spv::Op::OpBitwiseAnd:
+ case spv::Op::OpNot:
AddOpBitwiseOrOpNotSynonym(ir_context, transformation_context,
bit_instruction);
break;
@@ -106,10 +106,10 @@ bool TransformationAddBitInstructionSynonym::IsInstructionSupported(
// Right now we only support certain operations. When this issue is addressed
// the following conditional can use the function |spvOpcodeIsBit|.
// |instruction| must be defined and must be a supported bit instruction.
- if (!instruction || (instruction->opcode() != SpvOpBitwiseOr &&
- instruction->opcode() != SpvOpBitwiseXor &&
- instruction->opcode() != SpvOpBitwiseAnd &&
- instruction->opcode() != SpvOpNot)) {
+ if (!instruction || (instruction->opcode() != spv::Op::OpBitwiseOr &&
+ instruction->opcode() != spv::Op::OpBitwiseXor &&
+ instruction->opcode() != spv::Op::OpBitwiseAnd &&
+ instruction->opcode() != spv::Op::OpNot)) {
return false;
}
@@ -119,7 +119,7 @@ bool TransformationAddBitInstructionSynonym::IsInstructionSupported(
return false;
}
- if (instruction->opcode() == SpvOpNot) {
+ if (instruction->opcode() == spv::Op::OpNot) {
auto operand = instruction->GetInOperand(0).words[0];
auto operand_inst = ir_context->get_def_use_mgr()->GetDef(operand);
auto operand_type =
@@ -171,10 +171,10 @@ uint32_t TransformationAddBitInstructionSynonym::GetRequiredFreshIdCount(
// TODO(https://github.com/KhronosGroup/SPIRV-Tools/issues/3557):
// Right now, only certain operations are supported.
switch (bit_instruction->opcode()) {
- case SpvOpBitwiseOr:
- case SpvOpBitwiseXor:
- case SpvOpBitwiseAnd:
- case SpvOpNot:
+ case spv::Op::OpBitwiseOr:
+ case spv::Op::OpBitwiseXor:
+ case spv::Op::OpBitwiseAnd:
+ case spv::Op::OpNot:
return (2 + bit_instruction->NumInOperands()) *
ir_context->get_type_mgr()
->GetType(bit_instruction->type_id())
@@ -220,7 +220,7 @@ void TransformationAddBitInstructionSynonym::AddOpBitwiseOrOpNotSynonym(
for (auto operand = bit_instruction->begin() + 2;
operand != bit_instruction->end(); operand++) {
auto bit_extract =
- opt::Instruction(ir_context, SpvOpBitFieldUExtract,
+ opt::Instruction(ir_context, spv::Op::OpBitFieldUExtract,
bit_instruction->type_id(), *fresh_id++,
{{SPV_OPERAND_TYPE_ID, operand->words},
{SPV_OPERAND_TYPE_ID, {offset}},
@@ -246,12 +246,13 @@ void TransformationAddBitInstructionSynonym::AddOpBitwiseOrOpNotSynonym(
// first two bits of the result.
uint32_t offset = fuzzerutil::MaybeGetIntegerConstant(
ir_context, *transformation_context, {1}, 32, false, false);
- auto bit_insert = opt::Instruction(
- ir_context, SpvOpBitFieldInsert, bit_instruction->type_id(), *fresh_id++,
- {{SPV_OPERAND_TYPE_ID, {extracted_bit_instructions[0]}},
- {SPV_OPERAND_TYPE_ID, {extracted_bit_instructions[1]}},
- {SPV_OPERAND_TYPE_ID, {offset}},
- {SPV_OPERAND_TYPE_ID, {count}}});
+ auto bit_insert =
+ opt::Instruction(ir_context, spv::Op::OpBitFieldInsert,
+ bit_instruction->type_id(), *fresh_id++,
+ {{SPV_OPERAND_TYPE_ID, {extracted_bit_instructions[0]}},
+ {SPV_OPERAND_TYPE_ID, {extracted_bit_instructions[1]}},
+ {SPV_OPERAND_TYPE_ID, {offset}},
+ {SPV_OPERAND_TYPE_ID, {count}}});
bit_instruction->InsertBefore(MakeUnique(bit_insert));
fuzzerutil::UpdateModuleIdBound(ir_context, bit_insert.result_id());
@@ -260,7 +261,7 @@ void TransformationAddBitInstructionSynonym::AddOpBitwiseOrOpNotSynonym(
offset = fuzzerutil::MaybeGetIntegerConstant(
ir_context, *transformation_context, {i}, 32, false, false);
bit_insert = opt::Instruction(
- ir_context, SpvOpBitFieldInsert, bit_instruction->type_id(),
+ ir_context, spv::Op::OpBitFieldInsert, bit_instruction->type_id(),
*fresh_id++,
{{SPV_OPERAND_TYPE_ID, {bit_insert.result_id()}},
{SPV_OPERAND_TYPE_ID, {extracted_bit_instructions[i]}},
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_constant_boolean.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_constant_boolean.cpp
index 3935432577..89c2e5790f 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_constant_boolean.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_constant_boolean.cpp
@@ -43,7 +43,8 @@ void TransformationAddConstantBoolean::Apply(
// Add the boolean constant to the module, ensuring the module's id bound is
// high enough.
auto new_instruction = MakeUnique(
- ir_context, message_.is_true() ? SpvOpConstantTrue : SpvOpConstantFalse,
+ ir_context,
+ message_.is_true() ? spv::Op::OpConstantTrue : spv::Op::OpConstantFalse,
fuzzerutil::MaybeGetBoolType(ir_context), message_.fresh_id(),
opt::Instruction::OperandList());
auto new_instruction_ptr = new_instruction.get();
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_constant_composite.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_constant_composite.cpp
index 89007ab655..b8ee8be72b 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_constant_composite.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_constant_composite.cpp
@@ -53,7 +53,7 @@ bool TransformationAddConstantComposite::IsApplicable(
// struct - whether its decorations are OK.
std::vector constituent_type_ids;
switch (composite_type_instruction->opcode()) {
- case SpvOpTypeArray:
+ case spv::Op::OpTypeArray:
for (uint32_t index = 0;
index <
fuzzerutil::GetArraySize(*composite_type_instruction, ir_context);
@@ -62,8 +62,8 @@ bool TransformationAddConstantComposite::IsApplicable(
composite_type_instruction->GetSingleWordInOperand(0));
}
break;
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
for (uint32_t index = 0;
index < composite_type_instruction->GetSingleWordInOperand(1);
index++) {
@@ -71,7 +71,7 @@ bool TransformationAddConstantComposite::IsApplicable(
composite_type_instruction->GetSingleWordInOperand(0));
}
break;
- case SpvOpTypeStruct:
+ case spv::Op::OpTypeStruct:
// We do not create constants of structs decorated with Block nor
// BufferBlock. The SPIR-V spec does not explicitly disallow this, but it
// seems like a strange thing to do, so we disallow it to avoid triggering
@@ -120,7 +120,7 @@ void TransformationAddConstantComposite::Apply(
in_operands.push_back({SPV_OPERAND_TYPE_ID, {constituent_id}});
}
auto new_instruction = MakeUnique(
- ir_context, SpvOpConstantComposite, message_.type_id(),
+ ir_context, spv::Op::OpConstantComposite, message_.type_id(),
message_.fresh_id(), in_operands);
auto new_instruction_ptr = new_instruction.get();
ir_context->module()->AddGlobalValue(std::move(new_instruction));
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_constant_null.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_constant_null.cpp
index c0f736709d..7b83baea90 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_constant_null.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_constant_null.cpp
@@ -48,8 +48,8 @@ bool TransformationAddConstantNull::IsApplicable(
void TransformationAddConstantNull::Apply(
opt::IRContext* ir_context, TransformationContext* /*unused*/) const {
auto new_instruction = MakeUnique(
- ir_context, SpvOpConstantNull, message_.type_id(), message_.fresh_id(),
- opt::Instruction::OperandList());
+ ir_context, spv::Op::OpConstantNull, message_.type_id(),
+ message_.fresh_id(), opt::Instruction::OperandList());
auto new_instruction_ptr = new_instruction.get();
ir_context->module()->AddGlobalValue(std::move(new_instruction));
fuzzerutil::UpdateModuleIdBound(ir_context, message_.fresh_id());
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_constant_scalar.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_constant_scalar.cpp
index a2d95fb617..45989d4514 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_constant_scalar.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_constant_scalar.cpp
@@ -65,7 +65,7 @@ void TransformationAddConstantScalar::Apply(
opt::IRContext* ir_context,
TransformationContext* transformation_context) const {
auto new_instruction = MakeUnique(
- ir_context, SpvOpConstant, message_.type_id(), message_.fresh_id(),
+ ir_context, spv::Op::OpConstant, message_.type_id(), message_.fresh_id(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_LITERAL_INTEGER,
std::vector(message_.word().begin(),
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.cpp
index 5eb4bdc014..9d1f32566b 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.cpp
@@ -27,12 +27,12 @@ TransformationAddCopyMemory::TransformationAddCopyMemory(
TransformationAddCopyMemory::TransformationAddCopyMemory(
const protobufs::InstructionDescriptor& instruction_descriptor,
- uint32_t fresh_id, uint32_t source_id, SpvStorageClass storage_class,
+ uint32_t fresh_id, uint32_t source_id, spv::StorageClass storage_class,
uint32_t initializer_id) {
*message_.mutable_instruction_descriptor() = instruction_descriptor;
message_.set_fresh_id(fresh_id);
message_.set_source_id(source_id);
- message_.set_storage_class(storage_class);
+ message_.set_storage_class(uint32_t(storage_class));
message_.set_initializer_id(initializer_id);
}
@@ -53,7 +53,8 @@ bool TransformationAddCopyMemory::IsApplicable(
// Check that we can insert OpCopyMemory before |instruction_descriptor|.
auto iter = fuzzerutil::GetIteratorForInstruction(
ir_context->get_instr_block(inst), inst);
- if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(SpvOpCopyMemory, iter)) {
+ if (!fuzzerutil::CanInsertOpcodeBeforeInstruction(spv::Op::OpCopyMemory,
+ iter)) {
return false;
}
@@ -65,8 +66,10 @@ bool TransformationAddCopyMemory::IsApplicable(
}
// |storage_class| is either Function or Private.
- if (message_.storage_class() != SpvStorageClassFunction &&
- message_.storage_class() != SpvStorageClassPrivate) {
+ if (spv::StorageClass(message_.storage_class()) !=
+ spv::StorageClass::Function &&
+ spv::StorageClass(message_.storage_class()) !=
+ spv::StorageClass::Private) {
return false;
}
@@ -76,7 +79,7 @@ bool TransformationAddCopyMemory::IsApplicable(
// OpTypePointer with |message_.storage_class| exists.
if (!fuzzerutil::MaybeGetPointerType(
ir_context, pointee_type_id,
- static_cast(message_.storage_class()))) {
+ static_cast(message_.storage_class()))) {
return false;
}
@@ -103,20 +106,20 @@ void TransformationAddCopyMemory::Apply(
ir_context->get_instr_block(insert_before_inst);
// Add global or local variable to copy memory into.
- auto storage_class = static_cast(message_.storage_class());
+ auto storage_class = static_cast(message_.storage_class());
auto type_id = fuzzerutil::MaybeGetPointerType(
ir_context,
fuzzerutil::GetPointeeTypeIdFromPointerType(
ir_context, fuzzerutil::GetTypeId(ir_context, message_.source_id())),
storage_class);
- if (storage_class == SpvStorageClassPrivate) {
+ if (storage_class == spv::StorageClass::Private) {
opt::Instruction* new_global =
fuzzerutil::AddGlobalVariable(ir_context, message_.fresh_id(), type_id,
storage_class, message_.initializer_id());
ir_context->get_def_use_mgr()->AnalyzeInstDefUse(new_global);
} else {
- assert(storage_class == SpvStorageClassFunction &&
+ assert(storage_class == spv::StorageClass::Function &&
"Storage class can be either Private or Function");
opt::Function* enclosing_function = enclosing_block->GetParent();
opt::Instruction* new_local = fuzzerutil::AddLocalVariable(
@@ -130,7 +133,7 @@ void TransformationAddCopyMemory::Apply(
enclosing_block, insert_before_inst);
auto new_instruction = MakeUnique(
- ir_context, SpvOpCopyMemory, 0, 0,
+ ir_context, spv::Op::OpCopyMemory, 0, 0,
opt::Instruction::OperandList{
{SPV_OPERAND_TYPE_ID, {message_.fresh_id()}},
{SPV_OPERAND_TYPE_ID, {message_.source_id()}}});
@@ -160,7 +163,8 @@ protobufs::Transformation TransformationAddCopyMemory::ToMessage() const {
bool TransformationAddCopyMemory::IsInstructionSupported(
opt::IRContext* ir_context, opt::Instruction* inst) {
if (!inst->result_id() || !inst->type_id() ||
- inst->opcode() == SpvOpConstantNull || inst->opcode() == SpvOpUndef) {
+ inst->opcode() == spv::Op::OpConstantNull ||
+ inst->opcode() == spv::Op::OpUndef) {
return false;
}
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.h b/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.h
index b25652fdd1..053b629146 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.h
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_copy_memory.h
@@ -30,7 +30,7 @@ class TransformationAddCopyMemory : public Transformation {
TransformationAddCopyMemory(
const protobufs::InstructionDescriptor& instruction_descriptor,
- uint32_t fresh_id, uint32_t source_id, SpvStorageClass storage_class,
+ uint32_t fresh_id, uint32_t source_id, spv::StorageClass storage_class,
uint32_t initializer_id);
// - |instruction_descriptor| must point to a valid instruction in the module.
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_dead_block.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_dead_block.cpp
index df700ce587..930adc1084 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_dead_block.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_dead_block.cpp
@@ -61,7 +61,7 @@ bool TransformationAddDeadBlock::IsApplicable(
}
// It must end with OpBranch.
- if (existing_block->terminator()->opcode() != SpvOpBranch) {
+ if (existing_block->terminator()->opcode() != spv::Op::OpBranch) {
return false;
}
@@ -122,27 +122,27 @@ void TransformationAddDeadBlock::Apply(
auto enclosing_function = existing_block->GetParent();
std::unique_ptr new_block =
MakeUnique(MakeUnique(
- ir_context, SpvOpLabel, 0, message_.fresh_id(),
+ ir_context, spv::Op::OpLabel, 0, message_.fresh_id(),
opt::Instruction::OperandList()));
new_block->AddInstruction(MakeUnique(
- ir_context, SpvOpBranch, 0, 0,
+ ir_context, spv::Op::OpBranch, 0, 0,
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {successor_block_id}}})));
// Turn the original block into a selection merge, with its original successor
// as the merge block.
existing_block->terminator()->InsertBefore(MakeUnique(
- ir_context, SpvOpSelectionMerge, 0, 0,
+ ir_context, spv::Op::OpSelectionMerge, 0, 0,
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {successor_block_id}},
{SPV_OPERAND_TYPE_SELECTION_CONTROL,
- {SpvSelectionControlMaskNone}}})));
+ {uint32_t(spv::SelectionControlMask::MaskNone)}}})));
// Change the original block's terminator to be a conditional branch on the
// given boolean, with the original successor and the new successor as branch
// targets, and such that at runtime control will always transfer to the
// original successor.
- existing_block->terminator()->SetOpcode(SpvOpBranchConditional);
+ existing_block->terminator()->SetOpcode(spv::Op::OpBranchConditional);
existing_block->terminator()->SetInOperands(
{{SPV_OPERAND_TYPE_ID, {bool_id}},
{SPV_OPERAND_TYPE_ID,
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_dead_break.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_dead_break.cpp
index 32080ca4c1..07ed4dc560 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_dead_break.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_dead_break.cpp
@@ -142,7 +142,7 @@ bool TransformationAddDeadBreak::IsApplicable(
}
// Check that |message_.from_block| ends with an unconditional branch.
- if (bb_from->terminator()->opcode() != SpvOpBranch) {
+ if (bb_from->terminator()->opcode() != spv::Op::OpBranch) {
// The block associated with the id does not end with an unconditional
// branch.
return false;
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_dead_continue.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_dead_continue.cpp
index f2b9ab3fdd..c534801bb5 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_dead_continue.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_dead_continue.cpp
@@ -55,7 +55,7 @@ bool TransformationAddDeadContinue::IsApplicable(
}
// Check that |message_.from_block| ends with an unconditional branch.
- if (bb_from->terminator()->opcode() != SpvOpBranch) {
+ if (bb_from->terminator()->opcode() != spv::Op::OpBranch) {
// The block associated with the id does not end with an unconditional
// branch.
return false;
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.cpp
index 547398aa38..28e0186d15 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.cpp
@@ -28,17 +28,17 @@ TransformationAddEarlyTerminatorWrapper::
TransformationAddEarlyTerminatorWrapper::
TransformationAddEarlyTerminatorWrapper(uint32_t function_fresh_id,
uint32_t label_fresh_id,
- SpvOp opcode) {
+ spv::Op opcode) {
message_.set_function_fresh_id(function_fresh_id);
message_.set_label_fresh_id(label_fresh_id);
- message_.set_opcode(opcode);
+ message_.set_opcode(uint32_t(opcode));
}
bool TransformationAddEarlyTerminatorWrapper::IsApplicable(
opt::IRContext* ir_context, const TransformationContext& /*unused*/) const {
- assert((message_.opcode() == SpvOpKill ||
- message_.opcode() == SpvOpUnreachable ||
- message_.opcode() == SpvOpTerminateInvocation) &&
+ assert((spv::Op(message_.opcode()) == spv::Op::OpKill ||
+ spv::Op(message_.opcode()) == spv::Op::OpUnreachable ||
+ spv::Op(message_.opcode()) == spv::Op::OpTerminateInvocation) &&
"Invalid opcode.");
if (!fuzzerutil::IsFreshId(ir_context, message_.function_fresh_id())) {
@@ -66,26 +66,29 @@ void TransformationAddEarlyTerminatorWrapper::Apply(
// %label_fresh_id = OpLabel
// OpKill|Unreachable|TerminateInvocation
auto basic_block = MakeUnique(MakeUnique(
- ir_context, SpvOpLabel, 0, message_.label_fresh_id(),
+ ir_context, spv::Op::OpLabel, 0, message_.label_fresh_id(),
opt::Instruction::OperandList()));
basic_block->AddInstruction(MakeUnique(
- ir_context, static_cast(message_.opcode()), 0, 0,
+ ir_context, static_cast(message_.opcode()), 0, 0,
opt::Instruction::OperandList()));
// Create a zero-argument void function.
auto void_type_id = fuzzerutil::MaybeGetVoidType(ir_context);
auto function = MakeUnique(MakeUnique(
- ir_context, SpvOpFunction, void_type_id, message_.function_fresh_id(),
+ ir_context, spv::Op::OpFunction, void_type_id,
+ message_.function_fresh_id(),
opt::Instruction::OperandList(
- {{SPV_OPERAND_TYPE_FUNCTION_CONTROL, {SpvFunctionControlMaskNone}},
+ {{SPV_OPERAND_TYPE_FUNCTION_CONTROL,
+ {uint32_t(spv::FunctionControlMask::MaskNone)}},
{SPV_OPERAND_TYPE_TYPE_ID,
{fuzzerutil::FindFunctionType(ir_context, {void_type_id})}}})));
// Add the basic block to the function as the sole block, and add the function
// to the module.
function->AddBasicBlock(std::move(basic_block));
- function->SetFunctionEnd(MakeUnique(
- ir_context, SpvOpFunctionEnd, 0, 0, opt::Instruction::OperandList()));
+ function->SetFunctionEnd(
+ MakeUnique(ir_context, spv::Op::OpFunctionEnd, 0, 0,
+ opt::Instruction::OperandList()));
ir_context->module()->AddFunction(std::move(function));
ir_context->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone);
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.h b/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.h
index 97cc527cf6..5d0201ddba 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.h
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_early_terminator_wrapper.h
@@ -30,7 +30,7 @@ class TransformationAddEarlyTerminatorWrapper : public Transformation {
TransformationAddEarlyTerminatorWrapper(uint32_t function_fresh_id,
uint32_t label_fresh_id,
- SpvOp opcode);
+ spv::Op opcode);
// - |message_.function_fresh_id| and |message_.label_fresh_id| must be fresh
// and distinct.
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_function.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_function.cpp
index 06cd657241..1f61ede725 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_function.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_function.cpp
@@ -178,7 +178,7 @@ void TransformationAddFunction::Apply(
}
ir_context->InvalidateAnalysesExceptFor(opt::IRContext::kAnalysisNone);
- assert(message_.instruction(0).opcode() == SpvOpFunction &&
+ assert(spv::Op(message_.instruction(0).opcode()) == spv::Op::OpFunction &&
"The first instruction of an 'add function' transformation must be "
"OpFunction.");
@@ -189,7 +189,7 @@ void TransformationAddFunction::Apply(
} else {
// Inform the fact manager that all blocks in the function are dead.
for (auto& inst : message_.instruction()) {
- if (inst.opcode() == SpvOpLabel) {
+ if (spv::Op(inst.opcode()) == spv::Op::OpLabel) {
transformation_context->GetFactManager()->AddFactBlockIsDead(
inst.result_id());
}
@@ -202,16 +202,16 @@ void TransformationAddFunction::Apply(
// parameters to other functions knowing that it is OK if they get
// over-written.
for (auto& instruction : message_.instruction()) {
- switch (instruction.opcode()) {
- case SpvOpFunctionParameter:
+ switch (spv::Op(instruction.opcode())) {
+ case spv::Op::OpFunctionParameter:
if (ir_context->get_def_use_mgr()
->GetDef(instruction.result_type_id())
- ->opcode() == SpvOpTypePointer) {
+ ->opcode() == spv::Op::OpTypePointer) {
transformation_context->GetFactManager()
->AddFactValueOfPointeeIsIrrelevant(instruction.result_id());
}
break;
- case SpvOpVariable:
+ case spv::Op::OpVariable:
transformation_context->GetFactManager()
->AddFactValueOfPointeeIsIrrelevant(instruction.result_id());
break;
@@ -239,7 +239,7 @@ bool TransformationAddFunction::TryToAddFunction(
// A function must start with OpFunction.
auto function_begin = message_.instruction(0);
- if (function_begin.opcode() != SpvOpFunction) {
+ if (spv::Op(function_begin.opcode()) != spv::Op::OpFunction) {
return false;
}
@@ -256,8 +256,8 @@ bool TransformationAddFunction::TryToAddFunction(
// Iterate through all function parameter instructions, adding parameters to
// the new function.
while (instruction_index < num_instructions &&
- message_.instruction(instruction_index).opcode() ==
- SpvOpFunctionParameter) {
+ spv::Op(message_.instruction(instruction_index).opcode()) ==
+ spv::Op::OpFunctionParameter) {
new_function->AddParameter(InstructionFromMessage(
ir_context, message_.instruction(instruction_index)));
instruction_index++;
@@ -265,16 +265,19 @@ bool TransformationAddFunction::TryToAddFunction(
// After the parameters, there needs to be a label.
if (instruction_index == num_instructions ||
- message_.instruction(instruction_index).opcode() != SpvOpLabel) {
+ spv::Op(message_.instruction(instruction_index).opcode()) !=
+ spv::Op::OpLabel) {
return false;
}
// Iterate through the instructions block by block until the end of the
// function is reached.
while (instruction_index < num_instructions &&
- message_.instruction(instruction_index).opcode() != SpvOpFunctionEnd) {
+ spv::Op(message_.instruction(instruction_index).opcode()) !=
+ spv::Op::OpFunctionEnd) {
// Invariant: we should always be at a label instruction at this point.
- assert(message_.instruction(instruction_index).opcode() == SpvOpLabel);
+ assert(spv::Op(message_.instruction(instruction_index).opcode()) ==
+ spv::Op::OpLabel);
// Make a basic block using the label instruction.
std::unique_ptr block =
@@ -285,9 +288,10 @@ bool TransformationAddFunction::TryToAddFunction(
// of the function, adding each such instruction to the block.
instruction_index++;
while (instruction_index < num_instructions &&
- message_.instruction(instruction_index).opcode() !=
- SpvOpFunctionEnd &&
- message_.instruction(instruction_index).opcode() != SpvOpLabel) {
+ spv::Op(message_.instruction(instruction_index).opcode()) !=
+ spv::Op::OpFunctionEnd &&
+ spv::Op(message_.instruction(instruction_index).opcode()) !=
+ spv::Op::OpLabel) {
block->AddInstruction(InstructionFromMessage(
ir_context, message_.instruction(instruction_index)));
instruction_index++;
@@ -298,7 +302,8 @@ bool TransformationAddFunction::TryToAddFunction(
// Having considered all the blocks, we should be at the last instruction and
// it needs to be OpFunctionEnd.
if (instruction_index != num_instructions - 1 ||
- message_.instruction(instruction_index).opcode() != SpvOpFunctionEnd) {
+ spv::Op(message_.instruction(instruction_index).opcode()) !=
+ spv::Op::OpFunctionEnd) {
return false;
}
// Set the function's final instruction, add the function to the module and
@@ -339,20 +344,20 @@ bool TransformationAddFunction::TryToMakeFunctionLivesafe(
for (auto& block : *added_function) {
for (auto& inst : block) {
switch (inst.opcode()) {
- case SpvOpKill:
- case SpvOpUnreachable:
+ case spv::Op::OpKill:
+ case spv::Op::OpUnreachable:
if (!TryToTurnKillOrUnreachableIntoReturn(ir_context, added_function,
&inst)) {
return false;
}
break;
- case SpvOpAccessChain:
- case SpvOpInBoundsAccessChain:
+ case spv::Op::OpAccessChain:
+ case spv::Op::OpInBoundsAccessChain:
if (!TryToClampAccessChainIndices(ir_context, &inst)) {
return false;
}
break;
- case SpvOpFunctionCall:
+ case spv::Op::OpFunctionCall:
// A livesafe function my only call other livesafe functions.
if (!transformation_context.GetFactManager()->FunctionIsLivesafe(
inst.GetSingleWordInOperand(0))) {
@@ -404,7 +409,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
auto loop_limit_constant_id_instr =
ir_context->get_def_use_mgr()->GetDef(message_.loop_limit_constant_id());
if (!loop_limit_constant_id_instr ||
- loop_limit_constant_id_instr->opcode() != SpvOpConstant) {
+ loop_limit_constant_id_instr->opcode() != spv::Op::OpConstant) {
// The loop limit constant id instruction must exist and have an
// appropriate opcode.
return false;
@@ -412,7 +417,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
auto loop_limit_type = ir_context->get_def_use_mgr()->GetDef(
loop_limit_constant_id_instr->type_id());
- if (loop_limit_type->opcode() != SpvOpTypeInt ||
+ if (loop_limit_type->opcode() != spv::Op::OpTypeInt ||
loop_limit_type->GetSingleWordInOperand(0) != 32) {
// The type of the loop limit constant must be 32-bit integer. It
// doesn't actually matter whether the integer is signed or not.
@@ -457,7 +462,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Look for pointer-to-unsigned int type.
opt::analysis::Pointer pointer_to_unsigned_int_type(
- registered_unsigned_int_type, SpvStorageClassFunction);
+ registered_unsigned_int_type, spv::StorageClass::Function);
uint32_t pointer_to_unsigned_int_type_id =
ir_context->get_type_mgr()->GetId(&pointer_to_unsigned_int_type);
if (!pointer_to_unsigned_int_type_id) {
@@ -477,13 +482,13 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Declare the loop limiter variable at the start of the function's entry
// block, via an instruction of the form:
- // %loop_limiter_var = SpvOpVariable %ptr_to_uint Function %zero
+ // %loop_limiter_var = spv::Op::OpVariable %ptr_to_uint Function %zero
added_function->begin()->begin()->InsertBefore(MakeUnique(
- ir_context, SpvOpVariable, pointer_to_unsigned_int_type_id,
+ ir_context, spv::Op::OpVariable, pointer_to_unsigned_int_type_id,
message_.loop_limiter_variable_id(),
- opt::Instruction::OperandList(
- {{SPV_OPERAND_TYPE_STORAGE_CLASS, {SpvStorageClassFunction}},
- {SPV_OPERAND_TYPE_ID, {zero_id}}})));
+ opt::Instruction::OperandList({{SPV_OPERAND_TYPE_STORAGE_CLASS,
+ {uint32_t(spv::StorageClass::Function)}},
+ {SPV_OPERAND_TYPE_ID, {zero_id}}})));
// Update the module's id bound since we have added the loop limiter
// variable id.
fuzzerutil::UpdateModuleIdBound(ir_context,
@@ -589,10 +594,11 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
auto back_edge_block = ir_context->cfg()->block(back_edge_block_id);
auto back_edge_block_terminator = back_edge_block->terminator();
bool compare_using_greater_than_equal;
- if (back_edge_block_terminator->opcode() == SpvOpBranch) {
+ if (back_edge_block_terminator->opcode() == spv::Op::OpBranch) {
compare_using_greater_than_equal = true;
} else {
- assert(back_edge_block_terminator->opcode() == SpvOpBranchConditional);
+ assert(back_edge_block_terminator->opcode() ==
+ spv::Op::OpBranchConditional);
assert(((back_edge_block_terminator->GetSingleWordInOperand(1) ==
loop_header->id() &&
back_edge_block_terminator->GetSingleWordInOperand(2) ==
@@ -613,7 +619,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Add a load from the loop limiter variable, of the form:
// %t1 = OpLoad %uint32 %loop_limiter
new_instructions.push_back(MakeUnique(
- ir_context, SpvOpLoad, unsigned_int_type_id,
+ ir_context, spv::Op::OpLoad, unsigned_int_type_id,
loop_limiter_info.load_id(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {message_.loop_limiter_variable_id()}}})));
@@ -621,7 +627,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Increment the loaded value:
// %t2 = OpIAdd %uint32 %t1 %one
new_instructions.push_back(MakeUnique(
- ir_context, SpvOpIAdd, unsigned_int_type_id,
+ ir_context, spv::Op::OpIAdd, unsigned_int_type_id,
loop_limiter_info.increment_id(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {loop_limiter_info.load_id()}},
@@ -630,7 +636,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Store the incremented value back to the loop limiter variable:
// OpStore %loop_limiter %t2
new_instructions.push_back(MakeUnique(
- ir_context, SpvOpStore, 0, 0,
+ ir_context, spv::Op::OpStore, 0, 0,
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {message_.loop_limiter_variable_id()}},
{SPV_OPERAND_TYPE_ID, {loop_limiter_info.increment_id()}}})));
@@ -641,17 +647,18 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// %t3 = OpULessThan %bool %t1 %loop_limit
new_instructions.push_back(MakeUnique(
ir_context,
- compare_using_greater_than_equal ? SpvOpUGreaterThanEqual
- : SpvOpULessThan,
+ compare_using_greater_than_equal ? spv::Op::OpUGreaterThanEqual
+ : spv::Op::OpULessThan,
bool_type_id, loop_limiter_info.compare_id(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {loop_limiter_info.load_id()}},
{SPV_OPERAND_TYPE_ID, {message_.loop_limit_constant_id()}}})));
- if (back_edge_block_terminator->opcode() == SpvOpBranchConditional) {
+ if (back_edge_block_terminator->opcode() == spv::Op::OpBranchConditional) {
new_instructions.push_back(MakeUnique(
ir_context,
- compare_using_greater_than_equal ? SpvOpLogicalOr : SpvOpLogicalAnd,
+ compare_using_greater_than_equal ? spv::Op::OpLogicalOr
+ : spv::Op::OpLogicalAnd,
bool_type_id, loop_limiter_info.logical_op_id(),
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID,
@@ -669,11 +676,11 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
back_edge_block_terminator->InsertBefore(std::move(new_instructions));
}
- if (back_edge_block_terminator->opcode() == SpvOpBranchConditional) {
+ if (back_edge_block_terminator->opcode() == spv::Op::OpBranchConditional) {
back_edge_block_terminator->SetInOperand(
0, {loop_limiter_info.logical_op_id()});
} else {
- assert(back_edge_block_terminator->opcode() == SpvOpBranch &&
+ assert(back_edge_block_terminator->opcode() == spv::Op::OpBranch &&
"Back-edge terminator must be OpBranch or OpBranchConditional");
// Check that, if the merge block starts with OpPhi instructions, suitable
@@ -689,7 +696,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
// Augment OpPhi instructions at the loop merge with the given ids.
uint32_t phi_index = 0;
for (auto& inst : *merge_block) {
- if (inst.opcode() != SpvOpPhi) {
+ if (inst.opcode() != spv::Op::OpPhi) {
break;
}
assert(phi_index <
@@ -702,7 +709,7 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
}
// Add the new edge, by changing OpBranch to OpBranchConditional.
- back_edge_block_terminator->SetOpcode(SpvOpBranchConditional);
+ back_edge_block_terminator->SetOpcode(spv::Op::OpBranchConditional);
back_edge_block_terminator->SetInOperands(opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {loop_limiter_info.compare_id()}},
{SPV_OPERAND_TYPE_ID, {loop_header->MergeBlockId()}},
@@ -724,18 +731,18 @@ bool TransformationAddFunction::TryToAddLoopLimiters(
bool TransformationAddFunction::TryToTurnKillOrUnreachableIntoReturn(
opt::IRContext* ir_context, opt::Function* added_function,
opt::Instruction* kill_or_unreachable_inst) const {
- assert((kill_or_unreachable_inst->opcode() == SpvOpKill ||
- kill_or_unreachable_inst->opcode() == SpvOpUnreachable) &&
+ assert((kill_or_unreachable_inst->opcode() == spv::Op::OpKill ||
+ kill_or_unreachable_inst->opcode() == spv::Op::OpUnreachable) &&
"Precondition: instruction must be OpKill or OpUnreachable.");
// Get the function's return type.
auto function_return_type_inst =
ir_context->get_def_use_mgr()->GetDef(added_function->type_id());
- if (function_return_type_inst->opcode() == SpvOpTypeVoid) {
+ if (function_return_type_inst->opcode() == spv::Op::OpTypeVoid) {
// The function has void return type, so change this instruction to
// OpReturn.
- kill_or_unreachable_inst->SetOpcode(SpvOpReturn);
+ kill_or_unreachable_inst->SetOpcode(spv::Op::OpReturn);
} else {
// The function has non-void return type, so change this instruction
// to OpReturnValue, using the value id provided with the
@@ -749,7 +756,7 @@ bool TransformationAddFunction::TryToTurnKillOrUnreachableIntoReturn(
->type_id() != function_return_type_inst->result_id()) {
return false;
}
- kill_or_unreachable_inst->SetOpcode(SpvOpReturnValue);
+ kill_or_unreachable_inst->SetOpcode(spv::Op::OpReturnValue);
kill_or_unreachable_inst->SetInOperands(
{{SPV_OPERAND_TYPE_ID, {message_.kill_unreachable_return_value_id()}}});
}
@@ -758,8 +765,8 @@ bool TransformationAddFunction::TryToTurnKillOrUnreachableIntoReturn(
bool TransformationAddFunction::TryToClampAccessChainIndices(
opt::IRContext* ir_context, opt::Instruction* access_chain_inst) const {
- assert((access_chain_inst->opcode() == SpvOpAccessChain ||
- access_chain_inst->opcode() == SpvOpInBoundsAccessChain) &&
+ assert((access_chain_inst->opcode() == spv::Op::OpAccessChain ||
+ access_chain_inst->opcode() == spv::Op::OpInBoundsAccessChain) &&
"Precondition: instruction must be OpAccessChain or "
"OpInBoundsAccessChain.");
@@ -793,7 +800,7 @@ bool TransformationAddFunction::TryToClampAccessChainIndices(
assert(base_object && "The base object must exist.");
auto pointer_type =
ir_context->get_def_use_mgr()->GetDef(base_object->type_id());
- assert(pointer_type && pointer_type->opcode() == SpvOpTypePointer &&
+ assert(pointer_type && pointer_type->opcode() == spv::Op::OpTypePointer &&
"The base object must have pointer type.");
auto should_be_composite_type = ir_context->get_def_use_mgr()->GetDef(
pointer_type->GetSingleWordInOperand(1));
@@ -824,18 +831,18 @@ bool TransformationAddFunction::TryToClampAccessChainIndices(
auto index_inst = ir_context->get_def_use_mgr()->GetDef(index_id);
auto index_type_inst =
ir_context->get_def_use_mgr()->GetDef(index_inst->type_id());
- assert(index_type_inst->opcode() == SpvOpTypeInt);
+ assert(index_type_inst->opcode() == spv::Op::OpTypeInt);
assert(index_type_inst->GetSingleWordInOperand(0) == 32);
opt::analysis::Integer* index_int_type =
ir_context->get_type_mgr()
->GetType(index_type_inst->result_id())
->AsInteger();
- if (index_inst->opcode() != SpvOpConstant ||
+ if (index_inst->opcode() != spv::Op::OpConstant ||
index_inst->GetSingleWordInOperand(0) >= bound) {
// The index is either non-constant or an out-of-bounds constant, so we
// need to clamp it.
- assert(should_be_composite_type->opcode() != SpvOpTypeStruct &&
+ assert(should_be_composite_type->opcode() != spv::Op::OpTypeStruct &&
"Access chain indices into structures are required to be "
"constants.");
opt::analysis::IntConstant bound_minus_one(index_int_type, {bound - 1});
@@ -866,7 +873,7 @@ bool TransformationAddFunction::TryToClampAccessChainIndices(
// Compare the index with the bound via an instruction of the form:
// %t1 = OpULessThanEqual %bool %index %bound_minus_one
new_instructions.push_back(MakeUnique(
- ir_context, SpvOpULessThanEqual, bool_type_id, compare_id,
+ ir_context, spv::Op::OpULessThanEqual, bool_type_id, compare_id,
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {index_inst->result_id()}},
{SPV_OPERAND_TYPE_ID, {bound_minus_one_id}}})));
@@ -874,7 +881,8 @@ bool TransformationAddFunction::TryToClampAccessChainIndices(
// Select the index if in-bounds, otherwise one less than the bound:
// %t2 = OpSelect %int_type %t1 %index %bound_minus_one
new_instructions.push_back(MakeUnique(
- ir_context, SpvOpSelect, index_type_inst->result_id(), select_id,
+ ir_context, spv::Op::OpSelect, index_type_inst->result_id(),
+ select_id,
opt::Instruction::OperandList(
{{SPV_OPERAND_TYPE_ID, {compare_id}},
{SPV_OPERAND_TYPE_ID, {index_inst->result_id()}},
@@ -899,20 +907,20 @@ opt::Instruction* TransformationAddFunction::FollowCompositeIndex(
uint32_t index_id) {
uint32_t sub_object_type_id;
switch (composite_type_inst.opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
+ case spv::Op::OpTypeArray:
+ case spv::Op::OpTypeRuntimeArray:
sub_object_type_id = composite_type_inst.GetSingleWordInOperand(0);
break;
- case SpvOpTypeMatrix:
- case SpvOpTypeVector:
+ case spv::Op::OpTypeMatrix:
+ case spv::Op::OpTypeVector:
sub_object_type_id = composite_type_inst.GetSingleWordInOperand(0);
break;
- case SpvOpTypeStruct: {
+ case spv::Op::OpTypeStruct: {
auto index_inst = ir_context->get_def_use_mgr()->GetDef(index_id);
- assert(index_inst->opcode() == SpvOpConstant);
+ assert(index_inst->opcode() == spv::Op::OpConstant);
assert(ir_context->get_def_use_mgr()
->GetDef(index_inst->type_id())
- ->opcode() == SpvOpTypeInt);
+ ->opcode() == spv::Op::OpTypeInt);
assert(ir_context->get_def_use_mgr()
->GetDef(index_inst->type_id())
->GetSingleWordInOperand(0) == 32);
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_global_undef.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_global_undef.cpp
index ec0574a44b..5aca19d90e 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_global_undef.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_global_undef.cpp
@@ -39,14 +39,14 @@ bool TransformationAddGlobalUndef::IsApplicable(
auto type = ir_context->get_def_use_mgr()->GetDef(message_.type_id());
// The type must exist, and must not be a function or pointer type.
return type != nullptr && opt::IsTypeInst(type->opcode()) &&
- type->opcode() != SpvOpTypeFunction &&
- type->opcode() != SpvOpTypePointer;
+ type->opcode() != spv::Op::OpTypeFunction &&
+ type->opcode() != spv::Op::OpTypePointer;
}
void TransformationAddGlobalUndef::Apply(
opt::IRContext* ir_context, TransformationContext* /*unused*/) const {
auto new_instruction = MakeUnique(
- ir_context, SpvOpUndef, message_.type_id(), message_.fresh_id(),
+ ir_context, spv::Op::OpUndef, message_.type_id(), message_.fresh_id(),
opt::Instruction::OperandList());
auto new_instruction_ptr = new_instruction.get();
ir_context->module()->AddGlobalValue(std::move(new_instruction));
diff --git a/third_party/spirv-tools/source/fuzz/transformation_add_global_variable.cpp b/third_party/spirv-tools/source/fuzz/transformation_add_global_variable.cpp
index 814d01b344..6e82d59415 100644
--- a/third_party/spirv-tools/source/fuzz/transformation_add_global_variable.cpp
+++ b/third_party/spirv-tools/source/fuzz/transformation_add_global_variable.cpp
@@ -24,11 +24,11 @@ TransformationAddGlobalVariable::TransformationAddGlobalVariable(
: message_(std::move(message)) {}
TransformationAddGlobalVariable::TransformationAddGlobalVariable(
- uint32_t fresh_id, uint32_t type_id, SpvStorageClass storage_class,
+ uint32_t fresh_id, uint32_t type_id, spv::StorageClass storage_class,
uint32_t initializer_id, bool value_is_irrelevant) {
message_.set_fresh_id(fresh_id);
message_.set_type_id(type_id);
- message_.set_storage_class(storage_class);
+ message_.set_storage_class(uint32_t(storage_class));
message_.set_initializer_id(initializer_id);
message_.set_value_is_irrelevant(value_is_irrelevant);
}
@@ -41,10 +41,10 @@ bool TransformationAddGlobalVariable::IsApplicable(
}
// The storage class must be Private or Workgroup.
- auto storage_class = static_cast(message_.storage_class());
+ auto storage_class = static_cast(message_.storage_class());
switch (storage_class) {
- case SpvStorageClassPrivate:
- case SpvStorageClassWorkgroup:
+ case spv::StorageClass::Private:
+ case spv::StorageClass::Workgroup:
break;
default:
assert(false && "Unsupported storage class.");
@@ -66,7 +66,7 @@ bool TransformationAddGlobalVariable::IsApplicable(
}
if (message_.initializer_id()) {
// An initializer is not allowed if the storage class is Workgroup.
- if (storage_class == SpvStorageClassWorkgroup) {
+ if (storage_class == spv::StorageClass::Workgroup) {
assert(false &&
"By construction this transformation should not have an "
"initializer when Workgroup storage class is used.");
@@ -95,7 +95,7 @@ void TransformationAddGlobalVariable::Apply(
TransformationContext* transformation_context) const {
opt::Instruction* new_instruction = fuzzerutil::AddGlobalVariable(
ir_context, message_.fresh_id(), message_.type_id(),
- static_cast(message_.storage_class()),
+ static_cast